diff --git a/src/main.rs b/src/main.rs index 181076c..5c8df97 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,6 +7,11 @@ use std::fs::File; struct Dictionary { words: Vec, } + +fn line_to_word(l: String) -> String { + return l.to_lowercase() +} + fn main() { let args: Vec = env::args().collect(); let fname = &args[1]; @@ -18,7 +23,7 @@ fn main() { for line in buf.lines() { let line = line.unwrap(); // TODO: normalizza: lascia solo a-z, converti gli accenti, ecc. - w.push(line.to_string()) + w.push(line_to_word(line)) } let d = Dictionary{words: w};