-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Does not display all of the dictionary's results #30
Comments
Yes, it is how it works now, it just pick the first article/translation and return it back, |
I think it's very important, as I don't get the intended result (the definition of either a noun or a verb) quite frequently. |
@InterAl A temporary workaround was posted here: koreader/koreader#2951 (comment) |
But what the use case for such dictionaries? Why not just merge all translations with one key into one on the creating dictionary stage? |
If the dictionaries merged them beforehand, they would need to format the merged string themselves. When the definitions are separate, each client can implement its own formatting. |
Another real-life use case is when two words only differ by case in a dictionary. Example from Wiktionary: I think returning such words like this would be perfect:
|
I use a number of specialised dictionaries in Stardict format that all tend to have multiple entires with the same headword. It would be great if this functionality could be added to sdcv; I would very much like to use it over Goldendict. |
I'm really interested too. I use translations dictionaries in koreader and just get the first definition 👎 |
I started taking a look a this. While it looks trivial at first glance, a lot of the other code really depends on the special return values from Basically the issue is that StarDict works by having a index you binary search to find the entry offset for the main dictionary, but sdcv doesn't check that there are other lexically identical strings next to the one it finds in the search (meaning that the result you get is actually arbitrary -- adding an entry somewhere else in the dictionary would change which entry you get for an unrelated word lookup). The solution is conceptually simple (at the end of the binary search, walk back in the index until you hit a word that doesn't match the search string then walk forwards and return an array of the indexes you found -- same for the synonym index and every other kind of index) but because the lookup function is used as a way of getting the "next" result (which includes some magic values like |
#78 submitted which should fix this issue. |
Seems like the program does not return all values from the dictionary.
For example, there are multiple values for "rock" (noun, verb, etc) in the Webster's 1913 dictionary, but only the first result is displayed.
I tried with 2 other dictionaries as well, and the problem persisted.
The text was updated successfully, but these errors were encountered: