You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by ni...@apache.org on 2017/02/08 14:32:11 UTC

[32/53] [abbrv] lucenenet git commit: Lucene.Net.Suggest: Renamed all type-derived properties and methods from Short, Int, Long, and Float to match CLR types Int16, Int32, Int64, and Single, respectively.

Lucene.Net.Suggest: Renamed all type-derived properties and methods from Short, Int, Long, and Float to match CLR types Int16, Int32, Int64, and Single, respectively.


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

Branch: refs/heads/api-work
Commit: f0cd4246db710502cc696a22dfc60dec080f0dfe
Parents: 76f687c
Author: Shad Storhaug <sh...@shadstorhaug.com>
Authored: Wed Feb 8 00:38:18 2017 +0700
Committer: Shad Storhaug <sh...@shadstorhaug.com>
Committed: Wed Feb 8 21:08:22 2017 +0700

----------------------------------------------------------------------
 .../Spell/LuceneLevenshteinDistance.cs                | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f0cd4246/src/Lucene.Net.Suggest/Spell/LuceneLevenshteinDistance.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Suggest/Spell/LuceneLevenshteinDistance.cs b/src/Lucene.Net.Suggest/Spell/LuceneLevenshteinDistance.cs
index ab0c9b7..3ced995 100644
--- a/src/Lucene.Net.Suggest/Spell/LuceneLevenshteinDistance.cs
+++ b/src/Lucene.Net.Suggest/Spell/LuceneLevenshteinDistance.cs
@@ -64,12 +64,12 @@ namespace Lucene.Net.Search.Spell
             // in "distributed spellcheck", and its inefficient in other ways too...
 
             // cheaper to do this up front once
-            targetPoints = ToIntsRef(target);
-            otherPoints = ToIntsRef(other);
+            targetPoints = ToInt32sRef(target);
+            otherPoints = ToInt32sRef(other);
             n = targetPoints.Length;
             int m = otherPoints.Length;
 
-            d = ReturnRectangularIntArray(n + 1, m + 1);
+            d = ReturnRectangularInt32Array(n + 1, m + 1);
 
             if (n == 0 || m == 0)
             {
@@ -121,7 +121,10 @@ namespace Lucene.Net.Search.Spell
             return 1.0f - ((float)d[n][m] / Math.Min(m, n));
         }
 
-        private static IntsRef ToIntsRef(string s)
+        /// <summary>
+        /// NOTE: This was toIntsRef() in Lucene
+        /// </summary>
+        private static IntsRef ToInt32sRef(string s)
         {
             var @ref = new IntsRef(s.Length); // worst case
             int utf16Len = s.Length;
@@ -132,7 +135,8 @@ namespace Lucene.Net.Search.Spell
             return @ref;
         }
 
-        private static int[][] ReturnRectangularIntArray(int size1, int size2)
+        // LUCENENET TODO: Move to Support ?
+        private static int[][] ReturnRectangularInt32Array(int size1, int size2)
         {
             int[][] array;
             if (size1 > -1)