How to handle 'typo' inspections/annotations programmatically?


How can I, programmatically through my plugin, automatically add words to the dictionary? I don't mean that I have a list of words that I could format into a dictionary file and reference that. What I have is multiple yaml files that define responses from a chatbot. These files are FULL of slang and made up/custom words that are tagged as typos. One file has 439 'typos' - about 10% of them are legit typos. I want to retain the ability to have actual typos highlighted, but I want to take the other 400 or so (in that one file alone) "typos" that need to be added to the dictionary and have my existing plugin be able to auto-accept them.

Poking through the code I found the SpellCheckManager and acceptWordAsCorrect, but for the life of me cannot find where the typo annotations are stored. I'd be happy just getting a list of them, then running an acceptWordAsCorrect on them all.

Can anyone point me in the right direction? Non-stop googling has gotten me nowhere... (rant about the deterioation of google's algorithm is more appropriate elsewhere :D)


Please sign in to leave a comment.