Add gazetteer to analyze worker

Pass a `Gazetteer` to the analyze worker to enable proper-name
correction. The gazetteer is loaded from disk at application startup. If
the directory is missing or unreadable, the worker will start without
proper-name correction capabilities.
This commit is contained in:
2026-04-16 17:27:09 +02:00
parent 1fd252f363
commit 5717b8f718
3 changed files with 36 additions and 3 deletions
+4 -2
View File
@@ -332,7 +332,8 @@ async fn analyze_worker_writes_document_via_wiremock() {
let (tx, rx) = analyze::channel();
let client = reqwest::Client::new();
let busy = std::sync::Arc::new(std::sync::atomic::AtomicBool::new(false));
let handle = tokio::spawn(analyze::worker::run(rx, config, client, busy));
let vocab = std::sync::Arc::new(doctate_server::gazetteer::Gazetteer::empty());
let handle = tokio::spawn(analyze::worker::run(rx, config, client, busy, vocab));
tx.send(analyze::AnalyzeJob {
case_dir: case_dir.clone(),
@@ -863,7 +864,8 @@ async fn analyze_works_against_ollama_style_endpoint_without_api_key() {
let (tx, rx) = analyze::channel();
let client = reqwest::Client::new();
let busy = std::sync::Arc::new(std::sync::atomic::AtomicBool::new(false));
let handle = tokio::spawn(analyze::worker::run(rx, config, client, busy));
let vocab = std::sync::Arc::new(doctate_server::gazetteer::Gazetteer::empty());
let handle = tokio::spawn(analyze::worker::run(rx, config, client, busy, vocab));
tx.send(analyze::AnalyzeJob {
case_dir: case_dir.clone(),