Re: Need Help

2009-05-25 Thread abosalim
On May 25, 5:39 am, Steven D'Aprano wrote: > On Mon, 25 May 2009 00:16:19 +0200, Piet van Oostrum wrote: > > By the way, it is better to add python code as attachment instead of > > inline text because some news software might fold the lines like in your > > posting, making it difficult to reconst

Need Help

2009-05-23 Thread abosalim
#Gui import re, collections from Tkinter import * from nltk_lite import tokenize def words(text): return re.findall('[a-z]+', text.lower()) def train(features): model = collections.defaultdict(lambda: 1) for f in features: model[f] += 1 return model NWORDS = train(words(fi

Re: SpellChecker

2009-05-21 Thread abosalim
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 > > infor

SpellChecker

2009-05-20 Thread abosalim
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