line_to_word applied to Dictionary::load
This commit is contained in:
parent
ac99a172cc
commit
9f22e75549
1 changed files with 4 additions and 0 deletions
|
@ -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,
|
||||
|
|
Reference in a new issue