Module koplugin.japanese

Japanese language support for KOReader, modelled after Yomichan.

This plugin extends KOReader's built-in dictionary and selection system to support Yomichan-style deinflection and text scanning, allowing for one-tap searches of inflected verbs and multi-character words and phrases. As such, this plugin removes the need for synonym-based deinflection rules for StarDict-converted Japanese dictionaries.

Functions

onWordLookup (args) Called from languagesupport.extraDictionaryFormCandidates for Japanese text.
onWordSelection (args) Called from languagesupport.improveWordSelection for Japanese text.

Issues

onWordLookup-todo17

Try to repeatedly reduce the text and deinflect the shortened text

   to provide more candidates. This is particularly needed because
   JMDict has a habit of creating entries for compounds or phrases
   that do not exist in monolingual dictionaries (even in 大辞林 or
   広辞苑) and our onWordSelection expansion accepts any dictionary's
   largest entry. Unfortunately doing this nicely requires a bit of
   extra work to be efficient (since we need to remove the last
   character in the string).
onWordLookup-todo17-todo18

Pass up the reasons list (formatted Yomichan style) to the

   dictionary pop-up so you can get some more information about the
   inflection. But this would require adding some kind of tag
   metadata that we have to pass through from the lookup to the
   dictionary pop-up.


Functions

onWordLookup (args)
Called from languagesupport.extraDictionaryFormCandidates for Japanese text. Tries to find and return any possible deinflections for the given text.

Parameters:

  • args arguments from language support

Returns:

    {string,...} extra dictionary form candiadates found (or nil)

See also:

onWordSelection (args)
Called from languagesupport.improveWordSelection for Japanese text. Tries to expand the word selection defined by args.

Parameters:

  • args arguments from language support

Returns:

    {pos0,pos1} the new selection range (or nil)

See also:

Issues

onWordLookup-todo17

Try to repeatedly reduce the text and deinflect the shortened text

   to provide more candidates. This is particularly needed because
   JMDict has a habit of creating entries for compounds or phrases
   that do not exist in monolingual dictionaries (even in 大辞林 or
   広辞苑) and our onWordSelection expansion accepts any dictionary's
   largest entry. Unfortunately doing this nicely requires a bit of
   extra work to be efficient (since we need to remove the last
   character in the string).
onWordLookup-todo17-todo18

Pass up the reasons list (formatted Yomichan style) to the

   dictionary pop-up so you can get some more information about the
   inflection. But this would require adding some kind of tag
   metadata that we have to pass through from the lookup to the
   dictionary pop-up.
generated by LDoc 1.4.6 Last updated 2021-12-04 18:04:16