From 63efcc06d5bee7f05a1ee9539b2391c80e5d6205 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 2 Apr 2025 17:35:23 +1100 Subject: Tweak ranked match behaviour to consider the number of full words Tracking the number of query words that appear as full words in the candidate seems to fix a few cases where the existing fuzzy matching algorithm was not great. I have been running with this for a while and did not notice any annoyances, the whole RankedMatch code probably deserves more attention but this seems to go in the right direction. --- src/ranked_match.hh | 1 + 1 file changed, 1 insertion(+) (limited to 'src/ranked_match.hh') diff --git a/src/ranked_match.hh b/src/ranked_match.hh index 5a58defb..1d877d53 100644 --- a/src/ranked_match.hh +++ b/src/ranked_match.hh @@ -54,6 +54,7 @@ private: StringView m_candidate{}; bool m_matches = false; Flags m_flags = Flags::None; + int m_full_word_match_count = 0; int m_word_boundary_match_count = 0; int m_max_index = 0; size_t m_input_sequence_number = 0; -- cgit v1.2.3