ajatt-tools / anki.koplugin Goto Github PK
View Code? Open in Web Editor NEWKOReader plugin enabling Anki card generations for words looked up in the internal dictionary.
KOReader plugin enabling Anki card generations for words looked up in the internal dictionary.
Hello, thank you for this plugin! It's definitely something i've been looking for for a while.
I managed to install this plugin accordingly and edited the fields to match my own deck on Anki. However, when I click on "Add to anki", this gives me an error posted below. I also have my wifi connected + ssh server on whilst adding.
Wondering if this is something I messed up during installation.
Currently using a Korean dictionary, and when I try to generate a note for Anki it says it cannot sync because the note is empty. Tried both in localhost (Ubuntu laptop) and koreader within Kindle using the same dictionary, and both give the same result.
Tested that notes are generated, for example, for English words without an available dictionary (but only stored offline, as it cannot figure out the language). When adding a dictionary, even English words fail with the same error.
Once again, thanks for this amazing script. I have noticed the script tends to only add the sentence the word is in until there's a comma or a dot.
Would it be possible to implement a system where you could highlight the whole context you would like to add in the note? Sometimes the sentence the word is, doesn't have enough context to remember it in the future while reviewing it.
Thanks in advance.
Hello again!
I have noticed that the new versions (from May 18 and up) of the plugin suppress spaces in sentences sent to context_field.
I guess it has something to do with the "custom sentence context" addition (pretty cool feature btw).
Thanks again for your work, your plugin make my workflow SO much more streamlined.
Hi it's me again:p
I have notice that with the May 29 version some words cause koreader to crash, for exemple:
When adding the word blench in this sentence
I got this crash:
And when trying to add man in this sentence (I thought that maybe the !’ was somehow causing problem):
I got this crash:
But then I tried to add mother from this sentence:
And it just worked, without any trouble.
So I don't know what's causing the crash, when a word in a specific sentence crash he always will. But the same word added to anki in other sentences won't cause any trouble.
Sorry for keeping creating new issues every two day:p
Greetings!
My device: Onyx Boox Leaf 2 (android 11)
I have installed a Koreader plugin using this tutorial guide: https://github.com/Ajatt-Tools/anki.koplugin
Then I installed AnkiconnectAndroid, put http://localhost:8765/ in CORS Host settings, start service. When I press add to anki in Koreader, I get these errors:
Any solutions?
I’ve got the program up and running and it works great, so thank you! When i mine I like to put a lot of definitions on my cards, like three monolingual dictionaries and one bilingual. I’ve gotten the multi-definition extension to run and edited the lua script so that I created “Definition 2,” “Definition 3,” and so on fields on my note type in anki and have each dictionary mapped to send to a particular field in the lua script.
However, when I actually use the program, instead of getting definitions from all of or most of the six custom dictionaries I have installed, I am only getting one to two definitions per card.
I think this is due to the part of the code where there is deconfliction of kana? When I am in koreader and do the lookup I get results for like five dictionaries but they aren’t sending to the card so I’m guessing it must be due to the deconfliction and formatting between dictionaries.
I get why the deconfliction exists but I’d rather get superfluous extra results I can edit out of my card later rather than getting shorted definitions from my other dictionaries. Could you advise if this is an issue I could remedy by commenting out a certain portion of the extension code, or changing something in it so that all the dictionary results that surface in koreader actually get sent to my card?
Thank you!
Hello, first of all thank you for the plugin, it looks fantastic!
Second, here is the problem:
My ereader had the wifi off and I was adding a bunch of cards offline (as I have not yet successed in connecting the ereader with Anki) when all of a sudden Koreader crashed. I did not manage to get a picture before the error disappeared but I noticed that the plugin was not working anymore (the Add to Anki button had disappeared).
03/20/24-18:19:05 INFO (re)initializing context buffer with size: 50 03/20/24-18:19:05 INFO after reinit: prev table = 54, next table = 54 03/20/24-18:19:05 INFO AnkiNote#get_custom_context() 1 0 1 0 03/20/24-18:19:14 WARN unwrapped dismissablePopen(), falling back to blocking io.popen() g_mkdir failed: No such file or directory g_mkdir failed: No such file or directory 03/20/24-18:19:17 WARN unwrapped dismissablePopen(), falling back to blocking io.popen() g_mkdir failed: No such file or directory g_mkdir failed: No such file or directory 03/20/24-18:19:21 WARN unwrapped dismissablePopen(), falling back to blocking io.popen() g_mkdir failed: No such file or directory g_mkdir failed: No such file or directory 03/20/24-18:19:46 WARN unwrapped dismissablePopen(), falling back to blocking io.popen() g_mkdir failed: No such file or directory g_mkdir failed: No such file or directory 03/20/24-18:20:06 WARN unwrapped dismissablePopen(), falling back to blocking io.popen() g_mkdir failed: No such file or directory g_mkdir failed: No such file or directory 03/20/24-18:20:20 WARN unwrapped dismissablePopen(), falling back to blocking io.popen() g_mkdir failed: No such file or directory g_mkdir failed: No such file or directory 03/20/24-18:20:23 WARN unwrapped dismissablePopen(), falling back to blocking io.popen() g_mkdir failed: No such file or directory g_mkdir failed: No such file or directory 03/20/24-18:20:30 WARN unwrapped dismissablePopen(), falling back to blocking io.popen() g_mkdir failed: No such file or directory g_mkdir failed: No such file or directory 03/20/24-18:20:42 WARN unwrapped dismissablePopen(), falling back to blocking io.popen() g_mkdir failed: No such file or directory g_mkdir failed: No such file or directory 03/20/24-18:23:37 ERROR Failed to initialize anki plugin: plugins/anki.koplugin/ankiconnect.lua:277: attempt to index local 'note' (a nil value) 03/20/24-18:23:39 INFO opening file /mnt/onboard/神去なあなあ日常 -- 三浦しをん.epub 03/20/24-18:23:39 INFO Inhibiting user input 03/20/24-18:23:39 ERROR Failed to initialize anki plugin: plugins/anki.koplugin/ankiconnect.lua:277: attempt to index local 'note' (a nil value) 03/20/24-18:23:40 INFO Restoring user input handling 03/20/24-18:25:31 INFO Inhibiting user input 03/20/24-18:25:31 INFO Restoring user input handling 03/20/24-18:25:33 INFO Inhibiting user input 03/20/24-18:25:33 INFO Restoring user input handling 03/20/24-18:26:22 WARN unwrapped dismissablePopen(), falling back to blocking io.popen() g_mkdir failed: No such file or directory g_mkdir failed: No such file or directory 03/20/24-18:27:00 WARN unwrapped dismissablePopen(), falling back to blocking io.popen() g_mkdir failed: No such file or directory g_mkdir failed: No such file or directory 03/20/24-18:27:07 WARN unwrapped dismissablePopen(), falling back to blocking io.popen() g_mkdir failed: No such file or directory g_mkdir failed: No such file or directory 03/20/24-18:27:17 WARN unwrapped dismissablePopen(), falling back to blocking io.popen() g_mkdir failed: No such file or directory g_mkdir failed: No such file or directory 03/20/24-18:27:38 WARN unwrapped dismissablePopen(), falling back to blocking io.popen() g_mkdir failed: No such file or directory g_mkdir failed: No such file or directory ./luajit: plugins/anki.koplugin/ankinote.lua:45: attempt to index field 'document' (a nil value) stack traceback: plugins/anki.koplugin/ankinote.lua:45: in function 'fn' plugins/anki.koplugin/ankinote.lua:172: in function 'build' plugins/anki.koplugin/ankiconnect.lua:224: in function 'add_note' plugins/anki.koplugin/main.lua:175: in function 'callback' frontend/ui/widget/buttontable.lua:81: in function 'callback' frontend/ui/widget/button.lua:472: in function 'handleEvent' frontend/ui/widget/container/inputcontainer.lua:266: in function 'handleEvent' frontend/ui/widget/container/widgetcontainer.lua:83: in function 'propagateEvent' frontend/ui/widget/container/widgetcontainer.lua:101: in function 'handleEvent' frontend/ui/widget/container/widgetcontainer.lua:83: in function 'propagateEvent' frontend/ui/widget/container/widgetcontainer.lua:101: in function 'handleEvent' ... frontend/ui/widget/container/widgetcontainer.lua:101: in function 'handleEvent' frontend/ui/widget/container/widgetcontainer.lua:83: in function 'propagateEvent' frontend/ui/widget/container/widgetcontainer.lua:101: in function 'handleEvent' frontend/ui/uimanager.lua:907: in function 'sendEvent' frontend/ui/uimanager.lua:53: in function '__default__' frontend/ui/uimanager.lua:1436: in function 'handleInputEvent' frontend/ui/uimanager.lua:1536: in function 'handleInput' frontend/ui/uimanager.lua:1580: in function 'run' ./reader.lua:280: in main chunk [C]: at 0x000140cd !!!! Uh oh, something went awry... (Crash n°1: 03/20/24 @ 18:28:02) Running FW 4.38.21908 on Linux 4.1.15-00866-g3a75628c73c (#96 SMP PREEMPT Thu Nov 17 14:25:47 CST 2022) Attempting to restart KOReader . . . !!!!
After seeing the "attempt to index local 'note' (a nil value)' error, I also looked at the anki.koplugin_notes.json
file and there is two notes with a different format:
So I guess a short term answer would be to clear the file but the problem remains.
I think there may be an error in the config.lua file
since I also can't connect but I don't seem to find it.
I wrote the url variable like this: url = "http://IPv4:8765" (IPv4 being my IP address of course.)
Maybe it is the space in "Word Audio" ?
If you have any idea that would be great, thank you!
Hey there, loving the extension. One thing I’d like to request if possible - right now, for adjectives and verbs, the target word that gets output to Anki is the conjugated word used in the sentence as opposed to the deinflected dictionary form of the word. For example, if my sentence contains 食べたり, the target word will export as 食べたり instead of 食べる.
Can this behavior - at least optionally - be altered to export the headword of the selected dictionary entry, or deinflected form of the word, as the target word instead? This would help avoid inflated known word counts for me.
Amazing idea! I was exporting my words and sentences manually so far!!!
Suring the setting up I'm stuck on SSH server commands in windows. I couldn't manage to connect the plugin with ankiconnect after trial & denials for some hours.
as a windows user (tips for the next rookie users);
About the setting up the SSH, An easy step by step guide for windows would be much appreciated.
On the other hand, eveb being able to saving the cards offlin, on the device is also fine for me. So thanks for this work already!
When "Add to Anki" is pressed or long-pressed on a query via the manual dictionary lookup, KOReader crashes.
Not all documents are OCR-able, making this function essential.
The problem seems to be pretty straightforward. It fails to determine that there is no context and attempts to concatenate an uninitialized variable.
Thx for your amazing koplugin! I have reached an issue like this:
After clicking the button "Add to Anki" the first time,there goes an alert like above.
192.168.6.180 is the IP address of my PC where AnkiConnect is running, the connection through e-reader to PC is working fine I think
Is there any anything goes wrong with my settings in Anki Settings->General Settings? (I didn't change any item in Anki Settings->Anki Note Settings.)
I had the plugin working for a minute, but wasn't able to connect to ankiconnect. I realized I had missed putting in my IP address in the config file, so I added my IPv4 address (as I saw in a previous post). I did try to make a few cards before this, but since it wouldn't sync, it just stored them offline.
Starting up KOReader now though, the anki button disappeared and there isn't any editing options in the toolbar.
I took a look at the crash log and saw a few instances of this line:
ERROR Failed to initialize anki plugin: plugins/anki.koplugin/ankiconnect.lua:277: attempt to index local 'note' (a nil value)
Maybe I entered the IP incorrectly since that's the last thing I did, but I'm also trying to figure out what's going on with the error. Maybe they're connected?
Hello, I am trying to run this on my BOOX Palma but I’m not sure if it’s compatible or not, the Palma’s OS is Android 11 and I currently use the Ankidroid and Ankiconnect android apps along with the Yomitan broswer extension to automatically create flashcards while using my regular browser. I really needed something for when I’m reading though so when I saw this I was pretty excited and downloaded it and was able to install it to Koreader but unfortunately whenever I select the “add to anki” button after highlighting a word, I get an error that says “Couldn’t Synchronize Note, Couldn’t Get Deck ID” and then a bunch of other random words(see picture below) I just want to know if it’s even possible to use this plugin on Android so I don’t waste my time ripping my hair out trying to figure this out because it would be a huge lifesaver for me as I currently create anki cards by hand for all my reading vocab, thank you so much!
First of all, thanks for your work. I have been using Koreader for a year now and was really hoping for an anki integration.
Sadly I can't get this plugin to work with both my kobo Clara 2e and my boox nova air. I have installed the plugin via USB on both my device and changed the ankiconnect config =>
{
"apiKey": null,
"apiLogPath": null,
"ignoreOriginList": [],
"webBindAddress": "0.0.0.0",
"webBindPort": 8765,
"webCorsOriginList": [
"http://localhost"
]
}
wifi on my devices is on (SSH works on my pc without trouble)
But every time I try to synchronize my note I get this error.
Maybe I'm missing something obvious, I'm a complete noob when it come to tech especially network stuff. Anyway thanks for your time and your work on this project.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.