I would like to know everyone's thoughts about having morph highlighting available in "other" cards through a formatter. #307
Replies: 7 comments 10 replies
-
I can't really give any advice on this without more information since it really depends on how many cards you have, whether or not you want your "other" cards to be sorted, etc.
AnkiMorphs does not have a runtime formatter, but you could make your own relatively easily, all you need to do is:
If anyone made that into a separate add-on and called it |
Beta Was this translation helpful? Give feedback.
-
|
Ok, I looked at this a little more this evening. I think I have a game plan together. I'll need your https://github.com/mortii/anki-morphs/blob/main/ankimorphs/ankimorphs_db.py#L181-L197 and With those the only piece I would be missing to connect the dots would be having the formatter get the card id. I'm still getting up to speed on writing plugins for Anki, still looking to see if that data is given to me in a prop when the filter is called. (i.e. I am trying to find the datatype for the second param to the formatter ( I'm also loathe to copy/paste so much of your code into the extension. Both for the fact that it seems crappy to do that, but also for the maint aspect. (OTOH it'd be nice to have the exact implications as you so that we'd be 100% in sync) Would you entertain pushing some of your code to pipy or some other repo, or should I just suck it up and paste it in? I think the db stuff is so small scoped and internal that having a copy of that would be fine, but the text manipulation would suck to have to re-write, and having a different implementations means that we'd have different bugs than each other and keeping the plugin data in sync with "the real thing" would be a PITA. Anyway I'm still a long way out since I have all kinds of other things to figure out in how to make an Anki extension in general. |
Beta Was this translation helpful? Give feedback.
-
I don't know if you've seen the latest release notes, but this project is essentially in a bug fix only phase, although I left a tiny gap open for new features, so any additions would have to be minimally invasive.
Guessing the morphemizer is definitely not a good approach. It would probably be fine most of the time, but when it fails it will likely fail spectacularly.
That seems reasonable, reusing the current note-filter system would reduce additional code 👍 |
Beta Was this translation helpful? Give feedback.
-
|
#308 is ready for review. I am all ears for any changes. |
Beta Was this translation helpful? Give feedback.
-
|
Just noting that I'm still on this. I worked on it a bunch over the weekend, and a little last night. I have a branch, where I ended up chasing features until I had completely reimplemented the highlight_text function. I don't know if I even want to propose/pr it here. or if I do, maybe it's just for informational purposes, and or if anyone is curious. I was really pleased to see your tests for highlight_text and I have stubbed in my implementation and run through them. I am especially thankful for the regex escape one, as that was def overlooked by me! The German one still has some work before I pass. Contrasting the implementations: I didn't look at your implementation in any detail while I was implementing mine, so I'm going to do that when the tests are fully passing. From what I did see, the difference in our impls is that I rely more heavily on regexes. I expect that they will be pretty similar to one another in the long run. At the end of the day, it's a fun and interesting exercise, and I certainly upped my regex game while tinkering around in here. I doubt this code should see the light of day beyond a pr for exposure, but fun none the less. Should have a pr in a couple days. I'll still need to go back to the "real" original pr and make sure that I tidy up loose ends so that it's quality enough to merge. |
Beta Was this translation helpful? Give feedback.
-
|
I'm still alive. here's a tease :D Tests fully pass. Code is done but needs a cleanup pass. Will have a PR in a day or so. Main: New: |
Beta Was this translation helpful? Give feedback.
-
|
This has been implemented and merged in #313! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
First off, thanks for the amazing plugin! I am new to t+1 learning and discovered MorphMan last week and have since moved up to AnkiMorphs.
One thing that I miss from MorphMan is the ability to use the formatter
morphHighlighton card templates to add morph tracking to cards that I am not mining for morphemes. Ala https://github.com/kaegi/MorphMan/blob/master/morph/newMorphHelper.py#L251-L318.With MorphMan, you did have to register the note type, but you could mark is
not readandnot write. this would enable the formatter to be used but exclude the cards from any other considerations.It was not perfect, and I did need to write a little js snippet that would shuffle the attributes around when tags were used. but I eventually got it wired up nicely.
It appears that AnkiMorphs takes a different approach and defers the highlight processing time all to the calculation phase (as opposed to the card draw phase -- names I just made up on the spot, lol). This has not only runtime a performance benefit, but the benefit of not requiring the plug-in on mobile devices. It does, however, have the drawback of requiring that all card types where you'd like to use the morph data to be pre-processed and have static data persisted in the card, making your card data duplicative .
I wonder if this kind of formatter is possible/appropriate for AnkiMorphs, or if I should just not care about card data duplication, bite the bullet, and add am-highlighted to all my "other" cards.
I'd love to hear your thoughts!
Beta Was this translation helpful? Give feedback.
All reactions