@@ -13,7 +13,7 @@ static WORDS_FST: Lazy<Fst<&[u8]>> =
1313 Lazy :: new ( || Fst :: new ( & include_bytes ! ( "../../dictionaries/fst/german/words.fst" ) [ ..] ) . unwrap ( ) ) ;
1414
1515static FST_SEGMENTER : Lazy < FstSegmenter > =
16- Lazy :: new ( || FstSegmenter :: new ( & WORDS_FST , Some ( 4 ) , true ) ) ;
16+ Lazy :: new ( || FstSegmenter :: new ( & WORDS_FST , Some ( 2 ) , true ) ) ;
1717
1818impl Segmenter for GermanSegmenter {
1919 fn segment_str < ' o > ( & self , to_segment : & ' o str ) -> Box < dyn Iterator < Item = & ' o str > + ' o > {
@@ -100,7 +100,34 @@ mod test {
100100 word1
101101 ) ;
102102 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) ;
104104 test_segmentation ! ( "Wissensorganisation" , & [ "Wissens" , "organisation" ] , word4) ;
105105 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+ ) ;
106133}
0 commit comments