lowercase dict
This commit is contained in:
parent
a953bf22ec
commit
f35e839110
1 changed files with 6 additions and 1 deletions
|
@ -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};
|
||||
|
|
Reference in a new issue