cessen / kobo_jp_dict

A Japanese-English dictionary builder for Kobo e-readers.
Apache License 2.0
32 stars 2 forks source link

Support Yomichan json dictionaries. #1

Closed matsumurae closed 3 years ago

matsumurae commented 3 years ago

The idea is to have the same results I have with yomichan (I'm using JMNedict, JMDict, KireiCake, Shinmekai and Daijisen), I'm curious if it would be possible to combine multiple dictionaries into one and have the same on my Kobo.

Also not sure if i would be able to use them even as a separated dict, they're json not XML.

Never worked with dictionaries so sorry if this is a dumb question!

cessen commented 3 years ago

Hi @matsumurae!

Right now I've only written the code to support a specific set of dictionaries (two of which are included as gzipped files under dictionaries/ in this repo). You can indeed combine all three supported dictionaries into a single dictionary for Kobo. Unfortunately, I haven't added support for Yomichan dictionaries yet.

But I think that's a great idea, and adding support for them is definitely possible. I have some free time today, so I might take a first crack at it.

cessen commented 3 years ago

I'm working on this in the yomichan_support branch.

So far I have reading the dictionaries working. Next step is to actually integrate that data into the generated the dictionary.

cessen commented 3 years ago

Just dropping a line to say that I do still plan to get around to this, but am currently a bit on the busy side, so it might be a while. But I haven't abandoned this issue.

cessen commented 3 years ago

I've made a little more progress on this now. If you compile the yomichan_support branch, you can now specify yomichan .zip files, and it will read them and (mostly) include them in the resulting dictionary. A quick summary of the current state:

I'll probably (no promises) be hacking on this over the course of this month, and hopefully get it all working nicely and merged into master.

matsumurae commented 3 years ago

Thanks for your hard work, really you're awesome!

Word entries are my main problem so maybe it's not so useful for me now haha I'll check it and see if I can help in any way

cessen commented 3 years ago

Oh, yeah, the word entries are weird right now. I don't think it's worth testing yet. I'll post another comment here once I've gotten that working properly.

cessen commented 3 years ago

Okay, I think the feature is basically ready, aside from some testing and bug fixing. I opened a PR to track it here: #2

If you want to take a crack at using it, and let me know if you run into any issues, that would be awesome. To add yomichan dictionaries you use the -y flag. You need to repeat the flag for each included dictionary, but you can include as many as you like. For example:

kobo_jp_dict output_dictionary.zip -j JMdict_e.xml -p accents.tsv -y kanjidic_english.zip -y 三省堂 スーパー大辞林.zip -y jmnedict.zip
matsumurae commented 3 years ago

Wow that was really fast! I'll check it out when I have some free time. I'll let you know if I see something wrong.

cessen commented 3 years ago

I've merged Yomichan dictionary support into master. If you run into any issues with it please feel free to open another issue!