Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > KOReader

Notices

Reply
 
Thread Tools Search this Thread
Old 10-12-2019, 07:31 PM   #1
mintwurm
Junior Member
mintwurm began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Oct 2019
Device: Libra h2o
Plugin development: search in dictionary

Does the lua API expose dictionary lookups? I would like to create a plugin that automates some text translations.
mintwurm is offline   Reply With Quote
Old 10-13-2019, 08:07 AM   #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,618
Karma: 724945
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
It sounds like you may want something other than dictionary lookups?

http://koreader.rocks/doc/modules/ui...ator:translate

As for the literal question, probably, but it shouldn't matter much either way. A local function/table/variable is likely just a quick refactor away from being made available as a module method.
Frenzie is offline   Reply With Quote
Advert
Old 10-15-2019, 05:04 AM   #3
mintwurm
Junior Member
mintwurm began at the beginning.
 
Posts: 5
Karma: 10
Join Date: Oct 2019
Device: Libra h2o
Thank you for your reply. This community is awesome

Maybe I should have made my question broader in the beginning. It's about adding a vocabulary trainer to koreader.

On kindle, they have an integrated vocabulary trainer. It keeps track of all the words you have looked up during your reading and turns them into flashcards. The flashcards are quite smart, they keep the sentence where you looked up the word as an example and show you the dictionary page as translation.

But at the same time, the vocab trainer is weirdly limited. The words aren't sorted by dictionary. When you repeat words, they are all thrown into the same pot. English and French and Spanish are revised at the same time.

And the tool only has two categories "known" and "unknown" cards. No proper scheduling of repetitions, etc.

Also, you can't add flashcards on your own. You have to look up the word during reading.

This tool could be so powerful. I pick up my ereader basically every day. It would be easy to make a habit of repeating a few words every time. But the kindle training tool is so frustratingly limited.

I was amazed when I found koreader, such an awesome project
So now I would like to dabble in lua programming a bit and try to hack up a vocab trainer like on kindle (just better :P)

This issue https://github.com/koreader/koreader/issues/5490 was also me.
I have some programming experience, but none in lua.
Looks fun though.

My plan is to:
1. hook into dictionary lookups and extract the flashcard data
2. create a simple UI
3. add a tutor algorithm with spaced repetition
4. make the UI more complicated (allow users to add their own flashcards, etc)
5. cloud sync ? maybe look at flashcard formats from Anki or other open source tools and get them to play along

No idea how far I'll make it but I would really like to have this tool. So currently, I'm rather motivated.
mintwurm is offline   Reply With Quote
Old 10-15-2019, 06:58 AM   #4
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,618
Karma: 724945
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
Anki is definitely an interesting program. I've been experimenting with it myself over the past few months (i.e., instead of or in addition to writing unknown French vocab on paper, put it in Anki so the algorithm takes care of spacing it out).

Btw, I already added a (very) basic dictionary history one or two years ago.
Frenzie is offline   Reply With Quote
Old 10-27-2020, 08:54 AM   #5
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: 746
Karma: 619508
Join Date: Sep 2013
Device: EnergySistemEreaderPro, Nook STG, Pocketbook 622, Bookeen Cybooks ...
Any progress here. Having a vocabulary trainer as plugin for Koreader would be awesome!
nhedgehog is offline   Reply With Quote
Advert
Old 10-27-2020, 11:04 AM   #6
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,271
Karma: 2200049
Join Date: Apr 2014
Device: BQ Cervantes 4
Quote:
Originally Posted by nhedgehog View Post
Any progress here. Having a vocabulary trainer as plugin for Koreader would be awesome!
There was a request to export lookup history in a format compatible with being imported by anki (csv) in https://github.com/koreader/koreader/issues/6502

The main problem is: doing dict lookups takes time. The lookup history has queries stored but not their definitions. So, the feature would require to iterate over the entire lookup history (or last n items) and do a dict lookup for each one of them, which would be painfully slow on most embedded devices.

If that gets implemented it can be repurposed for OP intents. The only missing part is the UI.
pazos is offline   Reply With Quote
Old 10-27-2020, 01:11 PM   #7
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: 746
Karma: 619508
Join Date: Sep 2013
Device: EnergySistemEreaderPro, Nook STG, Pocketbook 622, Bookeen Cybooks ...
Thanks for the update and the link.
I was guessing in that direction, dictionary lookup will probably be the problem. But it is an interesting project with some potential!
nhedgehog is offline   Reply With Quote
Reply

Tags
api, development, lua, plugin, translation


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Plugin Development KevinH Plugins 525 04-20-2024 09:40 AM
Dictionary plugin in Sigil? For example Oxford-English Dictionary. Rindr Plugins 2 03-04-2018 11:11 AM
Loading Plugin in development Sladd Development 6 06-17-2014 06:57 PM
DR800 Plugin development for DR800/DR1000 yuri_b iRex Developer's Corner 0 09-18-2010 09:46 AM
Device plugin development reader42 Plugins 10 03-29-2010 12:39 PM


All times are GMT -4. The time now is 12:49 PM.


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