getting started with Lute import + branching out

alexΒ 22nd September 2024 at 10:54am

[September 22th, 2024: some time has passed from the original write-up; this took some further editing to better reflect the many options I shall pursue after.]

some context on Lute

Lute is a great tool and a great source of practice! It has got to export new terms to a .csv, and I'm looking to automatically import these to Anki β€” and, at some point, to have them become updated on Lute's database too.

initial assessment of Lute term exporting

These are some terms from my latest term export.

term,parent,translation,language,tags,added,status,link_status,pronunciation
Der,,there / that / who,Danish,"adverb, pronoun",2024-08-16 12:33:56,W,,
Hendes,,,Danish,,2024-09-11 09:31:55,W,,
Hun,,she,Danish,pronoun,2024-08-21 22:57:54,W,,
beslutte,,to decide,Danish,verb,2024-08-17 12:51:06,1,,
besluttede,beslutte,decided,Danish,verb,2024-08-17 12:51:06,1,y,
besluttede​ ​sig​ ​for,,he decided that/for,Danish,common-phrases,2024-08-17 15:09:16,1,,
[...]

In fact, there are a few filters I could use:

Notice also that Lute has a feature that creates entries from various words: that is where the ​ comes from.

batch processing of information

Setting up the parsing of Lute term lines was quick β€” now, there's the issue of handling the creation of so many cards at once. On one hand, I wouldn't mind having a screen with all of them, and then do some batch requesting β€” but the whole interface would have to be set up, bugs, etc. which overall is not so practical (or pragmatic).

On the other hand, if I bring the SQL database back, dumping Lute's data in it, I can safely do queries for unadded flashcards using the single card interface. This simpler approach also protects against any sort of interface failure that would discard the whole batch of parsed flashcards in memory. Of course, I could instead try to query my own Anki database directly, bypassing the SQL intermediary β€” but then there's the issue of...

bidirectional correspondence between Anki and Lute

...identifying each term entry uniquely (how can I know whether a Lute term has already been added? How to avoid redundant information?).

My noun flashcards follow the form noun(article) (like bil(en) β€” the car), and to uniquely identify a card by its source or target alone would imply matching the word as it would appear in a text; in this example, a card would have bil, and then possibly a gender field from which I could derive the renderering of both en bil and bilen (problems would arise with irregular noun declensions; these can be queried from Wiktionary β€” or would I implement Danish grammar rules? That would be some good study!) β€” and, in Lute, bilen would then be related to it as a child card. This approach would also allow for simple communication back and forth between the two platforms: achieving a learning threshold in Anki could then trigger an update on Lute's own database.

It seems like this might be unearthing other problems β€” a very interesting set, in fact β€” but as it so frequently happens, this might be a glorious derailing of my work.

[September 22th, 2024: it did not necessarily derail, but there's certainly some delayed gratification here, and it is not clear I'm appropriately cutting corners to reap benefits as soon as possible.]

This is not a priority for now β€” the SQL might serve as a middleman alright – but these are nevertheless problems that require some thinking.

Statusdone
Prioritymedium