Anki maturity-based known-word highlighting (#172)

This commit is contained in:
2026-07-27 23:58:02 -07:00
committed by GitHub
parent 08c6807cb1
commit 987b325edb
54 changed files with 3046 additions and 381 deletions
+2
View File
@@ -82,6 +82,8 @@ export interface AnkiConnectConfig {
};
knownWords?: {
highlightEnabled?: boolean;
maturityEnabled?: boolean;
matureThresholdDays?: number;
refreshMinutes?: number;
addMinedWordsImmediately?: boolean;
matchMode?: NPlusOneMatchMode;
+2
View File
@@ -254,6 +254,8 @@ export interface ResolvedConfig {
};
knownWords: {
highlightEnabled: boolean;
maturityEnabled: boolean;
matureThresholdDays: number;
refreshMinutes: number;
addMinedWordsImmediately: boolean;
matchMode: NPlusOneMatchMode;
+1
View File
@@ -1,6 +1,7 @@
export type RuntimeOptionId =
| 'anki.autoUpdateNewCards'
| 'subtitle.annotation.knownWords.highlightEnabled'
| 'subtitle.annotation.knownWords.maturityEnabled'
| 'subtitle.annotation.nPlusOne'
| 'subtitle.annotation.jlpt'
| 'subtitle.annotation.frequency'
+11
View File
@@ -39,6 +39,8 @@ export interface MergedToken {
pos3?: string;
isMerged: boolean;
isKnown: boolean;
/** Anki card maturity for a known token; unset when tier data is unavailable. */
knownMaturity?: KnownWordMaturityTier;
isNPlusOneTarget: boolean;
/**
* Text Yomitan had no dictionary entry for (e.g. ぅ~ elongation runs,
@@ -61,6 +63,9 @@ export type FrequencyDictionaryLookup = (term: string) => number | null;
export type JlptLevel = 'N1' | 'N2' | 'N3' | 'N4' | 'N5';
/** Anki card maturity tier for a known word, most mature card wins. */
export type KnownWordMaturityTier = 'new' | 'learning' | 'young' | 'mature';
export interface SubtitlePosition {
yPercent: number;
}
@@ -112,6 +117,12 @@ export interface SubtitleStyleConfig {
backgroundColor?: string;
nPlusOneColor?: string;
knownWordColor?: string;
knownWordMaturityColors?: {
new: string;
learning: string;
young: string;
mature: string;
};
jlptColors?: {
N1: string;
N2: string;