1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 00:57:45 +00:00

Assistant: Save match all match points in Fuzzy Match

From what I think, the array should consist of point indexes that have
been matched instead of just the last one.

For example, these are the array contents after searching 'file' for
'File Manager':
- Before: [ 3 ]
- Now: [ 0, 1, 2, 3 ]

Besides that, this greatly improves the scoring logic, as it can now
calculate bonuses.

Closes: #8310
This commit is contained in:
Karol Kosek 2021-10-14 16:30:55 +02:00 committed by Andreas Kling
parent e7eccf3de2
commit 5e10cd364b

View file

@ -97,8 +97,8 @@ static FuzzyMatchResult fuzzy_match_recursive(String const& needle, String const
best_recursive_score = result.score; best_recursive_score = result.score;
} }
had_recursive_match = true; had_recursive_match = true;
matches[next_match++] = haystack_idx;
} }
matches[next_match++] = haystack_idx;
needle_idx++; needle_idx++;
} }
haystack_idx++; haystack_idx++;