mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-06-06 20:25:40 +00:00
Only intern in case of single-typo when looking for single typoes
This commit is contained in:
parent
d9a527854a
commit
c9b4c1fb81
@ -92,12 +92,12 @@ fn find_one_typo_derivations(
|
|||||||
let mut stream = fst.search_with_state(Intersection(starts, &dfa)).into_stream();
|
let mut stream = fst.search_with_state(Intersection(starts, &dfa)).into_stream();
|
||||||
|
|
||||||
while let Some((derived_word, state)) = stream.next() {
|
while let Some((derived_word, state)) = stream.next() {
|
||||||
let derived_word = std::str::from_utf8(derived_word)?;
|
|
||||||
let derived_word = ctx.word_interner.insert(derived_word.to_owned());
|
|
||||||
let d = dfa.distance(state.1);
|
let d = dfa.distance(state.1);
|
||||||
match d.to_u8() {
|
match d.to_u8() {
|
||||||
0 => (),
|
0 => (),
|
||||||
1 => {
|
1 => {
|
||||||
|
let derived_word = std::str::from_utf8(derived_word)?;
|
||||||
|
let derived_word = ctx.word_interner.insert(derived_word.to_owned());
|
||||||
let cf = visit(derived_word)?;
|
let cf = visit(derived_word)?;
|
||||||
if cf.is_break() {
|
if cf.is_break() {
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user