Merge lp:~jpakkane/libcolumbus/lessfuzz-test into lp:libcolumbus

Proposed by Jussi Pakkanen
Status: Merged
Approved by: Mathieu Trudel-Lapierre
Approved revision: 445
Merged at revision: 445
Proposed branch: lp:~jpakkane/libcolumbus/lessfuzz-test
Merge into: lp:libcolumbus
Diff against target: 34 lines (+9/-6)
1 file modified
src/Matcher.cc (+9/-6)
To merge this branch: bzr merge lp:~jpakkane/libcolumbus/lessfuzz-test
Reviewer Review Type Date Requested Status
Mathieu Trudel-Lapierre Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+159106@code.launchpad.net

Commit message

Reduce the default amount of fuzziness.

Description of the change

Reduce the default amount of fuzziness allowed to cut down on matches that can be seen as non-relevant.

This is the same patch that was recently merged to 0.4.

To post a comment you must log in.
445. By Jussi Pakkanen

Merged trunk.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Approve.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Matcher.cc'
2--- src/Matcher.cc 2013-04-03 13:50:54 +0000
3+++ src/Matcher.cc 2013-04-16 09:05:35 +0000
4@@ -138,21 +138,24 @@
5 }
6
7 /*
8- * These are helper functions for Matcher. They are not member functions to avoid polluting the header
9- * with STL includes.
10+ * Long words should allow for more error than short ones.
11+ * This is a simple function which is meant to be strict
12+ * so there won't be too many matches.
13 */
14
15-
16 static int getDynamicError(const Word &w) {
17 size_t len = w.length();
18 if(len < 2)
19 return LevenshteinIndex::getDefaultError();
20- else if(len < 5)
21+ else
22 return 2*LevenshteinIndex::getDefaultError();
23- else
24- return int((1+len/4.0)*LevenshteinIndex::getDefaultError()); // Permit a typo for every fourth letter.
25 }
26
27+/*
28+ * These are helper functions for Matcher. They are not member functions to avoid polluting the header
29+ * with STL includes.
30+ */
31+
32 static void addMatches(MatcherPrivate */*p*/, BestIndexMatches &bestIndexMatches, const Word &/*queryWord*/, const WordID indexID, IndexMatches &matches) {
33 MatchIndIterator it = bestIndexMatches.find(indexID);
34 map<WordID, int> *indexMatches;

Subscribers

People subscribed via source and target branches

to all changes: