yomichan
yomichan copied to clipboard
Sentence parsing doesn't work in some scenarious with quotes
Description
I'm reading these stories, where entires sentences with periods are quoted in 「」. If I create an Anki card for a term in a sentence after such a quote (for instance 声 on that page), the "sentence" field also contains the two preceding sentences in quotes:
「おれの方が強い。」「いいや、ぼくの方が強い。」北風と太陽の声が聞こえます。
The following code backs up beyond the quotes and doesn't treat the periods as sentence terminators because they're in quotes:
https://github.com/FooSoft/yomichan/blob/ca4bf5e65e2b2eeb20aceb465fa04f0795294328/ext/js/dom/document-util.js#L102-L131
That may be appropriate in some other scenarios, but here it results in several sentences being identified as the sentence containing the expression, and I'd assume that this would be a rather common scenario.
Browser version Firefox 94.0.1
Yomichan version 21.9.30.2
Exported settings file yomichan-settings-2021-11-22-00-32-14.txt
Related: #1998 (would also require changes to the parsing algorithm)