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

dict: conflict between options --mime with --strategy #3

Open
Michahel opened this issue Jan 21, 2018 · 1 comment
Open

dict: conflict between options --mime with --strategy #3

Michahel opened this issue Jan 21, 2018 · 1 comment

Comments

@Michahel
Copy link

Michahel commented Jan 21, 2018

How to reproduce the problem.

Perform the following tests:

dict -h dict.bibleonline.ru -M "ide"
1 definition found

From Греческо-русский лексикон Нового Завета [ell-rus_strong]:

  Content-type: text/html; charset=utf-8
  Content-transfer-encoding: 8bit

  2396  ἴδε   ide
  вот, се, смотри, посмотри;<BR><I TITLE='второе лицо, единственное число, повел
ительное наклонение, действительный залог от' STYLE='COLOR: GREEN; CURSOR:DEFAUL
T'>2-е л. ед.ч. повел. действ. от</I> 1492 (εἰδῶ, οἶδα).

We got a normal result.

dict -s word -h dict.bibleonline.ru -M "ide"

No result. When you use the -s you have a problem.

dict -s prefix -h dict.bibleonline.ru -M "ide"

From Греческо-русский лексикон Нового Завета [ell-rus_strong]:

  Content-type: text/html; charset=utf-8
  Content-transfer-encoding: 8bit

  2396  ἴδε   ide
  вот, се, смотри, посмотри;<BR><I TITLE='второе лицо, единственное число, повел
ительное наклонение, действительный залог от' STYLE='COLOR: GREEN; CURSOR:DEFAUL
T'>2-е л. ед.ч. повел. действ. от</I> 1492 (εἰδῶ, οἶδα).

Now, the last two tests without using the -M, to see what should be the result.

dict -s word -h dict.bibleonline.ru "ide"

From Греческо-русский лексикон Нового Завета [ell-rus_strong]:

  2396  ἴδε   ide
  вот, се, смотри, посмотри;
  2-е л. ед.ч. повел. действ. от 1492 ( {εἰδῶ, οἶδα} ).
dict -s prefix -h dict.bibleonline.ru "ide"

From Греческо-русский лексикон Нового Завета [ell-rus_strong]:

  2396  ἴδε   ide
  вот, се, смотри, посмотри;
  2-е л. ед.ч. повел. действ. от 1492 ( {εἰδῶ, οἶδα} ).

From Греческо-русский лексикон Нового Завета [ell-rus_strong]:

  2397  ἰδέα  idea
  вид (1. наружность, внешность;
  2. разновидность, тип);
  син. 3444 ( {μορφή} ), 4976 ( {σχῆμα} ).

Conclusion: When you use the -M compatible with -s causes that the last dictionary entry is runaway.

I check this conclusion. I run DICT-server by command:
/usr/sbin/dictd -dnodetach -dinit

I do two tests:

  1. dict -s prefix -h dict.bibleonline.ru -M "ide"
  2. dict -s word -h dict.bibleonline.ru -M "ide"

I can see the result on the DICT-server:

:C: "dict 1.12.1/rf on CYGWIN_NT-5.1 1.7.28(0.271/5/3)"
:M: * prefix "ide" 2
:D: ell-rus_strong "ide" 1
:I: quit: d/m/c = 1/2/108; 1.000r 0.000u 0.000s
:C: "dict 1.12.1/rf on CYGWIN_NT-5.1 1.7.28(0.271/5/3)"
:M: * word "ide" 1
:I: quit: d/m/c = 0/1/903735; 0.000r 0.000u 0.000s

Note: We use the -M option instead --mime, but this is also true for the long option (--mime) as for the short one (-M).

@Michahel Michahel changed the title dict: Conflict option --mime with --strategy dict: conflict between options --mime with --strategy Jan 21, 2018
@Michahel
Copy link
Author

Michahel commented Jan 22, 2018

Change line 1093 in dict.c to
for (i = cmd_reply.matches + option_mime; i > 0; --i) {
Can you test this and see if it works?
Thanks.

Michahel added a commit to Michahel/dictd that referenced this issue Feb 3, 2019
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

1 participant