feat: backup architecture docs, source code, and scripts
This commit is contained in:
23
src/bin/test_synonym_chinese.rs
Normal file
23
src/bin/test_synonym_chinese.rs
Normal file
@@ -0,0 +1,23 @@
|
||||
use momentry_core::core::text::global_synonym_expander;
|
||||
|
||||
fn main() {
|
||||
let expander = global_synonym_expander();
|
||||
|
||||
println!("=== 中文同義詞擴展測試 ===");
|
||||
|
||||
let test_queries = vec!["電腦", "電腦工作", "工作檔案", "視頻分析", "電腦工作檔案"];
|
||||
|
||||
for query in test_queries {
|
||||
println!("\n查詢: '{}'", query);
|
||||
let expanded = expander.expand_chinese_query(query);
|
||||
println!("擴展結果: {}", expanded);
|
||||
|
||||
// 測試單詞擴展
|
||||
println!("單詞擴展:");
|
||||
if let Some(syns) = expander.get_synonyms(query) {
|
||||
println!(" '{}' -> {:?}", query, syns);
|
||||
} else {
|
||||
println!(" '{}' 沒有同義詞", query);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user