@@ -13,7 +13,7 @@ static WORDS_FST: Lazy<Fst<&[u8]>> =
13
13
Lazy :: new ( || Fst :: new ( & include_bytes ! ( "../../dictionaries/fst/german/words.fst" ) [ ..] ) . unwrap ( ) ) ;
14
14
15
15
static FST_SEGMENTER : Lazy < FstSegmenter > =
16
- Lazy :: new ( || FstSegmenter :: new ( & WORDS_FST , Some ( 4 ) , true ) ) ;
16
+ Lazy :: new ( || FstSegmenter :: new ( & WORDS_FST , Some ( 2 ) , true ) ) ;
17
17
18
18
impl Segmenter for GermanSegmenter {
19
19
fn segment_str < ' o > ( & self , to_segment : & ' o str ) -> Box < dyn Iterator < Item = & ' o str > + ' o > {
@@ -100,7 +100,34 @@ mod test {
100
100
word1
101
101
) ;
102
102
test_segmentation ! ( "Schreibprozess" , & [ "Schreib" , "prozess" ] , word2) ;
103
- test_segmentation ! ( "Interkulturalität" , & [ "Inter" , "kultur" , "alität "] , word3) ;
103
+ test_segmentation ! ( "Interkulturalität" , & [ "Inter" , "kulturalität " ] , word3) ;
104
104
test_segmentation ! ( "Wissensorganisation" , & [ "Wissens" , "organisation" ] , word4) ;
105
105
test_segmentation ! ( "Aufgabenplanung" , & [ "Aufgaben" , "planung" ] , word5) ;
106
+ test_segmentation ! ( "Eisbrecher" , & [ "Eis" , "brecher" ] , word6) ;
107
+ test_segmentation ! ( "Zuckerei" , & [ "Zucker" , "ei" ] , word7) ;
108
+ test_segmentation ! ( "Glatteis" , & [ "Glatt" , "eis" ] , word8) ;
109
+ test_segmentation ! ( "Sinnfindung" , & [ "Sinn" , "findung" ] , word9) ;
110
+ test_segmentation ! (
111
+ "Donaudampfschifffahrtsgesellschaftskapitän" ,
112
+ & [ "Donau" , "dampf" , "schifffahrts" , "gesellschafts" , "kapitän" ] ,
113
+ word10
114
+ ) ;
115
+ test_segmentation ! (
116
+ "Rindfleischetikettierungsüberwachungsaufgabenübertragungsgesetz" ,
117
+ & [
118
+ "Rind" ,
119
+ "fleisch" ,
120
+ "etikettierungs" ,
121
+ "überwachungs" ,
122
+ "aufgaben" ,
123
+ "übertragungs" ,
124
+ "gesetz"
125
+ ] ,
126
+ word11
127
+ ) ;
128
+ test_segmentation ! (
129
+ "Nahrungsmittelunverträglichkeitsdiagnoseverfahren" ,
130
+ & [ "Nahrungs" , "mittel" , "un" , "verträglichkeits" , "diagnose" , "verfahren" ] ,
131
+ word12
132
+ ) ;
106
133
}
0 commit comments