Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@
# remove leading and trailing whitespace
line = line.strip()

# make lower case
line = line.lower()

# split the line into words; splits on any whitespace
words = line.split()

# output tuples (word, 1) in tab-delimited format
stopwords = set(['the', 'and', 'a', 'for', 'I', 'go', 'four', 'three', 'be', 'not', 'to', 'railing'])

# output tuples (word, 1) in tab-delimited format
for word in words:
print '%s\t%s' % (word, "1")