xuexi 0.1.5

utility to parse a sentence into words for multiple language
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/// clean_sentence from a sentence to avoid being count
///
/// # Arguments
///
/// * `sentence` - A slice of string which represent a sentence
/// * `punctuations`
pub fn clean_sentence<S: AsRef<str>>(sentence: S, punctuations: &[String]) -> String {
    let mut filtered_sentence = sentence.as_ref().to_string();
    punctuations
        .iter()
        .for_each(|pat| filtered_sentence = filtered_sentence.replace(pat, ""));

    filtered_sentence
}