Back

Help programming with EPWING files

#1
I'm an amateur programmer trying to figure out how to search through EPWING dictionary files. I did some searching in the source code of some projects that have EPWING support and found out about eplkup which sounds really useful, but I can't get it to work. It looks like eplkup v1.5 is in the source code for Rikaisama (https://sourceforge.net/projects/rikaisama/files/), but I try to run like "eplkup --help" and nothing happens. Other versions give me an error saying unsupported 16 bit application. Can anyone help me get it working or any other help using EPWING files?
Reply
#2
Check "yomichan", it is like Rikaisama but for Chrome.
It cames with a tool called "yomichan import", which is used to import dictionaries (such as the EPWING ones) inside a database.
So that when you use yomichan, it will check inside the database, and not inside the original EPWING.

What you may find interesting is how the importing tool works: for the EPWING dictionaries it uses a third party tool called "zero-epwing", which export the messy EPWING format into a more readable one, called "JSON".

What I did when I wrote an EPWING tool was:

1) I exported the EPWING dictionary into JSON format with zero-epwing;
2) I used a C# library to read the JSON format and import its content inside a SQLite database;

This is easy, the real work is when you import the dictionary content inside the db, because each EPWING dictionary has its way to represent entries, with all sorts of strange symbols, separators and so on and, in order to make the db content easily searchable, you need to translate it into a simple "word + reading + definition".

Hope this helps because at the time I didn't find any help and I spent days trying to figure how to do it ._.

PS: if you look at the yomichan source code you will see that the db import requires a lot of regular expressions in order to create clean entries inside the db.
Edited: 2017-04-18, 8:06 am
Reply
#3
Unless you want to do stuff with an epwing yomichan-import does not support, I would also highly recommend using it to make epwings easier to use in whatever programming project you're doing. For yomichan-import I wrote the support for the meikyou and kotowaza (and did the gaiji tables for wadai but didn't touch the regexes) epwings and it is not pleasant at all.

I tried looking at Rikaisama as well before many years back and gave up pretty fast. Thanks to yomichan-import I was able to add monolingual support for my personal flashcard generator project so now I don't even need to manually copy and paste J -> J definitions anymore over the EDICT2 entries on the flashcards it spits out at me.

EDIT: Also, zero-epwing is developed by FooSoft as well who primarily develops yomichan-import and yomichan. Although zero-epwing uses his modified version of the eb/libeb/eblib library as well; you can find more information on the respective github repos of his.

I would recommend using the JSON output of yomichan-import instead of zero-epwing; you should be able to get the word/reading/definition information much more easily that way; otherwise you're going to have to write regexes as cophnia61 has mentioned.
Edited: 2017-04-18, 1:24 pm
Reply
May 15 - 26: Pretty Big Deal: Get 31% OFF Premium & Premium PLUS! CLICK HERE
JapanesePod101
#4
(2017-04-18, 9:17 am)karageko Wrote: I would recommend using the JSON output of yomichan-import instead of zero-epwing; you should be able to get the word/reading/definition information much more easily that way; otherwise you're going to have to write regexes as cophnia61 has mentioned.

How do I get the JSON output?

EDIT: I see yomichan-import can be run on command line but I try "yomichan-import --help" and nothing happens. That seems to keep happening...don't know if I'm doing something wrong.

EDIT2: Ok it's actually working and I got the JSON files. Not sure why the help wouldn't display, but no matter. Thanks for the help.
Edited: 2017-04-18, 5:38 pm
Reply
#5
(2017-04-18, 3:48 pm)kudokupo Wrote:
(2017-04-18, 9:17 am)karageko Wrote: I would recommend using the JSON output of yomichan-import instead of zero-epwing; you should be able to get the word/reading/definition information much more easily that way; otherwise you're going to have to write regexes as cophnia61 has mentioned.

How do I get the JSON output?

EDIT: I see yomichan-import can be run on command line but I try "yomichan-import --help" and nothing happens. That seems to keep happening...don't know if I'm doing something wrong.

EDIT2: Ok it's actually working and I got the JSON files. Not sure why the help wouldn't display, but no matter. Thanks for the help.

I'm the author of both yomichan-import and zero-epwing. Basically if you want to just get raw output of EPWING dictionaries without any post-processing you would use zero-epwing. If you want to get actual usable data, you would use yomichan-import.

It's odd that you were not getting any command line help when you ran yomichan-import. Are you perhaps a Windows user? Windows is always a pain in the ass because it works differently from everything else out there; when building a UI application you have to link with a special flag to disable console output (otherwise you get the console popping up in the background). All the command line arguments should still work though -- you can check out the Yomichan Import homepage for details.
Reply