Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API for adding custom words #66

Open
mikeb-celtx opened this issue Apr 28, 2018 · 3 comments
Open

API for adding custom words #66

mikeb-celtx opened this issue Apr 28, 2018 · 3 comments

Comments

@mikeb-celtx
Copy link

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.

@dportuesi
Copy link

What is the PR where it shows the hackaround? Currently trying to get adding single custom words to work in typo js, thanks.

@cfinke
Copy link
Owner

cfinke commented Oct 20, 2021

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

@whawker
Copy link

whawker commented Sep 2, 2022

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants