lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lai...@apache.org
Subject lucenenet git commit: try a different approach
Date Thu, 28 May 2015 00:37:52 GMT
Repository: lucenenet
Updated Branches:
  refs/heads/failingtests 0b4e49e5c -> 632f810bd


try a different approach


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/632f810b
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/632f810b
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/632f810b

Branch: refs/heads/failingtests
Commit: 632f810bd96582e240de79fe909345a0c94712c0
Parents: 0b4e49e
Author: Laimonas Simutis <laimis@gmail.com>
Authored: Wed May 27 20:37:39 2015 -0400
Committer: Laimonas Simutis <laimis@gmail.com>
Committed: Wed May 27 20:37:39 2015 -0400

----------------------------------------------------------------------
 src/Lucene.Net.Core/Search/FuzzyTermsEnum.cs | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/632f810b/src/Lucene.Net.Core/Search/FuzzyTermsEnum.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Search/FuzzyTermsEnum.cs b/src/Lucene.Net.Core/Search/FuzzyTermsEnum.cs
index 2434ef7..945a4a3 100644
--- a/src/Lucene.Net.Core/Search/FuzzyTermsEnum.cs
+++ b/src/Lucene.Net.Core/Search/FuzzyTermsEnum.cs
@@ -242,14 +242,18 @@ namespace Lucene.Net.Search
             // true if the last term encountered is lexicographically equal or after the
bottom term in the PQ
             bool termAfter = BottomTerm == null || (lastTerm != null && TermComparator.Compare(lastTerm,
BottomTerm) >= 0);
 
-            OutputCollector.AppendLine("    termAfter=" + termAfter + ", Bottom=" + Bottom.ToString("f20"));
+            var maxBoost = CalculateMaxBoost(MaxEdits);
 
+            OutputCollector.AppendLine("    termAfter=" + termAfter + ", Bottom=" + Bottom.ToString("f20"));
+            OutputCollector.AppendLine(string.Format("    Bottom >= maxBoost: {0}, Bottom
> maxBoost: {1}", Bottom >= maxBoost, Bottom > maxBoost));
+            
             // as long as the max non-competitive boost is >= the max boost
             // for some edit distance, keep dropping the max edit distance.
-            while (MaxEdits > 0 && (termAfter ? Bottom >= CalculateMaxBoost(MaxEdits)
: Bottom > CalculateMaxBoost(MaxEdits)))
+            while (MaxEdits > 0 && (termAfter ? Bottom >= maxBoost : Bottom
> maxBoost))
             {
-                OutputCollector.AppendLine("        maxBoost:" + CalculateMaxBoost(MaxEdits).ToString("f20"));
+                OutputCollector.AppendLine("        max edits subtracted");
                 MaxEdits--;
+                maxBoost = CalculateMaxBoost(MaxEdits);
             }
 
             OutputCollector.AppendLine("    oldMaxEdits=" + oldMaxEdits + ", maxEdits=" +
MaxEdits);


Mime
View raw message