turned ispell into a stand-alone script

--HG--
branch : pmacs2
This commit is contained in:
moculus 2008-03-16 22:47:54 +00:00
parent 6cb96eb661
commit 41e30a7127
1 changed files with 22 additions and 1 deletions

View File

@ -1,4 +1,5 @@
import os
#!/usr/bin/env python
import os, sys
from subprocess import Popen, PIPE, STDOUT
import cache
@ -78,3 +79,23 @@ class Speller(object):
if _can_spell:
_speller = Speller()
if __name__ == "__main__":
s = Speller()
while True:
sys.stdout.write('enter a word: ')
line = sys.stdin.readline()
if not line:
print
break
elif line == '\n':
continue
elif ' ' in line:
print 'please enter a single world'
continue
for word in line.split('-'):
word = word.strip()
if s.check(word):
print '%s: ok' % word
else:
print '%s: misspelled' % word