mirror of
https://github.com/Yuyi-Oak/BlueArchiveToolkit.git
synced 2026-09-18 11:56:23 +08:00
feat(glossary): 实现 Rust Glossary V1
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
//! Glossary repository boundary.
|
||||
|
||||
use crate::domain::{GlossaryEvaluation, TranslationMemoryContext};
|
||||
use async_trait::async_trait;
|
||||
|
||||
/// Read-only matching boundary consumed by translation workers.
|
||||
#[async_trait]
|
||||
pub trait GlossaryRepository: Send + Sync {
|
||||
/// Evaluates approved terms against one source TextUnit.
|
||||
async fn evaluate(
|
||||
&self,
|
||||
source_text: &str,
|
||||
context: &TranslationMemoryContext,
|
||||
) -> crate::Result<GlossaryEvaluation>;
|
||||
}
|
||||
@@ -3,11 +3,13 @@
|
||||
//! 定义所有数据访问接口
|
||||
|
||||
pub mod cas_repository;
|
||||
pub mod glossary_repository;
|
||||
pub mod resource_repository;
|
||||
pub mod translation_memory_repository;
|
||||
pub mod translation_repository;
|
||||
|
||||
pub use cas_repository::CasRepository;
|
||||
pub use glossary_repository::GlossaryRepository;
|
||||
pub use resource_repository::ResourceRepository;
|
||||
pub use translation_memory_repository::TranslationMemoryRepository;
|
||||
pub use translation_repository::TranslationRepository;
|
||||
|
||||
Reference in New Issue
Block a user