Feature request: scorer callback function
I think this would be a pretty small and relatively noninvasive patch and would be happy to code it up and submit a pull request if the change would be welcome.
Is your feature request related to a problem? Please describe.
I have a grammar that I would like to support without the trouble if generating a kenlm language model. The grammar might be dynamically updated as speech is processed.
Describe the solution you'd like
I'd like to be able to pass on the C API a scorer function with a void * which returns the score for a given possible phrase.
Describe alternatives you've considered
I considered dynamically generating a kenlm model by linking with kenlm as a library, which seems quite cumbersome. Or calling the kenlm executable. Either way I would need to generate a corpus of possible expressions which is both inefficient and cumbersome.