fix: Only create non-prefix DFA when generating synonyms alternatives

This commit is contained in:
Clément Renault 2019-06-18 15:18:16 +02:00
parent a76c00a787
commit 8f044c6853
No known key found for this signature in database
GPG Key ID: 0151CDAB43460DAE

View File

@ -45,7 +45,7 @@ fn generate_automatons<S: Store>(query: &str, store: &S) -> Result<Vec<(usize, D
while let Some(synonyms) = stream.next() {
let synonyms = std::str::from_utf8(synonyms).unwrap();
for synonym in split_query_string(synonyms) {
let lev = if not_prefix_dfa { build_dfa(synonym) } else { build_prefix_dfa(synonym) };
let lev = build_dfa(synonym);
automatons.push((index, synonym.to_owned(), lev));
}
}