Browse Source

line_to_word applied to Dictionary::load

boyska 4 years ago
parent
commit
9f22e75549
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/main.rs

+ 4 - 0
src/main.rs

@@ -24,6 +24,10 @@ impl Dictionary {
         // so we're still using a normal Vec, and perform deduplication at load time
         let mut aux_set = HashSet::new();
         lines
+            .map(|res| match res {
+                Ok(word) => Ok(line_to_word(word.as_str())),
+                _ => res,
+            })
             .filter(|res| match res {
                 Ok(word) => aux_set.insert(word.clone()),
                 _ => false,