Open mikeb-celtx opened 6 years ago
What is the PR where it shows the hackaround? Currently trying to get adding single custom words to work in typo js, thanks.
When adding a new word, would you expect to ever be specifying flags for the word, or would it always be just "learn this exact word"?
FWIW, without a proper API, the way to add a word to an existing Typo instance should be:
var newWord = "cromulent";
var typo = new Typo([...]);
...
typo.dictionaryTable[newWord] = null
The command line version of Hunspell only allows simple word lists in personal dictionary files. Perhaps that would be a good place to start, and possibly simpler with no need for flags?
Maybe there could be a public addPersonalDictionary
method, that you pass a file name/file data to, and it calls _parseDIC
under the hood?
It would be much appreciated if there were a way to add new custom words to the working dictionary. Right now I'm reloading the whole thing, though I saw on another PR that there is a hackaround to add single words using internal members. It seems like this is an obvious candidate for API extension.