|
@@ -1,12 +1,12 @@
|
|
|
use std::env;
|
|
|
-use std::iter::Iterator;
|
|
|
-use std::io::Error;
|
|
|
-use std::io::BufReader;
|
|
|
-use std::io::BufRead;
|
|
|
use std::fs::File;
|
|
|
+use std::io::BufRead;
|
|
|
+use std::io::BufReader;
|
|
|
+use std::io::Error;
|
|
|
+use std::iter::Iterator;
|
|
|
|
|
|
-use unidecode::unidecode;
|
|
|
use regex::Regex;
|
|
|
+use unidecode::unidecode;
|
|
|
|
|
|
#[derive(Default)]
|
|
|
struct Dictionary {
|
|
@@ -40,7 +40,10 @@ fn dictionary_from_iterable(lines: impl Iterator<Item = Result<String, Error>>)
|
|
|
// TODO: normalizza: lascia solo a-z, converti gli accenti, ecc.
|
|
|
w.push(line_to_word(line))
|
|
|
}
|
|
|
- return Dictionary{words: w, ..Dictionary::default()};
|
|
|
+ return Dictionary {
|
|
|
+ words: w,
|
|
|
+ ..Dictionary::default()
|
|
|
+ };
|
|
|
}
|
|
|
|
|
|
fn line_to_word(l: String) -> String {
|