0

This seems like the suggestion is wrong:

>>> f= enchant.request_dict("en_US")
>>> f.check('50')
False
>>> f.suggest('50')
['W', 'Y', 'w', 'y', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'X', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'x', 'z']

Is there anyway I can improve the suggestion when it comes to numbers?

A.D
  • 1,480
  • 2
  • 18
  • 33

1 Answers1

0

You can change your underlying provider to myspell which will give you different results. In the case of these numbers it will give you better results e.g.

import enchant
b = enchant.Broker()
b.set_ordering("en_US","myspell,aspell")
print b.describe()
d=b.request_dict("en_US")
print d.provider
s = '50'
print d.suggest(s)

Will give you:

[<Enchant: Aspell Provider>, <Enchant: Ispell Provider>, <Enchant: Myspell Provider>, <Enchant: Hspell Provider>]
<Enchant: Myspell Provider>
['5', '0', '50s']

You will need Myspell installed with the Myspell dictionaries you need.

Dan-Dev
  • 8,957
  • 3
  • 38
  • 55