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 2019/12/15 11:44:49 UTC

[lucenenet] branch master updated (cfcbb35 -> 85f824c)

This is an automated email from the ASF dual-hosted git repository.

nightowl888 pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git.


    from cfcbb35  Merge pull request #233 from stevetemple/feature/join-mappings-in-jdoc-converter
     new 4eeb1ae  Lucene.Net.Support.SetExtensions: Factored out AddAll in favor of UnionWith, PutAll, or AddRange depending on the collection type
     new aa1da68  Lucene.Net.Support.Number::BitCount(long): Replaced implementation with the one from Apache Harmony, which benchmarked 9.5x faster
     new de4fd37  BUG: Lucene.Net.Support.Number::BitCount(int) does not pass Harmony tests. Replaced the implementation with one that does.
     new dfdf708  Lucene.Net.Support.Number: Factored out ToString(long) in favor of long.ToString(CultureInfo.InvariantCulture)
     new 2072092  Upgraded to Morfologik.Stemming 2.1.6-alpha-0002
     new bebbae9  Upgraded to ICU4N 60.1.0-alpha.192
     new 85f824c  Lucene.Net.Support.BitArrayExtensions::Cardinality(): Replaced implementation with one that benchmarked more than 3x faster, at the cost of a small amount of RAM

The 7 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 build/Dependencies.props                           |  4 +-
 .../Analysis/Icu/ICUTransformFilter.cs             | 40 +++++---------
 .../Icu/Segmentation/BreakIteratorWrapper.cs       | 36 ++++--------
 .../Icu/Segmentation/CompositeBreakIterator.cs     | 10 +---
 .../Icu/Segmentation/DefaultICUTokenizerConfig.cs  | 10 ++--
 .../Icu/Segmentation/ICUTokenizerConfig.cs         |  2 +-
 src/Lucene.Net.Facet/DrillDownQuery.cs             |  9 ++-
 .../PostingsHighlight/MultiTermHighlighting.cs     | 51 ++++++++---------
 .../VectorHighlight/BaseFragmentsBuilder.cs        |  2 +-
 .../VectorHighlight/FieldPhraseList.cs             |  4 +-
 src/Lucene.Net.Queries/CommonTermsQuery.cs         |  2 +-
 src/Lucene.Net.Suggest/Spell/DirectSpellChecker.cs |  4 +-
 .../Index/ThreadedIndexingAndSearchingTestCase.cs  |  6 +-
 .../JavaCompatibility/SystemTypesHelpers.cs        |  2 +-
 .../Util/TestRuleSetupAndRestoreClassEnv.cs        |  2 +-
 .../Analysis/Util/TestCharArraySet.cs              | 12 ++--
 .../TestPostingsHighlighterRanking.cs              |  2 +-
 src/Lucene.Net.Tests.Join/TestJoinUtil.cs          |  2 +-
 src/Lucene.Net.Tests/Index/TestNeverDelete.cs      |  2 +-
 src/Lucene.Net.Tests/Index/TestPrefixCodedTerms.cs |  2 +-
 src/Lucene.Net/Support/BitArrayExtensions.cs       | 36 +++++++++++-
 src/Lucene.Net/Support/Number.cs                   | 64 +++++-----------------
 src/Lucene.Net/Support/SetExtensions.cs            |  9 ---
 .../TestICUPostingsHighlighterRanking.cs           |  2 +-
 24 files changed, 133 insertions(+), 182 deletions(-)


[lucenenet] 02/07: Lucene.Net.Support.Number::BitCount(long): Replaced implementation with the one from Apache Harmony, which benchmarked 9.5x faster

Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

nightowl888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git

commit aa1da683bb48e6a483543c2a044d26d7371b78b0
Author: Shad Storhaug <sh...@shadstorhaug.com>
AuthorDate: Wed Dec 4 19:43:50 2019 +0700

    Lucene.Net.Support.Number::BitCount(long): Replaced implementation with the one from Apache Harmony, which benchmarked 9.5x faster
---
 src/Lucene.Net/Support/Number.cs | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/src/Lucene.Net/Support/Number.cs b/src/Lucene.Net/Support/Number.cs
index 9f572b8..73dafa8 100644
--- a/src/Lucene.Net/Support/Number.cs
+++ b/src/Lucene.Net/Support/Number.cs
@@ -325,15 +325,14 @@ namespace Lucene.Net.Support
         // Returns the number of 1-bits in the number
         public static int BitCount(long num)
         {
-            int bitcount = 0;
-            // To use the > 0 condition
-            ulong nonNegNum = (ulong) num;
-            while (nonNegNum > 0)
-            {
-                bitcount += (int)(nonNegNum & 0x1);
-                nonNegNum >>= 1;
-            }
-            return bitcount;
+            num = (num & 0x5555555555555555L) + ((num >> 1) & 0x5555555555555555L);
+            num = (num & 0x3333333333333333L) + ((num >> 2) & 0x3333333333333333L);
+            // adjust for 64-bit integer
+            int i = (int)(URShift(num, 32) + num);
+            i = (i & 0x0F0F0F0F) + ((i >> 4) & 0x0F0F0F0F);
+            i = (i & 0x00FF00FF) + ((i >> 8) & 0x00FF00FF);
+            i = (i & 0x0000FFFF) + ((i >> 16) & 0x0000FFFF);
+            return i;
         }
 
         public static int Signum(long a)


[lucenenet] 03/07: BUG: Lucene.Net.Support.Number::BitCount(int) does not pass Harmony tests. Replaced the implementation with one that does.

Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

nightowl888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git

commit de4fd37218525fe3dbcefaa7faed9381daf84e20
Author: Shad Storhaug <sh...@shadstorhaug.com>
AuthorDate: Thu Dec 5 12:29:49 2019 +0700

    BUG: Lucene.Net.Support.Number::BitCount(int) does not pass Harmony tests. Replaced the implementation with one that does.
---
 src/Lucene.Net/Support/Number.cs | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/src/Lucene.Net/Support/Number.cs b/src/Lucene.Net/Support/Number.cs
index 73dafa8..0f4b5f1 100644
--- a/src/Lucene.Net/Support/Number.cs
+++ b/src/Lucene.Net/Support/Number.cs
@@ -341,15 +341,14 @@ namespace Lucene.Net.Support
         }
 
         // Returns the number of 1-bits in the number
