yomichan icon indicating copy to clipboard operation
yomichan copied to clipboard

[Feature Request] Bulk generate definitions (and other data) for anki cards

Open aiko-tanaka opened this issue 2 years ago • 7 comments

It'd be nice to be able to use yomichan to bulk-generate info for cards mined from a non-internet source (e.g. kindle).

I'm thinking it'd be easy to do using ankiconnect? (except for bulk-generating audio I guess, I imagine forvo/Jpod101 would probably block IP addresses with numerous requests, but I'm fine even without a bulk-generate audio feature).

Feel free to close this though if this is the same as #1649. I'm not that savvy with the details but I think this would be different from #1649 since this wouldn't necessarily require an API, rather, it'd only need to send/receive requests via a server?

aiko-tanaka avatar Oct 14 '21 15:10 aiko-tanaka

Probably more of a question for AnkiConnect than Yomichan, but yes you can use AnkiConnect to add a lot of data to Anki. If you have a data source and can figure out how to set up the correct AnkiConnect API calls, I don't see why it wouldn't be possible.

toasted-nutbread avatar Oct 15 '21 02:10 toasted-nutbread

Any chance you could give a few hints on how to do this on the yomichan side?

I'm already familiar with using ankiconnect with python but I have no idea how to send the info to yomichan and back into anki.

aiko-tanaka avatar Oct 15 '21 09:10 aiko-tanaka

For example, the pitch accent functionality of yomichan was only added somewhat recently. And I think most people only start using Yomichan with JMDict and then later add monolingual dictionaries. Sometimes I wish there was a way to add that new info to pre-existing notes from within yomichan.

The obvious problem, especially when considering bulk updates, is that yomichan has no way of uniquely mapping a dictionary entry to an anki note.

  • If your unique expression is 止める, how will yomichan know that you want the dictionary entry for とめる and not やめる?
  • If your unique expression is やばい, how will it know you don't want the wild apricot definition?
  • If you have two notes for 方 (one for かた and one for ほう), how will yomichan know which note to update?

Even if yomichan was updated to check both the kanji and kana expression fields in each anki note, I'm not sure that would resolve 100% of the ambiguities. Yomichan could detect those situations and skip them when they occur, though.

stephenmk avatar Oct 15 '21 17:10 stephenmk

I'm was thinking of maybe having a base functionality of only filling up cards with 1:1 mappings, which i would guess would account for 60-70% or a regular mining deck.

Some of the extended functions i have in mind would be -

  • for cards which have more than one mapping, fill in the definition for all of those mappings (or maybe a max of 3 mappings and I'll just have to manually edit the card to select the mapping i want)
  • specify dictionary preference order (if user opts for more than one dict)

I guess with those in mind, it probably would account for 90% of cards, the rest would simply be up to the user to fill in manually.

There's still issues with words such as やばい but i wouldn't mind filling those in manually.

aiko-tanaka avatar Oct 16 '21 05:10 aiko-tanaka

You could use Migaku (though you have to downgrade Anki to version 2.35) to bulk add definitions, audios and images to your cards.

Feripe-a avatar Oct 23 '21 19:10 Feripe-a

Was playing around with yomichan a bit recently and I thought it'd be cool if I could web scrape the results from chrome-extension://--------------/search.html?query={expression} .

Tried to look for ways to do this using python but couldn't find any. It'd be cool if chrome-extension://--------------/search.html?query={expression} could be accessible using a web query. I wonder if that's possible. From there, web scraping the results should be easy enough.

aiko-tanaka avatar Dec 01 '21 03:12 aiko-tanaka

There is no way to access chrome-extensions: URLs outside of manually running a script in the Browser's developer console.

toasted-nutbread avatar Dec 17 '21 21:12 toasted-nutbread