Advertisement
Guest User

Untitled

a guest
Jan 20th, 2020
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rust 0.50 KB | None | 0 0
  1. let sentences_replaced_abbreviations = SentenceTokenizer::<Standard>::new(text, data)
  2.         .map(|item| { replacer(rules, item) });
  3.  
  4.     if no_check {
  5.         ...
  6.     } else {
  7.         let mut sentences = vec![];
  8.         while sentences.len() < amount {
  9.             let sentence = sentences_replaced_abbreviations.choose(&mut rng).unwrap();
  10.             if predicate(rules, &sentence) {
  11.                 sentences.push(sentence.trim().to_string());
  12.             }
  13.         }
  14.  
  15.         sentences
  16.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement