10-12-2019, 07:31 PM | #1 |
Junior Member
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.
|
10-13-2019, 08:07 AM | #2 |
Wizard
Posts: 1,670
Karma: 730583
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. |
Advert | |
|
10-15-2019, 05:04 AM | #3 |
Junior Member
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. |
10-15-2019, 06:58 AM | #4 |
Wizard
Posts: 1,670
Karma: 730583
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. |
10-27-2020, 08:54 AM | #5 |
Guru
Posts: 769
Karma: 625812
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!
|
Advert | |
|
10-27-2020, 11:04 AM | #6 | |
cosiñeiro
Posts: 1,319
Karma: 2200073
Join Date: Apr 2014
Device: BQ Cervantes 4
|
Quote:
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. |
|
10-27-2020, 01:11 PM | #7 |
Guru
Posts: 769
Karma: 625812
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! |
Tags |
api, development, lua, plugin, translation |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Plugin Development | KevinH | Plugins | 546 | 09-29-2024 05:57 PM |
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 |