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.