QScintilla/SpellChecker.py

changeset 2210
e02bb8cbf145
parent 2208
c63e2ab86189
child 2280
8e85ca3fabe7
equal deleted inserted replaced
2209:da964a932840 2210:e02bb8cbf145
97 return os.path.join(Utilities.getConfigDir(), "spelling", "pel.dic") 97 return os.path.join(Utilities.getConfigDir(), "spelling", "pel.dic")
98 else: 98 else:
99 return os.path.join(Utilities.getConfigDir(), "spelling", "pwl.dic") 99 return os.path.join(Utilities.getConfigDir(), "spelling", "pwl.dic")
100 100
101 @classmethod 101 @classmethod
102 def getUserDictionaryPath(cls, isException): 102 def getUserDictionaryPath(cls, isException=False):
103 """ 103 """
104 Class method to get the path name of a user dictionary file. 104 Class method to get the path name of a user dictionary file.
105 105
106 @param isException flag indicating to return the name of the user 106 @param isException flag indicating to return the name of the user
107 exception dictionary (boolean) 107 exception dictionary (boolean)
410 Public method to get suggestions for the given word. 410 Public method to get suggestions for the given word.
411 411
412 @param word word to get suggestions for (string) 412 @param word word to get suggestions for (string)
413 @return list of suggestions (list of strings) 413 @return list of suggestions (list of strings)
414 """ 414 """
415 suggestions = []
415 spell = self._spelling_dict 416 spell = self._spelling_dict
416 if spell and len(word) >= self.minimumWordSize: 417 if spell and len(word) >= self.minimumWordSize:
417 suggestions = spell.suggest(word) 418 try:
418 return suggestions 419 suggestions = spell.suggest(word)
419 420 except enchant.errors.Error:
420 return [] 421 # ignore these
422 pass
423 return suggestions
421 424
422 def add(self, word=None): 425 def add(self, word=None):
423 """ 426 """
424 Public method to add a word to the personal word list. 427 Public method to add a word to the personal word list.
425 428

eric ide

mercurial