Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id F0DB5200C39 for ; Wed, 8 Feb 2017 15:31:45 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id EF9AD160B70; Wed, 8 Feb 2017 14:31:45 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 1CAEF160B71 for ; Wed, 8 Feb 2017 15:31:44 +0100 (CET) Received: (qmail 54034 invoked by uid 500); 8 Feb 2017 14:31:43 -0000 Mailing-List: contact commits-help@lucenenet.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: lucene-net-dev@lucenenet.apache.org Delivered-To: mailing list commits@lucenenet.apache.org Received: (qmail 52510 invoked by uid 99); 8 Feb 2017 14:31:42 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Feb 2017 14:31:42 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 65D96DFF17; Wed, 8 Feb 2017 14:31:42 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: nightowl888@apache.org To: commits@lucenenet.apache.org Date: Wed, 08 Feb 2017 14:32:11 -0000 Message-Id: <0a3dc7fba0f3435bac9e86bcc538a8fa@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [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. archived-at: Wed, 08 Feb 2017 14:31:46 -0000 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 Authored: Wed Feb 8 00:38:18 2017 +0700 Committer: Shad Storhaug 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) + /// + /// NOTE: This was toIntsRef() in Lucene + /// + 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)