Closed cyphar closed 2 years ago
To be honest, I'm not sure that returning an error if only one of the words failed to be looked up is preferable (it depends on what the user wants -- for the Japanese use-case if any one of the candidate words was correctly found that's a success), but I've kept the same error returning behaviour as before just in case.
Added a test to tests/t_json
.
/ping @Dushistov
This is a feature which is needed for KoReader to get language-specific plugin support (specifically Japanese but it would be needed for a few other languages where you need to be able to efficiently look up multiple candidate words at the same time).
Thanks for PR. I am little busy now, but I will test PR at the end of this week.
Thanks. :smile_cat:
Due to the lack of deinflection support in StarDict, users might want to be able to create a list of possible deinflections and search each one to see if there is a dictionary entry for that deinflection.
Being able to do this in one sdcv invocation is far more preferable to calling sdcv once for each candidate due to the performance cost of doing so. The most obvious language that would benefit from this is Japanese, but I'm sure other folks would prefer this.
In order to make this use-case better supported -- try to look up every word in the provided list of words before existing with an error if any one of the words failed to be looked up.
Signed-off-by: Aleksa Sarai cyphar@cyphar.com