Adds 424 bilingual StarDict dictionaries from WikDict
(https://www.wikdict.com). #9037 requested dictionaries from both
ebook-reader-dict and WikDict; the ebook-reader-dict (reader.dict) entries
are already present, and this adds the WikDict side. Source data is
Wiktionary via DBnary; the dictionaries are licensed CC BY-SA 3.0 and hosted
at download.wikdict.com.
The entries are kept in a separate file, dictionaries_wikdict.lua, instead
of being inlined into dictionaries.lua, because:
- The list is large (424 pairs) and would dominate the hand-curated
dictionaries.lua, making that file harder to review and diff.
- It is generated programmatically from the published dictionaries (via
wikdict-gen's `helper.py koreader`), so it is regenerated wholesale on
each WikDict release. Keeping it as its own file makes an update a single
file replacement with no manual merging.
dictionaries.lua appends the entries with table.move and still returns one
flat dictionaries table, so nothing else needs to change.
For example, to determine whether the Japanese or Chinese form should be shown.
* Dictionaries.lua - use iso3 codes everywhere
readerdictionary.lua - convert iso to bcp tag, to construct ifo_lang
isolanguage.lua - map from iso3 to full language name, map from iso3 to bcp language tag
* Make the full language names translatable
* Store ifo information from dictionaries.lua in downloaded dictionaries
The previous version of JMdict comes from 2009 and doesn't appear to
work at all when trying to do basic lookups (likely due to some kind of
encoding problem). In addition, the license information and sourcing was
not really in line with the requirements specified by the JMdict
license. This version is far more up-to-date and also includes synonym-based
deinflection (though because KOReader has a Japanese plugin now, this is
technically not necessary).
Since there didn't exist a nicely-maintained place to download these
dictionaries (because StarDict is not widely used for Japanese
dictionaries), I've set up a personal GitHub repository where I've
hosted them. Note that we're intentionally not pinning the commit hash
because GitHub only recommends we use gh-pages for CDN purposes, and one
of the requirements of the JMdict license is that you need to be able to
update to later versions.
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
* Virtually the entire list that was originally on Sourceforge, except for some dictionaries with unclear or questionable licences.
* Without the Webster's duplicates. The GCIDE (GNU Collaborative International Dictionary of English), already included, is the extended version of it.
* Without Freelang. To "dissociate" dictionaries, the permission of individual authors has to be obtained.
Many thanks to @avsej who prepared it all.
See https://github.com/koreader/koreader/pull/3176#issuecomment-447085441