How to exclude abreviations in PyEnchant check function?

51 views Asked by At

I am writing a silly program to extract words out of random text. I am using the pyenchant library. However, I have run into the issue that pyenchant is recognizing single letters and abreviations as proper words. Some sample output is

n ll w nu y ha v ai s n d b see p ls l k we r kt kc hf j r fib x t j o p z lx o j v m c a f t on yr l a y s la lb a g g br k mb dz r lv o h u p ac p re ya c f i dg j vs ben scr y y j fab 

Is there any way to get the pyenchant checker to exclude abreviations?

My current code is this. text is a very long random string.

text = "AVeryLongRandomStringOfText"
final = ""
for word in text.split(" "):
    if d.check(word): #Check if word is valid
        final += word + " "
print(final)
0

There are 0 answers