inspirer added inline comments.

================
Comment at: clangd/FuzzyMatch.cpp:254
+  // Penalty: matching inside a segment (and previous char wasn't matched).
+  if (WordRole[W] == Tail && P && !Matched[P - 1][W - 1])
+    S -= 3;
----------------
You need a third boolean dimension in your DP table for this condition to work 
- "matches".

Consider matching "Abde" against "AbdDe". The result should be [Ab]d[De] and 
not [Abd]D[e]. While evaluating Abd against AbdD, you will have to choose 
between two ways to represent the match and no matter what you choose, scoring 
in this line will not know whether your previous char matched, since you merged 
two branches and kept only one of them.

This scoring works OK-ish since you check "if (Diag >= Left)" above and so you 
Matched table is full of trues, but you matches will gravitate towards the ends 
of the candidate string if you decide to show them in the UI.


https://reviews.llvm.org/D40060



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to