-        public static int BitCount(int num)
+        public static int BitCount(int value)
         {
-            int bitcount = 0;
-            while (num > 0)
-            {
-                bitcount += (num & 1);
-                num >>= 1;
-            }
-            return bitcount;
+            value -= ((value >> 1) & 0x55555555);
+            value = (value & 0x33333333) + ((value >> 2) & 0x33333333);
+            value = (((value >> 4) + value) & 0x0F0F0F0F);
+            value += (value >> 8);
+            value += (value >> 16);
+            return (value & 0x0000003F);
         }
 
         public static int RotateLeft(int i, int reps)


[lucenenet] 07/07: Lucene.Net.Support.BitArrayExtensions::Cardinality(): Replaced implementation with one that benchmarked more than 3x faster, at the cost of a small amount of RAM

Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

nightowl888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git

commit 85f824c6323d843af3d5136d4aaff3fdeafb439a
Author: Shad Storhaug <sh...@shadstorhaug.com>
AuthorDate: Sat Dec 14 18:10:06 2019 +0700

    Lucene.Net.Support.BitArrayExtensions::Cardinality(): Replaced implementation with one that benchmarked more than 3x faster, at the cost of a small amount of RAM
---
 src/Lucene.Net/Support/BitArrayExtensions.cs | 36 +++++++++++++++++++++++++---
 1 file changed, 33 insertions(+), 3 deletions(-)

diff --git a/src/Lucene.Net/Support/BitArrayExtensions.cs b/src/Lucene.Net/Support/BitArrayExtensions.cs
index 21e322d..e9c36c1 100644
--- a/src/Lucene.Net/Support/BitArrayExtensions.cs
+++ b/src/Lucene.Net/Support/BitArrayExtensions.cs
@@ -143,18 +143,48 @@ namespace Lucene.Net.Support
         }
 
         /// <summary>
-        /// Returns the number of bits set to true in this BitSet.
+        /// Returns the number of bits set to <c>true</c> in this <see cref="BitArray"/>.
         /// </summary>
-        /// <param name="bits">The BitArray object.</param>
-        /// <returns>The number of bits set to true in this BitSet.</returns>
+        /// <param name="bits">This <see cref="BitArray"/>.</param>
+        /// <returns>The number of bits set to true in this <see cref="BitArray"/>.</returns>
         public static int Cardinality(this BitArray bits)
         {
+            if (bits == null)
+                throw new ArgumentNullException(nameof(bits));
             int count = 0;
+
+#if NETSTANDARD1_6
             for (int i = 0; i < bits.Length; i++)
             {
                 if (bits[i])
                     count++;
             }
+#else
+            int bitsLength = bits.Length;
+            int[] ints = new int[(bitsLength >> 5) + 1];
+            int intsLength = ints.Length;
+            int c;
+
+            bits.CopyTo(ints, 0);
+
+            // fix for not truncated bits in last integer that may have been set to true with SetAll()
+            ints[intsLength - 1] &= ~(-1 << (bitsLength % 32));
+
+            for (int i = 0; i < intsLength; i++)
+            {
+                c = ints[i];
+
+                // magic (http://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetParallel)
+                unchecked
+                {
+                    c -= (c >> 1) & 0x55555555;
+                    c = (c & 0x33333333) + ((c >> 2) & 0x33333333);
+                    c = ((c + (c >> 4) & 0xF0F0F0F) * 0x1010101) >> 24;
+                }
+
+                count += c;
+            }
+#endif
             return count;
         }
 


[lucenenet] 04/07: Lucene.Net.Support.Number: Factored out ToString(long) in favor of long.ToString(CultureInfo.InvariantCulture)

Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

nightowl888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git

commit dfdf7088707d13aeb7379c28de58b37d74b5555b
Author: Shad Storhaug <sh...@shadstorhaug.com>
AuthorDate: Thu Dec 5 22:42:34 2019 +0700

    Lucene.Net.Support.Number: Factored out ToString(long) in favor of long.ToString(CultureInfo.InvariantCulture)
---
 .../TestPostingsHighlighterRanking.cs              |  2 +-
 src/Lucene.Net/Support/Number.cs                   | 32 ----------------------
 .../TestICUPostingsHighlighterRanking.cs           |  2 +-
 3 files changed, 2 insertions(+), 34 deletions(-)

diff --git a/src/Lucene.Net.Tests.Highlighter/PostingsHighlight/TestPostingsHighlighterRanking.cs b/src/Lucene.Net.Tests.Highlighter/PostingsHighlight/TestPostingsHighlighterRanking.cs
index 16690ac..b40f913 100644
--- a/src/Lucene.Net.Tests.Highlighter/PostingsHighlight/TestPostingsHighlighterRanking.cs
+++ b/src/Lucene.Net.Tests.Highlighter/PostingsHighlight/TestPostingsHighlighterRanking.cs
@@ -140,7 +140,7 @@ namespace Lucene.Net.Search.PostingsHighlight
 
                 BooleanQuery bq = new BooleanQuery(false);
                 bq.Add(query, Occur.MUST);
-                bq.Add(new TermQuery(new Term("id", Number.ToString(doc))), Occur.MUST);
+                bq.Add(new TermQuery(new Term("id", doc.ToString(CultureInfo.InvariantCulture))), Occur.MUST);
                 TopDocs td = @is.Search(bq, 1);
                 p1.Highlight("body", bq, @is, td, n);
                 p2.Highlight("body", bq, @is, td, n + 1);
diff --git a/src/Lucene.Net/Support/Number.cs b/src/Lucene.Net/Support/Number.cs
index 0f4b5f1..f474730 100644
--- a/src/Lucene.Net/Support/Number.cs
+++ b/src/Lucene.Net/Support/Number.cs
@@ -47,38 +47,6 @@ namespace Lucene.Net.Support
         /// <summary>
         /// Converts a number to System.String.
         /// </summary>
-        /// <param name="number"></param>
-        /// <returns></returns>
-        public static string ToString(long number)
-        {
-            var s = new System.Text.StringBuilder();
-
-            if (number == 0)
-            {
-                s.Append("0");
-            }
-            else
-            {
-                if (number < 0)
-                {
-                    s.Append("-");
-                    number = -number;
-                }
-
-                while (number > 0)
-                {
-                    char c = digits[(int)number % 36];
-                    s.Insert(0, c);
-                    number = number / 36;
-                }
-            }
-
-            return s.ToString();
-        }
-
-        /// <summary>
-        /// Converts a number to System.String.
-        /// </summary>
         /// <param name="f"></param>
         /// <returns></returns>
         public static System.String ToString(float f)
