feat: dictation segmentation on blank lines

This commit is contained in:
2026-05-18 16:38:21 +02:00
parent 9f3e79c874
commit 27d5144864
2 changed files with 42 additions and 1 deletions
+22
View File
@@ -0,0 +1,22 @@
use alpha_id::segment::split_segments;
#[test]
fn splits_on_blank_lines() {
let d = "Befund eins\nmit Zeile zwei\n\nBefund zwei\n\n\nBefund drei\n";
let segs = split_segments(d);
assert_eq!(segs, vec![
"Befund eins\nmit Zeile zwei".to_string(),
"Befund zwei".to_string(),
"Befund drei".to_string(),
]);
}
#[test]
fn single_segment_when_no_blank_line() {
assert_eq!(split_segments("nur ein Befund"), vec!["nur ein Befund".to_string()]);
}
#[test]
fn empty_input_yields_no_segments() {
assert!(split_segments(" \n\n").is_empty());
}