feat: Fachwortliste für Whisper aus einer Quelle (T7 L2 Task 12)

npm run export:voice-vocabulary schreibt ApiCore-Whisper/vocabulary.txt
aus whisperInitialPrompt(); ein Wächter vergleicht Datei und Quelle im
Monorepo (im Backend-Image-Build ohne Nachbarordner übersprungen).
Datei mit LF über .gitattributes; scripts/ aus dem Nest-Build
ausgeschlossen.

Refs #27

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
Nick SzaunigandClaude Opus 5.5 committed 2026-10-16 09:44:58 +02:00
1 parent 9795f98006
commit 61985afc4b
6 files changed
+49 -2

No files matched your search

@@ -0,0 +1,26 @@
import { existsSync, readFileSync } from 'node:fs';
import { join } from 'node:path';
import { whisperInitialPrompt } from './voice-vocabulary';
const MONOREPO_ROOT = join(__dirname, '..', '..', '..', '..');
const VOCABULARY_FILE = join(
MONOREPO_ROOT,
'ApiCore-Whisper',
'vocabulary.txt',
);
// The backend image build only sees ApiCore-Backend, so the comparison runs in
// the monorepo checkout and is skipped inside that build.
const inMonorepo = existsSync(join(MONOREPO_ROOT, 'ApiCore-Frontend'));
const describeInMonorepo = inMonorepo ? describe : describe.skip;
describeInMonorepo('whisper vocabulary export', () => {
it('the whisper vocabulary file equals whisperInitialPrompt()', () => {
// Windows checkouts may turn LF into CRLF; the content is what counts.
const onDisk = readFileSync(VOCABULARY_FILE, 'utf8')
.replace(/\r\n/g, '\n')
.replace(/\n$/, '');
expect(onDisk).toBe(whisperInitialPrompt());
});
});