turned ispell into a stand-alone script
--HG-- branch : pmacs2
This commit is contained in:
parent
6cb96eb661
commit
41e30a7127
23
ispell.py
23
ispell.py
|
@ -1,4 +1,5 @@
|
||||||
import os
|
#!/usr/bin/env python
|
||||||
|
import os, sys
|
||||||
from subprocess import Popen, PIPE, STDOUT
|
from subprocess import Popen, PIPE, STDOUT
|
||||||
import cache
|
import cache
|
||||||
|
|
||||||
|
@ -78,3 +79,23 @@ class Speller(object):
|
||||||
|
|
||||||
if _can_spell:
|
if _can_spell:
|
||||||
_speller = Speller()
|
_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
|
||||||
|
|
Loading…
Reference in New Issue