'Python Spelling replacement packages, how to add words to dictionary?

I have trialled a number of options for a quick spelling replacer, namely autocorrect, spellchecker and textblob. However, I have some words that are being altered as they are not in the dictionary, for example Zumba. I have tried adding to the dictionaries in the packages, but I continue to get the same results.

FOr example for autocorrect I located the dictionaries in \autocorrect-master\words.bz2...I added in the words to all the files in here. Reloaded the package and no change!

Im new to editing packages so figure either im doing something wrong, or its no possible!

For most instances all packages work great, but I need to be able to account for some specific words not in the dictionaries.

Thanks in advance



Solution 1:[1]

So, the solution I have found is as follows (for autocorrect package);

import autocorrect as 
ac.word.LOWERCASE.update({'zumba'})
ac.word.MIXED_CASE.update({'Zumba'})

I got to this simply by iterating through the module attributes;

dir(ac.word.LOWERCASE)

Sorted!

Solution 2:[2]

The above solution does not work anymore in the current version of autocorrect. The dictionary is now found in the speller class

import autocorrect as ac
spell = ac.Speller()
spell.nlp_data.update({"Zumba":1000})

Not sure what the number number stands for but this worked for me.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Siobhan
Solution 2 Chris C