fix: Lowercase the query

This commit is contained in:
Clément Renault 2018-09-26 15:08:42 +02:00
parent a8d2fbd3aa
commit e43dce7274

View File

@ -61,8 +61,9 @@ where M: AsRef<Metadata>,
D: AsRef<DB>, D: AsRef<DB>,
{ {
let mut automatons = Vec::new(); let mut automatons = Vec::new();
for query in query.split_whitespace().filter(|q| !common_words.contains(*q)) { for query in query.split_whitespace().map(str::to_lowercase) {
let lev = automaton::build(query); if common_words.contains(&query) { continue }
let lev = automaton::build(&query);
automatons.push(lev); automatons.push(lev);
} }