working model of spell check mechanism (basic)#1
working model of spell check mechanism (basic)#1Manas-kashyap wants to merge 3 commits intoBashmug:masterfrom
Conversation
bhanuvrat
left a comment
There was a problem hiding this comment.
some pep8 changes required.
also, do not push .pyc files to version control.
| import sys | ||
|
|
||
| def main(): | ||
| spellchk = SpellCheck('/usr/share/dict/words') |
There was a problem hiding this comment.
sure , will keep that in mind.
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| main() No newline at end of file |
| import re, random | ||
| class Misspell: | ||
| #Give list of words to mispell | ||
| def __init__(self, wordList): |
There was a problem hiding this comment.
pep8: use lowercase words separated by underscore for variable names.
| def misspelled(self, word): | ||
| if len(word) == 1: | ||
| return word | ||
| vowels = 'aeiouy' |
| raw_input('<enter>\n') | ||
| except KeyboardInterrupt: | ||
|
|
||
| 'exit' |
There was a problem hiding this comment.
what do you intend to do with the string exit?
it is not going to have any effect.
There was a problem hiding this comment.
okay , removing the unnecessary things
| print 'Incorrect -', word | ||
| spellchk = self.correct(word, lWords) | ||
| if spellchk == word and spellchk not in lWords[word[0]]: | ||
| print 'NO SUGGESTION' |
There was a problem hiding this comment.
use python logging module instead of print statements
There was a problem hiding this comment.
when does this loop terminate? I do not see a break.
There was a problem hiding this comment.
okay , i am reading about python logging module , and maybe i forgot to give break .
|
@bhanuvrat thankyou for such a awesome review. |
Basic model of spell check that currently working on command line .