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 {
|
struct Dictionary {
|
||||||
words: Vec<String>,
|
words: Vec<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn line_to_word(l: String) -> String {
|
||||||
|
return l.to_lowercase()
|
||||||
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let args: Vec<String> = env::args().collect();
|
let args: Vec<String> = env::args().collect();
|
||||||
let fname = &args[1];
|
let fname = &args[1];
|
||||||
|
@ -18,7 +23,7 @@ fn main() {
|
||||||
for line in buf.lines() {
|
for line in buf.lines() {
|
||||||
let line = line.unwrap();
|
let line = line.unwrap();
|
||||||
// TODO: normalizza: lascia solo a-z, converti gli accenti, ecc.
|
// 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};
|
let d = Dictionary{words: w};
|
||||||
|
|
Reference in a new issue