Add gazetteer configuration and dependency

This commit introduces the `VOCAB_DIR` configuration option, which
specifies the directory for gazetteer files. It also adds the `strsim`
crate, which is used for calculating string similarity and is essential
for the gazetteer's functionality.

The gazetteer module has been significantly expanded to include the
`Gazetteer` struct, its loading mechanism from `.txt` files, and an
annotation function. This functionality allows for pre-LLM correction of
proper names and technical vocabulary by identifying potential
misspellings based on phonetic similarity and edit distance.
This commit is contained in:
2026-04-16 17:23:52 +02:00
parent 412bf9355e
commit 1fd252f363
5 changed files with 326 additions and 5 deletions
+5
View File
@@ -33,5 +33,10 @@ LLM_TIMEOUT_SECONDS=180
# Single line — escape newlines with \n if your shell preserves them, or put the prompt on one logical line.
LLM_SYSTEM_PROMPT="Du bist ein medizinischer Assistent. Fasse die folgenden diktierten Abschnitte zu einem zusammenhängenden Text zusammen. Bereinigen und strukturieren, nichts hinzufügen, nichts interpretieren, keine Diagnose, keine Arztbrief-Struktur. Entferne Redundanzen. Spätere Aufnahmen haben Vorrang — Korrekturen, Nachträge und Widersprüche zugunsten der chronologisch letzten Aussage auflösen. Antworte auf Deutsch. Nur der zusammengefasste Text, keine Einleitung, kein Abschlusssatz."
# Gazetteer (pre-LLM proper-name correction)
# Directory with *.txt files, one entry per line. Blank and #-comment lines
# are skipped. Missing directory is non-fatal — analysis runs without hints.
VOCAB_DIR=./vocab
# Session
SESSION_TIMEOUT_HOURS=8