Skip to content
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

Most sdcv output is repeated twice #76

Open
clauseggers opened this issue Sep 7, 2021 · 3 comments
Open

Most sdcv output is repeated twice #76

clauseggers opened this issue Sep 7, 2021 · 3 comments

Comments

@clauseggers
Copy link

Here’s an odd one. Most output I get from sdcv (0.52) is shown two times. The second output consecutively to the first. However something like sdcv -v is only output once. Here is the output of sdcv -l:

> sdcv -l
Dictionary's name   Word count
The Britannica Concise    24402
Duden    118901
LDaF    57822
Oxford Advanced Learner's Dictionary    34153
English Thesaurus    20003
AHD Indo-European and Semitic Roots Supplement (En-En)    1022
Apresyan (En-Ru)    117141
English Etymology    18380
Obscene language (En-Ru)    226
English-Greek    13357
Oxford English Dictionary 2nd Ed. P1    140086
Latin-English    2300
Longman Dictionary of Common Errors (En-En)    1277
Collins Thesaurus (En-En)    11649
AHD Indo-European and Semitic Roots Supplement (En-En)    1022
American_Idioms 2nd Ed    25740
The Britannica Concise    24402
Duden    118901
LDaF    57822
Oxford Advanced Learner's Dictionary    34153
English Thesaurus    20003
AHD Indo-European and Semitic Roots Supplement (En-En)    1022
Apresyan (En-Ru)    117141
English Etymology    18380
Obscene language (En-Ru)    226
English-Greek    13357
Oxford English Dictionary 2nd Ed. P1    140086
Latin-English    2300
Longman Dictionary of Common Errors (En-En)    1277
Collins Thesaurus (En-En)    11649
AHD Indo-European and Semitic Roots Supplement (En-En)    1022
American_Idioms 2nd Ed    25740

And here the output of an interactive query:

> sdcv bread
Found 16 items, similar to bread.
0)The Britannica Concise-->bread
1)Oxford Advanced Learner's Dictionary-->bread
2)Apresyan (En-Ru)-->bread
3)English Etymology-->bread
4)English-Greek-->bread
5)Oxford English Dictionary 2nd Ed. P1-->bread
6)Longman Dictionary of Common Errors (En-En)-->bread
7)Collins Thesaurus (En-En)-->bread
8)The Britannica Concise-->bread
9)Oxford Advanced Learner's Dictionary-->bread
10)Apresyan (En-Ru)-->bread
11)English Etymology-->bread
12)English-Greek-->bread
13)Oxford English Dictionary 2nd Ed. P1-->bread
14)Longman Dictionary of Common Errors (En-En)-->bread
15)Collins Thesaurus (En-En)-->bread
Your choice[-1 to abort]: 

The doubling of output also happen when I use this shell function:

dict () {
	sdcv -n --utf8-input --utf8-output --color "$@" 2>&1 | fold --width="$(tput cols)" | w3m
}

I’m running it under ZorinOS 16 (which is based on Ubuntu 20.04). I’m at a loss as to why this happens. I’ve manually set the $STARDICT_DATA_DIR to $HOME/.stardict/dic/ and placed the dictionaries in sub-directories within.

@cyphar
Copy link
Contributor

cyphar commented Sep 28, 2021

Does this happen if you use the -e (exact / no fuzzy search) option? KoReader has some code that works around the fact that sdcv can output the same entry multiple times if it decides to trigger a fuzzy search after finding an exact search (the exact search finds an entry and outputs it, then fuzzy search finds the same entry and outputs it again).

@clauseggers
Copy link
Author

Yup, same outcome.

@dosimple
Copy link

I experienced a similar issue awhile ago. It turned out, I had two sets of dictionaries at different locations, both used by sdcv at the same time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants