LuteOrg / lute-v3

LUTE = Learning Using Texts: learn languages through reading. Python/Flask.
MIT License
348 stars 38 forks source link

Add opinionated Anki export #3

Open jzohrab opened 1 year ago

jzohrab commented 1 year ago

(I've revised this issue based on new thoughts)

Summary

I wrote Lute based off of LWT, but dropped the SRS feature of LWT: the code was brutal, and for the initial MVP (minimal viable product) release of Lute I didn't feel that it was a necessary feature. I still don't :-) for a few reasons:

  1. A brute-force approach of "just test everything" isn't the best. In some cases like verb inflections, I don't need to test every permutation -- perhaps I should only see the parent, and a few child examples. Also, there are many words that I've only seen once so far in my reading, and may never see again. I think I should be able to select the terms I want/need to test.
  2. I question whether Anki testing falls within the primary use-case of Lute, which is just to get you reading, and to hopefully encourage you to keep reading. I read a lot with Lute, and would vastly prefer to focus on reading, rather than testing.
  3. Testing by seeing sentences I've read, and then regurgitating those (or similar), isn't very fun for me!

Even Steve Kaufmann of LingQ doesn't really recommend using their testing feature, probably for the same reasons as I have above. :-) (He does recommend their "sentence mode" for building sentences, I believe.)

Exporting terms to a CSV, and images to somewhere else, may be trickier than needed, so I'll with using AnkiConnect as the first iteration of this.

This will be an opinionated export: it will assume certain note types, deck name, field names, etc.

Design/UX notes

The following are some rough ideas only. I'd need to try implementations to really get a handle on the UX.

Config

Exports from term listing

The term listing has a checkbox. Users could select the terms they want to export, and then click an "export to anki" button.

Ankiconnect supports exporting images, see https://github.com/FooSoft/anki-connect/issues/158.

Lute doesn't store sample sentences for terms, but it does has a reference lookup that could get the latest sentence for any term. The sentences table is loaded on opening a page for reading, so even if the page isn't marked read something should be in the table. Need to update the export to include a non-read page's sentences.

Fields to export:

failed exports

Anki note/card templates

I'll put some kind of pre-designed note type in a public place so people can access it ... that's probably the easiest thing to do. Creating a single-card shared deck on AnkiWeb would be easiest. AnkiConnect apparently does let you create models using the API, I'm not sure how tough that would be. https://foosoft.net/projects/anki-connect/index.html#model-actions

It would be nice to have Anki cards be able click back to Lute, if Lute's running, so that people can see the term and its sample sentences again.

jzohrab commented 1 year ago

Another possibility here is to use AnkiConnect -- that has some real advantages (namely, seamless operation). Much of the above still applies, with AnkiConnect.

For AnkiConnect, I think a first-round implementation could be as follows:

jzohrab commented 7 months ago

Some of the above is no longer valid (e.g. any mention of the .env file, which is replaced with settings). But the ideas are still good.

thelazyoxymoron commented 1 month ago

Would love to see this being implemented. I agree with your initial thoughts on Anki not being a suitable place for regurgitation, however there's an adjacent use-case that we can target.

Exporting terms which are a bit mature in the learning cycle (i.e. let's say learning levels 2/3/4) along with sentences would probably be better (That way we ensure that the term would've been seen at least twice or more number of times by the user)