In 2012, I put together a collection of EPWING dictionaries. One thing I liked about them was that the dictionary files were separate from the reader software. As long as a reader supported the format, I could change applications without replacing the dictionaries.
More than a decade later, collecting Japanese dictionaries again is considerably messier. One folder contains .mdx and .mdd files; another contains a ZIP full of JSON files. Others hold XML, EPWING directory structures, or files belonging to a specific dictionary application.
Worse, the same book can exist in two or three formats. They may all let you look up words, but they may not contain exactly the same information. I started Unidicts because looking up Japanese words on my Mac and Kindle was such a nuisance. The first task, apparently, is working out what these files actually hold.
What are these formats for?
EPWING is an old acquaintance. It comes from the days of Japanese electronic dictionaries and CD-ROM dictionaries, with its own organisation of text, indexes and special characters. Opening one with software such as EBWin felt like inserting a dictionary disc into a computer. I still like its separation between data and reader, but it was not designed for today’s browser extensions or mobile reading apps.
MDict’s MDX/MDD took another approach. Roughly speaking, MDX holds entries and their content, while MDD can hold resources such as pictures, fonts and audio. Definitions may contain HTML, styling and cross-references. Extracting text from an MDX file is one thing; displaying the whole dictionary correctly is another.
Yomitan’s packages are much easier to inspect. They are typically ZIP archives containing index.json, term_bank_*.json and other files for dictionary metadata, terms, readings, tags and definitions. They can also contain images and styles. Several Unidicts dictionaries use Yomitan v3 sources because this format is straightforward to examine.
JMdict’s XML is different again. It is structured lexical data, explicitly recording written forms, readings, senses and restrictions between them. Turning it into a pleasant dictionary page requires presentation decisions. Going the other way—from an already formatted dictionary article to structured data—often means recovering relationships that the page layout only implies.
These formats did not grow as successive versions of one universal standard. Publishers, dictionary applications, browser lookup tools and open lexical projects all had their own purposes. The different formats accumulated over time.
Easier to parse does not mean more complete
Naturally, my first preference was to find a Yomitan edition. You can open the ZIP and inspect its JSON in a text editor. That is much nicer than working out a binary file format.
But Unidicts is not a demonstration that I can open a file. It is an attempt to retain as much of a dictionary’s useful content as possible. Convenience alone cannot decide which source to use.
In our local comparisons, the full and image-free packages of Daijirin (大辞林), Fourth Edition, each contained 334,751 records. Their sets of distinct written-form/reading pairs matched exactly. That establishes equivalence for the headword set, but it does not tell us which pictures or other valuable resources are missing from the image-free version.
Daijisen (大辞泉), Second Edition, was a different story. The full edition had 636,276 records and the image-free edition 636,269—only seven fewer. Yet when we compared written-form/reading pairs, the image-free version was missing 5,528 pairs found in the full one, while containing 5,544 pairs not in the full one. It was not simply the same dictionary with its pictures removed.
Two Yomitan builds of the Todōfukenbetsu Zenkoku Hōgen Jiten (都道府県別全国方言辞典) had matching record counts and identical written-form/reading sets, but 801 records differed in part-of-speech or other fields. Even a complete headword comparison would not catch that.
These numbers come from comparisons actually performed on the project’s local sources. So I no longer assume that a file labelled “image-free” is equivalent to the full edition, or discard an MDX or EPWING source just because its Yomitan version is easier to parse.
Unpacking a file is not converting a dictionary
The easiest conversion to produce is a table of “headword → text definition”. Unfortunately, many of the most useful parts of a Japanese dictionary do not fit into that model.
Our local Kojien (広辞苑), Seventh Edition, source contains SVG resources for special characters known as 外字(がいじ). Daijirin, Fourth Edition, contains nested senses, examples, citations and ruby annotations. The MDX/MDD source for Nihon Kokugo Daijiten (日本国語大辞典), Second Edition, also requires attention to HTML, accompanying resources and cross-references. Flatten all of that into plain text and the result may still be searchable, but it is no longer the same book.
There is a subtler problem too. Does a tiny marker in a definition indicate a part of speech, a usage note, or a qualification applying to one sense? The MDX or JSON format itself cannot tell you. That belongs to the editorial conventions of the particular dictionary. A universal parser that guesses these meanings will eventually get them wrong.
How I am handling it
Unidicts now separates the two jobs. A common parser reads the file format. The Yomitan parser reads ZIP archives and the eight-field term bank records; the MDX/MDD parser reads file headers, indexes, compressed blocks and entry data. Neither decides what a word means.
Each dictionary has its own converter to map the source content into entries, senses and resources. The result is one independent SQLite database per dictionary, rather than a single amalgam of definitions from dozens of books. An eventual Mac or Kindle exporter will not need to start over from the original MDX or ZIP files.
That division is already being used in the project, but it does not mean every format is supported. The shared readers currently cover Yomitan v3 and certain MDX/MDD variants. Unsupported encryption and compression methods are rejected explicitly. EPWING appearing in the research plan does not mean comprehensive EPWING support has been delivered. Apple Dictionary export has entered a separate trial phase, but the final lookup experience on devices still needs real acceptance testing.
In the next article, I want to look inside an actual dictionary entry. Beyond the headword and its explanation, which details are worth all this trouble to preserve?
Technical notes (optional)
The shared Unidicts parsers expose source records; they do not decide how a particular book organises senses. The Yomitan v3 parser reads the ZIP index and term banks. The MDX/MDD reader supports selected encodings, zlib and uncompressed blocks, and reports unsupported encryption or LZO compression. Dictionary-specific mapping produces independent SQLite databases with entries, senses and assets. Source records with no determinable reading are counted separately, without inventing readings for them.