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:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user