The algorithm searches in the language model (trie + lm.binary) for words. If “tast” is in there, it can be an output. So you could reduce the word combinations in the language model.
So I have downloaded generate_lm.py and want to use it to generate my own language model, but I’m unsure how to do it… I just need to feed it a text file containing my sentences?
Sorry, you’ll have to read the code and/or read documentation. Building your own language model makes up roughly 20% of questions here, so be prepared to put in a couple of hours.