[ReaderDictionary] Clean interpuncts, pipes and up arrows from text selection (#14031)
Some checks failed
macos / macOS 13 x86-64 🔨15.2 🎯10.15 (push) Has been cancelled
macos / macOS 14 ARM64 🔨15.4 🎯11.0 (push) Has been cancelled

This commit is contained in:
David
2025-07-14 21:48:01 +01:00
committed by GitHub
parent 9ad9d52cef
commit 105abfa159

View File

@@ -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