lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [7/9] lucenenet git commit: Lucene.Net.Analysis.Hu refactor: member accessibility and documentation comments
Date Fri, 03 Feb 2017 09:33:18 GMT
Lucene.Net.Analysis.Hu refactor: member accessibility and documentation comments


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

Branch: refs/heads/api-work
Commit: 50853b4711f65da5485e347ce551f51110206002
Parents: ce43351
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Fri Feb 3 15:41:43 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Fri Feb 3 15:41:43 2017 +0700

----------------------------------------------------------------------
 .../Analysis/Hu/HungarianAnalyzer.cs            | 10 ++---
 .../Analysis/Hu/HungarianLightStemFilter.cs     |  4 +-
 .../Hu/HungarianLightStemFilterFactory.cs       |  5 +--
 .../Analysis/Hu/HungarianLightStemmer.cs        | 42 ++++++++++----------
 4 files changed, 30 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/50853b47/src/Lucene.Net.Analysis.Common/Analysis/Hu/HungarianAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Hu/HungarianAnalyzer.cs b/src/Lucene.Net.Analysis.Common/Analysis/Hu/HungarianAnalyzer.cs
index 46fc2ec..9d9cdd5 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Hu/HungarianAnalyzer.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Hu/HungarianAnalyzer.cs
@@ -51,7 +51,7 @@ namespace Lucene.Net.Analysis.Hu
         }
 
         /// <summary>
-        /// Atomically loads the DEFAULT_STOP_SET in a lazy fashion once the outer class

+        /// Atomically loads the <see cref="DEFAULT_STOP_SET"/> in a lazy fashion once
the outer class 
         /// accesses the static final set the first time.;
         /// </summary>
         private class DefaultSetHolder
@@ -79,7 +79,7 @@ namespace Lucene.Net.Analysis.Hu
         }
 
         /// <summary>
-        /// Builds an analyzer with the default stop words: <see cref="#DEFAULT_STOPWORD_FILE"/>.
+        /// Builds an analyzer with the default stop words: <see cref="DEFAULT_STOPWORD_FILE"/>.
         /// </summary>
         public HungarianAnalyzer(LuceneVersion matchVersion)
               : this(matchVersion, DefaultSetHolder.DEFAULT_STOP_SET)
@@ -113,13 +113,13 @@ namespace Lucene.Net.Analysis.Hu
         /// <summary>
         /// Creates a
         /// <see cref="Analyzer.TokenStreamComponents"/>
-        /// which tokenizes all the text in the provided <see cref="Reader"/>.
+        /// which tokenizes all the text in the provided <see cref="TextReader"/>.
         /// </summary>
         /// <returns> A
         ///         <see cref="Analyzer.TokenStreamComponents"/>
         ///         built from an <see cref="StandardTokenizer"/> filtered with
