Offline Japanese Dictionary for Linux?

6 points by ananiochita ↗ HN
Other than Kiten, which is the only one I could find but pulls a gazillion dependencies. I'm using GTK and would rather not have Qt / KDE stuff. Even a CLI one would do.

8 comments

[ 1.3 ms ] story [ 45.3 ms ] thread
Thank you, but how am I supposed to use these files ? Extracting a tarball leaves a bunch of files, some readable, some not so much. Looks like this is meant to be used as data for an application.
Make your own.

They are all based off EDICT data, which is a flat file you could load into an editor and search directly.

Get the edic2.gz file here:

http://www.edrdg.org/jmdict/edict.html

OK, that is unfortunately not in UTF-8 but in an outdated encoding EUC-JP. No problem, Glibc's character set converter to the rescue:

   $ gunzip -c edict2.gz | iconv -f euc-jp -t utf-8 > edict2
Some sample lines from the middle of this almost 200,000 line file:

  発券 [はっけん] /(n,vs,vt) issuing (a banknote, ticket, etc.)/EntL1477300X/
  発見 [はっけん] /(n,vs,vt) discovery/detection/finding/(P)/EntL1477310X/
  発見器;発見機 [はっけんき] /(n) detector/detecting machine/detecting device/EntL2855554/   
This is super easy to parse.

What is that "Ent..." field at the end? The Wiki documentation explains it:

"In addition, the EDICT2 has as its last field the sequence number of the entry. This matches the "ent_seq" entity value in the XML edition. The field has the format: EntLnnnnnnnnX. The EntL is a unique string to help identify the field. The "X", if present, indicates that an audio clip of the entry reading is available from the JapanesePod101.com site."

The (P) identifies a common usage word, but the documentation says that this is not reliable.