[go: up one dir, main page]

Menu

[r13]: / bin / SpellChecker.py  Maximize  Restore  History

Download this file

30 lines (20 with data), 637 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/python
# -*- coding: utf-8 -*-
try:
import enchant
except:
print "Spell checker pyenchant is not available."
class NeatSpell:
def __init__(self):
try:
self.dictionary = enchant.Dict()
except enchant.Error:
print "The Dictionary could not be identified.\n Falling back to English."
self.dictionary = enchant.Dict("en_US")
def CheckWord(self, word):
return self.dictionary.check(word)
def GetSuggestion(self, word):
return self.dictionary.suggest(word)
def ShowSpellDialog(self, event):
pass
WordSpeller = NeatSpell()