-        ///         <see cref="StandardFilter"/>, <see cref="LowerCaseFilter"/>,
<see cref="StopFilter"/>
-        ///         , <see cref="SetKeywordMarkerFilter"/> if a stem exclusion set
is
+        ///         <see cref="StandardFilter"/>, <see cref="LowerCaseFilter"/>,
<see cref="StopFilter"/>,
+        ///         <see cref="SetKeywordMarkerFilter"/> if a stem exclusion set is
         ///         provided and <see cref="SnowballFilter"/>. </returns>
         protected override TokenStreamComponents CreateComponents(string fieldName, TextReader
reader)
         {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/50853b47/src/Lucene.Net.Analysis.Common/Analysis/Hu/HungarianLightStemFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Hu/HungarianLightStemFilter.cs b/src/Lucene.Net.Analysis.Common/Analysis/Hu/HungarianLightStemFilter.cs
index 43f33a1..eb95edb 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Hu/HungarianLightStemFilter.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Hu/HungarianLightStemFilter.cs
@@ -25,7 +25,7 @@ namespace Lucene.Net.Analysis.Hu
     /// Hungarian words.
     /// <para>
     /// To prevent terms from being stemmed use an instance of
-    /// <see cref="SetKeywordMarkerFilter"/> or a custom <see cref="TokenFilter"/>
that sets
+    /// <see cref="Miscellaneous.SetKeywordMarkerFilter"/> or a custom <see cref="TokenFilter"/>
that sets
     /// the <see cref="KeywordAttribute"/> before this <see cref="TokenStream"/>.
     /// </para>
     /// </summary>
@@ -48,7 +48,7 @@ namespace Lucene.Net.Analysis.Hu
             {
                 if (!keywordAttr.IsKeyword)
                 {
-                    int newlen = stemmer.stem(termAtt.Buffer, termAtt.Length);
+                    int newlen = stemmer.Stem(termAtt.Buffer, termAtt.Length);
                     termAtt.Length = newlen;
                 }
                 return true;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/50853b47/src/Lucene.Net.Analysis.Common/Analysis/Hu/HungarianLightStemFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Hu/HungarianLightStemFilterFactory.cs
b/src/Lucene.Net.Analysis.Common/Analysis/Hu/HungarianLightStemFilterFactory.cs
index 2664d63..89f6bfe 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Hu/HungarianLightStemFilterFactory.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Hu/HungarianLightStemFilterFactory.cs
@@ -34,11 +34,10 @@ namespace Lucene.Net.Analysis.Hu
     /// </summary>
     public class HungarianLightStemFilterFactory : TokenFilterFactory
     {
-
         /// <summary>
-        /// Creates a new HungarianLightStemFilterFactory </summary>
+        /// Creates a new <see cref="HungarianLightStemFilterFactory"/> </summary>
         public HungarianLightStemFilterFactory(IDictionary<string, string> args)
-              : base(args)
+            : base(args)
         {
             if (args.Count > 0)
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/50853b47/src/Lucene.Net.Analysis.Common/Analysis/Hu/HungarianLightStemmer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Hu/HungarianLightStemmer.cs b/src/Lucene.Net.Analysis.Common/Analysis/Hu/HungarianLightStemmer.cs
index 6a590ae..bd9636f 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Hu/HungarianLightStemmer.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Hu/HungarianLightStemmer.cs
@@ -59,13 +59,13 @@ namespace Lucene.Net.Analysis.Hu
     /// Light Stemmer for Hungarian.
     /// <para>
     /// This stemmer implements the "UniNE" algorithm in:
-    /// <i>Light Stemming Approaches for the French, Portuguese, German and Hungarian
Languages</i>
+    /// <c>Light Stemming Approaches for the French, Portuguese, German and Hungarian
Languages</c>
     /// Jacques Savoy
     /// </para>
     /// </summary>
     public class HungarianLightStemmer
     {
-        public virtual int stem(char[] s, int len)
+        public virtual int Stem(char[] s, int len)
         {
             for (int i = 0; i < len; i++)
             {
@@ -97,13 +97,13 @@ namespace Lucene.Net.Analysis.Hu
                 }
             }
 
-            len = removeCase(s, len);
-            len = removePossessive(s, len);
-            len = removePlural(s, len);
-            return normalize(s, len);
+            len = RemoveCase(s, len);
+            len = RemovePossessive(s, len);
+            len = RemovePlural(s, len);
+            return Normalize(s, len);
         }
 
-        private int removeCase(char[] s, int len)
+        private int RemoveCase(char[] s, int len)
         {
             if (len > 6 && StemmerUtil.EndsWith(s, len, "kent"))
             {
@@ -119,7 +119,7 @@ namespace Lucene.Net.Analysis.Hu
 
                 if (StemmerUtil.EndsWith(s, len, "al") || StemmerUtil.EndsWith(s, len, "el"))
                 {
-                    if (!isVowel(s[len - 3]) && s[len - 3] == s[len - 4])
+                    if (!IsVowel(s[len - 3]) && s[len - 3] == s[len - 4])
                     {
                         return len - 3;
                     }
@@ -133,7 +133,7 @@ namespace Lucene.Net.Analysis.Hu
                     return len - 2;
                 }
 
-                if ((StemmerUtil.EndsWith(s, len, "on") || StemmerUtil.EndsWith(s, len, "en"))
&& !isVowel(s[len - 3]))
+                if ((StemmerUtil.EndsWith(s, len, "on") || StemmerUtil.EndsWith(s, len, "en"))
&& !IsVowel(s[len - 3]))
                 {
                     return len - 2;
                 }
@@ -145,7 +145,7 @@ namespace Lucene.Net.Analysis.Hu
                         return len - 1;
                     case 'a':
                     case 'e':
-                        if (s[len - 2] == s[len - 3] && !isVowel(s[len - 2]))
+                        if (s[len - 2] == s[len - 3] && !IsVowel(s[len - 2]))
                         {
                             return len - 2;
                         }
@@ -156,11 +156,11 @@ namespace Lucene.Net.Analysis.Hu
             return len;
         }
 
-        private int removePossessive(char[] s, int len)
+        private int RemovePossessive(char[] s, int len)
         {
             if (len > 6)
             {
-                if (!isVowel(s[len - 5]) && (StemmerUtil.EndsWith(s, len, "atok")
|| StemmerUtil.EndsWith(s, len, "otok") || StemmerUtil.EndsWith(s, len, "etek")))
+                if (!IsVowel(s[len - 5]) && (StemmerUtil.EndsWith(s, len, "atok")
|| StemmerUtil.EndsWith(s, len, "otok") || StemmerUtil.EndsWith(s, len, "etek")))
                 {
                     return len - 4;
                 }
@@ -173,12 +173,12 @@ namespace Lucene.Net.Analysis.Hu
 
             if (len > 5)
             {
-                if (!isVowel(s[len - 4]) && (StemmerUtil.EndsWith(s, len, "unk")
|| StemmerUtil.EndsWith(s, len, "tok") || StemmerUtil.EndsWith(s, len, "tek")))
+                if (!IsVowel(s[len - 4]) && (StemmerUtil.EndsWith(s, len, "unk")
|| StemmerUtil.EndsWith(s, len, "tok") || StemmerUtil.EndsWith(s, len, "tek")))
                 {
                     return len - 3;
                 }
 
-                if (isVowel(s[len - 4]) && StemmerUtil.EndsWith(s, len, "juk"))
+                if (IsVowel(s[len - 4]) && StemmerUtil.EndsWith(s, len, "juk"))
                 {
                     return len - 3;
                 }
@@ -191,12 +191,12 @@ namespace Lucene.Net.Analysis.Hu
 
             if (len > 4)
             {
-                if (!isVowel(s[len - 3]) && (StemmerUtil.EndsWith(s, len, "am") ||
StemmerUtil.EndsWith(s, len, "em") || StemmerUtil.EndsWith(s, len, "om") || StemmerUtil.EndsWith(s,
len, "ad") || StemmerUtil.EndsWith(s, len, "ed") || StemmerUtil.EndsWith(s, len, "od") ||
StemmerUtil.EndsWith(s, len, "uk")))
+                if (!IsVowel(s[len - 3]) && (StemmerUtil.EndsWith(s, len, "am") ||
StemmerUtil.EndsWith(s, len, "em") || StemmerUtil.EndsWith(s, len, "om") || StemmerUtil.EndsWith(s,
len, "ad") || StemmerUtil.EndsWith(s, len, "ed") || StemmerUtil.EndsWith(s, len, "od") ||
StemmerUtil.EndsWith(s, len, "uk")))
                 {
                     return len - 2;
                 }
 
-                if (isVowel(s[len - 3]) && (StemmerUtil.EndsWith(s, len, "nk") ||
StemmerUtil.EndsWith(s, len, "ja") || StemmerUtil.EndsWith(s, len, "je")))
+                if (IsVowel(s[len - 3]) && (StemmerUtil.EndsWith(s, len, "nk") ||
StemmerUtil.EndsWith(s, len, "ja") || StemmerUtil.EndsWith(s, len, "je")))
                 {
                     return len - 2;
                 }
@@ -213,14 +213,14 @@ namespace Lucene.Net.Analysis.Hu
                 {
                     case 'a':
                     case 'e':
-                        if (!isVowel(s[len - 2]))
+                        if (!IsVowel(s[len - 2]))
                         {
                             return len - 1;
                         }
                         break;
                     case 'm':
                     case 'd':
-                        if (isVowel(s[len - 2]))
+                        if (IsVowel(s[len - 2]))
                         {
                             return len - 1;
                         }
@@ -233,7 +233,7 @@ namespace Lucene.Net.Analysis.Hu
             return len;
         }
 
-        private int removePlural(char[] s, int len)
+        private int RemovePlural(char[] s, int len)
         {
             if (len > 3 && s[len - 1] == 'k')
             {
@@ -254,7 +254,7 @@ namespace Lucene.Net.Analysis.Hu
             return len;
         }
 
-        private int normalize(char[] s, int len)
+        private int Normalize(char[] s, int len)
         {
             if (len > 3)
             {
@@ -270,7 +270,7 @@ namespace Lucene.Net.Analysis.Hu
             return len;
         }
 
-        private bool isVowel(char ch)
+        private bool IsVowel(char ch)
         {
             switch (ch)
             {


Mime
View raw message