feat: text normalization with medical abbreviation expansion
This commit is contained in:
@@ -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");
|
||||
}
|
||||
Reference in New Issue
Block a user