File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -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 byte 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 ( ) )
Original file line number Diff line number Diff line change 1+ # Copyright © Michal Čihař <michal@weblate.org>
2+ #
3+ # SPDX-License-Identifier: MIT
4+ """
5+ Type stubs for unicode-segmentation-rs
6+
7+ This module provides Unicode text segmentation and width calculation.
8+ """
9+
10+ def graphemes (text : str , is_extended : bool ) -> list [str ]:
11+ ...
12+
13+ def grapheme_indices (text : str , is_extended : bool ) -> list [tuple [int , str ]]:
14+ ...
15+
16+ def split_word_bounds (text : str ) -> list [str ]:
17+ ...
18+
19+ def split_word_bound_indices (text : str ) -> list [tuple [int , str ]]:
20+ ...
21+
22+ def unicode_words (text : str ) -> list [str ]:
23+ ...
24+
25+ def unicode_sentences (text : str ) -> list [str ]:
26+ ...
27+
28+ def text_width (text : str ) -> int :
29+ ...
You can’t perform that action at this time.
0 commit comments