- Notifications
You must be signed in to change notification settings - Fork17
JMdict, JMnedict, Kanjidic, KRADFILE/RADKFILE in JSON format
License
scriptin/jmdict-simplified
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
JMdict,JMnedict,Kanjidic, andKradfile/Radkfile in JSON format
with more comprehensible structure and beginner-friendly documentation
- Releases are automatically scheduled for every Monday. Seerelease.yml
- Found a bug? Need a new feature? SeeCONTRIBUTING.md
Original XML files are less than ideal in terms of format.(My opinion only, the JMdict/JMnedict project in general is absolutely awesome!)This project provides the following changes and improvements:
- JSON instead of XML (or custom text format of RADKFILE/KRADFILE).Because the original format used some "advanced" XML features,such as entities and DOCTYPE, it could be quite difficult to use in some tech stacks,e.g. when your programming language of choice has no libraries for parsing some syntax
- Regular structure for every item in every collection, no "same as in previous" implicit values.This is a problem with original XML files because users' code has to keep trackof various parts of state while traversing collections. In this project, I tried to make everyitem of every collection "self-contained," with all the fields having all the values,without a need to refer to preceding items
- Avoiding
null
(with few exceptions) and missing fields, preferring empty arrays.Seehttp://thecodelesscode.com/case/6 for the inspiration for this - Human-readable names for fields instead of cryptic abbreviations with no explanations
- Documentation in a single file instead of browsing obscure pages across multiple sites.In my opinion, the documentation is the weakest part of JMDict/JMnedict project
See theFormat documentation orTypeScript types
Please also read the original documentation if you have more questions:
There are also Kotlin types, although they contain some methods and annotations you might not need.
There are three main types of JSON files for the JMdict dictionary:
- full - same as original files, with no omissions of entries
- "common-only" - containing only dictionary entries considered "common" -if any of
/k_ele/ke_pri
or/r_ele/re_pri
elements in XML files containone of these markers: "news1", "ichi1", "spec1", "spec2", "gai1".Only one such element is enough for the whole word to be considered common.This corresponds to how online dictionaries such ashttps://jisho.orgclassify words as "common". Common-only distributions are much smaller.They are marked with "common" keyword in file names, see thelatest release - with example sentences (built from JMdict_e_examp.xml source file) - English-only versionwith example sentences from Tanaka corpus maintained byhttps://tatoeba.org.This version doesn't have a full support in this project: NPM libraries do not provideparsers and type definitions
Also, JMdict and Kanjidic have language-specific versions with language codes(3-letterISO 639-2 codes for JMdict,2-letterISO 639-1 codes for Kanjidic) in file names:
all
- all languages, i.e. no language filter was appliedeng
/en
- Englishger
/de
- Germanrus
/ru
- Russianhun
/hu
- Hungariandut
/nl
- Dutchspa
/es
- Spanishfre
/fr
- Frenchswe
/sv
- Swedishslv
/sl
- Slovenian
JMnedict and JMdict with examples have only one respective version each,since they are both English-only, and JMnedict has no "common" indicators on entries.
- Java 17 (JRE only, JDK is not necessary) - you can useAzul Zulu OpenJDK
You don't need to install Gradle, just use the Gradle wrapper provided in this repository:gradlew
(for Linux/Mac) orgradlew.bat
(for Windows)
NOTE: You can grab the pre-built JSON files in thelatest release
Use included scripts:gradlew
(for Linux/macOS) orgradlew.bat
(for Windows).
Tasks to convert dictionary files and create distribution archives:
./gradlew clean
- clean all build artifacts to start a fresh build,in cases when you need to re-download and convert from scratch./gradlew download
- download and extract original dictionary XML files intobuild/dict-xml
./gradlew convert
- convert all dictionaries to JSON and place intobuild/dict-json
./gradlew archive
- create distribution archives (zip, tar+gzip) inbuild/distributions
Utility tasks (for CI/CD workflows):
./gradlew --quiet jmdictHasChanged
,./gradlew --quiet jmnedictHasChanged
,and./gradlew --quiet kanjidicHasChanged
- check if dictionary files have changedby comparing checksums of downloaded files with those stored in thechecksums.OutputsYES
orNO
. Run this only afterdownload
task!The--quiet
is to silence Gradle logs, e.g. when you need to put values into environments variables../gradlew updateChecksums
- update checksum files in thechecksums directory.Run after creating distribution archives and commit checksum files into the repository,so that next time CI/CD workflow knows if it needs to rebuild anything../gradlew uberJar
- create an Uber JAR for standalone use (i.e. w/o Gradle).The JAR program shows help messages and should be intuitive to use if you know how to run it.
For the full list of available tasks, run./gradlew tasks
- Make sure to run tasks in order:
download
->convert
->archive
- If running Gradle fails, make sure
java
is available on your$PATH
environment variable - Run Gradle with
--stacktrace
,--info
, or--debug
arguments to see more detailsif you get an error
The original XML files -JMdict.xml,JMdict_e.xml,JMdict_e_examp.xml,andJMnedict.xml -are the property of the Electronic Dictionary Research and Development Group,and are used in conformance with the Group'slicense.Project started in 1991 by Jim Breen.
All derived files are distributed under the same license, as the original license requires it.
The originalkanjidic2.xml file is released underCreative Commons Attribution-ShareAlike License v4.0.See theCopyright and Permissionssection on the Kanjidic wiki for details.
All derived files are distributed under the same license, as the original license requires it.
The RADKFILE and KRADFILE files are copyright and available under theEDRDG Licence.The copyright of the RADKFILE2 and KRADFILE2 files is held by Jim Rose.
NPM packages@scriptin/jmdict-simplified-types
and@scriptin/jmdict-simplified-loader
are available underMIT license.
The source code and other files of this project, excluding the files and packages mentioned above,are available underCreative Commons Attribution-ShareAlike License v4.0.SeeLICENSE.txt
About
JMdict, JMnedict, Kanjidic, KRADFILE/RADKFILE in JSON format
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.
Contributors4
Uh oh!
There was an error while loading.Please reload this page.