@@ -8,7 +8,7 @@ mod unicode_segmentation_rs {
88 use unicode_segmentation:: UnicodeSegmentation ;
99 use unicode_width:: UnicodeWidthStr ;
1010
11- /// Split a string into grapheme clusters
11+ /// Split a string into grapheme clusters.
1212 #[ pyfunction]
1313 fn graphemes ( text : & str , is_extended : bool ) -> PyResult < Vec < String > > {
1414 Ok ( text. graphemes ( is_extended) . map ( |s| s. to_string ( ) ) . collect ( ) )
@@ -23,13 +23,13 @@ mod unicode_segmentation_rs {
2323 . collect ( ) )
2424 }
2525
26- /// Split a string into words
26+ /// Split a string at word boundaries (includes punctuation and whitespace).
2727 #[ pyfunction]
2828 fn split_word_bounds ( text : & str ) -> PyResult < Vec < String > > {
2929 Ok ( text. split_word_bounds ( ) . map ( |s| s. to_string ( ) ) . collect ( ) )
3030 }
3131
32- /// Split a string into word indices
32+ /// Split a string at word boundaries with indices.
3333 #[ pyfunction]
3434 fn split_word_bound_indices ( text : & str ) -> PyResult < Vec < ( usize , String ) > > {
3535 Ok ( text
@@ -38,13 +38,13 @@ mod unicode_segmentation_rs {
3838 . collect ( ) )
3939 }
4040
41- /// Get Unicode words (excluding punctuation and whitespace)
41+ /// Get Unicode words from a string (excludes punctuation and whitespace).
4242 #[ pyfunction]
4343 fn unicode_words ( text : & str ) -> PyResult < Vec < String > > {
4444 Ok ( text. unicode_words ( ) . map ( |s| s. to_string ( ) ) . collect ( ) )
4545 }
4646
47- /// Split a string into sentences
47+ /// Split a string at word boundaries (includes punctuation and whitespace).
4848 #[ pyfunction]
4949 fn unicode_sentences ( text : & str ) -> PyResult < Vec < String > > {
5050 Ok ( text. unicode_sentences ( ) . map ( |s| s. to_string ( ) ) . collect ( ) )
0 commit comments