mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
@@ -1072,7 +1072,7 @@ function ReaderHighlight:lookup(selected_text, selected_link)
|
||||
for _, sbox in ipairs(selected_text.sboxes) do
|
||||
local word = self.ui.document:getOCRWord(self.hold_pos.page, { sbox = sbox })
|
||||
logger.dbg("OCRed word:", word)
|
||||
-- @fixme This might produce incorrect results on RTL text.
|
||||
--- @fixme This might produce incorrect results on RTL text.
|
||||
if word and word ~= "" then
|
||||
text = text .. word
|
||||
end
|
||||
|
||||
@@ -435,7 +435,7 @@ function Deinflector:init()
|
||||
DEFAULT_TEXT_CONVERSIONS
|
||||
if self.rules ~= nil then return end -- already loaded
|
||||
|
||||
-- @todo Maybe make this location configurable?
|
||||
--- @todo Maybe make this location configurable?
|
||||
inflections = parsePluginJson("yomichan-deinflect.json")
|
||||
|
||||
-- Normalise the reasons and convert the rules to the rule_types bitflags.
|
||||
|
||||
@@ -68,7 +68,7 @@ function Japanese:onWordLookup(args)
|
||||
return
|
||||
end
|
||||
|
||||
-- @todo Try to repeatedly reduce the text and deinflect the shortened text
|
||||
--- @todo 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
|
||||
@@ -80,7 +80,7 @@ function Japanese:onWordLookup(args)
|
||||
results = self.deinflector:deinflect(text)
|
||||
logger.dbg("japanese.koplugin: deinflection of", text, "results:", results)
|
||||
|
||||
-- @todo Pass up the reasons list (formatted Yomichan style) to the
|
||||
--- @todo 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
|
||||
@@ -185,7 +185,7 @@ function Japanese:onWordSelection(args)
|
||||
-- Calling sdcv is fairly expensive, so reduce the cost by trying every
|
||||
-- candidate in one shot and then picking the longest one which gave us a
|
||||
-- result.
|
||||
-- @todo Given there is a limit to how many command-line arguments you can
|
||||
--- @todo Given there is a limit to how many command-line arguments you can
|
||||
-- pass, we should split up the candidate list if it's too long.
|
||||
local best_word
|
||||
local cancelled, all_results = self.dictionary:rawSdcv(all_words)
|
||||
|
||||
@@ -52,7 +52,7 @@ describe("Readerdictionary module", function()
|
||||
assert.spy(s).was_called()
|
||||
assert.spy(s).was_called_with(match.is_ref(readerui.languagesupport), word)
|
||||
if readerui.languagesupport.plugins["japanese_support"] then
|
||||
-- @todo This should probably check against a set or sorted list
|
||||
--- @todo This should probably check against a set or sorted list
|
||||
-- of the candidates we'd expect.
|
||||
assert.spy(s).was_returned_with(match.is_not_nil())
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user