Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > KOReader

Notices

Reply
 
Thread Tools Search this Thread
Old 03-18-2021, 10:52 AM   #1
nhedgehog
Guru
nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.
 
Posts: 771
Karma: 625816
Join Date: Sep 2013
Device: EnergySistemEreaderPro, Nook STG, Pocketbook 622, Bookeen Cybooks ...
Dictionary postformating - help needed

Using KoReader on a Pocketbook, I tried to force it to show some formatting.
Allready done:

set sametypesequence=h in wiki.ifo file

with:

Code:
/mnt/ext1/applications/koreader # ./sdcv -02 data/dict Zwickel
i get:

Code:
g_mkdir failed: No such file or directory
Found 1 item, similar to Zwickel.
-->De-De (Wiktionary)
-->Zwickel

<i>Substantiv, m</i><i>, Zwi·ckel, Pl. Zwi·ckel</i><br><b>Bedeutungen:</b><br>1. Architektur: eine dreiseitig begrenzte, ebene oder sphärische Fläche<br>2. Schneiderei: ein keilförmiger Einsatz an Kleidungsstücken<br>3. regional: ein sonderbarer oder seltsamer Mensch<br>4. regional: spezieller Zapfhahn zur Verprobung des Jungbieres<br><b>Synonyme:</b><br>2. Gehre<br>3. Sonderling<br>
Since this is shown only as Plaintext I thought, following the discussion on GIHUB:
https://github.com/koreader/koreader/pull/3573
I could force KoReader to change some of the Dictrionary html code on the fly by putting a wiki.lua file in the same folder where the dictionary is located and the wiki.ifo file can be found with the following code:

Code:
return function(html)
    html = html:gsub('<b>', '<span style="font-weight: bold; font-size: 1.1em">')
    html = html:gsub('</b>', '</span>')    
    html = html:gsub('<i>', '<span style="font-style: italic; font-size: 0.9em ">')   
    html = html:gsub('</i>', '</span>')
    html = html:gsub('<br/>', '&nbsp;<div></div>')
    return html
end
but that didn't help either.
What went wrong, where is my error? Please help.
nhedgehog is offline   Reply With Quote
Old 03-18-2021, 05:23 PM   #2
Frenzie
Wizard
Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.
 
Posts: 1,675
Karma: 730583
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
I don't see <br> in there, so you should try html = html:gsub("<br>", "<br/>") (and look at the error log).
Frenzie is offline   Reply With Quote
Old 03-18-2021, 06:08 PM   #3
nhedgehog
Guru
nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.nhedgehog ought to be getting tired of karma fortunes by now.
 
Posts: 771
Karma: 625816
Join Date: Sep 2013
Device: EnergySistemEreaderPro, Nook STG, Pocketbook 622, Bookeen Cybooks ...
Thanks for the help. So strange: now its working!
Before I had only plaintext dictionary entries showing, but changes I made in the Dic name of the ifo file didn't show up. In the meantime the device switched off and now every dictionary I created with html entries does show them instead of the plaintext it showed before, even without the lua files.
So my guess now is, my changes in the ifo files "sametypesequence=h" needed a reboot, even then I thought, that switching to mass storage mode and restart KoReader would force it to use the new ifo file.
I'm a very happy user now.
nhedgehog is offline   Reply With Quote
Old 06-07-2022, 09:28 PM   #4
mbrisco
(gtfo/freak)
mbrisco ought to be getting tired of karma fortunes by now.mbrisco ought to be getting tired of karma fortunes by now.mbrisco ought to be getting tired of karma fortunes by now.mbrisco ought to be getting tired of karma fortunes by now.mbrisco ought to be getting tired of karma fortunes by now.mbrisco ought to be getting tired of karma fortunes by now.mbrisco ought to be getting tired of karma fortunes by now.mbrisco ought to be getting tired of karma fortunes by now.mbrisco ought to be getting tired of karma fortunes by now.mbrisco ought to be getting tired of karma fortunes by now.mbrisco ought to be getting tired of karma fortunes by now.
 
Posts: 115
Karma: 2288752
Join Date: Nov 2019
Device: Likebook Alita
Quick question about this: do these ad-hoc .lua files have any impact on performance/battery life of using the dictionary? Theoretically I mean.
mbrisco is offline   Reply With Quote
Old 06-08-2022, 09:36 AM   #5
pazos
cosiñeiro
pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.pazos ought to be getting tired of karma fortunes by now.
 
Posts: 1,331
Karma: 2200073
Join Date: Apr 2014
Device: BQ Cervantes 4
Quote:
Originally Posted by mbrisco View Post
Quick question about this: do these ad-hoc .lua files have any impact on performance/battery life of using the dictionary? Theoretically I mean.
Theoretically yes, but that depends on what you're putting inside those lua files. Examples like the above with a few strings substitutions are quite cheap. (Much much much cheaper than rerendering a whole book or using WiFi)

So practically: nope.
pazos is offline   Reply With Quote
Old 06-22-2022, 03:14 AM   #6
mbrisco
(gtfo/freak)
mbrisco ought to be getting tired of karma fortunes by now.mbrisco ought to be getting tired of karma fortunes by now.mbrisco ought to be getting tired of karma fortunes by now.mbrisco ought to be getting tired of karma fortunes by now.mbrisco ought to be getting tired of karma fortunes by now.mbrisco ought to be getting tired of karma fortunes by now.mbrisco ought to be getting tired of karma fortunes by now.mbrisco ought to be getting tired of karma fortunes by now.mbrisco ought to be getting tired of karma fortunes by now.mbrisco ought to be getting tired of karma fortunes by now.mbrisco ought to be getting tired of karma fortunes by now.
 
Posts: 115
Karma: 2288752
Join Date: Nov 2019
Device: Likebook Alita
Quote:
Originally Posted by pazos View Post
Theoretically yes, but that depends on what you're putting inside those lua files. Examples like the above with a few strings substitutions are quite cheap. (Much much much cheaper than rerendering a whole book or using WiFi)

So practically: nope.
Interesting... But isn't the Lua code run every time you do a lookup?
mbrisco is offline   Reply With Quote
Old 06-22-2022, 06:48 AM   #7
Frenzie
Wizard
Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.Frenzie ought to be getting tired of karma fortunes by now.
 
Posts: 1,675
Karma: 730583
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
Even if you ran the code in the OP a hundred times on each lookup for no apparent reason you probably still wouldn't notice it.

The lookup itself is orders of magnitude more demanding than a handful of simple string substitutions.
Frenzie is offline   Reply With Quote
Reply

Tags
dictionary, koreader, pocketbook, stardict


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting an AZW dictionary to MOBI = no longer treated as a dictionary by Kindle beic Conversion 3 08-02-2016 11:10 AM
[HELP NEEDED] Custom Dictionary. antkiller23 PocketBook 12 10-23-2013 05:48 PM
Dictionary question: changing word delimiters for french dictionary oecherprinte Amazon Kindle 1 05-09-2011 05:45 AM
Oxford built-in dictionary disappears after changing default dictionary YYZscientist Amazon Kindle 4 01-24-2010 09:42 PM


All times are GMT -4. The time now is 11:46 AM.


MobileRead.com is a privately owned, operated and funded community.