Skip to content

Change the <pocketsphinx/search.h> API to be slightly more intuitive#298

Merged
dhdaines merged 7 commits intomasterfrom
fix_search_api
Sep 18, 2022
Merged

Change the <pocketsphinx/search.h> API to be slightly more intuitive#298
dhdaines merged 7 commits intomasterfrom
fix_search_api

Conversation

@dhdaines
Copy link
Contributor

The functions in <pocketsphinx/search.h> were extremely badly named. If I call ps_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.

@dhdaines dhdaines merged commit c80db95 into master Sep 18, 2022
@dhdaines dhdaines deleted the fix_search_api branch September 21, 2022 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant