mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-09-23 05:16:23 -07:00
fix(anki): regenerate sentence furigana when mined context changes
- Regenerate SentenceFurigana from the final sentence after timing-review expansion or stats-dashboard word mining - Add a Yomitan parseText-based generator with a 10s timeout and escaped, highlighted output - Clear stale furigana on failure so templates fall back to Sentence - Keep existing furigana formatting when the sentence is unchanged - Document the behavior in the anki-integration and immersion-tracking docs
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { generateSentenceFurigana } from '../../core/services/tokenizer/sentence-furigana';
|
||||
import path from 'node:path';
|
||||
import type { BrowserWindow } from 'electron';
|
||||
import {
|
||||
@@ -169,6 +170,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 = getPreferredYomitanAnkiServerUrl(ankiConnectConfig);
|
||||
|
||||
Reference in New Issue
Block a user