migaku-official / Migaku-Japanese-Addon

Migaku Japanese is an Anki add-on to help you learn Japanese more easily. If you have an issue please report it in the "Issues" tab. Reponses to issues can be slow on GitHub, for faster support consider joining our Discord server through our Patreon page.
GNU General Public License v3.0
109 stars 24 forks source link

Multiple audio files / audio files for all words or components of words in one field #38

Closed SpongebobSquamirez closed 5 years ago

SpongebobSquamirez commented 5 years ago

Type:

Environment:

I'm going to open a PR to resolve the issue:

Description: There's only one feature from the old NHK accent addon (or at least the dev branch of it that I maintained) that doesn't seem to have been fully carried over to this one, and that's the ability for audio/accent graphs to be generated for multiple words at once. This is especially useful for compound words, since sentences are sort of already covered by the click to listen functionality. For example, some text I ran the old addon on gave the following results (although this example is also covered by click-to-listen, I guess...although it fails with e.g. forvo, but that's a different addon): input: [悪性/良性]腫瘍 output: [sound:悪性.yomi0006D45B_0266.wav][sound:悪性.yomi0006D463_02FA.wav][sound:悪性.yomi0006D46C_009E.wav][sound:良性.yomi0009E915_00C2.wav]

(although in this case 腫瘍 wasn't found, for some reason I don't remember)

On the other hand, this does "work" (in that it can parse this to find the audio): input: 鰊・鯡 output: [sound:にしん.yomi00024700_0078.mp3]

so it seems like the infrastructure for doing this exists.

There are various ways to design this: it could always return the audio for all components, it could give it only when the full value of the field isn't found, it could give all components with 2 or more characters (seems reasonable to me), or maybe something else. It would work for both compound words with no clear boundaries between components, and for sentences.

SpongebobSquamirez commented 5 years ago

eh, nevermind, I guess. Click to listen seems to work well enough