Skip to content

Commit

Permalink
Cleanup and prep for push
Browse files Browse the repository at this point in the history
  • Loading branch information
cmccomb committed Mar 31, 2023
1 parent af05903 commit a50d851
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions examples/remove_stop_words_with_regex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ fn main() {
let regex_for_punctuation = one_or_more(punctuation());
let text_without_punctuation = regex_for_punctuation
.to_regex()
.replace_all(&*lowercase_doc, "");
.replace_all(&lowercase_doc, "");

// Make a regex to match stopwords with trailing spaces and punctuation
let regex_for_stop_words =
Expand All @@ -25,6 +25,6 @@ fn main() {
// Remove stop words
let clean_text = regex_for_stop_words
.to_regex()
.replace_all(&*text_without_punctuation, "");
.replace_all(&text_without_punctuation, "");
println!("\nClean text:\n{}", clean_text);
}
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ fn get_names_from_iso_code(input_language: String) -> Vec<String> {
if !json[&*input_language].is_array() {
panic!(concat!("Unfortunately, the '{}' language is not currently supported or nonexistent. Please make sure that the name is an appropriate 2-letter ISO code."), input_language )
}
let array_of_words = json[&*input_language].as_array_mut().unwrap();
let array_of_words = json[input_language].as_array_mut().unwrap();
array_of_words
.into_iter()
.iter()
.map(|x| x.as_str().unwrap().to_owned())
.collect()
}

0 comments on commit a50d851

Please sign in to comment.