Open Eltharis957 opened 5 years ago
I thought about adding words in smaller chunks via multiple for loops using CreateDictionaryEntry() function on arrays. To make this not stall the application, I could run those loops on a background thread. Small enough chunks could not affect performance, while gradually building a dictionary before a user gets to type in a word.
Yes, you can certainly do this. But there is no need to use chunks and multiple for loops. You can simply run LoadDictionary() or CreateDictionary() as a whole in a background thread. You should then synchronize CreateDictionaryEntry() and Lookup() via lock().
How to add multi-word phrases to dictionary?
LoadDictionary() and CreateDictionary() do not currently support multi-word phrases. The only way to add multi-word phrases is to do it programmatically via CreateDictionaryEntry()
How to add phrases (single and multi-word) with punctuation
Currently you can add phrases with punctuation only programmatically via CreateDictionaryEntry()
Thank you for this great code. I'd like to ask you about recommendation/suggestion on how I could make loading a big dictionary faster and not slowing down the application. I have an idea, please answer as a creator if this is going to work in your opinion:
My previous implementation was my own, but it was using SQL database. Queries were too slow for this kind of usage or too many with a bigger dictionary.
An issue - for some reason, CreateDictionaryEntry() is the only way for me that works after using LoadDictionary() first. CreateDictionary() doesn't add more terms to an existing database. Word count stays the same. Maybe it's because it's plain text without a second column for word frequency?
And two short questions: