2
0
mirror of https://github.com/koreader/koreader synced 2024-11-18 03:25:46 +00:00
koreader/plugins/japanese.koplugin
NiLuJe da65ac8b02
Cleanup various varargs shenanigans (#9624)
* Iterate over varargs directly via select if possible
* Use table.pack otherwise (https://github.com/koreader/koreader-base/pull/1535).
* This allows us to simplify a few Logger calls, as logger now handles nil values.
2022-10-12 19:59:48 +02:00
..
_meta.lua plugins: add Japanese Support plugin 2021-10-23 15:49:54 +02:00
deinflector.lua Cleanup various varargs shenanigans (#9624) 2022-10-12 19:59:48 +02:00
main.lua Clarify our OOP semantics across the codebase (#9586) 2022-10-06 02:14:48 +02:00
README.md plugins: add Japanese Support plugin 2021-10-23 15:49:54 +02:00
yomichan-deinflect.json plugins: add Japanese Support plugin 2021-10-23 15:49:54 +02:00

Japanese Support Plugin for KOReader

This plugin is heavily based on Yomichan's design, and makes use of Yomichan's deinflection data, but was written specifically for KOReader. There are two major features implemented by this plugin:

  1. Verb deinflection (aka deconjugation) support, based on Yomichan's very elegant rule-matching suffix replacement system using Yomichan's data.

  2. Text segmentation support without needing MeCab or any other binary helper, by re-using the users' installed dictionaries to exhaustively try every length of text and select the longest match which is present in the dictionary. This is similar to how Yomichan does MeCab-less segmentation.

    On paper this plugin should also be work with Chinese text if the user has Chinese dictionaries installed, though that is not its primary intended use-case.

The backbone of this plugin is the included yomichan-deinflect.json. This file is copied verbatim from Yomichan's ext/data/deinflect.json and can be updated when necessary by simply getting a newer copy.

Note that Yomichan and KOReader use the same license (GPL-3.0-or-later) so any theoretical licensing problems are a non-issue.