diff --git a/src/dotnet/Lucene.Net.Tests.ICU/Search/PostingsHighlight/TestICUPostingsHighlighterRanking.cs b/src/dotnet/Lucene.Net.Tests.ICU/Search/PostingsHighlight/TestICUPostingsHighlighterRanking.cs
index cdd74ef..f39514f 100644
--- a/src/dotnet/Lucene.Net.Tests.ICU/Search/PostingsHighlight/TestICUPostingsHighlighterRanking.cs
+++ b/src/dotnet/Lucene.Net.Tests.ICU/Search/PostingsHighlight/TestICUPostingsHighlighterRanking.cs
@@ -139,7 +139,7 @@ namespace Lucene.Net.Search.PostingsHighlight
 
                 BooleanQuery bq = new BooleanQuery(false);
                 bq.Add(query, Occur.MUST);
-                bq.Add(new TermQuery(new Term("id", Number.ToString(doc))), Occur.MUST);
+                bq.Add(new TermQuery(new Term("id", doc.ToString(CultureInfo.InvariantCulture))), Occur.MUST);
                 TopDocs td = @is.Search(bq, 1);
                 p1.Highlight("body", bq, @is, td, n);
                 p2.Highlight("body", bq, @is, td, n + 1);


[lucenenet] 05/07: Upgraded to Morfologik.Stemming 2.1.6-alpha-0002

Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

nightowl888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git

commit 20720923269624460d71f3fd143307e2b4a3aaf7
Author: Shad Storhaug <sh...@shadstorhaug.com>
AuthorDate: Sat Dec 14 00:54:54 2019 +0700

    Upgraded to Morfologik.Stemming 2.1.6-alpha-0002
---
 build/Dependencies.props | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build/Dependencies.props b/build/Dependencies.props
index c9be589..885eca4 100644
--- a/build/Dependencies.props
+++ b/build/Dependencies.props
@@ -43,7 +43,7 @@
     <MicrosoftCSharpPackageVersion>4.4.0</MicrosoftCSharpPackageVersion>
     <MicrosoftExtensionsDependencyModelPackageVersion>2.0.0</MicrosoftExtensionsDependencyModelPackageVersion>
     <MicrosoftNETTestSdkPackageVersion>16.2.0</MicrosoftNETTestSdkPackageVersion>
-    <MorfologikFsaPackageVersion>2.1.6-alpha-0001</MorfologikFsaPackageVersion>
+    <MorfologikFsaPackageVersion>2.1.6-alpha-0002</MorfologikFsaPackageVersion>
     <MorfologikPolishPackageVersion>$(MorfologikFsaPackageVersion)</MorfologikPolishPackageVersion>
     <MorfologikStemmingPackageVersion>$(MorfologikFsaPackageVersion)</MorfologikStemmingPackageVersion>
     <MSTestTestFrameworkPackageVersion>2.0.0</MSTestTestFrameworkPackageVersion>


[lucenenet] 01/07: Lucene.Net.Support.SetExtensions: Factored out AddAll in favor of UnionWith, PutAll, or AddRange depending on the collection type

Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

nightowl888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git

commit 4eeb1aee26e8c93d0eb72e84a4b0c6cb7222c6a8
Author: Shad Storhaug <sh...@shadstorhaug.com>
AuthorDate: Wed Dec 4 03:36:38 2019 +0700

    Lucene.Net.Support.SetExtensions: Factored out AddAll in favor of UnionWith, PutAll, or AddRange depending on the collection type
---
 src/Lucene.Net.Facet/DrillDownQuery.cs             |  9 ++--
 .../PostingsHighlight/MultiTermHighlighting.cs     | 51 ++++++++++------------
 .../VectorHighlight/BaseFragmentsBuilder.cs        |  2 +-
 .../VectorHighlight/FieldPhraseList.cs             |  4 +-
 src/Lucene.Net.Queries/CommonTermsQuery.cs         |  2 +-
 src/Lucene.Net.Suggest/Spell/DirectSpellChecker.cs |  4 +-
 .../Index/ThreadedIndexingAndSearchingTestCase.cs  |  6 +--
 .../JavaCompatibility/SystemTypesHelpers.cs        |  2 +-
 .../Util/TestRuleSetupAndRestoreClassEnv.cs        |  2 +-
 .../Analysis/Util/TestCharArraySet.cs              | 12 ++---
 src/Lucene.Net.Tests.Join/TestJoinUtil.cs          |  2 +-
 src/Lucene.Net.Tests/Index/TestNeverDelete.cs      |  2 +-
 src/Lucene.Net.Tests/Index/TestPrefixCodedTerms.cs |  2 +-
 src/Lucene.Net/Support/SetExtensions.cs            |  9 ----
 14 files changed, 47 insertions(+), 62 deletions(-)

diff --git a/src/Lucene.Net.Facet/DrillDownQuery.cs b/src/Lucene.Net.Facet/DrillDownQuery.cs
index c300c88..27a8cd2 100644
--- a/src/Lucene.Net.Facet/DrillDownQuery.cs
+++ b/src/Lucene.Net.Facet/DrillDownQuery.cs
@@ -69,7 +69,7 @@ namespace Lucene.Net.Facet
         internal DrillDownQuery(FacetsConfig config, BooleanQuery query, IDictionary<string, int?> drillDownDims)
         {
             this.query = (BooleanQuery)query.Clone();
-            this.drillDownDims.AddAll(drillDownDims);
+            this.drillDownDims.PutAll(drillDownDims);
             this.config = config;
         }
 
@@ -86,7 +86,7 @@ namespace Lucene.Net.Facet
                 throw new System.ArgumentException("cannot apply filter unless baseQuery isn't null; pass ConstantScoreQuery instead");
             }
             Debug.Assert(clauses.Length == 1 + other.drillDownDims.Count, clauses.Length + " vs " + (1 + other.drillDownDims.Count));
-            drillDownDims.AddAll(other.drillDownDims);
+            drillDownDims.PutAll(other.drillDownDims);
             query.Add(new FilteredQuery(clauses[0].Query, filter), Occur.MUST);
             for (int i = 1; i < clauses.Length; i++)
             {
@@ -109,7 +109,7 @@ namespace Lucene.Net.Facet
             {
                 query.Add(clause, Occur.MUST);
             }
-            this.drillDownDims.AddAll(drillDownDims);
+            this.drillDownDims.PutAll(drillDownDims);
             this.config = config;
         }
 
