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
Multiple dictionaries? #37
Comments
It's not impossible. Is the use case for bi-lingual people that would be writing in multiple languages? Or is it for loading multiple dictionaries in a single language, like the main English dictionary plus a slang dictionary? It might be simpler to just instantiate multiple Typo objects, one for each dictionary. |
Personally I have a Spanish and English dictionary, but I think this would serve both use cases. Currently I have a prototype where I instantiated two Typo object, though what I have to do is do a lookup in both and then concat the results. It would be nice if I could make one call and get a single array of suggestions from both dictionaries. Also, that step could remove duplicates. |
This feature is what I was looking for too. My use case is a language dictionary and a dictionary with technical terms for this language. |
I ended up manually adding words to |
@richardtallent I need to do something similar (letting users add a term to the dictionary while editing a file) and I tried the same approach you did, something like: but I put a breakpoint in typo.js's 'checkExact' function that runs right after I add the new word and its not there. Did this work for you? |
oh, nevermind...I just happened to be testing with a word that although was correctly being added to dictionaryTable it would fail the spell checking for other reasons (the word was zoe1234zoe or something, and the combo of letters and numbers is what failed the check, not the word). |
I see in the docs that
Typo
needs to be initialized with a dictionary code. Would it be feasible to enhance this so that it can load multiple dictionaries? If that's not impossible and sounds useful, I would be willing to help :)The text was updated successfully, but these errors were encountered: