Created
June 24, 2015 03:24
-
-
Save anonymous/7f3ab5183d519b0a8e80 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
worddict = set() | |
with open ('words.txt') as fh: | |
lines = fh.readlines() | |
for element in lines: | |
words = element.rstrip() | |
worddict.add(words) | |
print '{0} words in spelling words'.format(len(worddict)) | |
with open ('3-2_example.txt') as ex: | |
exlines = ex.read().split() | |
count = 0 | |
for exelement in exlines: | |
count = count + 1 | |
exwords = exelement.strip('.').strip(',').strip(';').strip(':').lower() | |
if exwords not in worddict: | |
print 'misspelled word on line {0}: {1}'.format(count, exwords) | |
muxueqz
commented
Jun 24, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment