feat: text normalization with medical abbreviation expansion

This commit is contained in:
2026-05-18 16:36:06 +02:00
parent c8ea9a5fb3
commit 9f3e79c874
2 changed files with 40 additions and 1 deletions
+17
View File
@@ -0,0 +1,17 @@
use alpha_id::normalize::normalize;
#[test]
fn lowercases_and_collapses_whitespace() {
assert_eq!(normalize(" Diabetes Mellitus\tTyp 2 "), "diabetes mellitus typ 2");
}
#[test]
fn expands_common_medical_abbreviations() {
assert_eq!(normalize("V.a. art. Hypertonie"), "verdacht auf arterielle hypertonie");
assert_eq!(normalize("Z.n. OP"), "zustand nach operation");
}
#[test]
fn keeps_german_umlauts() {
assert_eq!(normalize("Ödem"), "ödem");
}