On May 20, 12:37 pm, Mike Kazantsev
wrote:
> abosalim wrote:
> > I used this code.It works fine,but on word not whole text.I want to
> > extend this code to correct
> > text file not only a word,but i don't know.If you have any help,please
> > inform me.
> ...
> > def correct(word):
> > candid
abosalim wrote:
> I used this code.It works fine,but on word not whole text.I want to
> extend this code to correct
> text file not only a word,but i don't know.If you have any help,please
> inform me.
import re
import sys
def correct(word, _lookup={"teh": "the"}):
"""
Replace with Norvi
abosalim wrote:
> I used this code.It works fine,but on word not whole text.I want to
> extend this code to correct
> text file not only a word,but i don't know.If you have any help,please
> inform me.
...
> def correct(word):
> candidates = known([word]) or known(edits1(word)) or known_edits2
I used this code.It works fine,but on word not whole text.I want to
extend this code to correct
text file not only a word,but i don't know.If you have any help,please
inform me.
This is the code:
import re, collections
def words(text): return re.findall('[a-z]+', text.lower())
def train(feature