lowercase dict

This commit is contained in:
boyska 2020-05-18 13:01:12 +02:00
parent a953bf22ec
commit f35e839110

View file

@ -7,6 +7,11 @@ use std::fs::File;
struct Dictionary {
words: Vec<String>,
}
fn line_to_word(l: String) -> String {
return l.to_lowercase()
}
fn main() {
let args: Vec<String> = 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};