Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Only one setting allowed? #36

Open
Steven630 opened this issue Sep 16, 2024 · 8 comments
Open

Question: Only one setting allowed? #36

Steven630 opened this issue Sep 16, 2024 · 8 comments

Comments

@Steven630
Copy link

Hello, thank you for creating this useful plugin. I'm looking into a possible way to memorize words and come upon this plugin. I wonder if there is just one setting allowed. I look up words in three languages, and would like to add them to different decks depending on the language. Is this possible? In the config.lua, it seems the setting is fixed. Thank you.

@nairyosangha
Copy link
Member

Yeah the setting is fixed currently, you can only have one.
I messed around a while back with having multiple profiles, see this branch https://github.com/Ajatt-Tools/anki.koplugin/tree/MULTI_PROFILE_SUPPORT

the idea being that you would create multiple config.lua files with unique names under a new 'profiles' directory, which you can then associate with the document you're reading. It's not finished though, haven't really touched it in a while since I haven't really needed it myself

@Steven630
Copy link
Author

Thank you for the reply. I'll first try the fixed setting then. Does the plugin require a lot of CPU though? Hope it doesn't crash on my kpw2 (sometimes looking up a word in the dictionary crashes my Koreader😊)

@Steven630
Copy link
Author

I have just tried it out on my Android phone. It seems there is no notification when a card has been stored offline. Can the user change the default context length to at least a certain number of words? Sometimes a sentence contains words like "Mr." ,"U.S.A". To customize one by one is a bit slow. My suggestion is to let users to set a threshold. If the context is, say, less than 15 words when using the default extraction, the surrounding two sentences are added until the criterion is met.

@nairyosangha
Copy link
Member

Thank you for the reply. I'll first try the fixed setting then. Does the plugin require a lot of CPU though? Hope it doesn't crash on my kpw2 (sometimes looking up a word in the dictionary crashes my Koreader😊)

I would expect it to work fine, my old kobo aura manages fine

I have just tried it out on my Android phone. It seems there is no notification when a card has been stored offline.

It only notifies you the first time so you're not constantly told a note was stored offline, certain popups are only shown if the previously shown popup wasn't exactly the same, which was an easy way to make it less spammy.

Can the user change the default context length to at least a certain number of words? Sometimes a sentence contains words like "Mr." ,"U.S.A". To customize one by one is a bit slow. My suggestion is to let users to set a threshold. If the context is, say, less than 15 words when using the default extraction, the surrounding two sentences are added until the criterion is met.

That's also not configurable, you can just select the context you want with the custom context menu though, isn't that good enough 🤔

Would it be okay if the threshold applies to both the part before the word looked up and the part after separately?
E.g. if the sentence part before the word looked up is fewer than 15 words it adds an extra sentence until we have more than 15 words. Same thing would happen for the part after the sentence. KOreader returns the context as the part before and after the string separately so that'd make it cleaner to implement

@Steven630
Copy link
Author

Steven630 commented Sep 18, 2024

Would it be okay if the threshold applies to both the part before the word looked up and the part after separately?
E.g. if the sentence part before the word looked up is fewer than 15 words it adds an extra sentence until we have more than 15 words. Same thing would happen for the part after the sentence. KOreader returns the context as the part before and after the string separately so that'd make it cleaner to implement

Yes, setting threshold for both previous and next context would be nice. I personally prefer more contexts, so customizing frequently would be a bit inconvenient. (And there are the annoying Mr. Mrs. that cut a sentence short).

@TonioBanderas
Copy link

Yeah the setting is fixed currently, you can only have one. I messed around a while back with having multiple profiles, see this branch https://github.com/Ajatt-Tools/anki.koplugin/tree/MULTI_PROFILE_SUPPORT

the idea being that you would create multiple config.lua files with unique names under a new 'profiles' directory, which you can then associate with the document you're reading. It's not finished though, haven't really touched it in a while since I haven't really needed it myself

This would be so awesome :)

@nairyosangha
Copy link
Member

I've added a prev_sentence_count and next_sentence_count setting. Leave it at 1 to have the current behavior, setting it to 2 will prepend/append one extra sentence, etc.

@nairyosangha
Copy link
Member

I've also added support for having multiple profiles. Instead of having the single config.lua you can now just drop multiple .lua files in the ./profiles directory and then link them with a doc.
I've updated the readme, I hope it's pretty self explanatory, please let me know if something is unclear

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants