lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [2/8] lucenenet git commit: Lucene.Net.Analysis.Payloads refactor: member accessibility and documentation comments
Date Fri, 03 Feb 2017 21:06:37 GMT
Lucene.Net.Analysis.Payloads 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/cdff5aae
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/cdff5aae
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/cdff5aae

Branch: refs/heads/api-work
Commit: cdff5aaeced753eacd72f0b217d91e795122bc2d
Parents: d60de97
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Sat Feb 4 03:00:15 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Sat Feb 4 03:00:15 2017 +0700

----------------------------------------------------------------------
 .../Analysis/Payloads/AbstractEncoder.cs                |  3 +--
 .../Analysis/Payloads/DelimitedPayloadTokenFilter.cs    | 12 ++++++------
 .../Payloads/DelimitedPayloadTokenFilterFactory.cs      |  2 +-
 .../Analysis/Payloads/FloatEncoder.cs                   |  9 +++------
 .../Analysis/Payloads/IdentityEncoder.cs                |  2 --
 .../Analysis/Payloads/IntegerEncoder.cs                 |  9 +++------
 .../Analysis/Payloads/NumericPayloadTokenFilter.cs      | 10 ++++------
 .../Payloads/NumericPayloadTokenFilterFactory.cs        |  2 +-
 .../Analysis/Payloads/PayloadEncoder.cs                 |  6 ++----
 .../Analysis/Payloads/PayloadHelper.cs                  | 11 ++++-------
 .../Analysis/Payloads/TokenOffsetPayloadTokenFilter.cs  |  9 +++------
 .../Payloads/TokenOffsetPayloadTokenFilterFactory.cs    |  5 ++---
 .../Analysis/Payloads/TypeAsPayloadTokenFilter.cs       | 10 ++++------
 .../Payloads/TypeAsPayloadTokenFilterFactory.cs         |  5 ++---
 14 files changed, 36 insertions(+), 59 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cdff5aae/src/Lucene.Net.Analysis.Common/Analysis/Payloads/AbstractEncoder.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Payloads/AbstractEncoder.cs b/src/Lucene.Net.Analysis.Common/Analysis/Payloads/AbstractEncoder.cs
index 708b7b2..42836e9 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Payloads/AbstractEncoder.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Payloads/AbstractEncoder.cs
@@ -21,12 +21,11 @@ namespace Lucene.Net.Analysis.Payloads
 
     /// <summary>
     /// Base class for payload encoders.
-    /// 
-    /// 
     /// </summary>
     public abstract class AbstractEncoder : IPayloadEncoder
     {
         public abstract BytesRef Encode(char[] buffer, int offset, int length);
+
         public virtual BytesRef Encode(char[] buffer)
         {
             return Encode(buffer, 0, buffer.Length);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cdff5aae/src/Lucene.Net.Analysis.Common/Analysis/Payloads/DelimitedPayloadTokenFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Payloads/DelimitedPayloadTokenFilter.cs
b/src/Lucene.Net.Analysis.Common/Analysis/Payloads/DelimitedPayloadTokenFilter.cs
index 1e1b5de..225c026 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Payloads/DelimitedPayloadTokenFilter.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Payloads/DelimitedPayloadTokenFilter.cs
@@ -21,15 +21,15 @@ namespace Lucene.Net.Analysis.Payloads
 
     /// <summary>
     /// Characters before the delimiter are the "token", those after are the payload.
-    /// <p/>
+    /// <para/>
     /// For example, if the delimiter is '|', then for the string "foo|bar", foo is the token
     /// and "bar" is a payload.
-    /// <p/>
-    /// Note, you can also include a <see cref="org.apache.lucene.analysis.payloads.PayloadEncoder"/>
to convert the payload in an appropriate way (from characters to bytes).
-    /// <p/>
-    /// Note make sure your Tokenizer doesn't split on the delimiter, or this won't work
+    /// <para/>
+    /// Note, you can also include a <see cref="IPayloadEncoder"/> to convert the payload
in an appropriate way (from characters to bytes).
+    /// <para/>
+    /// Note make sure your <see cref="Tokenizer"/> doesn't split on the delimiter,
or this won't work
     /// </summary>
-    /// <seealso cref= PayloadEncoder </seealso>
+    /// <seealso cref="IPayloadEncoder"/>
     public sealed class DelimitedPayloadTokenFilter : TokenFilter
     {
         public const char DEFAULT_DELIMITER = '|';

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cdff5aae/src/Lucene.Net.Analysis.Common/Analysis/Payloads/DelimitedPayloadTokenFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Payloads/DelimitedPayloadTokenFilterFactory.cs
b/src/Lucene.Net.Analysis.Common/Analysis/Payloads/DelimitedPayloadTokenFilterFactory.cs
index 5db15c9..429e9a8 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Payloads/DelimitedPayloadTokenFilterFactory.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Payloads/DelimitedPayloadTokenFilterFactory.cs
@@ -41,7 +41,7 @@ namespace Lucene.Net.Analysis.Payloads
         private IPayloadEncoder encoder;
 
         /// <summary>
-        /// Creates a new DelimitedPayloadTokenFilterFactory </summary>
+        /// Creates a new <see cref="DelimitedPayloadTokenFilterFactory"/> </summary>
         public DelimitedPayloadTokenFilterFactory(IDictionary<string, string> args)
             : base(args)
         {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cdff5aae/src/Lucene.Net.Analysis.Common/Analysis/Payloads/FloatEncoder.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Payloads/FloatEncoder.cs b/src/Lucene.Net.Analysis.Common/Analysis/Payloads/FloatEncoder.cs
index f3e38af..4a014d0 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Payloads/FloatEncoder.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Payloads/FloatEncoder.cs
@@ -21,14 +21,11 @@ namespace Lucene.Net.Analysis.Payloads
 	 */
 
     /// <summary>
-    ///  Encode a character array Float as a <see cref="BytesRef"/>.
-    /// <p/> </summary>
-    /// <seealso cref= org.apache.lucene.analysis.payloads.PayloadHelper#encodeFloat(float,
byte[], int)
-    /// 
-    ///  </seealso>
+    /// Encode a character array <see cref="float"/> as a <see cref="BytesRef"/>.
+    /// </summary>
+    /// <seealso cref="PayloadHelper.EncodeFloat(float, byte[], int)"/>
     public class FloatEncoder : AbstractEncoder, IPayloadEncoder
     {
-
         public override BytesRef Encode(char[] buffer, int offset, int length)
         {
             float payload = float.Parse(new string(buffer, offset, length)); //TODO: improve
this so that we don't have to new Strings

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cdff5aae/src/Lucene.Net.Analysis.Common/Analysis/Payloads/IdentityEncoder.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Payloads/IdentityEncoder.cs b/src/Lucene.Net.Analysis.Common/Analysis/Payloads/IdentityEncoder.cs
index 2382807..9488ab5 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Payloads/IdentityEncoder.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Payloads/IdentityEncoder.cs
@@ -22,8 +22,6 @@ namespace Lucene.Net.Analysis.Payloads
 
     /// <summary>
     ///  Does nothing other than convert the char array to a byte array using the specified
encoding.
-    /// 
-    /// 
     /// </summary>
     public class IdentityEncoder : AbstractEncoder, IPayloadEncoder
     {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cdff5aae/src/Lucene.Net.Analysis.Common/Analysis/Payloads/IntegerEncoder.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Payloads/IntegerEncoder.cs b/src/Lucene.Net.Analysis.Common/Analysis/Payloads/IntegerEncoder.cs
index 879279b..bb264a3 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Payloads/IntegerEncoder.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Payloads/IntegerEncoder.cs
@@ -21,15 +21,12 @@ namespace Lucene.Net.Analysis.Payloads
 	 */
 
     /// <summary>
-    ///  Encode a character array Integer as a <see cref="BytesRef"/>.
-    /// <p/>
-    /// See <see cref="org.apache.lucene.analysis.payloads.PayloadHelper#encodeInt(int,
byte[], int)"/>.
-    /// 
-    /// 
+    /// Encode a character array <see cref="int"/> as a <see cref="BytesRef"/>.
+    /// <para/>
+    /// See <see cref="PayloadHelper.EncodeInt(int, byte[], int)"/>.
     /// </summary>
     public class IntegerEncoder : AbstractEncoder, IPayloadEncoder
     {
-
         public override BytesRef Encode(char[] buffer, int offset, int length)
         {
             int payload = ArrayUtil.ParseInt(buffer, offset, length); //TODO: improve this
so that we don't have to new Strings

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cdff5aae/src/Lucene.Net.Analysis.Common/Analysis/Payloads/NumericPayloadTokenFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Payloads/NumericPayloadTokenFilter.cs
b/src/Lucene.Net.Analysis.Common/Analysis/Payloads/NumericPayloadTokenFilter.cs
index 5d3997d..6d678a7 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Payloads/NumericPayloadTokenFilter.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Payloads/NumericPayloadTokenFilter.cs
@@ -22,24 +22,22 @@ namespace Lucene.Net.Analysis.Payloads
 	 */
 
     /// <summary>
-    /// Assigns a payload to a token based on the <see cref="org.apache.lucene.analysis.Token#type()"/>
-    /// 
-    /// 
+    /// Assigns a payload to a token based on the <see cref="Token.Type"/>
     /// </summary>
     public class NumericPayloadTokenFilter : TokenFilter
     {
-
         private string typeMatch;
         private BytesRef thePayload;
 
         private readonly IPayloadAttribute payloadAtt;
         private readonly ITypeAttribute typeAtt;
 
-        public NumericPayloadTokenFilter(TokenStream input, float payload, string typeMatch)
: base(input)
+        public NumericPayloadTokenFilter(TokenStream input, float payload, string typeMatch)

+            : base(input)
         {
             if (typeMatch == null)
             {
-                throw new System.ArgumentException("typeMatch cannot be null");
+                throw new ArgumentException("typeMatch cannot be null");
             }
             //Need to encode the payload
             thePayload = new BytesRef(PayloadHelper.EncodeFloat(payload));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cdff5aae/src/Lucene.Net.Analysis.Common/Analysis/Payloads/NumericPayloadTokenFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Payloads/NumericPayloadTokenFilterFactory.cs
b/src/Lucene.Net.Analysis.Common/Analysis/Payloads/NumericPayloadTokenFilterFactory.cs
index 310ff0a..3412d80 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Payloads/NumericPayloadTokenFilterFactory.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Payloads/NumericPayloadTokenFilterFactory.cs
@@ -36,7 +36,7 @@ namespace Lucene.Net.Analysis.Payloads
         private readonly string typeMatch;
 
         /// <summary>
-        /// Creates a new NumericPayloadTokenFilterFactory </summary>
+        /// Creates a new <see cref="NumericPayloadTokenFilterFactory"/> </summary>
         public NumericPayloadTokenFilterFactory(IDictionary<string, string> args) :
base(args)
         {
             payload = RequireFloat(args, "payload");

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cdff5aae/src/Lucene.Net.Analysis.Common/Analysis/Payloads/PayloadEncoder.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Payloads/PayloadEncoder.cs b/src/Lucene.Net.Analysis.Common/Analysis/Payloads/PayloadEncoder.cs
index 3304dc9..5deace5 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Payloads/PayloadEncoder.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Payloads/PayloadEncoder.cs
@@ -20,12 +20,10 @@ namespace Lucene.Net.Analysis.Payloads
 	 */
 
     /// <summary>
-    /// Mainly for use with the DelimitedPayloadTokenFilter, converts char buffers to
+    /// Mainly for use with the <see cref="DelimitedPayloadTokenFilter"/>, converts
char buffers to
     /// <see cref="BytesRef"/>.
-    /// <p/>
+    /// <para/>
     /// NOTE: This interface is subject to change 
-    /// 
-    /// 
     /// </summary>
     public interface IPayloadEncoder
     {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cdff5aae/src/Lucene.Net.Analysis.Common/Analysis/Payloads/PayloadHelper.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Payloads/PayloadHelper.cs b/src/Lucene.Net.Analysis.Common/Analysis/Payloads/PayloadHelper.cs
index 7c861f0..1045489 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Payloads/PayloadHelper.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Payloads/PayloadHelper.cs
@@ -21,12 +21,9 @@ namespace Lucene.Net.Analysis.Payloads
 
     /// <summary>
     /// Utility methods for encoding payloads.
-    /// 
-    /// 
     /// </summary>
     public class PayloadHelper
     {
-
         public static byte[] EncodeFloat(float payload)
         {
             return EncodeFloat(payload, new byte[4], 0);
@@ -51,8 +48,8 @@ namespace Lucene.Net.Analysis.Payloads
             return data;
         }
 
-        /// <seealso cref= #decodeFloat(byte[], int) </seealso>
-        /// <seealso cref= #encodeFloat(float) </seealso>
+        /// <seealso cref="DecodeFloat(byte[], int)"/>
+        /// <seealso cref="EncodeFloat(float)"/>
         /// <returns> the decoded float </returns>
         public static float DecodeFloat(byte[] bytes)
         {
@@ -60,13 +57,13 @@ namespace Lucene.Net.Analysis.Payloads
         }
 
         /// <summary>
-        /// Decode the payload that was encoded using <see cref="#encodeFloat(float)"/>.
+        /// Decode the payload that was encoded using <see cref="EncodeFloat(float)"/>.
         /// NOTE: the length of the array must be at least offset + 4 long. </summary>
         /// <param name="bytes"> The bytes to decode </param>
         /// <param name="offset"> The offset into the array. </param>
         /// <returns> The float that was encoded
         /// </returns>
-        /// <seealso cref= #encodeFloat(float) </seealso>
+        /// <seealso cref="EncodeFloat(float)"/>
         public static float DecodeFloat(byte[] bytes, int offset)
         {
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cdff5aae/src/Lucene.Net.Analysis.Common/Analysis/Payloads/TokenOffsetPayloadTokenFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Payloads/TokenOffsetPayloadTokenFilter.cs
b/src/Lucene.Net.Analysis.Common/Analysis/Payloads/TokenOffsetPayloadTokenFilter.cs
index cffa398..a68aeb6 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Payloads/TokenOffsetPayloadTokenFilter.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Payloads/TokenOffsetPayloadTokenFilter.cs
@@ -1,6 +1,5 @@
 ´╗┐using Lucene.Net.Analysis.TokenAttributes;
 using Lucene.Net.Util;
-using System;
 
 namespace Lucene.Net.Analysis.Payloads
 {
@@ -22,11 +21,9 @@ namespace Lucene.Net.Analysis.Payloads
 	 */
 
     /// <summary>
-    /// Adds the <see cref="OffsetAttribute#startOffset()"/>
-    /// and <see cref="OffsetAttribute#endOffset()"/>
+    /// Adds the <see cref="OffsetAttribute.StartOffset"/>
+    /// and <see cref="OffsetAttribute.EndOffset"/>
     /// First 4 bytes are the start
-    /// 
-    /// 
     /// </summary>
     public class TokenOffsetPayloadTokenFilter : TokenFilter
     {
@@ -34,7 +31,7 @@ namespace Lucene.Net.Analysis.Payloads
         private readonly IPayloadAttribute payAtt;
 
         public TokenOffsetPayloadTokenFilter(TokenStream input)
-              : base(input)
+            : base(input)
         {
             offsetAtt = AddAttribute<IOffsetAttribute>();
             payAtt = AddAttribute<IPayloadAttribute>();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cdff5aae/src/Lucene.Net.Analysis.Common/Analysis/Payloads/TokenOffsetPayloadTokenFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Payloads/TokenOffsetPayloadTokenFilterFactory.cs
b/src/Lucene.Net.Analysis.Common/Analysis/Payloads/TokenOffsetPayloadTokenFilterFactory.cs
index 111feef..ea7eb25 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Payloads/TokenOffsetPayloadTokenFilterFactory.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Payloads/TokenOffsetPayloadTokenFilterFactory.cs
@@ -32,11 +32,10 @@ namespace Lucene.Net.Analysis.Payloads
     /// </summary>
     public class TokenOffsetPayloadTokenFilterFactory : TokenFilterFactory
     {
-
         /// <summary>
-        /// Creates a new TokenOffsetPayloadTokenFilterFactory </summary>
+        /// Creates a new <see cref="TokenOffsetPayloadTokenFilterFactory"/> </summary>
         public TokenOffsetPayloadTokenFilterFactory(IDictionary<string, string> args)
-              : base(args)
+            : base(args)
         {
             if (args.Count > 0)
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cdff5aae/src/Lucene.Net.Analysis.Common/Analysis/Payloads/TypeAsPayloadTokenFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Payloads/TypeAsPayloadTokenFilter.cs
b/src/Lucene.Net.Analysis.Common/Analysis/Payloads/TypeAsPayloadTokenFilter.cs
index 2b3b076..d472f65 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Payloads/TypeAsPayloadTokenFilter.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Payloads/TypeAsPayloadTokenFilter.cs
@@ -21,11 +21,9 @@ namespace Lucene.Net.Analysis.Payloads
 	 */
 
     /// <summary>
-    /// Makes the <see cref="org.apache.lucene.analysis.Token#type()"/> a payload.
-    /// 
-    /// Encodes the type using <see cref="String#getBytes(String)"/> with "UTF-8" as
the encoding
-    /// 
-    /// 
+    /// Makes the <see cref="Token.Type"/> a payload.
+    /// <para/>
+    /// Encodes the type using System.Text.Encoding.UTF8.GetBytes(string)
     /// </summary>
     public class TypeAsPayloadTokenFilter : TokenFilter
     {
@@ -33,7 +31,7 @@ namespace Lucene.Net.Analysis.Payloads
         private readonly ITypeAttribute typeAtt;
 
         public TypeAsPayloadTokenFilter(TokenStream input)
-              : base(input)
+            : base(input)
         {
             payloadAtt = AddAttribute<IPayloadAttribute>();
             typeAtt = AddAttribute<ITypeAttribute>();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cdff5aae/src/Lucene.Net.Analysis.Common/Analysis/Payloads/TypeAsPayloadTokenFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Payloads/TypeAsPayloadTokenFilterFactory.cs
b/src/Lucene.Net.Analysis.Common/Analysis/Payloads/TypeAsPayloadTokenFilterFactory.cs
index a990d0a..8bcc0de 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Payloads/TypeAsPayloadTokenFilterFactory.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Payloads/TypeAsPayloadTokenFilterFactory.cs
@@ -32,11 +32,10 @@ namespace Lucene.Net.Analysis.Payloads
     /// </summary>
     public class TypeAsPayloadTokenFilterFactory : TokenFilterFactory
     {
-
         /// <summary>
-        /// Creates a new TypeAsPayloadTokenFilterFactory </summary>
+        /// Creates a new <see cref="TypeAsPayloadTokenFilterFactory"/> </summary>
         public TypeAsPayloadTokenFilterFactory(IDictionary<string, string> args)
-              : base(args)
+            : base(args)
         {
             if (args.Count > 0)
             {


Mime
View raw message