PyEnchant seems to have weird behavior on certain letter/number combinations:
>>> import enchant
>>> d=enchant.Dict("en_US")
>>> d.add("def")
>>> d.add("abc")
>>> d.suggest("P92")
** (python.exe:15036): CRITICAL **: enchant_is_all_caps: assertion `word && *word' failed
['ᾈ\t_us', 'Def', 'Abc']
Not every letter/number combination yields this issue. More examples are:
>>> d.suggest("A92")
['Abc']
>>> d.suggest("92P")
** (python.exe:15036): CRITICAL **: enchant_is_all_caps: assertion `word && *word' failed
** (python.exe:15036): CRITICAL **: enchant_is_title_case: assertion `word && *word' failed
** (python.exe:15036): CRITICAL **: enchant_is_all_caps: assertion `word && *word' failed
['', 'DEF', 'ABC']
A92 yielded something, 92P gave 3 critical responses.
In PyEnchant, the critical errors (are they errors?) print to the screen, but there does not seem to be a mechanism to capture this. I unsuccessfully tried the try/except
block
Is there a way to test when the "critical" message would be displayed and eliminate the message by not asking for a spelling suggestion?