mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-07-08 01:08:53 -07:00
fix(tokenizer): prevent grammar tokens from borrowing known-word highlight via unrelated readings (#147)
This commit is contained in:
@@ -163,7 +163,14 @@ export class KnownWordCacheManager {
|
||||
);
|
||||
}
|
||||
|
||||
return this.readingCounts.has(convertKatakanaToHiragana(normalized));
|
||||
// Reading-only fallback, except for single-kana text: particles and
|
||||
// interjections (よ, ね, え…) would otherwise borrow the reading of an
|
||||
// unrelated note (夜「よ」, 絵「え」) and count as known.
|
||||
const hiragana = convertKatakanaToHiragana(normalized);
|
||||
if ([...hiragana].length === 1) {
|
||||
return false;
|
||||
}
|
||||
return this.readingCounts.has(hiragana);
|
||||
}
|
||||
|
||||
refresh(force = false): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user