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 1CC52200C0F for ; Thu, 2 Feb 2017 13:42:37 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 1B528160B67; Thu, 2 Feb 2017 12:42:37 +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 12D84160B54 for ; Thu, 2 Feb 2017 13:42:34 +0100 (CET) Received: (qmail 14818 invoked by uid 500); 2 Feb 2017 12:42:33 -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 14715 invoked by uid 99); 2 Feb 2017 12:42:32 -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, 02 Feb 2017 12:42:32 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 88373DFC12; Thu, 2 Feb 2017 12:42:32 +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: Thu, 02 Feb 2017 12:42:32 -0000 Message-Id: <253887f4046d44debe425bd978ccffd5@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [01/14] lucenenet git commit: Lucene.Net.Analysis.Common.Analysis.Miscellaneous.WordDelimiterIterator refactor: changed parameters and fields from sbyte to byte for CLS compliance archived-at: Thu, 02 Feb 2017 12:42:37 -0000 Repository: lucenenet Updated Branches: refs/heads/api-work 11a1a1c36 -> bc485b4c4 Lucene.Net.Analysis.Common.Analysis.Miscellaneous.WordDelimiterIterator refactor: changed parameters and fields from sbyte to byte for CLS compliance Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/7cd69ab0 Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/7cd69ab0 Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/7cd69ab0 Branch: refs/heads/api-work Commit: 7cd69ab00ac649081feeb814c846e9eaeb99f208 Parents: 11a1a1c Author: Shad Storhaug Authored: Wed Feb 1 23:51:38 2017 +0700 Committer: Shad Storhaug Committed: Wed Feb 1 23:51:38 2017 +0700 ---------------------------------------------------------------------- .../Miscellaneous/Lucene47WordDelimiterFilter.cs | 2 +- .../Analysis/Miscellaneous/WordDelimiterFilter.cs | 2 +- .../Miscellaneous/WordDelimiterFilterFactory.cs | 12 ++++++------ .../Miscellaneous/WordDelimiterIterator.cs | 18 +++++++++--------- .../Analysis/Core/TestBugInSomething.cs | 6 +++--- 5 files changed, 20 insertions(+), 20 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucenenet/blob/7cd69ab0/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/Lucene47WordDelimiterFilter.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/Lucene47WordDelimiterFilter.cs b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/Lucene47WordDelimiterFilter.cs index 219db723..d46b6c5 100644 --- a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/Lucene47WordDelimiterFilter.cs +++ b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/Lucene47WordDelimiterFilter.cs @@ -155,7 +155,7 @@ namespace Lucene.Net.Analysis.Miscellaneous /// table containing character types /// Flags configuring the filter /// If not null is the set of tokens to protect from being delimited - public Lucene47WordDelimiterFilter(TokenStream @in, sbyte[] charTypeTable, int configurationFlags, CharArraySet protWords) + public Lucene47WordDelimiterFilter(TokenStream @in, byte[] charTypeTable, int configurationFlags, CharArraySet protWords) : base(@in) { termAttribute = AddAttribute(); http://git-wip-us.apache.org/repos/asf/lucenenet/blob/7cd69ab0/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/WordDelimiterFilter.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/WordDelimiterFilter.cs b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/WordDelimiterFilter.cs index d002ab2..77f643e 100644 --- a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/WordDelimiterFilter.cs +++ b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/WordDelimiterFilter.cs @@ -206,7 +206,7 @@ namespace Lucene.Net.Analysis.Miscellaneous /// table containing character types /// Flags configuring the filter /// If not null is the set of tokens to protect from being delimited - public WordDelimiterFilter(LuceneVersion matchVersion, TokenStream @in, sbyte[] charTypeTable, int configurationFlags, CharArraySet protWords) + public WordDelimiterFilter(LuceneVersion matchVersion, TokenStream @in, byte[] charTypeTable, int configurationFlags, CharArraySet protWords) : base(@in) { InitializeInstanceFields(); http://git-wip-us.apache.org/repos/asf/lucenenet/blob/7cd69ab0/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/WordDelimiterFilterFactory.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/WordDelimiterFilterFactory.cs b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/WordDelimiterFilterFactory.cs index b9aaf96..ce4959c 100644 --- a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/WordDelimiterFilterFactory.cs +++ b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/WordDelimiterFilterFactory.cs @@ -48,7 +48,7 @@ namespace Lucene.Net.Analysis.Miscellaneous private readonly string wordFiles; private readonly string types; private readonly int flags; - internal sbyte[] typeTable = null; + internal byte[] typeTable = null; private CharArraySet protectedWords = null; /// @@ -142,9 +142,9 @@ namespace Lucene.Net.Analysis.Miscellaneous private static Regex typePattern = new Regex("(.*)\\s*=>\\s*(.*)\\s*$", RegexOptions.Compiled); // parses a list of MappingCharFilter style rules into a custom byte[] type table - private sbyte[] ParseTypes(IList rules) + private byte[] ParseTypes(IList rules) { - IDictionary typeMap = new SortedDictionary(); + IDictionary typeMap = new SortedDictionary(); foreach (string rule in rules) { //Matcher m = typePattern.matcher(rule); @@ -155,7 +155,7 @@ namespace Lucene.Net.Analysis.Miscellaneous throw new System.ArgumentException("Invalid Mapping Rule : [" + rule + "]"); } string lhs = ParseString(m.Groups[1].Value.Trim()); - sbyte rhs = ParseType(m.Groups[2].Value.Trim()); + byte rhs = ParseType(m.Groups[2].Value.Trim()); if (lhs.Length != 1) { throw new System.ArgumentException("Invalid Mapping Rule : [" + rule + "]. Only a single character is allowed."); @@ -168,7 +168,7 @@ namespace Lucene.Net.Analysis.Miscellaneous } // ensure the table is always at least as big as DEFAULT_WORD_DELIM_TABLE for performance - sbyte[] types = new sbyte[Math.Max(typeMap.Keys.LastOrDefault() + 1, WordDelimiterIterator.DEFAULT_WORD_DELIM_TABLE.Length)]; + byte[] types = new byte[Math.Max(typeMap.Keys.LastOrDefault() + 1, WordDelimiterIterator.DEFAULT_WORD_DELIM_TABLE.Length)]; for (int i = 0; i < types.Length; i++) { types[i] = WordDelimiterIterator.GetType(i); @@ -180,7 +180,7 @@ namespace Lucene.Net.Analysis.Miscellaneous return types; } - private sbyte ParseType(string s) + private byte ParseType(string s) { if (s.Equals("LOWER")) { http://git-wip-us.apache.org/repos/asf/lucenenet/blob/7cd69ab0/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/WordDelimiterIterator.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/WordDelimiterIterator.cs b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/WordDelimiterIterator.cs index 46c43a1..3fe61b6 100644 --- a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/WordDelimiterIterator.cs +++ b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/WordDelimiterIterator.cs @@ -30,7 +30,7 @@ namespace Lucene.Net.Analysis.Miscellaneous /// Indicates the end of iteration public const int DONE = -1; - public static readonly sbyte[] DEFAULT_WORD_DELIM_TABLE; + public static readonly byte[] DEFAULT_WORD_DELIM_TABLE; internal char[] text; internal int length; @@ -71,7 +71,7 @@ namespace Lucene.Net.Analysis.Miscellaneous /// internal readonly bool stemEnglishPossessive; - private readonly sbyte[] charTypeTable; + private readonly byte[] charTypeTable; /// /// if true, need to skip over a possessive found in the last call to next() @@ -81,21 +81,21 @@ namespace Lucene.Net.Analysis.Miscellaneous // done if separated by these chars?) "," would be an obvious candidate... static WordDelimiterIterator() { - var tab = new sbyte[256]; + var tab = new byte[256]; for (int i = 0; i < 256; i++) { - sbyte code = 0; + byte code = 0; if (char.IsLower((char)i)) { - code |= (sbyte)WordDelimiterFilter.LOWER; + code |= (byte)WordDelimiterFilter.LOWER; } else if (char.IsUpper((char)i)) { - code |= (sbyte)WordDelimiterFilter.UPPER; + code |= (byte)WordDelimiterFilter.UPPER; } else if (char.IsDigit((char)i)) { - code |= (sbyte)WordDelimiterFilter.DIGIT; + code |= (byte)WordDelimiterFilter.DIGIT; } if (code == 0) { @@ -113,7 +113,7 @@ namespace Lucene.Net.Analysis.Miscellaneous /// if true, causes "PowerShot" to be two tokens; ("Power-Shot" remains two parts regards) /// if true, causes "j2se" to be three tokens; "j" "2" "se" /// if true, causes trailing "'s" to be removed for each subword: "O'Neil's" => "O", "Neil" - internal WordDelimiterIterator(sbyte[] charTypeTable, bool splitOnCaseChange, bool splitOnNumerics, bool stemEnglishPossessive) + internal WordDelimiterIterator(byte[] charTypeTable, bool splitOnCaseChange, bool splitOnNumerics, bool stemEnglishPossessive) { this.charTypeTable = charTypeTable; this.splitOnCaseChange = splitOnCaseChange; @@ -315,7 +315,7 @@ namespace Lucene.Net.Analysis.Miscellaneous /// /// Character whose type is to be determined /// Type of the character - public static sbyte GetType(int ch) + public static byte GetType(int ch) { switch (CharUnicodeInfo.GetUnicodeCategory((char)ch)) { http://git-wip-us.apache.org/repos/asf/lucenenet/blob/7cd69ab0/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestBugInSomething.cs ---------------------------------------------------------------------- diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestBugInSomething.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestBugInSomething.cs index e552384..1a7f7e9 100644 --- a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestBugInSomething.cs +++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestBugInSomething.cs @@ -333,7 +333,7 @@ namespace Lucene.Net.Analysis.Core public virtual void TestCuriousWikipediaString() { CharArraySet protWords = new CharArraySet(TEST_VERSION_CURRENT, new HashSet(Arrays.AsList("rrdpafa", "pupmmlu", "xlq", "dyy", "zqrxrrck", "o", "hsrlfvcha")), false); - sbyte[] table = new sbyte[] { -57, 26, 1, 48, 63, -23, 55, -84, 18, 120, -97, 103, 58, 13, 84, 89, 57, -13, -63, 5, 28, 97, -54, -94, 102, -108, -5, 5, 46, 40, 43, 78, 43, -72, 36, 29, 124, -106, -22, -51, 65, 5, 31, -42, 6, -99, 97, 14, 81, -128, 74, 100, 54, -55, -25, 53, -71, -98, 44, 33, 86, 106, -42, 47, 115, -89, -18, -26, 22, -95, -43, 83, -125, 105, -104, -24, 106, -16, 126, 115, -105, 97, 65, -33, 57, 44, -1, 123, -68, 100, 13, -41, -64, -119, 0, 92, 94, -36, 53, -9, -102, -18, 90, 94, -26, 31, 71, -20 }; + byte[] table = (byte[])(Array)new sbyte[] { -57, 26, 1, 48, 63, -23, 55, -84, 18, 120, -97, 103, 58, 13, 84, 89, 57, -13, -63, 5, 28, 97, -54, -94, 102, -108, -5, 5, 46, 40, 43, 78, 43, -72, 36, 29, 124, -106, -22, -51, 65, 5, 31, -42, 6, -99, 97, 14, 81, -128, 74, 100, 54, -55, -25, 53, -71, -98, 44, 33, 86, 106, -42, 47, 115, -89, -18, -26, 22, -95, -43, 83, -125, 105, -104, -24, 106, -16, 126, 115, -105, 97, 65, -33, 57, 44, -1, 123, -68, 100, 13, -41, -64, -119, 0, 92, 94, -36, 53, -9, -102, -18, 90, 94, -26, 31, 71, -20 }; Analyzer a = new AnalyzerAnonymousInnerClassHelper2(this, protWords, table); CheckAnalysisConsistency(Random(), a, false, "B\u28c3\ue0f8[ \ud800\udfc2

jb"); } @@ -343,9 +343,9 @@ namespace Lucene.Net.Analysis.Core private readonly TestBugInSomething outerInstance; private CharArraySet protWords; - private sbyte[] table; + private byte[] table; - public AnalyzerAnonymousInnerClassHelper2(TestBugInSomething outerInstance, CharArraySet protWords, sbyte[] table) + public AnalyzerAnonymousInnerClassHelper2(TestBugInSomething outerInstance, CharArraySet protWords, byte[] table) { this.outerInstance = outerInstance; this.protWords = protWords;