fix(tokenizer): lazy yomitan term-only frequency fallback

This commit is contained in:
2026-03-02 01:45:37 -08:00
parent 629fe97ef7
commit 737101fe9e
5 changed files with 298 additions and 79 deletions

View File

@@ -346,6 +346,11 @@ test('tokenizeSubtitle queries headword frequencies with token reading for disam
webContents: {
executeJavaScript: async (script: string) => {
if (script.includes('getTermFrequencies')) {
assert.equal(
script.includes('"term":"鍛える","reading":null'),
false,
'should not eagerly include term-only fallback pair when reading lookup is present',
);
if (!script.includes('"term":"鍛える","reading":"きた"')) {
return [];
}