Change the <pocketsphinx/search.h> API to be slightly more intuitive #298
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The functions in
<pocketsphinx/search.h>
were extremely badly named. If I callps_set_lm()
then I expect it to set the current language model. But it didn't actually do that! It just added the language model to a list of "search modules" and didn't actually change anything.This is certainly a useful thing to do, but the function name should describe what it actually does. Since we are breaking a bunch of APIs anyway, the old function names are just removed, except in Python, where they are still there but give deprecation warnings (since it's not nice to make people's code crash, whereas making it fail to compile is just fine).
Ideally there would be a
ps_set_lm()
(for instance) which would actually do what you expect it to, but since the namespace has already been polluted, we probably can't do that. Oh well.