@@ -177,12 +177,6 @@ pub trait UnicodeSegmentation {
177
177
/// ```
178
178
fn split_word_bound_indices < ' a > ( & ' a self ) -> UWordBoundIndices < ' a > ;
179
179
180
- /// Returns an iterator over substrings of `self` separated on
181
- /// [UAX#29 sentence boundaries](http://www.unicode.org/reports/tr29/#Sentence_Boundaries).
182
- ///
183
- /// The concatenation of the substrings returned by this function is just the original string.
184
- fn unicode_sentences < ' a > ( & ' a self ) -> UnicodeSentences < ' a > ;
185
-
186
180
/// Returns an iterator over substrings of `self` separated on
187
181
/// [UAX#29 sentence boundaries](http://www.unicode.org/reports/tr29/#Sentence_Boundaries).
188
182
///
@@ -192,10 +186,50 @@ pub trait UnicodeSegmentation {
192
186
/// [Alphabetic](http://unicode.org/reports/tr44/#Alphabetic)
193
187
/// property, or with
194
188
/// [General_Category=Number](http://unicode.org/reports/tr44/#General_Category_Values).
189
+ ///
190
+ /// # Example
191
+ ///
192
+ /// ```
193
+ /// # use self::unicode_segmentation::UnicodeSegmentation;
194
+ /// let uss = "Mr. Fox jumped. [...] The dog was too lazy.";
195
+ /// let us1 = uss.unicode_sentences().collect::<Vec<&str>>();
196
+ /// let b: &[_] = &["Mr. ", "Fox jumped. ", "The dog was too lazy."];
197
+ ///
198
+ /// assert_eq!(&us1[..], b);
199
+ /// ```
200
+ fn unicode_sentences < ' a > ( & ' a self ) -> UnicodeSentences < ' a > ;
201
+
202
+ /// Returns an iterator over substrings of `self` separated on
203
+ /// [UAX#29 sentence boundaries](http://www.unicode.org/reports/tr29/#Sentence_Boundaries).
204
+ ///
205
+ /// The concatenation of the substrings returned by this function is just the original string.
206
+ ///
207
+ /// # Example
208
+ ///
209
+ /// ```
210
+ /// # use self::unicode_segmentation::UnicodeSegmentation;
211
+ /// let ssbs = "Mr. Fox jumped. [...] The dog was too lazy.";
212
+ /// let ssb1 = ssbs.split_sentence_bounds().collect::<Vec<&str>>();
213
+ /// let b: &[_] = &["Mr. ", "Fox jumped. ", "[...] ", "The dog was too lazy."];
214
+ ///
215
+ /// assert_eq!(&ssb1[..], b);
216
+ /// ```
195
217
fn split_sentence_bounds < ' a > ( & ' a self ) -> USentenceBounds < ' a > ;
196
218
197
219
/// Returns an iterator over substrings of `self`, split on UAX#29 sentence boundaries,
198
220
/// and their offsets. See `split_sentence_bounds()` for more information.
221
+ ///
222
+ /// # Example
223
+ ///
224
+ /// ```
225
+ /// # use self::unicode_segmentation::UnicodeSegmentation;
226
+ /// let ssis = "Mr. Fox jumped. [...] The dog was too lazy.";
227
+ /// let ssi1 = ssis.split_sentence_bound_indices().collect::<Vec<(usize, &str)>>();
228
+ /// let b: &[_] = &[(0, "Mr. "), (4, "Fox jumped. "), (16, "[...] "),
6062
div>
229
+ /// (22, "The dog was too lazy.")];
230
+ ///
231
+ /// assert_eq!(&ssi1[..], b);
232
+ /// ```
199
233
fn split_sentence_bound_indices < ' a > ( & ' a self ) -> USentenceBoundIndices < ' a > ;
200
234
}
201
235
0 commit comments