@@ -147,8 +147,7 @@ namespace Lucene.Net.Facet
         private void Merge(string dim, string[] path)
         {
             int index = 0;
-            int? idx;
-            if (drillDownDims.TryGetValue(dim, out idx) && idx.HasValue)
+            if (drillDownDims.TryGetValue(dim, out int? idx) && idx.HasValue)
             {
                 index = idx.Value;
             }
diff --git a/src/Lucene.Net.Highlighter/PostingsHighlight/MultiTermHighlighting.cs b/src/Lucene.Net.Highlighter/PostingsHighlight/MultiTermHighlighting.cs
index 4d0c46a..ea7eed9 100644
--- a/src/Lucene.Net.Highlighter/PostingsHighlight/MultiTermHighlighting.cs
+++ b/src/Lucene.Net.Highlighter/PostingsHighlight/MultiTermHighlighting.cs
@@ -41,72 +41,68 @@ namespace Lucene.Net.Search.PostingsHighlight
         internal static CharacterRunAutomaton[] ExtractAutomata(Query query, string field)
         {
             List<CharacterRunAutomaton> list = new List<CharacterRunAutomaton>();
-            if (query is BooleanQuery)
+            if (query is BooleanQuery booleanQuery)
             {
-                BooleanClause[] clauses = ((BooleanQuery)query).GetClauses();
-                foreach (BooleanClause clause in clauses)
+                foreach (BooleanClause clause in booleanQuery.GetClauses())
                 {
                     if (!clause.IsProhibited)
                     {
-                        list.AddAll(Arrays.AsList(ExtractAutomata(clause.Query, field)));
+                        list.AddRange(ExtractAutomata(clause.Query, field));
                     }
                 }
             }
-            else if (query is DisjunctionMaxQuery)
+            else if (query is DisjunctionMaxQuery disjunctionMaxQuery)
             {
-                foreach (Query sub in ((DisjunctionMaxQuery)query).Disjuncts)
+                foreach (Query sub in disjunctionMaxQuery.Disjuncts)
                 {
-                    list.AddAll(Arrays.AsList(ExtractAutomata(sub, field)));
+                    list.AddRange(ExtractAutomata(sub, field));
                 }
             }
-            else if (query is SpanOrQuery)
+            else if (query is SpanOrQuery spanOrQuery)
             {
-                foreach (Query sub in ((SpanOrQuery)query).GetClauses())
+                foreach (Query sub in spanOrQuery.GetClauses())
                 {
-                    list.AddAll(Arrays.AsList(ExtractAutomata(sub, field)));
+                    list.AddRange(ExtractAutomata(sub, field));
                 }
             }
-            else if (query is SpanNearQuery)
+            else if (query is SpanNearQuery spanNearQuery)
             {
-                foreach (Query sub in ((SpanNearQuery)query).GetClauses())
+                foreach (Query sub in spanNearQuery.GetClauses())
                 {
-                    list.AddAll(Arrays.AsList(ExtractAutomata(sub, field)));
+                    list.AddRange(ExtractAutomata(sub, field));
                 }
             }
-            else if (query is SpanNotQuery)
+            else if (query is SpanNotQuery spanNotQuery)
             {
-                list.AddAll(Arrays.AsList(ExtractAutomata(((SpanNotQuery)query).Include, field)));
+                list.AddRange(ExtractAutomata(spanNotQuery.Include, field));
             }
-            else if (query is SpanPositionCheckQuery)
+            else if (query is SpanPositionCheckQuery spanPositionCheckQuery)
             {
-                list.AddAll(Arrays.AsList(ExtractAutomata(((SpanPositionCheckQuery)query).Match, field)));
+                list.AddRange(ExtractAutomata(spanPositionCheckQuery.Match, field));
             }
-            else if (query is ISpanMultiTermQueryWrapper)
+            else if (query is ISpanMultiTermQueryWrapper spanMultiTermQueryWrapper)
             {
-                list.AddAll(Arrays.AsList(ExtractAutomata(((ISpanMultiTermQueryWrapper)query).WrappedQuery, field)));
+                list.AddRange(ExtractAutomata(spanMultiTermQueryWrapper.WrappedQuery, field));
             }
-            else if (query is AutomatonQuery)
+            else if (query is AutomatonQuery aq)
             {
-                AutomatonQuery aq = (AutomatonQuery)query;
                 if (aq.Field.Equals(field, StringComparison.Ordinal))
                 {
                     list.Add(new CharacterRunAutomatonToStringAnonymousHelper(aq.Automaton, () => aq.ToString()));
                 }
             }
-            else if (query is PrefixQuery)
+            else if (query is PrefixQuery pq)
             {
-                PrefixQuery pq = (PrefixQuery)query;
                 Term prefix = pq.Prefix;
                 if (prefix.Field.Equals(field, StringComparison.Ordinal))
                 {
                     list.Add(new CharacterRunAutomatonToStringAnonymousHelper(
-                        BasicOperations.Concatenate(BasicAutomata.MakeString(prefix.Text()), BasicAutomata.MakeAnyString()), 
+                        BasicOperations.Concatenate(BasicAutomata.MakeString(prefix.Text()), BasicAutomata.MakeAnyString()),
                         () => pq.ToString()));
                 }
             }
-            else if (query is FuzzyQuery)
+            else if (query is FuzzyQuery fq)
             {
-                FuzzyQuery fq = (FuzzyQuery)query;
                 if (fq.Field.Equals(field, StringComparison.Ordinal))
                 {
                     string utf16 = fq.Term.Text();
@@ -128,9 +124,8 @@ namespace Lucene.Net.Search.PostingsHighlight
                     list.Add(new CharacterRunAutomatonToStringAnonymousHelper(automaton, () => fq.ToString()));
                 }
             }
-            else if (query is TermRangeQuery)
+            else if (query is TermRangeQuery tq)
             {
-                TermRangeQuery tq = (TermRangeQuery)query;
                 if (tq.Field.Equals(field, StringComparison.Ordinal))
                 {
                     // this is *not* an automaton, but its very simple
diff --git a/src/Lucene.Net.Highlighter/VectorHighlight/BaseFragmentsBuilder.cs b/src/Lucene.Net.Highlighter/VectorHighlight/BaseFragmentsBuilder.cs
index 29adb50..e56f389 100644
--- a/src/Lucene.Net.Highlighter/VectorHighlight/BaseFragmentsBuilder.cs
+++ b/src/Lucene.Net.Highlighter/VectorHighlight/BaseFragmentsBuilder.cs
@@ -348,7 +348,7 @@ namespace Lucene.Net.Search.VectorHighlight
             List<WeightedFragInfo> result = new List<WeightedFragInfo>();
             foreach (List<WeightedFragInfo> weightedFragInfos in fieldNameToFragInfos.Values)
             {
-                result.AddAll(weightedFragInfos);
+                result.AddRange(weightedFragInfos);
             }
             CollectionUtil.TimSort(result, new DiscreteMultiValueHighlightingComparerAnonymousHelper());
 
diff --git a/src/Lucene.Net.Highlighter/VectorHighlight/FieldPhraseList.cs b/src/Lucene.Net.Highlighter/VectorHighlight/FieldPhraseList.cs
index 93a2e3a..f7818b1 100644
--- a/src/Lucene.Net.Highlighter/VectorHighlight/FieldPhraseList.cs
+++ b/src/Lucene.Net.Highlighter/VectorHighlight/FieldPhraseList.cs
@@ -220,7 +220,7 @@ namespace Lucene.Net.Search.VectorHighlight
                 {
                     // WeightedPhraseInfo.addIfNoOverlap() dumps the second part of, for example, hyphenated words (social-economics). 
                     // The result is that all informations in TermInfo are lost and not available for further operations. 
-                    existWpi.TermsInfos.AddAll(wpi.TermsInfos);
+                    existWpi.TermsInfos.AddRange(wpi.TermsInfos);
                     return;
                 }
             }
@@ -343,7 +343,7 @@ namespace Lucene.Net.Search.VectorHighlight
                         {
                             WeightedPhraseInfo info = toMergeItr.Current;
                             boost += info.boost;
-                            termsInfos.AddAll(info.termsInfos);
+                            termsInfos.AddRange(info.termsInfos);
                             allToffs[index++] = info.termsOffsets.GetEnumerator();
                         }
 
diff --git a/src/Lucene.Net.Queries/CommonTermsQuery.cs b/src/Lucene.Net.Queries/CommonTermsQuery.cs
index 701dbd6..6b5e070 100644
--- a/src/Lucene.Net.Queries/CommonTermsQuery.cs
+++ b/src/Lucene.Net.Queries/CommonTermsQuery.cs
@@ -356,7 +356,7 @@ namespace Lucene.Net.Queries
 
         public override void ExtractTerms(ISet<Term> terms)
         {
-            terms.AddAll(this.m_terms);
+            terms.UnionWith(this.m_terms);
         }
 
         public override string ToString(string field)
diff --git a/src/Lucene.Net.Suggest/Spell/DirectSpellChecker.cs b/src/Lucene.Net.Suggest/Spell/DirectSpellChecker.cs
index 0ade7dc..910c1ad 100644
--- a/src/Lucene.Net.Suggest/Spell/DirectSpellChecker.cs
+++ b/src/Lucene.Net.Suggest/Spell/DirectSpellChecker.cs
@@ -428,8 +428,8 @@ namespace Lucene.Net.Search.Spell
             if (maxEdits > 1 && terms.Count() < inspections)
             {
                 var moreTerms = new HashSet<ScoreTerm>();
-                moreTerms.AddAll(terms);
-                moreTerms.AddAll(SuggestSimilar(term, inspections, ir, docfreq, maxEdits, accuracy, spare));
+                moreTerms.UnionWith(terms);
+                moreTerms.UnionWith(SuggestSimilar(term, inspections, ir, docfreq, maxEdits, accuracy, spare));
                 terms = moreTerms;
             }
 
diff --git a/src/Lucene.Net.TestFramework/Index/ThreadedIndexingAndSearchingTestCase.cs b/src/Lucene.Net.TestFramework/Index/ThreadedIndexingAndSearchingTestCase.cs
index 649de0d..95aaafb 100644
--- a/src/Lucene.Net.TestFramework/Index/ThreadedIndexingAndSearchingTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Index/ThreadedIndexingAndSearchingTestCase.cs
@@ -276,7 +276,7 @@ namespace Lucene.Net.Index
                                 if (delSubDocs != null)
                                 {
                                     delSubDocs.Deleted = true;
-                                    delIDs.AddAll(delSubDocs.SubIDs);
+                                    delIDs.UnionWith(delSubDocs.SubIDs);
                                     outerInstance.m_delCount.AddAndGet(delSubDocs.SubIDs.Count);
                                     if (VERBOSE)
                                     {
@@ -366,7 +366,7 @@ namespace Lucene.Net.Index
                             {
                                 Console.WriteLine(Thread.CurrentThread.Name + ": tot " + count + " deletes");
                             }
-                            delIDs.AddAll(toDeleteIDs);
+                            delIDs.UnionWith(toDeleteIDs);
                             toDeleteIDs.Clear();
 
                             foreach (SubDocs subDocs in toDeleteSubDocs)
@@ -379,7 +379,7 @@ namespace Lucene.Net.Index
                                 {
                                     Console.WriteLine(Thread.CurrentThread.Name + ": del subs: " + subDocs.SubIDs + " packID=" + subDocs.PackID);
                                 }
-                                delIDs.AddAll(subDocs.SubIDs);
+                                delIDs.UnionWith(subDocs.SubIDs);
                                 outerInstance.m_delCount.AddAndGet(subDocs.SubIDs.Count);
                             }
                             toDeleteSubDocs.Clear();
diff --git a/src/Lucene.Net.TestFramework/Support/JavaCompatibility/SystemTypesHelpers.cs b/src/Lucene.Net.TestFramework/Support/JavaCompatibility/SystemTypesHelpers.cs
index da17171..1d3e561 100644
--- a/src/Lucene.Net.TestFramework/Support/JavaCompatibility/SystemTypesHelpers.cs
+++ b/src/Lucene.Net.TestFramework/Support/JavaCompatibility/SystemTypesHelpers.cs
@@ -231,7 +231,7 @@ namespace Lucene.Net
 
         public static void addAll<T>(this ISet<T> s, IEnumerable<T> other)
         {
-            s.AddAll(other);
+            s.UnionWith(other);
         }
 
         public static bool contains<T>(this ISet<T> s, T item)
diff --git a/src/Lucene.Net.TestFramework/Util/TestRuleSetupAndRestoreClassEnv.cs b/src/Lucene.Net.TestFramework/Util/TestRuleSetupAndRestoreClassEnv.cs
index 68ef766..cd0695a 100644
--- a/src/Lucene.Net.TestFramework/Util/TestRuleSetupAndRestoreClassEnv.cs
+++ b/src/Lucene.Net.TestFramework/Util/TestRuleSetupAndRestoreClassEnv.cs
@@ -163,7 +163,7 @@ namespace Lucene.Net.Util
             var suppressCodecsAttribute = targetClass.GetTypeInfo().GetCustomAttribute<LuceneTestCase.SuppressCodecsAttribute>();
             if (suppressCodecsAttribute != null)
             {
-                avoidCodecs.AddAll(suppressCodecsAttribute.Value);
+                avoidCodecs.UnionWith(suppressCodecsAttribute.Value);
             }
 
             // set back to default
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestCharArraySet.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestCharArraySet.cs
index df04154..428f9c4 100644
--- a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestCharArraySet.cs
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestCharArraySet.cs
@@ -54,7 +54,7 @@ namespace Lucene.Net.Analysis.Util
             string[] words = new string[] { "Hello", "World", "this", "is", "a", "test" };
             char[] findme = "xthisy".ToCharArray();
             CharArraySet set = new CharArraySet(TEST_VERSION_CURRENT, 10, true);
-            set.AddAll(words);
+            set.UnionWith(words);
             assertTrue(set.Contains(findme, 1, 4));
             assertTrue(set.Contains(new string(findme, 1, 4)));
 
@@ -86,7 +86,7 @@ namespace Lucene.Net.Analysis.Util
         public virtual void TestClear()
         {
             var set = new CharArraySet(TEST_VERSION_CURRENT, 10, true);
-            set.AddAll(TEST_STOP_WORDS);
+            set.UnionWith(TEST_STOP_WORDS);
             assertEquals("Not all words added", TEST_STOP_WORDS.Length, set.size());
             set.Clear();
             assertEquals("not empty", 0, set.size());
@@ -94,7 +94,7 @@ namespace Lucene.Net.Analysis.Util
             {
                 assertFalse(set.Contains(TEST_STOP_WORDS[i]));
             }
-            set.AddAll(TEST_STOP_WORDS);
+            set.UnionWith(TEST_STOP_WORDS);
             assertEquals("Not all words added", TEST_STOP_WORDS.Length, set.size());
             for (var i = 0; i < TEST_STOP_WORDS.Length; i++)
             {
@@ -106,7 +106,7 @@ namespace Lucene.Net.Analysis.Util
         public virtual void TestModifyOnUnmodifiable()
         {
             CharArraySet set = new CharArraySet(TEST_VERSION_CURRENT, 10, true);
-            set.AddAll(TEST_STOP_WORDS);
+            set.UnionWith(TEST_STOP_WORDS);
             int size = set.size();
             set = CharArraySet.UnmodifiableSet(set);
             assertEquals("Set size changed due to unmodifiableSet call", size, set.size());
@@ -249,7 +249,7 @@ namespace Lucene.Net.Analysis.Util
         public virtual void TestUnmodifiableSet()
         {
             var set = new CharArraySet(TEST_VERSION_CURRENT, 10, true);
-            set.AddAll(TEST_STOP_WORDS);
+            set.UnionWith(TEST_STOP_WORDS);
             set.Add(Convert.ToInt32(1));
             int size = set.size();
             set = CharArraySet.UnmodifiableSet(set);
@@ -662,7 +662,7 @@ namespace Lucene.Net.Analysis.Util
 
             values = new List<string> { "sally", "seashells", "by", "the", "sea", "shore" };
             charArraySet.Clear();
-            charArraySet.AddAll(values);
+            charArraySet.UnionWith(values);
 
             assertFalse(charArraySet.GetHashCode().Equals(charArraySetCopy.GetHashCode()));
             assertFalse(charArraySet.Equals(charArraySetCopy));
diff --git a/src/Lucene.Net.Tests.Join/TestJoinUtil.cs b/src/Lucene.Net.Tests.Join/TestJoinUtil.cs
index d6916bb..76d7940 100644
--- a/src/Lucene.Net.Tests.Join/TestJoinUtil.cs
+++ b/src/Lucene.Net.Tests.Join/TestJoinUtil.cs
@@ -715,7 +715,7 @@ namespace Lucene.Net.Tests.Join
                             TermsEnum termsEnum = null;
                             SortedSet<BytesRef> joinValues =
                                 new SortedSet<BytesRef>(BytesRef.UTF8SortedAsUnicodeComparer);
-                            joinValues.AddAll(joinValueToJoinScores.Keys);
+                            joinValues.UnionWith(joinValueToJoinScores.Keys);
                             foreach (BytesRef joinValue in joinValues)
                             {
                                 termsEnum = terms.GetIterator(termsEnum);
diff --git a/src/Lucene.Net.Tests/Index/TestNeverDelete.cs b/src/Lucene.Net.Tests/Index/TestNeverDelete.cs
index 67e1655..1ae2b97 100644
--- a/src/Lucene.Net.Tests/Index/TestNeverDelete.cs
+++ b/src/Lucene.Net.Tests/Index/TestNeverDelete.cs
@@ -78,7 +78,7 @@ namespace Lucene.Net.Index
                 {
                     Console.WriteLine("TEST: check files: " + ic.FileNames);
                 }
-                allFiles.AddAll(ic.FileNames);
+                allFiles.UnionWith(ic.FileNames);
                 // Make sure no old files were removed
                 foreach (string fileName in allFiles)
                 {
diff --git a/src/Lucene.Net.Tests/Index/TestPrefixCodedTerms.cs b/src/Lucene.Net.Tests/Index/TestPrefixCodedTerms.cs
index f403ed7..18aa0b5 100644
--- a/src/Lucene.Net.Tests/Index/TestPrefixCodedTerms.cs
+++ b/src/Lucene.Net.Tests/Index/TestPrefixCodedTerms.cs
@@ -113,7 +113,7 @@ namespace Lucene.Net.Index
                     Term term = new Term(TestUtil.RandomUnicodeString(Random, 2), TestUtil.RandomUnicodeString(Random, 4));
                     terms.Add(term);
                 }
-                superSet.AddAll(terms);
+                superSet.UnionWith(terms);
 
                 PrefixCodedTerms.Builder b = new PrefixCodedTerms.Builder();
                 foreach (Term @ref in terms)
diff --git a/src/Lucene.Net/Support/SetExtensions.cs b/src/Lucene.Net/Support/SetExtensions.cs
index 5e2f3c6..50e9d31 100644
--- a/src/Lucene.Net/Support/SetExtensions.cs
+++ b/src/Lucene.Net/Support/SetExtensions.cs
@@ -30,14 +30,5 @@ namespace Lucene.Net.Support
                 theSet.Remove(elt);
             }
         }
-
-        [DebuggerStepThrough]
-        public static void AddAll<T>(this ICollection<T> set, IEnumerable<T> itemsToAdd)
-        {
-            foreach (var item in itemsToAdd)
-            {
-                set.Add(item);
-            }
-        }
     }
 }
\ No newline at end of file


[lucenenet] 06/07: Upgraded to ICU4N 60.1.0-alpha.192

Posted by ni...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

nightowl888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucenenet.git

commit bebbae94145916520972ce25b3ebc2778db7c699
Author: Shad Storhaug <sh...@shadstorhaug.com>
AuthorDate: Sat Dec 14 01:33:22 2019 +0700

    Upgraded to ICU4N 60.1.0-alpha.192
---
 build/Dependencies.props                           |  2 +-
 .../Analysis/Icu/ICUTransformFilter.cs             | 40 ++++++++--------------
 .../Icu/Segmentation/BreakIteratorWrapper.cs       | 36 +++++++------------
 .../Icu/Segmentation/CompositeBreakIterator.cs     | 10 ++----
 .../Icu/Segmentation/DefaultICUTokenizerConfig.cs  | 10 +++---
 .../Icu/Segmentation/ICUTokenizerConfig.cs         |  2 +-
 6 files changed, 35 insertions(+), 65 deletions(-)

diff --git a/build/Dependencies.props b/build/Dependencies.props
index 885eca4..595cdb7 100644
--- a/build/Dependencies.props
+++ b/build/Dependencies.props
@@ -32,7 +32,7 @@
         https://github.com/apache/lucene-solr/tree/31d7ec7bbfdcd2c4cc61d9d35e962165410b65fe/lucene/analysis/icu/src/data/utr30
         Just make sure they are adjusted to the right version of ICU/Lucene.
     <ICU4NPackageVersion>[60.1,60.2)</ICU4NPackageVersion> -->
-    <ICU4NPackageVersion>60.1.0-alpha.53</ICU4NPackageVersion>
+    <ICU4NPackageVersion>60.1.0-alpha.192</ICU4NPackageVersion>
     <ICU4NCollationPackageVersion>$(ICU4NPackageVersion)</ICU4NCollationPackageVersion>
     <ICU4NCurrencyDataPackageVersion>$(ICU4NPackageVersion)</ICU4NCurrencyDataPackageVersion>
     <ICU4NLanguageDataPackageVersion>$(ICU4NPackageVersion)</ICU4NLanguageDataPackageVersion>
diff --git a/src/Lucene.Net.Analysis.ICU/Analysis/Icu/ICUTransformFilter.cs b/src/Lucene.Net.Analysis.ICU/Analysis/Icu/ICUTransformFilter.cs
index 8564acb..839a916 100644
--- a/src/Lucene.Net.Analysis.ICU/Analysis/Icu/ICUTransformFilter.cs
+++ b/src/Lucene.Net.Analysis.ICU/Analysis/Icu/ICUTransformFilter.cs
@@ -128,21 +128,15 @@ namespace Lucene.Net.Analysis.Icu
                 this.length = token.Length;
             }
 
-            public int Char32At(int pos)
-            {
-                return UTF16.CharAt(buffer, 0, length, pos);
-            }
+            public int Char32At(int pos) => UTF16.CharAt(buffer, 0, length, pos);
 
-            public char this[int pos]
-            {
-                get { return buffer[pos]; }
-            }
+            public char this[int pos] => buffer[pos];
 
-            public void Copy(int start, int limit, int dest)
+            public void Copy(int startIndex, int length, int destinationIndex) // LUCENENET: Changed 2nd parameter from limit to length
             {
-                char[] text = new char[limit - start];
-                CopyTo(start, text, 0, limit - start);
-                Replace(dest, dest, text, 0, limit - start);
+                char[] text = new char[length]; // LUCENENET: Corrected length
+                CopyTo(startIndex, text, 0, length); // LUCENENET: Corrected length
+                Replace(destinationIndex, destinationIndex - destinationIndex, text, 0, length); // LUCENENET: Corrected length & charsLen
             }
 
             public void CopyTo(int sourceIndex, char[] destination, int destinationIndex, int count)
@@ -150,33 +144,27 @@ namespace Lucene.Net.Analysis.Icu
                 System.Array.Copy(buffer, sourceIndex, destination, destinationIndex, count);
             }
 
-            public bool HasMetaData
-            {
-                get { return false; }
-            }
+            public bool HasMetaData => false;
 
-            public int Length
-            {
-                get { return length; }
-            }
+            public int Length => length;
 
-            public void Replace(int start, int limit, string text)
+            public void Replace(int start, int length, string text) // LUCENENET: Changed 2nd parameter from limit to length
             {
                 int charsLen = text.Length;
-                int newLength = ShiftForReplace(start, limit, charsLen);
+                int newLength = ShiftForReplace(start, length + start, charsLen); // LUCENENET: Changed 2nd parameter to calculate limit
                 // insert the replacement text
                 text.CopyTo(0, buffer, start, charsLen);
-                token.Length = (length = newLength);
+                token.Length = (this.length = newLength);
             }
 
-            public void Replace(int start, int limit, char[] text, int charsStart,
+            public void Replace(int start, int length, char[] text, int charsStart,
                 int charsLen)
             {
                 // shift text if necessary for the replacement
-                int newLength = ShiftForReplace(start, limit, charsLen);
+                int newLength = ShiftForReplace(start, length + start, charsLen); // LUCENENET: Changed 2nd parameter to calculate limit
                 // insert the replacement text
                 System.Array.Copy(text, charsStart, buffer, start, charsLen);
-                token.Length = (length = newLength);
+                token.Length = (this.length = newLength);
             }
 
             /// <summary>shift text (if necessary) for a replacement operation</summary>
diff --git a/src/Lucene.Net.Analysis.ICU/Analysis/Icu/Segmentation/BreakIteratorWrapper.cs b/src/Lucene.Net.Analysis.ICU/Analysis/Icu/Segmentation/BreakIteratorWrapper.cs
index 2b4db33..af50927 100644
--- a/src/Lucene.Net.Analysis.ICU/Analysis/Icu/Segmentation/BreakIteratorWrapper.cs
+++ b/src/Lucene.Net.Analysis.ICU/Analysis/Icu/Segmentation/BreakIteratorWrapper.cs
@@ -47,7 +47,7 @@ namespace Lucene.Net.Analysis.Icu.Segmentation
 
         public abstract int Next();
         public abstract int Current { get; }
-        public abstract ICU4N.Text.RuleStatus RuleStatus { get; }
+        public abstract int RuleStatus { get; }
         public abstract void SetText(CharacterIterator text);
 
         public void SetText(char[] text, int start, int length)
@@ -87,15 +87,9 @@ namespace Lucene.Net.Analysis.Icu.Segmentation
                 this.rbbi = rbbi;
             }
 
-            public override int Current
-            {
-                get { return rbbi.Current; }
-            }
+            public override int Current => rbbi.Current;
 
-            public override ICU4N.Text.RuleStatus RuleStatus
-            {
-                get { return rbbi.RuleStatus; }
-            }
+            public override int RuleStatus => rbbi.RuleStatus;
 
             public override int Next()
             {
@@ -119,22 +113,16 @@ namespace Lucene.Net.Analysis.Icu.Segmentation
         private sealed class BIWrapper : BreakIteratorWrapper
         {
             private readonly BreakIterator bi;
-            private ICU4N.Text.RuleStatus status;
+            private int status;
 
             internal BIWrapper(BreakIterator bi)
             {
                 this.bi = bi;
             }
 
-            public override int Current
-            {
-                get { return bi.Current; }
-            }
+            public override int Current => bi.Current;
 
-            public override ICU4N.Text.RuleStatus RuleStatus
-            {
-                get { return status; }
-            }
+            public override int RuleStatus => status;
 
             public override int Next()
             {
@@ -144,10 +132,10 @@ namespace Lucene.Net.Analysis.Icu.Segmentation
                 return next;
             }
 
-            private RuleStatus CalcStatus(int current, int next)
+            private int CalcStatus(int current, int next)
             {
                 if (current == BreakIterator.Done || next == BreakIterator.Done)
-                    return ICU4N.Text.RuleStatus.WordNone;
+                    return BreakIterator.WordNone;
 
                 int begin = m_start + current;
                 int end = m_start + next;
@@ -158,22 +146,22 @@ namespace Lucene.Net.Analysis.Icu.Segmentation
                     codepoint = UTF16.CharAt(m_text, 0, end, begin);
 
                     if (UChar.IsDigit(codepoint))
-                        return ICU4N.Text.RuleStatus.WordNumber;
+                        return BreakIterator.WordNumber;
                     else if (UChar.IsLetter(codepoint))
                     {
                         // TODO: try to separately specify ideographic, kana? 
                         // [currently all bundled as letter for this case]
-                        return ICU4N.Text.RuleStatus.WordLetter;
+                        return BreakIterator.WordLetter;
                     }
                 }
 
-                return ICU4N.Text.RuleStatus.WordNone;
+                return BreakIterator.WordNone;
             }
 
             public override void SetText(CharacterIterator text)
             {
                 bi.SetText(text);
-                status = ICU4N.Text.RuleStatus.WordNone;
+                status = BreakIterator.WordNone;
             }
         }
     }
diff --git a/src/Lucene.Net.Analysis.ICU/Analysis/Icu/Segmentation/CompositeBreakIterator.cs b/src/Lucene.Net.Analysis.ICU/Analysis/Icu/Segmentation/CompositeBreakIterator.cs
index 15b6fcd..d697ae1 100644
--- a/src/Lucene.Net.Analysis.ICU/Analysis/Icu/Segmentation/CompositeBreakIterator.cs
+++ b/src/Lucene.Net.Analysis.ICU/Analysis/Icu/Segmentation/CompositeBreakIterator.cs
@@ -91,19 +91,13 @@ namespace Lucene.Net.Analysis.Icu.Segmentation
         /// Gets the rule status code (token type) from the underlying break
         /// iterator. See <see cref="RuleBasedBreakIterator"/> constants.
         /// </summary>
-        public RuleStatus RuleStatus
-        {
-            get { return rbbi.RuleStatus; }
-        }
+        public int RuleStatus => rbbi.RuleStatus;
 
         /// <summary>
         /// Gets the <see cref="UScript"/> script code for the current token. This code can be
         /// decoded with <see cref="UScript"/> into a name or ISO 15924 code.
         /// </summary>
-        public int ScriptCode
-        {
-            get { return scriptIterator.ScriptCode; }
-        }
+        public int ScriptCode => scriptIterator.ScriptCode;
 
         /// <summary>
         /// Set a new region of text to be examined by this iterator.
diff --git a/src/Lucene.Net.Analysis.ICU/Analysis/Icu/Segmentation/DefaultICUTokenizerConfig.cs b/src/Lucene.Net.Analysis.ICU/Analysis/Icu/Segmentation/DefaultICUTokenizerConfig.cs
index 3fb7334..bdee024 100644
--- a/src/Lucene.Net.Analysis.ICU/Analysis/Icu/Segmentation/DefaultICUTokenizerConfig.cs
+++ b/src/Lucene.Net.Analysis.ICU/Analysis/Icu/Segmentation/DefaultICUTokenizerConfig.cs
@@ -113,17 +113,17 @@ namespace Lucene.Net.Analysis.Icu.Segmentation
             }
         }
 
