feat: dictation segmentation on blank lines
This commit is contained in:
@@ -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());
|
||||
}
|
||||
Reference in New Issue
Block a user