PyEnchant seems to have weird behavior on certain letter/number combinations

59 views
Skip to first unread message

Marc Meketon

unread,
Nov 7, 2016, 2:23:00 PM11/7/16
to pyenchant users

[I also posted this to StackOverflow, and so far have received no response; I also tried to post this last week to this group, but have not yet seen it come up on the mailing list]:


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?

Pankaj Gmcs

unread,
May 23, 2017, 2:19:09 AM5/23/17
to pyenchant users
Did you find any solution to this problem. I am seeing the similar behaviour for other words like 20% and 34.50. Pyenchant removes the character when suggesting, For e.g. for 20%, it suggests 20 and for 34.50 it suggests 34. 
Reply all
Reply to author
Forward
0 new messages