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

Dictionary feature broken: shows empty pages #7318

Closed
gerhaher opened this issue Feb 20, 2021 · 6 comments
Closed

Dictionary feature broken: shows empty pages #7318

gerhaher opened this issue Feb 20, 2021 · 6 comments
Assignees
Milestone

Comments

@gerhaher
Copy link

  • KOReader version: v2021.02-1-g995668a_2021-02-18/
  • Device: KA1

Issue

I have 4 dictionaries installed. When I look up a word and then tap forward (not using <</>>), my second and third dictionary show empty results (see picture below) when:

  • my first dictionary needs 2 pages to explain a word, my second dictionary is empty.

  • my first dictionary needs 3 or more pages to explain a word, my second & third dictionary is empty.

My first & fourth dictionary is never empty.

Reader_2021-02-20_105959

@Markismus
Copy link
Member

I've uploaded some Koreader optimized dictionaries here. Could you please check whether it is your dictionary or Koreader acting up?
They're zipped, so please unzip them first.

@poire-z
Copy link
Contributor

poire-z commented Feb 20, 2021

You're not saying: is this something new when updating KOReader ? or something that happens with previous versions ?

Can't reproduce.
Can you see what what kind of dicts (text or HTML?) are your 1st, 2nd, 3rd, 4th :) And see if by re-ordering them, you can guess a pattern of the kind of transition with which this happens (say, 1:text > 2:text or 1:html > 2:text). This will help understanding and fixing it.

@poire-z
Copy link
Contributor

poire-z commented Feb 20, 2021

OK, I can reproduce it: text dict > text dict.
Feels like the scroll position is not reset :/ so if the 1st result has 3 pages and on the 3rd page you tap to go to next result, you're on page 3 of next result: if the result is smaller than that: no content.

Pinging @NiLuJe , and re-mentionning my comments about this ugly, complex, uneeded change :/ #7212 (comment) #7166 (comment)

@gerhaher
Copy link
Author

gerhaher commented Feb 20, 2021

I updated KOReader a week ago (before that: several months ago (sep, oct, nov?)). Noticed the issue today.
I can reproduce it on my android.

I have used these dictionaries for a long time with no problem. Downloaded from here: http://download.huzheng.org/bigdict/

First dict: Oxford Advanced Learner's Dictionary 8th Ed.
Second: Merriam-Webster's Collegiate 11th Ed. (En-En)
Third: Webster's Third New International Dictionary, Unabridged (En-En)
Fourth: Gcide

After playing with the order: it is the first three that are the problem. If I place gcide or @Markismus' optimized Oxford advanced Learner's dictionary in between they are OK.

Questions to @Markismus:
Is the Oxford Advanced Learner's Dictionary on your page the same (except later ed) as the one I have used (as many words)? Your has much much smaller size.
And what about the Webster abridged 3? The formats on your page can't be used on KOreader, can they?

@NiLuJe NiLuJe self-assigned this Feb 20, 2021
@NiLuJe
Copy link
Member

NiLuJe commented Feb 20, 2021

Yep, trivial fix because of internal behavior differing between ScrollTextWidget & ScrollHtmlWidget, despite the similar API.

NiLuJe added a commit to NiLuJe/koreader that referenced this issue Feb 20, 2021
ScrollTextWidget

Despite a similar API between ScrollTextWidget and ScrollHtmlWiget, what
they do internally doesn't quite match.

So, while ScrollHtmlWidget's resetSCroll *does* rewind back to the top,
ScrollTextWidget's doesn't, it just updates the scrollbar itself.
So, do that on our end, *before* the (re-)init, which'll call
_renderText for us.

Fix koreader#7318
NiLuJe added a commit to NiLuJe/koreader that referenced this issue Feb 20, 2021
ScrollTextWidget

Despite a similar API between ScrollTextWidget and ScrollHtmlWiget, what
they do internally doesn't quite match.

So, while ScrollHtmlWidget's resetSCroll *does* rewind back to the top,
ScrollTextWidget's doesn't, it just updates the scrollbar itself.
So, do that on our end, *before* the (re-)init, which'll call
_renderText for us.

Fix koreader#7318
@NiLuJe NiLuJe mentioned this issue Feb 20, 2021
@Frenzie Frenzie added this to the 2021.03 milestone Feb 20, 2021
@Markismus
Copy link
Member

@gerhaher No entries were removed, rather the script removes the nested blockquotes.

The Oxford dictionaries have a rather large amount of nested blockquote-blocks. So an entry with 3 meanings would have [blockquote][blockquote][blockquote][blockquote]......[/blockquote][/blockquote][/blockquote][/blockquote] around it. It reduces the dictionary size considerably.

The script also changes the tag involved with text color, which reduces the size a small bit.

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

5 participants