fix(anki): regenerate sentence furigana from the final sentence (#268)

This commit is contained in:
2026-09-22 21:43:19 -07:00
committed by GitHub
parent b0fb39a8f5
commit 7c161723cd
16 changed files with 489 additions and 18 deletions
+3
View File
@@ -1,3 +1,4 @@
import { generateSentenceFurigana } from '../../core/services/tokenizer/sentence-furigana';
import path from 'node:path';
import type { BrowserWindow } from 'electron';
import {
@@ -166,6 +167,8 @@ export function createStatsServerRuntime(deps: StatsServerRuntimeDeps): {
}),
resolveAnkiNoteId: (noteId: number) => deps.resolveAnkiNoteId(noteId),
resolveSentenceSearchHeadwords: (term: string) => deps.resolveSentenceSearchHeadwords(term),
generateSentenceFurigana: (text, highlightedText) =>
generateSentenceFurigana(text, highlightedText, yomitanDeps, yomitanLogger),
addYomitanNote: async (word: string) => {
const ankiConnectConfig = deps.getResolvedConfig().ankiConnect;
const ankiUrl = ankiConnectConfig.url || 'http://127.0.0.1:8765';