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 5A89B200B74 for ; Thu, 1 Sep 2016 16:39:30 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 59358160AB5; Thu, 1 Sep 2016 14:39:30 +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 795CC160AD3 for ; Thu, 1 Sep 2016 16:39:28 +0200 (CEST) Received: (qmail 71919 invoked by uid 500); 1 Sep 2016 14:39:25 -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 71097 invoked by uid 99); 1 Sep 2016 14:39:24 -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; Thu, 01 Sep 2016 14:39:24 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 9B3EAE056F; Thu, 1 Sep 2016 14:39:24 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: synhershko@apache.org To: commits@lucenenet.apache.org Date: Thu, 01 Sep 2016 14:40:12 -0000 Message-Id: <3c21df334fc7424197dc32d26af786e4@git.apache.org> In-Reply-To: <8ca16dfa9b744f62a1ee6e6469fe3783@git.apache.org> References: <8ca16dfa9b744f62a1ee6e6469fe3783@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [51/52] [abbrv] lucenenet git commit: Fixed some minor code differences in Analysis.Compound.Hyphenation archived-at: Thu, 01 Sep 2016 14:39:30 -0000 Fixed some minor code differences in Analysis.Compound.Hyphenation Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/8a05b168 Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/8a05b168 Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/8a05b168 Branch: refs/heads/master Commit: 8a05b1682b9d1405ed71d42e75d06a296736641d Parents: 3664f1d Author: Shad Storhaug Authored: Sat Aug 27 01:57:32 2016 +0700 Committer: Shad Storhaug Committed: Sat Aug 27 02:20:14 2016 +0700 ---------------------------------------------------------------------- .../Analysis/Compound/hyphenation/HyphenationTree.cs | 11 ++++++----- .../Analysis/Compound/hyphenation/PatternParser.cs | 10 ++++------ 2 files changed, 10 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8a05b168/src/Lucene.Net.Analysis.Common/Analysis/Compound/hyphenation/HyphenationTree.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Compound/hyphenation/HyphenationTree.cs b/src/Lucene.Net.Analysis.Common/Analysis/Compound/hyphenation/HyphenationTree.cs index 33bc310..287f6f3 100644 --- a/src/Lucene.Net.Analysis.Common/Analysis/Compound/hyphenation/HyphenationTree.cs +++ b/src/Lucene.Net.Analysis.Common/Analysis/Compound/hyphenation/HyphenationTree.cs @@ -1,4 +1,5 @@ -using System; +using Lucene.Net.Support; +using System; using System.Collections.Generic; using System.IO; using System.Text; @@ -40,7 +41,7 @@ namespace Lucene.Net.Analysis.Compound.Hyphenation /// /// This map stores hyphenation exceptions /// - protected internal Dictionary> stoplist; + protected internal IDictionary> stoplist; /// /// This map stores the character classes @@ -55,7 +56,7 @@ namespace Lucene.Net.Analysis.Compound.Hyphenation public HyphenationTree() { - stoplist = new Dictionary>(23); // usually a small table + stoplist = new HashMap>(23); // usually a small table classmap = new TernaryTree(); vspace = new ByteVector(); vspace.Alloc(1); // this reserves index 0, which we don't use @@ -234,7 +235,7 @@ namespace Lucene.Net.Analysis.Compound.Hyphenation sbyte v = vspace[k++]; while (v != 0) { - char c = (char)(((int)((uint)v >> 4)) - 1); + char c = (char)((((int)((uint)v >> 4))) - 1); buf.Append(c); c = (char)(v & 0x0f); if (c == 0) @@ -453,7 +454,7 @@ namespace Lucene.Net.Analysis.Compound.Hyphenation { // assume only simple hyphens (Hyphen.pre="-", Hyphen.post = Hyphen.no = // null) - List hw = stoplist[sw]; + IList hw = stoplist[sw]; int j = 0; for (i = 0; i < hw.Count; i++) { http://git-wip-us.apache.org/repos/asf/lucenenet/blob/8a05b168/src/Lucene.Net.Analysis.Common/Analysis/Compound/hyphenation/PatternParser.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Compound/hyphenation/PatternParser.cs b/src/Lucene.Net.Analysis.Common/Analysis/Compound/hyphenation/PatternParser.cs index e94e8cf..33e07dd 100644 --- a/src/Lucene.Net.Analysis.Common/Analysis/Compound/hyphenation/PatternParser.cs +++ b/src/Lucene.Net.Analysis.Common/Analysis/Compound/hyphenation/PatternParser.cs @@ -237,7 +237,7 @@ namespace Lucene.Net.Analysis.Compound.Hyphenation break; } } - token.Append(chars.ToString(0, i)); + token.Append(chars.ToString(0, i - 0)); // chars.delete(0,i); for (int countr = i; countr < chars.Length; countr++) { @@ -250,7 +250,7 @@ namespace Lucene.Net.Analysis.Compound.Hyphenation token.Length = 0; return word; } - token.Append(chars); + token.Append(chars.ToString()); return null; } @@ -360,7 +360,7 @@ namespace Lucene.Net.Analysis.Compound.Hyphenation public override object GetEntity(Uri absoluteUri, string role, Type ofObjectToReturn) { string dtdFilename = "hyphenation.dtd"; - if (dtdFilename.Equals(absoluteUri.Segments.LastOrDefault())) + if (dtdFilename.Equals(absoluteUri.Segments.LastOrDefault(), StringComparison.OrdinalIgnoreCase)) { var qualifedDtdFilename = string.Concat(GetType().Namespace, ".", dtdFilename); return GetType().Assembly.GetManifestResourceStream(qualifedDtdFilename); @@ -415,7 +415,6 @@ namespace Lucene.Net.Analysis.Compound.Hyphenation /// java.lang.String, java.lang.String) public void EndElement(string uri, string local, string raw) { - if (token.Length > 0) { string word = token.ToString(); @@ -449,7 +448,6 @@ namespace Lucene.Net.Analysis.Compound.Hyphenation { currElement = 0; } - } /// @@ -458,7 +456,7 @@ namespace Lucene.Net.Analysis.Compound.Hyphenation StringBuilder chars = new StringBuilder(length); chars.Append(ch, start, length); string word = ReadToken(chars); - while (!string.IsNullOrEmpty(word)) + while (word != null) { // System.out.println("\"" + word + "\""); switch (currElement)