mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
[ReaderDictionary] Clean interpuncts, pipes and up arrows from text selection (#14031)
This commit is contained in:
@@ -852,6 +852,9 @@ function ReaderDictionary:cleanSelection(text, is_sane)
|
||||
text = text:gsub("\u{2019}", "'") -- Right single quotation mark
|
||||
-- Strip punctuation characters around selection
|
||||
text = util.stripPunctuation(text)
|
||||
-- In some dictionaries, both interpuncts (·) and pipes (|) are used to delimiter syllables.
|
||||
-- Up arrows (↑), are used in some dictionaries to indicate related words.
|
||||
text = text:gsub("[·|↑]", "")
|
||||
-- Strip some common english grammatical construct
|
||||
text = text:gsub("'s$", '') -- english possessive
|
||||
-- Strip some common french grammatical constructs
|
||||
|
||||
Reference in New Issue
Block a user