-        public override string GetType(int script, RuleStatus ruleStatus)
+        public override string GetType(int script, int ruleStatus)
         {
             switch (ruleStatus)
             {
-                case RuleStatus.WordIdeo:
+                case BreakIterator.WordIdeo:
                     return WORD_IDEO;
-                case RuleStatus.WordKana: //RuleBasedBreakIterator.WORD_KANA:
+                case BreakIterator.WordKana: //RuleBasedBreakIterator.WORD_KANA:
                     return script == UScript.Hiragana ? WORD_HIRAGANA : WORD_KATAKANA;
-                case RuleStatus.WordLetter: //RuleBasedBreakIterator.WORD_LETTER:
+                case BreakIterator.WordLetter: //RuleBasedBreakIterator.WORD_LETTER:
                     return script == UScript.Hangul ? WORD_HANGUL : WORD_LETTER;
-                case RuleStatus.WordNumber: //RuleBasedBreakIterator.WORD_NUMBER:
+                case BreakIterator.WordNumber: //RuleBasedBreakIterator.WORD_NUMBER:
                     return WORD_NUMBER;
                 default: /* some other custom code */
                     return "<OTHER>";
diff --git a/src/Lucene.Net.Analysis.ICU/Analysis/Icu/Segmentation/ICUTokenizerConfig.cs b/src/Lucene.Net.Analysis.ICU/Analysis/Icu/Segmentation/ICUTokenizerConfig.cs
index c65b7f8..e8014f5 100644
--- a/src/Lucene.Net.Analysis.ICU/Analysis/Icu/Segmentation/ICUTokenizerConfig.cs
+++ b/src/Lucene.Net.Analysis.ICU/Analysis/Icu/Segmentation/ICUTokenizerConfig.cs
@@ -42,7 +42,7 @@ namespace Lucene.Net.Analysis.Icu.Segmentation
         /// <summary>
         /// Return a token type value for a given script and BreakIterator rule status.
         /// </summary>
-        public abstract string GetType(int script, RuleStatus ruleStatus);
+        public abstract string GetType(int script, int ruleStatus);
         /// <summary>
         /// true if Han, Hiragana, and Katakana scripts should all be returned as Japanese
         /// </summary>