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 |