mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-08-16 01:55:51 -07:00
18 lines
493 B
TypeScript
18 lines
493 B
TypeScript
import { getVocabularySummary } from './query-lexical';
|
|
import { Database } from './sqlite';
|
|
import { applyPragmas } from './storage';
|
|
import type { VocabularyStatsSummary } from './types';
|
|
|
|
export function executeVocabularySummaryTask(
|
|
dbPath: string,
|
|
knownWords: string[] | null,
|
|
): VocabularyStatsSummary {
|
|
const db = new Database(dbPath);
|
|
try {
|
|
applyPragmas(db);
|
|
return getVocabularySummary(db, knownWords ? new Set(knownWords) : null);
|
|
} finally {
|
|
db.close();
|
|
}
|
|
}
|