lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [2/4] lucenenet git commit: More Analysis porting fixes
Date Sun, 09 Nov 2014 04:47:58 GMT
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cd3ee136/src/Lucene.Net.Analysis.Common/Analysis/Ngram/EdgeNGramTokenFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Ngram/EdgeNGramTokenFilter.cs b/src/Lucene.Net.Analysis.Common/Analysis/Ngram/EdgeNGramTokenFilter.cs
index 0b6dc5a..5c1d0bb 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Ngram/EdgeNGramTokenFilter.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Ngram/EdgeNGramTokenFilter.cs
@@ -1,6 +1,12 @@
 using System;
-
-namespace org.apache.lucene.analysis.ngram
+using Lucene.Net.Analysis.Tokenattributes;
+using Lucene.Net.Analysis.Util;
+using Lucene.Net.Util;
+using org.apache.lucene.analysis.reverse;
+using org.apache.lucene.analysis.util;
+using Version = Lucene.Net.Util.Version;
+
+namespace Lucene.Net.Analysis.Ngram
 {
 
 	/*
@@ -19,16 +25,7 @@ namespace org.apache.lucene.analysis.ngram
 	 * See the License for the specific language governing permissions and
 	 * limitations under the License.
 	 */
-
-	using ReverseStringFilter = org.apache.lucene.analysis.reverse.ReverseStringFilter;
-	using OffsetAttribute = org.apache.lucene.analysis.tokenattributes.OffsetAttribute;
-	using CharTermAttribute = org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
-	using PositionIncrementAttribute = org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
-	using PositionLengthAttribute = org.apache.lucene.analysis.tokenattributes.PositionLengthAttribute;
-	using CharacterUtils = org.apache.lucene.analysis.util.CharacterUtils;
-	using Version = org.apache.lucene.util.Version;
-
-	/// <summary>
+    /// <summary>
 	/// Tokenizes the given token into n-grams of given size(s).
 	/// <para>
 	/// This <seealso cref="TokenFilter"/> create n-grams from the beginning edge or ending edge of a input token.
@@ -45,35 +42,21 @@ namespace org.apache.lucene.analysis.ngram
 	  public const int DEFAULT_MAX_GRAM_SIZE = 1;
 	  public const int DEFAULT_MIN_GRAM_SIZE = 1;
 
-	  /// <summary>
-	  /// Specifies which side of the input the n-gram should be generated from </summary>
-	  public enum Side
-	  {
+	    /// <summary>
+	    /// Specifies which side of the input the n-gram should be generated from </summary>
+	    public enum Side
+	    {
 
-		/// <summary>
-		/// Get the n-gram from the front of the input </summary>
-//JAVA TO C# CONVERTER TODO TASK: The following line could not be converted:
-		FRONT
-		{
-		  public String getLabel() { return "front"
-		}
-	  },
+	        /// <summary>
+	        /// Get the n-gram from the front of the input </summary>
+	        FRONT,
 
-		/// <summary>
-		/// Get the n-gram from the end of the input </summary>
-		[System.Obsolete]
-//JAVA TO C# CONVERTER TODO TASK: The following line could not be converted:
-		@Deprecated BACK
-		{
-			public String getLabel()
-			{
-				return "back";
-			}
-		}
-
-		public = 
+	        /// <summary>
+	        /// Get the n-gram from the end of the input </summary>
+	        [System.Obsolete] BACK,
+	    }
 
-		// Get the appropriate Side from a string
+	    // Get the appropriate Side from a string
 		public static Side getSide(String sideName)
 		{
 //JAVA TO C# CONVERTER TODO TASK: The following line could not be converted:
@@ -88,7 +71,6 @@ namespace org.apache.lucene.analysis.ngram
 		  }
 		  return null;
 		}
-	}
 
 	  private readonly Version version;
 	  private readonly CharacterUtils charUtils;
@@ -127,7 +109,7 @@ namespace org.apache.lucene.analysis.ngram
 		  throw new System.ArgumentException("version must not be null");
 		}
 
-		if (version.onOrAfter(Version.LUCENE_44) && side == Side.BACK)
+		if (version.OnOrAfter(Version.LUCENE_44) && side == Side.BACK)
 		{
 		  throw new System.ArgumentException("Side.BACK is not supported anymore as of Lucene 4.4, use ReverseStringFilter up-front and afterward");
 		}
@@ -178,27 +160,25 @@ namespace org.apache.lucene.analysis.ngram
 	  {
 	  }
 
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: @Override public final boolean incrementToken() throws java.io.IOException
-	  public override bool incrementToken()
+	  public override bool IncrementToken()
 	  {
 		while (true)
 		{
 		  if (curTermBuffer == null)
 		  {
-			if (!input.incrementToken())
+			if (!input.IncrementToken())
 			{
 			  return false;
 			}
 			else
 			{
-			  curTermBuffer = termAtt.buffer().clone();
-			  curTermLength = termAtt.length();
+			  curTermBuffer = termAtt.Buffer().Clone();
+			  curTermLength = termAtt.Length();
 			  curCodePointCount = charUtils.codePointCount(termAtt);
 			  curGramSize = minGram;
-			  tokStart = offsetAtt.startOffset();
-			  tokEnd = offsetAtt.endOffset();
-			  if (version.onOrAfter(Version.LUCENE_44))
+			  tokStart = offsetAtt.StartOffset();
+			  tokEnd = offsetAtt.EndOffset();
+			  if (version.OnOrAfter(Version.LUCENE_44))
 			  {
 				// Never update offsets
 				updateOffsets = false;
@@ -218,20 +198,16 @@ namespace org.apache.lucene.analysis.ngram
 			if (curGramSize <= curCodePointCount) // if the remaining input is too short, we can't generate any n-grams
 			{
 			  // grab gramSize chars from front or back
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final int start = side == Side.FRONT ? 0 : charUtils.offsetByCodePoints(curTermBuffer, 0, curTermLength, curTermLength, -curGramSize);
 			  int start = side == Side.FRONT ? 0 : charUtils.offsetByCodePoints(curTermBuffer, 0, curTermLength, curTermLength, -curGramSize);
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final int end = charUtils.offsetByCodePoints(curTermBuffer, 0, curTermLength, start, curGramSize);
 			  int end = charUtils.offsetByCodePoints(curTermBuffer, 0, curTermLength, start, curGramSize);
-			  clearAttributes();
+			  ClearAttributes();
 			  if (updateOffsets)
 			  {
-				offsetAtt.setOffset(tokStart + start, tokStart + end);
+				offsetAtt.SetOffset(tokStart + start, tokStart + end);
 			  }
 			  else
 			  {
-				offsetAtt.setOffset(tokStart, tokEnd);
+				offsetAtt.SetOffset(tokStart, tokEnd);
 			  }
 			  // first ngram gets increment, others don't
 			  if (curGramSize == minGram)
@@ -244,7 +220,7 @@ namespace org.apache.lucene.analysis.ngram
 				posIncrAtt.PositionIncrement = 0;
 			  }
 			  posLenAtt.PositionLength = savePosLen;
-			  termAtt.copyBuffer(curTermBuffer, start, end - start);
+			  termAtt.CopyBuffer(curTermBuffer, start, end - start);
 			  curGramSize++;
 			  return true;
 			}
@@ -253,14 +229,11 @@ namespace org.apache.lucene.analysis.ngram
 		}
 	  }
 
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: @Override public void reset() throws java.io.IOException
-	  public override void reset()
+	  public override void Reset()
 	  {
-		base.reset();
+		base.Reset();
 		curTermBuffer = null;
 		savePosIncr = 0;
 	  }
 }
-
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cd3ee136/src/Lucene.Net.Analysis.Common/Analysis/Ngram/EdgeNGramTokenizerFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Ngram/EdgeNGramTokenizerFactory.cs b/src/Lucene.Net.Analysis.Common/Analysis/Ngram/EdgeNGramTokenizerFactory.cs
index 195a6e1..23bf8c5 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Ngram/EdgeNGramTokenizerFactory.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Ngram/EdgeNGramTokenizerFactory.cs
@@ -1,7 +1,10 @@
 using System.Collections.Generic;
-using TokenizerFactory = Lucene.Net.Analysis.Util.TokenizerFactory;
+using System.IO;
+using Lucene.Net.Analysis.Util;
+using Lucene.Net.Util;
+using org.apache.lucene.analysis.ngram;
 
-namespace org.apache.lucene.analysis.ngram
+namespace Lucene.Net.Analysis.Ngram
 {
 
 	/*
@@ -20,13 +23,7 @@ namespace org.apache.lucene.analysis.ngram
 	 * See the License for the specific language governing permissions and
 	 * limitations under the License.
 	 */
-
-
-	using TokenizerFactory = TokenizerFactory;
-	using AttributeFactory = org.apache.lucene.util.AttributeSource.AttributeFactory;
-	using Version = org.apache.lucene.util.Version;
-
-	/// <summary>
+    /// <summary>
 	/// Creates new instances of <seealso cref="EdgeNGramTokenizer"/>.
 	/// <pre class="prettyprint">
 	/// &lt;fieldType name="text_edgngrm" class="solr.TextField" positionIncrementGap="100"&gt;
@@ -54,9 +51,9 @@ namespace org.apache.lucene.analysis.ngram
 		}
 	  }
 
-	  public override Tokenizer create(AttributeFactory factory, Reader input)
+	  public override Tokenizer Create(AttributeSource.AttributeFactory factory, TextReader input)
 	  {
-		if (luceneMatchVersion.onOrAfter(Version.LUCENE_44))
+		if (luceneMatchVersion.OnOrAfter(Version.LUCENE_44))
 		{
 		  if (!EdgeNGramTokenFilter.Side.FRONT.Label.Equals(side))
 		  {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cd3ee136/src/Lucene.Net.Analysis.Common/Analysis/Ngram/NGramTokenFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Ngram/NGramTokenFilter.cs b/src/Lucene.Net.Analysis.Common/Analysis/Ngram/NGramTokenFilter.cs
index 3e7012c..59b8dcb 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Ngram/NGramTokenFilter.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Ngram/NGramTokenFilter.cs
@@ -1,4 +1,6 @@
-namespace org.apache.lucene.analysis.ngram
+using Lucene.Net.Analysis.Util;
+
+namespace org.apache.lucene.analysis.ngram
 {
 
 	/*
@@ -23,7 +25,7 @@
 	using OffsetAttribute = org.apache.lucene.analysis.tokenattributes.OffsetAttribute;
 	using PositionIncrementAttribute = org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
 	using PositionLengthAttribute = org.apache.lucene.analysis.tokenattributes.PositionLengthAttribute;
-	using CharacterUtils = org.apache.lucene.analysis.util.CharacterUtils;
+	using CharacterUtils = CharacterUtils;
 	using Version = org.apache.lucene.util.Version;
 
 	/// <summary>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cd3ee136/src/Lucene.Net.Analysis.Common/Analysis/Ngram/NGramTokenizer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Ngram/NGramTokenizer.cs b/src/Lucene.Net.Analysis.Common/Analysis/Ngram/NGramTokenizer.cs
index b782e94..37d6102 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Ngram/NGramTokenizer.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Ngram/NGramTokenizer.cs
@@ -1,5 +1,6 @@
 using System;
 using System.Diagnostics;
+using Lucene.Net.Analysis.Util;
 
 namespace org.apache.lucene.analysis.ngram
 {
@@ -26,7 +27,7 @@ namespace org.apache.lucene.analysis.ngram
 	using OffsetAttribute = org.apache.lucene.analysis.tokenattributes.OffsetAttribute;
 	using PositionIncrementAttribute = org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
 	using PositionLengthAttribute = org.apache.lucene.analysis.tokenattributes.PositionLengthAttribute;
-	using CharacterUtils = org.apache.lucene.analysis.util.CharacterUtils;
+	using CharacterUtils = CharacterUtils;
 	using Version = org.apache.lucene.util.Version;
 
 	/// <summary>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cd3ee136/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 4d5dd75..ec0e412 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Payloads/DelimitedPayloadTokenFilterFactory.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Payloads/DelimitedPayloadTokenFilterFactory.cs
@@ -1,85 +1,82 @@
 using System.Collections.Generic;
-using TokenFilterFactory = Lucene.Net.Analysis.Util.TokenFilterFactory;
+using Lucene.Net.Analysis.Util;
+using org.apache.lucene.analysis.payloads;
 
-namespace org.apache.lucene.analysis.payloads
+namespace Lucene.Net.Analysis.Payloads
 {
 
-	/*
-	 * Licensed to the Apache Software Foundation (ASF) under one or more
-	 * contributor license agreements.  See the NOTICE file distributed with
-	 * this work for additional information regarding copyright ownership.
-	 * The ASF licenses this file to You under the Apache License, Version 2.0
-	 * (the "License"); you may not use this file except in compliance with
-	 * the License.  You may obtain a copy of the License at
-	 *
-	 *     http://www.apache.org/licenses/LICENSE-2.0
-	 *
-	 * Unless required by applicable law or agreed to in writing, software
-	 * distributed under the License is distributed on an "AS IS" BASIS,
-	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-	 * See the License for the specific language governing permissions and
-	 * limitations under the License.
-	 */
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+    /// <summary>
+    /// Factory for <seealso cref="DelimitedPayloadTokenFilter"/>.
+    /// <pre class="prettyprint">
+    /// &lt;fieldType name="text_dlmtd" class="solr.TextField" positionIncrementGap="100"&gt;
+    ///   &lt;analyzer&gt;
+    ///     &lt;tokenizer class="solr.WhitespaceTokenizerFactory"/&gt;
+    ///     &lt;filter class="solr.DelimitedPayloadTokenFilterFactory" encoder="float" delimiter="|"/&gt;
+    ///   &lt;/analyzer&gt;
+    /// &lt;/fieldType&gt;</pre>
+    /// </summary>
+    public class DelimitedPayloadTokenFilterFactory : TokenFilterFactory, ResourceLoaderAware
+    {
+        public const string ENCODER_ATTR = "encoder";
+        public const string DELIMITER_ATTR = "delimiter";
 
-	using ResourceLoader = org.apache.lucene.analysis.util.ResourceLoader;
-	using ResourceLoaderAware = org.apache.lucene.analysis.util.ResourceLoaderAware;
-	using TokenFilterFactory = TokenFilterFactory;
+        private readonly string encoderClass;
+        private readonly char delimiter;
 
-	/// <summary>
-	/// Factory for <seealso cref="DelimitedPayloadTokenFilter"/>.
-	/// <pre class="prettyprint">
-	/// &lt;fieldType name="text_dlmtd" class="solr.TextField" positionIncrementGap="100"&gt;
-	///   &lt;analyzer&gt;
-	///     &lt;tokenizer class="solr.WhitespaceTokenizerFactory"/&gt;
-	///     &lt;filter class="solr.DelimitedPayloadTokenFilterFactory" encoder="float" delimiter="|"/&gt;
-	///   &lt;/analyzer&gt;
-	/// &lt;/fieldType&gt;</pre>
-	/// </summary>
-	public class DelimitedPayloadTokenFilterFactory : TokenFilterFactory, ResourceLoaderAware
-	{
-	  public const string ENCODER_ATTR = "encoder";
-	  public const string DELIMITER_ATTR = "delimiter";
+        private PayloadEncoder encoder;
 
-	  private readonly string encoderClass;
-	  private readonly char delimiter;
+        /// <summary>
+        /// Creates a new DelimitedPayloadTokenFilterFactory </summary>
+        public DelimitedPayloadTokenFilterFactory(IDictionary<string, string> args)
+            : base(args)
+        {
+            encoderClass = require(args, ENCODER_ATTR);
+            delimiter = getChar(args, DELIMITER_ATTR, '|');
+            if (args.Count > 0)
+            {
+                throw new System.ArgumentException("Unknown parameters: " + args);
+            }
+        }
 
-	  private PayloadEncoder encoder;
+        public override TokenStream Create(TokenStream input)
+        {
+            return new DelimitedPayloadTokenFilter(input, delimiter, encoder);
+        }
 
-	  /// <summary>
-	  /// Creates a new DelimitedPayloadTokenFilterFactory </summary>
-	  public DelimitedPayloadTokenFilterFactory(IDictionary<string, string> args) : base(args)
-	  {
-		encoderClass = require(args, ENCODER_ATTR);
-		delimiter = getChar(args, DELIMITER_ATTR, '|');
-		if (args.Count > 0)
-		{
-		  throw new System.ArgumentException("Unknown parameters: " + args);
-		}
-	  }
-
-	  public override DelimitedPayloadTokenFilter create(TokenStream input)
-	  {
-		return new DelimitedPayloadTokenFilter(input, delimiter, encoder);
-	  }
-
-	  public virtual void inform(ResourceLoader loader)
-	  {
-		if (encoderClass.Equals("float"))
-		{
-		  encoder = new FloatEncoder();
-		}
-		else if (encoderClass.Equals("integer"))
-		{
-		  encoder = new IntegerEncoder();
-		}
-		else if (encoderClass.Equals("identity"))
-		{
-		  encoder = new IdentityEncoder();
-		}
-		else
-		{
-		  encoder = loader.newInstance(encoderClass, typeof(PayloadEncoder));
-		}
-	  }
-	}
+        public virtual void Inform(ResourceLoader loader)
+        {
+            if (encoderClass.Equals("float"))
+            {
+                encoder = new FloatEncoder();
+            }
+            else if (encoderClass.Equals("integer"))
+            {
+                encoder = new IntegerEncoder();
+            }
+            else if (encoderClass.Equals("identity"))
+            {
+                encoder = new IdentityEncoder();
+            }
+            else
+            {
+                encoder = loader.NewInstance(encoderClass, typeof(PayloadEncoder));
+            }
+        }
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cd3ee136/src/Lucene.Net.Analysis.Common/Analysis/Position/PositionFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Position/PositionFilter.cs b/src/Lucene.Net.Analysis.Common/Analysis/Position/PositionFilter.cs
index 92f73bc..104422b 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Position/PositionFilter.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Position/PositionFilter.cs
@@ -1,6 +1,7 @@
 using System;
+using Lucene.Net.Analysis.Tokenattributes;
 
-namespace org.apache.lucene.analysis.position
+namespace Lucene.Net.Analysis.Position
 {
 
 	/*
@@ -19,10 +20,7 @@ namespace org.apache.lucene.analysis.position
 	 * See the License for the specific language governing permissions and
 	 * limitations under the License.
 	 */
-
-	using PositionIncrementAttribute = org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
-
-	/// <summary>
+    /// <summary>
 	/// Set the positionIncrement of all tokens to the "positionIncrement",
 	/// except the first return token which retains its original positionIncrement value.
 	/// The default positionIncrement value is zero. </summary>
@@ -51,8 +49,6 @@ namespace org.apache.lucene.analysis.position
 	  /// all but the first token from the given input stream.
 	  /// </summary>
 	  /// <param name="input"> the input stream </param>
-//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
-//ORIGINAL LINE: public PositionFilter(final org.apache.lucene.analysis.TokenStream input)
 	  public PositionFilter(TokenStream input) : this(input, 0)
 	  {
 	  }
@@ -64,8 +60,6 @@ namespace org.apache.lucene.analysis.position
 	  /// <param name="input"> the input stream </param>
 	  /// <param name="positionIncrement"> position increment to assign to all but the first
 	  ///  token from the input stream </param>
-//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
-//ORIGINAL LINE: public PositionFilter(final org.apache.lucene.analysis.TokenStream input, final int positionIncrement)
 	  public PositionFilter(TokenStream input, int positionIncrement) : base(input)
 	  {
 		if (positionIncrement < 0)
@@ -75,11 +69,9 @@ namespace org.apache.lucene.analysis.position
 		this.positionIncrement = positionIncrement;
 	  }
 
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: @Override public final boolean incrementToken() throws java.io.IOException
-	  public override bool incrementToken()
+	  public override bool IncrementToken()
 	  {
-		if (input.incrementToken())
+		if (input.IncrementToken())
 		{
 		  if (firstTokenPositioned)
 		  {
@@ -97,13 +89,10 @@ namespace org.apache.lucene.analysis.position
 		}
 	  }
 
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: @Override public void reset() throws java.io.IOException
-	  public override void reset()
+        public override void Reset()
 	  {
-		base.reset();
+		base.Reset();
 		firstTokenPositioned = false;
 	  }
 	}
-
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cd3ee136/src/Lucene.Net.Analysis.Common/Analysis/Position/PositionFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Position/PositionFilterFactory.cs b/src/Lucene.Net.Analysis.Common/Analysis/Position/PositionFilterFactory.cs
index 74bf1e4..cc65164 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Position/PositionFilterFactory.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Position/PositionFilterFactory.cs
@@ -1,70 +1,65 @@
 using System;
 using System.Collections.Generic;
-using TokenFilterFactory = Lucene.Net.Analysis.Util.TokenFilterFactory;
+using Lucene.Net.Analysis.Util;
 
-namespace org.apache.lucene.analysis.position
+namespace Lucene.Net.Analysis.Position
 {
 
-	/*
-	 * Licensed to the Apache Software Foundation (ASF) under one or more
-	 * contributor license agreements.  See the NOTICE file distributed with
-	 * this work for additional information regarding copyright ownership.
-	 * The ASF licenses this file to You under the Apache License, Version 2.0
-	 * (the "License"); you may not use this file except in compliance with
-	 * the License.  You may obtain a copy of the License at
-	 *
-	 *     http://www.apache.org/licenses/LICENSE-2.0
-	 *
-	 * Unless required by applicable law or agreed to in writing, software
-	 * distributed under the License is distributed on an "AS IS" BASIS,
-	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-	 * See the License for the specific language governing permissions and
-	 * limitations under the License.
-	 */
-
-	using TokenFilterFactory = TokenFilterFactory;
-	using Version = org.apache.lucene.util.Version;
-
-	/// <summary>
-	/// Factory for <seealso cref="PositionFilter"/>.
-	/// Set the positionIncrement of all tokens to the "positionIncrement", except the first return token which retains its
-	/// original positionIncrement value. The default positionIncrement value is zero.
-	/// <pre class="prettyprint">
-	/// &lt;fieldType name="text_position" class="solr.TextField" positionIncrementGap="100"&gt;
-	///   &lt;analyzer&gt;
-	///     &lt;tokenizer class="solr.WhitespaceTokenizerFactory"/&gt;
-	///     &lt;filter class="solr.PositionFilterFactory" positionIncrement="0"/&gt;
-	///   &lt;/analyzer&gt;
-	/// &lt;/fieldType&gt;</pre>
-	/// </summary>
-	/// <seealso cref= org.apache.lucene.analysis.position.PositionFilter
-	/// @since solr 1.4 </seealso>
-	/// @deprecated (4.4) 
-	[Obsolete("(4.4)")]
-	public class PositionFilterFactory : TokenFilterFactory
-	{
-	  private readonly int positionIncrement;
-
-	  /// <summary>
-	  /// Creates a new PositionFilterFactory </summary>
-	  public PositionFilterFactory(IDictionary<string, string> args) : base(args)
-	  {
-		positionIncrement = getInt(args, "positionIncrement", 0);
-		if (args.Count > 0)
-		{
-		  throw new System.ArgumentException("Unknown parameters: " + args);
-		}
-		if (luceneMatchVersion != null && luceneMatchVersion.onOrAfter(Version.LUCENE_44))
-		{
-		  throw new System.ArgumentException("PositionFilter is deprecated as of Lucene 4.4. You should either fix your code to not use it or use Lucene 4.3 version compatibility");
-		}
-	  }
-
-	  public override PositionFilter create(TokenStream input)
-	  {
-		return new PositionFilter(input, positionIncrement);
-	  }
-	}
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+    /// <summary>
+    /// Factory for <seealso cref="PositionFilter"/>.
+    /// Set the positionIncrement of all tokens to the "positionIncrement", except the first return token which retains its
+    /// original positionIncrement value. The default positionIncrement value is zero.
+    /// <pre class="prettyprint">
+    /// &lt;fieldType name="text_position" class="solr.TextField" positionIncrementGap="100"&gt;
+    ///   &lt;analyzer&gt;
+    ///     &lt;tokenizer class="solr.WhitespaceTokenizerFactory"/&gt;
+    ///     &lt;filter class="solr.PositionFilterFactory" positionIncrement="0"/&gt;
+    ///   &lt;/analyzer&gt;
+    /// &lt;/fieldType&gt;</pre>
+    /// </summary>
+    /// <seealso cref= org.apache.lucene.analysis.position.PositionFilter
+    /// @since solr 1.4 </seealso>
+    /// @deprecated (4.4) 
+    [Obsolete("(4.4)")]
+    public class PositionFilterFactory : TokenFilterFactory
+    {
+        private readonly int positionIncrement;
 
+        /// <summary>
+        /// Creates a new PositionFilterFactory </summary>
+        public PositionFilterFactory(IDictionary<string, string> args)
+            : base(args)
+        {
+            positionIncrement = getInt(args, "positionIncrement", 0);
+            if (args.Count > 0)
+            {
+                throw new System.ArgumentException("Unknown parameters: " + args);
+            }
+            if (luceneMatchVersion != null && luceneMatchVersion.onOrAfter(Version.LUCENE_44))
+            {
+                throw new System.ArgumentException("PositionFilter is deprecated as of Lucene 4.4. You should either fix your code to not use it or use Lucene 4.3 version compatibility");
+            }
+        }
 
+        public override TokenStream Create(TokenStream input)
+        {
+            return new PositionFilter(input, positionIncrement);
+        }
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cd3ee136/src/Lucene.Net.Analysis.Common/Analysis/Query/QueryAutoStopWordAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Query/QueryAutoStopWordAnalyzer.cs b/src/Lucene.Net.Analysis.Common/Analysis/Query/QueryAutoStopWordAnalyzer.cs
index 2daf790..be73228 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Query/QueryAutoStopWordAnalyzer.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Query/QueryAutoStopWordAnalyzer.cs
@@ -1,213 +1,198 @@
 using System.Collections.Generic;
+using System.IO;
+using System.Linq;
 using Lucene.Net.Analysis.Core;
+using Lucene.Net.Analysis.Util;
+using Lucene.Net.Index;
+using Lucene.Net.Util;
 
-namespace org.apache.lucene.analysis.query
+namespace Lucene.Net.Analysis.Query
 {
-	/*
-	 * Licensed to the Apache Software Foundation (ASF) under one or more
-	 * contributor license agreements.  See the NOTICE file distributed with
-	 * this work for additional information regarding copyright ownership.
-	 * The ASF licenses this file to You under the Apache License, Version 2.0
-	 * (the "License"); you may not use this file except in compliance with
-	 * the License.  You may obtain a copy of the License at
-	 *
-	 *     http://www.apache.org/licenses/LICENSE-2.0
-	 *
-	 * Unless required by applicable law or agreed to in writing, software
-	 * distributed under the License is distributed on an "AS IS" BASIS,
-	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-	 * See the License for the specific language governing permissions and
-	 * limitations under the License.
-	 */
-
-
-	using StopFilter = StopFilter;
-	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
-	using IndexReader = org.apache.lucene.index.IndexReader;
-	using MultiFields = org.apache.lucene.index.MultiFields;
-	using Term = org.apache.lucene.index.Term;
-	using Terms = org.apache.lucene.index.Terms;
-	using TermsEnum = org.apache.lucene.index.TermsEnum;
-	using BytesRef = org.apache.lucene.util.BytesRef;
-	using CharsRef = org.apache.lucene.util.CharsRef;
-	using UnicodeUtil = org.apache.lucene.util.UnicodeUtil;
-	using Version = org.apache.lucene.util.Version;
-
-	/// <summary>
-	/// An <seealso cref="Analyzer"/> used primarily at query time to wrap another analyzer and provide a layer of protection
-	/// which prevents very common words from being passed into queries. 
-	/// <para>
-	/// For very large indexes the cost
-	/// of reading TermDocs for a very common word can be  high. This analyzer was created after experience with
-	/// a 38 million doc index which had a term in around 50% of docs and was causing TermQueries for 
-	/// this term to take 2 seconds.
-	/// </para>
-	/// </summary>
-	public sealed class QueryAutoStopWordAnalyzer : AnalyzerWrapper
-	{
-
-	  private readonly Analyzer @delegate;
-	  private readonly IDictionary<string, HashSet<string>> stopWordsPerField = new Dictionary<string, HashSet<string>>();
-	  //The default maximum percentage (40%) of index documents which
-	  //can contain a term, after which the term is considered to be a stop word.
-	  public const float defaultMaxDocFreqPercent = 0.4f;
-	  private readonly Version matchVersion;
-
-	  /// <summary>
-	  /// Creates a new QueryAutoStopWordAnalyzer with stopwords calculated for all
-	  /// indexed fields from terms with a document frequency percentage greater than
-	  /// <seealso cref="#defaultMaxDocFreqPercent"/>
-	  /// </summary>
-	  /// <param name="matchVersion"> Version to be used in <seealso cref="StopFilter"/> </param>
-	  /// <param name="delegate"> Analyzer whose TokenStream will be filtered </param>
-	  /// <param name="indexReader"> IndexReader to identify the stopwords from </param>
-	  /// <exception cref="IOException"> Can be thrown while reading from the IndexReader </exception>
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: public QueryAutoStopWordAnalyzer(org.apache.lucene.util.Version matchVersion, org.apache.lucene.analysis.Analyzer delegate, org.apache.lucene.index.IndexReader indexReader) throws java.io.IOException
-	  public QueryAutoStopWordAnalyzer(Version matchVersion, Analyzer @delegate, IndexReader indexReader) : this(matchVersion, @delegate, indexReader, defaultMaxDocFreqPercent)
-	  {
-	  }
-
-	  /// <summary>
-	  /// Creates a new QueryAutoStopWordAnalyzer with stopwords calculated for all
-	  /// indexed fields from terms with a document frequency greater than the given
-	  /// maxDocFreq
-	  /// </summary>
-	  /// <param name="matchVersion"> Version to be used in <seealso cref="StopFilter"/> </param>
-	  /// <param name="delegate"> Analyzer whose TokenStream will be filtered </param>
-	  /// <param name="indexReader"> IndexReader to identify the stopwords from </param>
-	  /// <param name="maxDocFreq"> Document frequency terms should be above in order to be stopwords </param>
-	  /// <exception cref="IOException"> Can be thrown while reading from the IndexReader </exception>
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: public QueryAutoStopWordAnalyzer(org.apache.lucene.util.Version matchVersion, org.apache.lucene.analysis.Analyzer delegate, org.apache.lucene.index.IndexReader indexReader, int maxDocFreq) throws java.io.IOException
-	  public QueryAutoStopWordAnalyzer(Version matchVersion, Analyzer @delegate, IndexReader indexReader, int maxDocFreq) : this(matchVersion, @delegate, indexReader, MultiFields.getIndexedFields(indexReader), maxDocFreq)
-	  {
-	  }
-
-	  /// <summary>
-	  /// Creates a new QueryAutoStopWordAnalyzer with stopwords calculated for all
-	  /// indexed fields from terms with a document frequency percentage greater than
-	  /// the given maxPercentDocs
-	  /// </summary>
-	  /// <param name="matchVersion"> Version to be used in <seealso cref="StopFilter"/> </param>
-	  /// <param name="delegate"> Analyzer whose TokenStream will be filtered </param>
-	  /// <param name="indexReader"> IndexReader to identify the stopwords from </param>
-	  /// <param name="maxPercentDocs"> The maximum percentage (between 0.0 and 1.0) of index documents which
-	  ///                      contain a term, after which the word is considered to be a stop word </param>
-	  /// <exception cref="IOException"> Can be thrown while reading from the IndexReader </exception>
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: public QueryAutoStopWordAnalyzer(org.apache.lucene.util.Version matchVersion, org.apache.lucene.analysis.Analyzer delegate, org.apache.lucene.index.IndexReader indexReader, float maxPercentDocs) throws java.io.IOException
-	  public QueryAutoStopWordAnalyzer(Version matchVersion, Analyzer @delegate, IndexReader indexReader, float maxPercentDocs) : this(matchVersion, @delegate, indexReader, MultiFields.getIndexedFields(indexReader), maxPercentDocs)
-	  {
-	  }
-
-	  /// <summary>
-	  /// Creates a new QueryAutoStopWordAnalyzer with stopwords calculated for the
-	  /// given selection of fields from terms with a document frequency percentage
-	  /// greater than the given maxPercentDocs
-	  /// </summary>
-	  /// <param name="matchVersion"> Version to be used in <seealso cref="StopFilter"/> </param>
-	  /// <param name="delegate"> Analyzer whose TokenStream will be filtered </param>
-	  /// <param name="indexReader"> IndexReader to identify the stopwords from </param>
-	  /// <param name="fields"> Selection of fields to calculate stopwords for </param>
-	  /// <param name="maxPercentDocs"> The maximum percentage (between 0.0 and 1.0) of index documents which
-	  ///                      contain a term, after which the word is considered to be a stop word </param>
-	  /// <exception cref="IOException"> Can be thrown while reading from the IndexReader </exception>
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: public QueryAutoStopWordAnalyzer(org.apache.lucene.util.Version matchVersion, org.apache.lucene.analysis.Analyzer delegate, org.apache.lucene.index.IndexReader indexReader, Collection<String> fields, float maxPercentDocs) throws java.io.IOException
-	  public QueryAutoStopWordAnalyzer(Version matchVersion, Analyzer @delegate, IndexReader indexReader, ICollection<string> fields, float maxPercentDocs) : this(matchVersion, @delegate, indexReader, fields, (int)(indexReader.numDocs() * maxPercentDocs))
-	  {
-	  }
-
-	  /// <summary>
-	  /// Creates a new QueryAutoStopWordAnalyzer with stopwords calculated for the
-	  /// given selection of fields from terms with a document frequency greater than
-	  /// the given maxDocFreq
-	  /// </summary>
-	  /// <param name="matchVersion"> Version to be used in <seealso cref="StopFilter"/> </param>
-	  /// <param name="delegate"> Analyzer whose TokenStream will be filtered </param>
-	  /// <param name="indexReader"> IndexReader to identify the stopwords from </param>
-	  /// <param name="fields"> Selection of fields to calculate stopwords for </param>
-	  /// <param name="maxDocFreq"> Document frequency terms should be above in order to be stopwords </param>
-	  /// <exception cref="IOException"> Can be thrown while reading from the IndexReader </exception>
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: public QueryAutoStopWordAnalyzer(org.apache.lucene.util.Version matchVersion, org.apache.lucene.analysis.Analyzer delegate, org.apache.lucene.index.IndexReader indexReader, Collection<String> fields, int maxDocFreq) throws java.io.IOException
-	  public QueryAutoStopWordAnalyzer(Version matchVersion, Analyzer @delegate, IndexReader indexReader, ICollection<string> fields, int maxDocFreq) : base(@delegate.ReuseStrategy)
-	  {
-		this.matchVersion = matchVersion;
-		this.@delegate = @delegate;
-
-		foreach (string field in fields)
-		{
-		  HashSet<string> stopWords = new HashSet<string>();
-		  Terms terms = MultiFields.getTerms(indexReader, field);
-		  CharsRef spare = new CharsRef();
-		  if (terms != null)
-		  {
-			TermsEnum te = terms.iterator(null);
-			BytesRef text;
-			while ((text = te.next()) != null)
-			{
-			  if (te.docFreq() > maxDocFreq)
-			  {
-				UnicodeUtil.UTF8toUTF16(text, spare);
-				stopWords.Add(spare.ToString());
-			  }
-			}
-		  }
-		  stopWordsPerField[field] = stopWords;
-		}
-	  }
-
-	  protected internal override Analyzer getWrappedAnalyzer(string fieldName)
-	  {
-		return @delegate;
-	  }
-
-	  protected internal override TokenStreamComponents wrapComponents(string fieldName, TokenStreamComponents components)
-	  {
-		HashSet<string> stopWords = stopWordsPerField[fieldName];
-		if (stopWords == null)
-		{
-		  return components;
-		}
-		StopFilter stopFilter = new StopFilter(matchVersion, components.TokenStream, new CharArraySet(matchVersion, stopWords, false));
-		return new TokenStreamComponents(components.Tokenizer, stopFilter);
-	  }
-
-	  /// <summary>
-	  /// Provides information on which stop words have been identified for a field
-	  /// </summary>
-	  /// <param name="fieldName"> The field for which stop words identified in "addStopWords"
-	  ///                  method calls will be returned </param>
-	  /// <returns> the stop words identified for a field </returns>
-	  public string[] getStopWords(string fieldName)
-	  {
-		HashSet<string> stopWords = stopWordsPerField[fieldName];
-		return stopWords != null ? stopWords.toArray(new string[stopWords.Count]) : new string[0];
-	  }
-
-	  /// <summary>
-	  /// Provides information on which stop words have been identified for all fields
-	  /// </summary>
-	  /// <returns> the stop words (as terms) </returns>
-	  public Term[] StopWords
-	  {
-		  get
-		  {
-			IList<Term> allStopWords = new List<Term>();
-			foreach (string fieldName in stopWordsPerField.Keys)
-			{
-			  HashSet<string> stopWords = stopWordsPerField[fieldName];
-			  foreach (string text in stopWords)
-			  {
-				allStopWords.Add(new Term(fieldName, text));
-			  }
-			}
-			return allStopWords.ToArray();
-		  }
-	  }
-
-	}
-
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+    /// <summary>
+    /// An <seealso cref="Analyzer"/> used primarily at query time to wrap another analyzer and provide a layer of protection
+    /// which prevents very common words from being passed into queries. 
+    /// <para>
+    /// For very large indexes the cost
+    /// of reading TermDocs for a very common word can be  high. This analyzer was created after experience with
+    /// a 38 million doc index which had a term in around 50% of docs and was causing TermQueries for 
+    /// this term to take 2 seconds.
+    /// </para>
+    /// </summary>
+    public sealed class QueryAutoStopWordAnalyzer : AnalyzerWrapper
+    {
+
+        private readonly Analyzer @delegate;
+        private readonly IDictionary<string, HashSet<string>> stopWordsPerField = new Dictionary<string, HashSet<string>>();
+        //The default maximum percentage (40%) of index documents which
+        //can contain a term, after which the term is considered to be a stop word.
+        public const float defaultMaxDocFreqPercent = 0.4f;
+        private readonly Version matchVersion;
+
+        /// <summary>
+        /// Creates a new QueryAutoStopWordAnalyzer with stopwords calculated for all
+        /// indexed fields from terms with a document frequency percentage greater than
+        /// <seealso cref="#defaultMaxDocFreqPercent"/>
+        /// </summary>
+        /// <param name="matchVersion"> Version to be used in <seealso cref="StopFilter"/> </param>
+        /// <param name="delegate"> Analyzer whose TokenStream will be filtered </param>
+        /// <param name="indexReader"> IndexReader to identify the stopwords from </param>
+        /// <exception cref="IOException"> Can be thrown while reading from the IndexReader </exception>
+        public QueryAutoStopWordAnalyzer(Version matchVersion, Analyzer @delegate, IndexReader indexReader)
+            : this(matchVersion, @delegate, indexReader, defaultMaxDocFreqPercent)
+        {
+        }
+
+        /// <summary>
+        /// Creates a new QueryAutoStopWordAnalyzer with stopwords calculated for all
+        /// indexed fields from terms with a document frequency greater than the given
+        /// maxDocFreq
+        /// </summary>
+        /// <param name="matchVersion"> Version to be used in <seealso cref="StopFilter"/> </param>
+        /// <param name="delegate"> Analyzer whose TokenStream will be filtered </param>
+        /// <param name="indexReader"> IndexReader to identify the stopwords from </param>
+        /// <param name="maxDocFreq"> Document frequency terms should be above in order to be stopwords </param>
+        /// <exception cref="IOException"> Can be thrown while reading from the IndexReader </exception>
+        public QueryAutoStopWordAnalyzer(Version matchVersion, Analyzer @delegate, IndexReader indexReader, int maxDocFreq)
+            : this(matchVersion, @delegate, indexReader, MultiFields.GetIndexedFields(indexReader), maxDocFreq)
+        {
+        }
+
+        /// <summary>
+        /// Creates a new QueryAutoStopWordAnalyzer with stopwords calculated for all
+        /// indexed fields from terms with a document frequency percentage greater than
+        /// the given maxPercentDocs
+        /// </summary>
+        /// <param name="matchVersion"> Version to be used in <seealso cref="StopFilter"/> </param>
+        /// <param name="delegate"> Analyzer whose TokenStream will be filtered </param>
+        /// <param name="indexReader"> IndexReader to identify the stopwords from </param>
+        /// <param name="maxPercentDocs"> The maximum percentage (between 0.0 and 1.0) of index documents which
+        ///                      contain a term, after which the word is considered to be a stop word </param>
+        /// <exception cref="IOException"> Can be thrown while reading from the IndexReader </exception>
+        public QueryAutoStopWordAnalyzer(Version matchVersion, Analyzer @delegate, IndexReader indexReader, float maxPercentDocs)
+            : this(matchVersion, @delegate, indexReader, MultiFields.GetIndexedFields(indexReader), maxPercentDocs)
+        {
+        }
+
+        /// <summary>
+        /// Creates a new QueryAutoStopWordAnalyzer with stopwords calculated for the
+        /// given selection of fields from terms with a document frequency percentage
+        /// greater than the given maxPercentDocs
+        /// </summary>
+        /// <param name="matchVersion"> Version to be used in <seealso cref="StopFilter"/> </param>
+        /// <param name="delegate"> Analyzer whose TokenStream will be filtered </param>
+        /// <param name="indexReader"> IndexReader to identify the stopwords from </param>
+        /// <param name="fields"> Selection of fields to calculate stopwords for </param>
+        /// <param name="maxPercentDocs"> The maximum percentage (between 0.0 and 1.0) of index documents which
+        ///                      contain a term, after which the word is considered to be a stop word </param>
+        /// <exception cref="IOException"> Can be thrown while reading from the IndexReader </exception>
+        public QueryAutoStopWordAnalyzer(Version matchVersion, Analyzer @delegate, IndexReader indexReader, ICollection<string> fields, float maxPercentDocs)
+            : this(matchVersion, @delegate, indexReader, fields, (int)(indexReader.NumDocs * maxPercentDocs))
+        {
+        }
+
+        /// <summary>
+        /// Creates a new QueryAutoStopWordAnalyzer with stopwords calculated for the
+        /// given selection of fields from terms with a document frequency greater than
+        /// the given maxDocFreq
+        /// </summary>
+        /// <param name="matchVersion"> Version to be used in <seealso cref="StopFilter"/> </param>
+        /// <param name="delegate"> Analyzer whose TokenStream will be filtered </param>
+        /// <param name="indexReader"> IndexReader to identify the stopwords from </param>
+        /// <param name="fields"> Selection of fields to calculate stopwords for </param>
+        /// <param name="maxDocFreq"> Document frequency terms should be above in order to be stopwords </param>
+        /// <exception cref="IOException"> Can be thrown while reading from the IndexReader </exception>
+        public QueryAutoStopWordAnalyzer(Version matchVersion, Analyzer @delegate, IndexReader indexReader, ICollection<string> fields, int maxDocFreq)
+            : base(@delegate.Strategy)
+        {
+            this.matchVersion = matchVersion;
+            this.@delegate = @delegate;
+
+            foreach (string field in fields)
+            {
+                var stopWords = new HashSet<string>();
+                Terms terms = MultiFields.GetTerms(indexReader, field);
+                CharsRef spare = new CharsRef();
+                if (terms != null)
+                {
+                    TermsEnum te = terms.Iterator(null);
+                    BytesRef text;
+                    while ((text = te.Next()) != null)
+                    {
+                        if (te.DocFreq() > maxDocFreq)
+                        {
+                            UnicodeUtil.UTF8toUTF16(text, spare);
+                            stopWords.Add(spare.ToString());
+                        }
+                    }
+                }
+                stopWordsPerField[field] = stopWords;
+            }
+        }
+
+        protected override Analyzer GetWrappedAnalyzer(string fieldName)
+        {
+            return @delegate;
+        }
+
+        protected override TokenStreamComponents WrapComponents(string fieldName, TokenStreamComponents components)
+        {
+            HashSet<string> stopWords = stopWordsPerField[fieldName];
+            if (stopWords == null)
+            {
+                return components;
+            }
+            StopFilter stopFilter = new StopFilter(matchVersion, components.TokenStream, new CharArraySet(matchVersion, stopWords, false));
+            return new TokenStreamComponents(components.Tokenizer, stopFilter);
+        }
+
+        /// <summary>
+        /// Provides information on which stop words have been identified for a field
+        /// </summary>
+        /// <param name="fieldName"> The field for which stop words identified in "addStopWords"
+        ///                  method calls will be returned </param>
+        /// <returns> the stop words identified for a field </returns>
+        public string[] GetStopWords(string fieldName)
+        {
+            HashSet<string> stopWords = stopWordsPerField[fieldName];
+            return stopWords != null ? stopWords.ToArray(new string[stopWords.Count]) : new string[0];
+        }
+
+        /// <summary>
+        /// Provides information on which stop words have been identified for all fields
+        /// </summary>
+        /// <returns> the stop words (as terms) </returns>
+        public Term[] StopWords
+        {
+            get
+            {
+                IList<Term> allStopWords = new List<Term>();
+                foreach (string fieldName in stopWordsPerField.Keys)
+                {
+                    HashSet<string> stopWords = stopWordsPerField[fieldName];
+                    foreach (string text in stopWords)
+                    {
+                        allStopWords.Add(new Term(fieldName, text));
+                    }
+                }
+                return allStopWords.ToArray();
+            }
+        }
+
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cd3ee136/src/Lucene.Net.Analysis.Common/Analysis/Standard/ClassicAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Standard/ClassicAnalyzer.cs b/src/Lucene.Net.Analysis.Common/Analysis/Standard/ClassicAnalyzer.cs
index f2387f1..dcfe368 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Standard/ClassicAnalyzer.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Standard/ClassicAnalyzer.cs
@@ -1,4 +1,6 @@
 using Lucene.Net.Analysis.Core;
+using Lucene.Net.Analysis.Util;
+using StopwordAnalyzerBase = Lucene.Net.Analysis.Util.StopwordAnalyzerBase;
 
 namespace org.apache.lucene.analysis.standard
 {
@@ -24,9 +26,9 @@ namespace org.apache.lucene.analysis.standard
 	using LowerCaseFilter = LowerCaseFilter;
 	using StopAnalyzer = StopAnalyzer;
 	using StopFilter = StopFilter;
-	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
-	using StopwordAnalyzerBase = org.apache.lucene.analysis.util.StopwordAnalyzerBase;
-	using WordlistLoader = org.apache.lucene.analysis.util.WordlistLoader;
+	using CharArraySet = CharArraySet;
+	using StopwordAnalyzerBase = StopwordAnalyzerBase;
+	using WordlistLoader = WordlistLoader;
 	using Version = org.apache.lucene.util.Version;
 
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cd3ee136/src/Lucene.Net.Analysis.Common/Analysis/Standard/StandardAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Standard/StandardAnalyzer.cs b/src/Lucene.Net.Analysis.Common/Analysis/Standard/StandardAnalyzer.cs
index 73d16e3..392f656 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Standard/StandardAnalyzer.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Standard/StandardAnalyzer.cs
@@ -1,4 +1,6 @@
 using Lucene.Net.Analysis.Core;
+using Lucene.Net.Analysis.Util;
+using StopwordAnalyzerBase = Lucene.Net.Analysis.Util.StopwordAnalyzerBase;
 
 namespace org.apache.lucene.analysis.standard
 {
@@ -24,9 +26,9 @@ namespace org.apache.lucene.analysis.standard
 	using LowerCaseFilter = LowerCaseFilter;
 	using StopAnalyzer = StopAnalyzer;
 	using StopFilter = StopFilter;
-	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
-	using StopwordAnalyzerBase = org.apache.lucene.analysis.util.StopwordAnalyzerBase;
-	using WordlistLoader = org.apache.lucene.analysis.util.WordlistLoader;
+	using CharArraySet = CharArraySet;
+	using StopwordAnalyzerBase = StopwordAnalyzerBase;
+	using WordlistLoader = WordlistLoader;
 	using Version = org.apache.lucene.util.Version;
 
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cd3ee136/src/Lucene.Net.Analysis.Common/Analysis/Standard/UAX29URLEmailAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Standard/UAX29URLEmailAnalyzer.cs b/src/Lucene.Net.Analysis.Common/Analysis/Standard/UAX29URLEmailAnalyzer.cs
index 2067ff6..fd546ce 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Standard/UAX29URLEmailAnalyzer.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Standard/UAX29URLEmailAnalyzer.cs
@@ -1,4 +1,6 @@
 using Lucene.Net.Analysis.Core;
+using Lucene.Net.Analysis.Util;
+using StopwordAnalyzerBase = Lucene.Net.Analysis.Util.StopwordAnalyzerBase;
 
 namespace org.apache.lucene.analysis.standard
 {
@@ -23,8 +25,8 @@ namespace org.apache.lucene.analysis.standard
 	using LowerCaseFilter = LowerCaseFilter;
 	using StopAnalyzer = StopAnalyzer;
 	using StopFilter = StopFilter;
-	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
-	using StopwordAnalyzerBase = org.apache.lucene.analysis.util.StopwordAnalyzerBase;
+	using CharArraySet = CharArraySet;
+	using StopwordAnalyzerBase = StopwordAnalyzerBase;
 	using Version = org.apache.lucene.util.Version;
 
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cd3ee136/src/Lucene.Net.Analysis.Common/Analysis/Synonym/FSTSynonymFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Synonym/FSTSynonymFilterFactory.cs b/src/Lucene.Net.Analysis.Common/Analysis/Synonym/FSTSynonymFilterFactory.cs
index c38f1dd..2be937c 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Synonym/FSTSynonymFilterFactory.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Synonym/FSTSynonymFilterFactory.cs
@@ -56,8 +56,8 @@ namespace Lucene.Net.Analysis.Synonym
 		  for (IEnumerator<string> itr = args.Keys.GetEnumerator(); itr.MoveNext();)
 		  {
 			string key = itr.Current;
-			tokArgs[key.replaceAll("^tokenizerFactory\\.","")] = args[key];
-			itr.remove();
+			tokArgs[key.ReplaceAll("^tokenizerFactory\\.","")] = args[key];
+			itr.Remove();
 		  }
 		}
 		if (args.Count > 0)
@@ -66,19 +66,15 @@ namespace Lucene.Net.Analysis.Synonym
 		}
 	  }
 
-	  public override TokenStream create(TokenStream input)
+	  public override TokenStream Create(TokenStream input)
 	  {
 		// if the fst is null, it means there's actually no synonyms... just return the original stream
 		// as there is nothing to do here.
 		return map.fst == null ? input : new SynonymFilter(input, map, ignoreCase);
 	  }
 
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: @Override public void inform(ResourceLoader loader) throws java.io.IOException
 	  public void inform(ResourceLoader loader)
 	  {
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final TokenizerFactory factory = tokenizerFactory == null ? null : loadTokenizerFactory(loader, tokenizerFactory);
 		TokenizerFactory factory = tokenizerFactory == null ? null : loadTokenizerFactory(loader, tokenizerFactory);
 
 		Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper(this, factory);
@@ -115,7 +111,7 @@ namespace Lucene.Net.Analysis.Synonym
 			  this.factory = factory;
 		  }
 
-		  protected internal override Analyzer.TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  protected internal override Analyzer.TokenStreamComponents CreateComponents(string fieldName, Reader reader)
 		  {
 			Tokenizer tokenizer = factory == null ? new WhitespaceTokenizer(Version.LUCENE_CURRENT, reader) : factory.create(reader);
 			TokenStream stream = outerInstance.ignoreCase ? new LowerCaseFilter(Version.LUCENE_CURRENT, tokenizer) : tokenizer;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cd3ee136/src/Lucene.Net.Analysis.Common/Analysis/Synonym/SlowSynonymFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Synonym/SlowSynonymFilter.cs b/src/Lucene.Net.Analysis.Common/Analysis/Synonym/SlowSynonymFilter.cs
index 15abb7a..95b3c1f 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Synonym/SlowSynonymFilter.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Synonym/SlowSynonymFilter.cs
@@ -1,7 +1,9 @@
 using System;
 using System.Collections.Generic;
+using Lucene.Net.Analysis.Tokenattributes;
+using Lucene.Net.Util;
 
-namespace org.apache.lucene.analysis.synonym
+namespace Lucene.Net.Analysis.Synonym
 {
 
 	/*
@@ -20,15 +22,7 @@ namespace org.apache.lucene.analysis.synonym
 	 * See the License for the specific language governing permissions and
 	 * limitations under the License.
 	 */
-
-	using OffsetAttribute = org.apache.lucene.analysis.tokenattributes.OffsetAttribute;
-	using PositionIncrementAttribute = org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
-	using CharTermAttribute = org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
-	using TypeAttribute = org.apache.lucene.analysis.tokenattributes.TypeAttribute;
-	using AttributeSource = org.apache.lucene.util.AttributeSource;
-
-
-	/// <summary>
+    /// <summary>
 	/// SynonymFilter handles multi-token synonyms with variable position increment offsets.
 	/// <para>
 	/// The matched tokens from the input stream may be optionally passed through (includeOrig=true)
@@ -56,10 +50,10 @@ namespace org.apache.lucene.analysis.synonym
 
 		this.map = map;
 		// just ensuring these attributes exist...
-		addAttribute(typeof(CharTermAttribute));
-		addAttribute(typeof(PositionIncrementAttribute));
-		addAttribute(typeof(OffsetAttribute));
-		addAttribute(typeof(TypeAttribute));
+		AddAttribute(typeof(CharTermAttribute));
+		AddAttribute(typeof(PositionIncrementAttribute));
+		AddAttribute(typeof(OffsetAttribute));
+		AddAttribute(typeof(TypeAttribute));
 	  }
 
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cd3ee136/src/Lucene.Net.Analysis.Common/Analysis/Synonym/SlowSynonymFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Synonym/SlowSynonymFilterFactory.cs b/src/Lucene.Net.Analysis.Common/Analysis/Synonym/SlowSynonymFilterFactory.cs
index 5e76e47..1f3d604 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Synonym/SlowSynonymFilterFactory.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Synonym/SlowSynonymFilterFactory.cs
@@ -2,6 +2,7 @@
 using System.Collections;
 using System.Collections.Generic;
 using System.Text;
+using Lucene.Net.Analysis.Synonym;
 using Lucene.Net.Analysis.Util;
 
 namespace org.apache.lucene.analysis.synonym

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cd3ee136/src/Lucene.Net.Analysis.Common/Analysis/Synonym/SlowSynonymMap.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Synonym/SlowSynonymMap.cs b/src/Lucene.Net.Analysis.Common/Analysis/Synonym/SlowSynonymMap.cs
index cfc7d71..ab54cf5 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Synonym/SlowSynonymMap.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Synonym/SlowSynonymMap.cs
@@ -1,8 +1,10 @@
 using System;
 using System.Collections.Generic;
+using System.Linq;
 using System.Text;
+using org.apache.lucene.analysis.util;
 
-namespace org.apache.lucene.analysis.synonym
+namespace Lucene.Net.Analysis.Synonym
 {
 
 	/*
@@ -21,11 +23,7 @@ namespace org.apache.lucene.analysis.synonym
 	 * See the License for the specific language governing permissions and
 	 * limitations under the License.
 	 */
-
-	using org.apache.lucene.analysis.util;
-	using Version = org.apache.lucene.util.Version;
-
-	/// <summary>
+    /// <summary>
 	/// Mapping rules for use with <seealso cref="SlowSynonymFilter"/> </summary>
 	/// @deprecated (3.4) use <seealso cref="SynonymFilterFactory"/> instead. only for precise index backwards compatibility. this factory will be removed in Lucene 5.0 
 	[Obsolete("(3.4) use <seealso cref="SynonymFilterFactory"/> instead. only for precise index backwards compatibility. this factory will be removed in Lucene 5.0")]

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cd3ee136/src/Lucene.Net.Analysis.Common/Analysis/Synonym/SynonymFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Synonym/SynonymFilterFactory.cs b/src/Lucene.Net.Analysis.Common/Analysis/Synonym/SynonymFilterFactory.cs
index b6967d8..9d924f7 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Synonym/SynonymFilterFactory.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Synonym/SynonymFilterFactory.cs
@@ -1,77 +1,73 @@
 using System;
 using System.Collections.Generic;
-using Lucene.Net.Analysis.Synonym;
-using TokenFilterFactory = Lucene.Net.Analysis.Util.TokenFilterFactory;
+using Lucene.Net.Analysis.Util;
+using Lucene.Net.Util;
+using org.apache.lucene.analysis.synonym;
+using org.apache.lucene.analysis.util;
 
-namespace org.apache.lucene.analysis.synonym
+namespace Lucene.Net.Analysis.Synonym
 {
 
-	/*
-	 * Licensed to the Apache Software Foundation (ASF) under one or more
-	 * contributor license agreements.  See the NOTICE file distributed with
-	 * this work for additional information regarding copyright ownership.
-	 * The ASF licenses this file to You under the Apache License, Version 2.0
-	 * (the "License"); you may not use this file except in compliance with
-	 * the License.  You may obtain a copy of the License at
-	 *
-	 *     http://www.apache.org/licenses/LICENSE-2.0
-	 *
-	 * Unless required by applicable law or agreed to in writing, software
-	 * distributed under the License is distributed on an "AS IS" BASIS,
-	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-	 * See the License for the specific language governing permissions and
-	 * limitations under the License.
-	 */
+    /*
+     * Licensed to the Apache Software Foundation (ASF) under one or more
+     * contributor license agreements.  See the NOTICE file distributed with
+     * this work for additional information regarding copyright ownership.
+     * The ASF licenses this file to You under the Apache License, Version 2.0
+     * (the "License"); you may not use this file except in compliance with
+     * the License.  You may obtain a copy of the License at
+     *
+     *     http://www.apache.org/licenses/LICENSE-2.0
+     *
+     * Unless required by applicable law or agreed to in writing, software
+     * distributed under the License is distributed on an "AS IS" BASIS,
+     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     * See the License for the specific language governing permissions and
+     * limitations under the License.
+     */
+    /// <summary>
+    /// Factory for <seealso cref="SynonymFilter"/>.
+    /// <pre class="prettyprint" >
+    /// &lt;fieldType name="text_synonym" class="solr.TextField" positionIncrementGap="100"&gt;
+    ///   &lt;analyzer&gt;
+    ///     &lt;tokenizer class="solr.WhitespaceTokenizerFactory"/&gt;
+    ///     &lt;filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" 
+    ///             format="solr" ignoreCase="false" expand="true" 
+    ///             tokenizerFactory="solr.WhitespaceTokenizerFactory"
+    ///             [optional tokenizer factory parameters]/&gt;
+    ///   &lt;/analyzer&gt;
+    /// &lt;/fieldType&gt;</pre>
+    /// 
+    /// <para>
+    /// An optional param name prefix of "tokenizerFactory." may be used for any 
+    /// init params that the SynonymFilterFactory needs to pass to the specified 
+    /// TokenizerFactory.  If the TokenizerFactory expects an init parameters with 
+    /// the same name as an init param used by the SynonymFilterFactory, the prefix 
+    /// is mandatory.
+    /// </para>
+    /// <para>
+    /// The optional {@code format} parameter controls how the synonyms will be parsed:
+    /// It supports the short names of {@code solr} for <seealso cref="SolrSynonymParser"/> 
+    /// and {@code wordnet} for and <seealso cref="WordnetSynonymParser"/>, or your own 
+    /// {@code SynonymMap.Parser} class name. The default is {@code solr}.
+    /// A custom <seealso cref="SynonymMap.Parser"/> is expected to have a constructor taking:
+    /// <ul>
+    ///   <li><code>boolean dedup</code> - true if duplicates should be ignored, false otherwise</li>
+    ///   <li><code>boolean expand</code> - true if conflation groups should be expanded, false if they are one-directional</li>
+    ///   <li><code><seealso cref="Analyzer"/> analyzer</code> - an analyzer used for each raw synonym</li>
+    /// </ul>
+    /// </para>
+    /// </summary>
+    public class SynonymFilterFactory : TokenFilterFactory, ResourceLoaderAware
+    {
+        private readonly TokenFilterFactory delegator;
 
-
-	using Version = org.apache.lucene.util.Version;
-	using ResourceLoader = org.apache.lucene.analysis.util.ResourceLoader;
-	using ResourceLoaderAware = org.apache.lucene.analysis.util.ResourceLoaderAware;
-	using TokenFilterFactory = TokenFilterFactory;
-
-	/// <summary>
-	/// Factory for <seealso cref="SynonymFilter"/>.
-	/// <pre class="prettyprint" >
-	/// &lt;fieldType name="text_synonym" class="solr.TextField" positionIncrementGap="100"&gt;
-	///   &lt;analyzer&gt;
-	///     &lt;tokenizer class="solr.WhitespaceTokenizerFactory"/&gt;
-	///     &lt;filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" 
-	///             format="solr" ignoreCase="false" expand="true" 
-	///             tokenizerFactory="solr.WhitespaceTokenizerFactory"
-	///             [optional tokenizer factory parameters]/&gt;
-	///   &lt;/analyzer&gt;
-	/// &lt;/fieldType&gt;</pre>
-	/// 
-	/// <para>
-	/// An optional param name prefix of "tokenizerFactory." may be used for any 
-	/// init params that the SynonymFilterFactory needs to pass to the specified 
-	/// TokenizerFactory.  If the TokenizerFactory expects an init parameters with 
-	/// the same name as an init param used by the SynonymFilterFactory, the prefix 
-	/// is mandatory.
-	/// </para>
-	/// <para>
-	/// The optional {@code format} parameter controls how the synonyms will be parsed:
-	/// It supports the short names of {@code solr} for <seealso cref="SolrSynonymParser"/> 
-	/// and {@code wordnet} for and <seealso cref="WordnetSynonymParser"/>, or your own 
-	/// {@code SynonymMap.Parser} class name. The default is {@code solr}.
-	/// A custom <seealso cref="SynonymMap.Parser"/> is expected to have a constructor taking:
-	/// <ul>
-	///   <li><code>boolean dedup</code> - true if duplicates should be ignored, false otherwise</li>
-	///   <li><code>boolean expand</code> - true if conflation groups should be expanded, false if they are one-directional</li>
-	///   <li><code><seealso cref="Analyzer"/> analyzer</code> - an analyzer used for each raw synonym</li>
-	/// </ul>
-	/// </para>
-	/// </summary>
-	public class SynonymFilterFactory : TokenFilterFactory, ResourceLoaderAware
-	{
-	  private readonly TokenFilterFactory delegator;
-
-	  public SynonymFilterFactory(IDictionary<string, string> args) : base(args)
+        public SynonymFilterFactory(IDictionary<string, string> args)
+            : base(args)
 	  {
 		assureMatchVersion();
-		if (luceneMatchVersion.onOrAfter(Version.LUCENE_34))
+		if (luceneMatchVersion.OnOrAfter(Lucene.Net.Util.Version.LUCENE_34))
 		{
-		  delegator = new FSTSynonymFilterFactory(new Dictionary<>(OriginalArgs));
+		  delegator = new FSTSynonymFilterFactory(new Dictionary<string, string>(OriginalArgs));
 		}
 		else
 		{
@@ -85,31 +81,28 @@ namespace org.apache.lucene.analysis.synonym
 		}
 	  }
 
-	  public override TokenStream create(TokenStream input)
-	  {
-		return delegator.create(input);
-	  }
-
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: @Override public void inform(org.apache.lucene.analysis.util.ResourceLoader loader) throws java.io.IOException
-	  public virtual void inform(ResourceLoader loader)
-	  {
-		((ResourceLoaderAware) delegator).inform(loader);
-	  }
+        public override TokenStream Create(TokenStream input)
+        {
+            return delegator.Create(input);
+        }
 
-	  /// <summary>
-	  /// Access to the delegator TokenFilterFactory for test verification
-	  /// </summary>
-	  /// @deprecated Method exists only for testing 4x, will be removed in 5.0
-	  /// @lucene.internal 
-	  [Obsolete("Method exists only for testing 4x, will be removed in 5.0")]
-	  internal virtual TokenFilterFactory Delegator
-	  {
-		  get
-		  {
-			return delegator;
-		  }
-	  }
-	}
+        public virtual void Inform(ResourceLoader loader)
+        {
+            ((ResourceLoaderAware)delegator).Inform(loader);
+        }
 
+        /// <summary>
+        /// Access to the delegator TokenFilterFactory for test verification
+        /// </summary>
+        /// @deprecated Method exists only for testing 4x, will be removed in 5.0
+        /// @lucene.internal 
+        [Obsolete("Method exists only for testing 4x, will be removed in 5.0")]
+        internal virtual TokenFilterFactory Delegator
+        {
+            get
+            {
+                return delegator;
+            }
+        }
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cd3ee136/src/Lucene.Net.Analysis.Common/Analysis/Util/AnalysisSPILoader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Util/AnalysisSPILoader.cs b/src/Lucene.Net.Analysis.Common/Analysis/Util/AnalysisSPILoader.cs
index 351446f..f0e9bda 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Util/AnalysisSPILoader.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Util/AnalysisSPILoader.cs
@@ -2,9 +2,8 @@
 using System.Collections;
 using System.Collections.Generic;
 using System.Threading;
-using Lucene.Net.Analysis.Util;
 
-namespace org.apache.lucene.analysis.util
+namespace Lucene.Net.Analysis.Util
 {
 
 	/*
@@ -23,11 +22,7 @@ namespace org.apache.lucene.analysis.util
 	 * See the License for the specific language governing permissions and
 	 * limitations under the License.
 	 */
-
-
-	using SPIClassIterator = org.apache.lucene.util.SPIClassIterator;
-
-	/// <summary>
+    /// <summary>
 	/// Helper class for loading named SPIs from classpath (e.g. Tokenizers, TokenStreams).
 	/// @lucene.internal
 	/// </summary>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cd3ee136/src/Lucene.Net.Analysis.Common/Analysis/Util/CharArrayMap.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Util/CharArrayMap.cs b/src/Lucene.Net.Analysis.Common/Analysis/Util/CharArrayMap.cs
index 1086572..e608b1f 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Util/CharArrayMap.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Util/CharArrayMap.cs
@@ -3,6 +3,8 @@ using System.Diagnostics;
 using System.Collections;
 using System.Collections.Generic;
 using System.Text;
+using Lucene.Net.Analysis.Util;
+using Lucene.Net.Support;
 
 namespace org.apache.lucene.analysis.util
 {
@@ -25,9 +27,6 @@ namespace org.apache.lucene.analysis.util
 	 */
 
 
-	using Version = org.apache.lucene.util.Version;
-
-
 	/// <summary>
 	/// A simple class that stores key Strings as char[]'s in a
 	/// hash table. Note that this is not a general purpose
@@ -51,7 +50,7 @@ namespace org.apache.lucene.analysis.util
 	/// 3.1 pass a <seealso cref="Version"/> &lt; 3.1 to the constructors.
 	/// </para>
 	/// </summary>
-	public class CharArrayMap<V> : AbstractMap<object, V>
+	public class CharArrayMap<V> : IDictionary<object, V>
 	{
 	  // private only because missing generics
 //JAVA TO C# CONVERTER TODO TASK: Java wildcard generics are not converted to .NET:
@@ -123,78 +122,72 @@ namespace org.apache.lucene.analysis.util
 
 	  /// <summary>
 	  /// Clears all entries in this map. This method is supported for reusing, but not <seealso cref="Map#remove"/>. </summary>
-	  public override void clear()
+	  public override void Clear()
 	  {
 		count = 0;
-		Arrays.fill(keys, null);
-		Arrays.fill(values, null);
+		Arrays.Fill(keys, null);
+		Arrays.Fill(values, null);
 	  }
 
 	  /// <summary>
 	  /// true if the <code>len</code> chars of <code>text</code> starting at <code>off</code>
 	  /// are in the <seealso cref="#keySet()"/> 
 	  /// </summary>
-	  public virtual bool containsKey(char[] text, int off, int len)
+	  public virtual bool ContainsKey(char[] text, int off, int len)
 	  {
 		return keys[getSlot(text, off, len)] != null;
 	  }
 
 	  /// <summary>
 	  /// true if the <code>CharSequence</code> is in the <seealso cref="#keySet()"/> </summary>
-	  public virtual bool containsKey(CharSequence cs)
+	  public virtual bool ContainsKey(string cs)
 	  {
 		return keys[getSlot(cs)] != null;
 	  }
 
-	  public override bool containsKey(object o)
+	  public override bool ContainsKey(object o)
 	  {
 		if (o is char[])
 		{
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final char[] text = (char[])o;
 		  char[] text = (char[])o;
-		  return containsKey(text, 0, text.Length);
+		  return ContainsKey(text, 0, text.Length);
 		}
-		return containsKey(o.ToString());
+		return ContainsKey(o.ToString());
 	  }
 
 	  /// <summary>
 	  /// returns the value of the mapping of <code>len</code> chars of <code>text</code>
 	  /// starting at <code>off</code> 
 	  /// </summary>
-	  public virtual V get(char[] text, int off, int len)
+	  public virtual V Get(char[] text, int off, int len)
 	  {
 		return values[getSlot(text, off, len)];
 	  }
 
 	  /// <summary>
 	  /// returns the value of the mapping of the chars inside this {@code CharSequence} </summary>
-	  public virtual V get(CharSequence cs)
+	  public virtual V Get(string cs)
 	  {
 		return values[getSlot(cs)];
 	  }
 
-	  public override V get(object o)
+	  public V Get(object o)
 	  {
-		if (o is char[])
+	      var text = o as char[];
+		if (text != null)
 		{
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final char[] text = (char[])o;
-		  char[] text = (char[])o;
-		  return get(text, 0, text.Length);
+		    return Get(text, 0, text.Length);
 		}
-		return get(o.ToString());
+		return Get(o.ToString());
 	  }
 
-	  private int getSlot(char[] text, int off, int len)
+	  private int GetSlot(char[] text, int off, int len)
 	  {
 		int code = getHashCode(text, off, len);
 		int pos = code & (keys.Length - 1);
 		char[] text2 = keys[pos];
 		if (text2 != null && !Equals(text, off, len, text2))
 		{
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final int inc = ((code>>8)+code)|1;
 		  int inc = ((code >> 8) + code) | 1;
 		  do
 		  {
@@ -208,15 +201,13 @@ namespace org.apache.lucene.analysis.util
 
 	  /// <summary>
 	  /// Returns true if the String is in the set </summary>
-	  private int getSlot(CharSequence text)
+	  private int GetSlot(string text)
 	  {
 		int code = getHashCode(text);
 		int pos = code & (keys.Length - 1);
 		char[] text2 = keys[pos];
 		if (text2 != null && !Equals(text, text2))
 		{
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final int inc = ((code>>8)+code)|1;
 		  int inc = ((code >> 8) + code) | 1;
 		  do
 		  {
@@ -265,8 +256,6 @@ namespace org.apache.lucene.analysis.util
 		int slot = getSlot(text, 0, text.Length);
 		if (keys[slot] != null)
 		{
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final V oldValue = values[slot];
 		  V oldValue = values[slot];
 		  values[slot] = value;
 		  return oldValue;
@@ -277,15 +266,13 @@ namespace org.apache.lucene.analysis.util
 
 		if (count + (count >> 2) > keys.Length)
 		{
-		  rehash();
+		  Rehash();
 		}
 
 		return null;
 	  }
 
-//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
-//ORIGINAL LINE: @SuppressWarnings("unchecked") private void rehash()
-	  private void rehash()
+	  private void Rehash()
 	  {
 		Debug.Assert(keys.Length == values.Length);
 //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cd3ee136/src/Lucene.Net.Analysis.Common/Analysis/Util/CharArraySet.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Util/CharArraySet.cs b/src/Lucene.Net.Analysis.Common/Analysis/Util/CharArraySet.cs
index d9253d7..370c56a 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Util/CharArraySet.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Util/CharArraySet.cs
@@ -1,7 +1,9 @@
 using System.Collections.Generic;
 using System.Text;
+using Lucene.Net.Util;
+using org.apache.lucene.analysis.util;
 
-namespace org.apache.lucene.analysis.util
+namespace Lucene.Net.Analysis.Util
 {
 
 	/*
@@ -20,12 +22,7 @@ namespace org.apache.lucene.analysis.util
 	 * See the License for the specific language governing permissions and
 	 * limitations under the License.
 	 */
-
-
-	using Version = org.apache.lucene.util.Version;
-
-
-	/// <summary>
+    /// <summary>
 	/// A simple class that stores Strings as char[]'s in a
 	/// hash table.  Note that this is not a general purpose
 	/// class.  For example, it cannot remove items from the
@@ -51,12 +48,12 @@ namespace org.apache.lucene.analysis.util
 	/// does not behave like it should in all cases. The generic type is
 	/// {@code Set<Object>}, because you can add any object to it,
 	/// that has a string representation. The add methods will use
-	/// <seealso cref="Object#toString"/> and store the result using a {@code char[]}
+	/// <seealso cref="object#toString"/> and store the result using a {@code char[]}
 	/// buffer. The same behavior have the {@code contains()} methods.
 	/// The <seealso cref="#iterator()"/> returns an {@code Iterator<char[]>}.
 	/// </para>
 	/// </summary>
-	public class CharArraySet : AbstractSet<object>
+	public class CharArraySet : ISet<object>
 	{
 	  public static readonly CharArraySet EMPTY_SET = new CharArraySet(CharArrayMap.emptyMap<object>());
 	  private static readonly object PLACEHOLDER = new object();
@@ -91,13 +88,11 @@ namespace org.apache.lucene.analysis.util
 	  ///          otherwise <code>true</code>. </param>
 	  public CharArraySet<T1>(Version matchVersion, ICollection<T1> c, bool ignoreCase) : this(matchVersion, c.Count, ignoreCase)
 	  {
-		addAll(c);
+		AddAll(c);
 	  }
 
 	  /// <summary>
 	  /// Create set from the specified map (internal only), used also by <seealso cref="CharArrayMap#keySet()"/> </summary>
-//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
-//ORIGINAL LINE: CharArraySet(final CharArrayMap<Object> map)
 	  internal CharArraySet(CharArrayMap<object> map)
 	  {
 		this.map = map;
@@ -105,7 +100,7 @@ namespace org.apache.lucene.analysis.util
 
 	  /// <summary>
 	  /// Clears all entries in this set. This method is supported for reusing, but not <seealso cref="Set#remove"/>. </summary>
-	  public override void clear()
+	  public void Clear()
 	  {
 		map.clear();
 	  }
@@ -114,38 +109,31 @@ namespace org.apache.lucene.analysis.util
 	  /// true if the <code>len</code> chars of <code>text</code> starting at <code>off</code>
 	  /// are in the set 
 	  /// </summary>
-	  public virtual bool contains(char[] text, int off, int len)
+	  public virtual bool Contains(char[] text, int off, int len)
 	  {
 		return map.containsKey(text, off, len);
 	  }
 
 	  /// <summary>
 	  /// true if the <code>CharSequence</code> is in the set </summary>
-	  public virtual bool contains(CharSequence cs)
+	  public virtual bool Contains(string cs)
 	  {
 		return map.containsKey(cs);
 	  }
 
-	  public override bool contains(object o)
+	  public bool Contains(object o)
 	  {
 		return map.containsKey(o);
 	  }
 
-	  public override bool add(object o)
+	  public bool Add(object o)
 	  {
 		return map.put(o, PLACEHOLDER) == null;
 	  }
 
 	  /// <summary>
-	  /// Add this CharSequence into the set </summary>
-	  public virtual bool add(CharSequence text)
-	  {
-		return map.put(text, PLACEHOLDER) == null;
-	  }
-
-	  /// <summary>
 	  /// Add this String into the set </summary>
-	  public virtual bool add(string text)
+	  public virtual bool Add(string text)
 	  {
 		return map.put(text, PLACEHOLDER) == null;
 	  }
@@ -155,12 +143,12 @@ namespace org.apache.lucene.analysis.util
 	  /// If ignoreCase is true for this Set, the text array will be directly modified.
 	  /// The user should never modify this text array after calling this method.
 	  /// </summary>
-	  public virtual bool add(char[] text)
+	  public virtual bool Add(char[] text)
 	  {
 		return map.put(text, PLACEHOLDER) == null;
 	  }
 
-	  public override int size()
+	  public override int Size()
 	  {
 		return map.size();
 	  }
@@ -211,9 +199,7 @@ namespace org.apache.lucene.analysis.util
 	  /// <returns> a copy of the given set as a <seealso cref="CharArraySet"/>. If the given set
 	  ///         is a <seealso cref="CharArraySet"/> the ignoreCase property as well as the
 	  ///         matchVersion will be of the given set will be preserved. </returns>
-//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
-//ORIGINAL LINE: public static CharArraySet copy(final org.apache.lucene.util.Version matchVersion, final java.util.Set<?> set)
-	  public static CharArraySet copy<T1>(Version matchVersion, HashSet<T1> set)
+	  public static CharArraySet Copy<T1>(Version matchVersion, HashSet<T1> set)
 	  {
 		if (set == EMPTY_SET)
 		{
@@ -221,8 +207,6 @@ namespace org.apache.lucene.analysis.util
 		}
 		if (set is CharArraySet)
 		{
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final CharArraySet source = (CharArraySet) set;
 		  CharArraySet source = (CharArraySet) set;
 		  return new CharArraySet(CharArrayMap.copy(source.map.matchVersion, source.map));
 		}
@@ -232,8 +216,6 @@ namespace org.apache.lucene.analysis.util
 	  /// <summary>
 	  /// Returns an <seealso cref="Iterator"/> for {@code char[]} instances in this set.
 	  /// </summary>
-//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
-//ORIGINAL LINE: @Override @SuppressWarnings("unchecked") public java.util.Iterator<Object> iterator()
 	  public override IEnumerator<object> iterator()
 	  {
 		// use the AbstractSet#keySet()'s iterator (to not produce endless recursion)
@@ -242,9 +224,7 @@ namespace org.apache.lucene.analysis.util
 
 	  public override string ToString()
 	  {
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final StringBuilder sb = new StringBuilder("[");
-		StringBuilder sb = new StringBuilder("[");
+		var sb = new StringBuilder("[");
 		foreach (object item in this)
 		{
 		  if (sb.Length > 1)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cd3ee136/src/Lucene.Net.Analysis.Common/Analysis/Util/CharacterUtils.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Util/CharacterUtils.cs b/src/Lucene.Net.Analysis.Common/Analysis/Util/CharacterUtils.cs
index e876a6f..0b88d7b 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Util/CharacterUtils.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Util/CharacterUtils.cs
@@ -1,6 +1,8 @@
 using System.Diagnostics;
+using Lucene.Net.Support;
+using Lucene.Net.Util;
 
-namespace org.apache.lucene.analysis.util
+namespace Lucene.Net.Analysis.Util
 {
 
 	/*
@@ -19,11 +21,7 @@ namespace org.apache.lucene.analysis.util
 	 * See the License for the specific language governing permissions and
 	 * limitations under the License.
 	 */
-
-
-	using Version = org.apache.lucene.util.Version;
-
-	/// <summary>
+    /// <summary>
 	/// <seealso cref="CharacterUtils"/> provides a unified interface to Character-related
 	/// operations to implement backwards compatible character operations based on a
 	/// <seealso cref="Version"/> instance.
@@ -43,11 +41,9 @@ namespace org.apache.lucene.analysis.util
 	  ///          a version instance </param>
 	  /// <returns> a <seealso cref="CharacterUtils"/> implementation according to the given
 	  ///         <seealso cref="Version"/> instance. </returns>
-//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
-//ORIGINAL LINE: public static CharacterUtils getInstance(final org.apache.lucene.util.Version matchVersion)
 	  public static CharacterUtils getInstance(Version matchVersion)
 	  {
-		return matchVersion.onOrAfter(Version.LUCENE_31) ? JAVA_5 : JAVA_4;
+		return matchVersion.OnOrAfter(Version.LUCENE_31) ? JAVA_5 : JAVA_4;
 	  }
 
 	  /// <summary>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cd3ee136/src/Lucene.Net.Analysis.Common/Analysis/Util/ClasspathResourceLoader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Util/ClasspathResourceLoader.cs b/src/Lucene.Net.Analysis.Common/Analysis/Util/ClasspathResourceLoader.cs
index 8b7c93b..8ead1fb 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Util/ClasspathResourceLoader.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Util/ClasspathResourceLoader.cs
@@ -1,7 +1,8 @@
 using System;
+using System.IO;
 using System.Threading;
 
-namespace org.apache.lucene.analysis.util
+namespace Lucene.Net.Analysis.Util
 {
 
 	/*
@@ -62,13 +63,9 @@ namespace org.apache.lucene.analysis.util
 		this.loader = loader;
 	  }
 
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: @Override public java.io.InputStream openResource(String resource) throws java.io.IOException
-	  public InputStream openResource(string resource)
+	  public Stream openResource(string resource)
 	  {
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final java.io.InputStream stream = (clazz != null) ? clazz.getResourceAsStream(resource) : loader.getResourceAsStream(resource);
-		InputStream stream = (clazz != null) ? clazz.getResourceAsStream(resource) : loader.getResourceAsStream(resource);
+		Stream stream = (clazz != null) ? clazz.getResourceAsStream(resource) : loader.getResourceAsStream(resource);
 		if (stream == null)
 		{
 		  throw new IOException("Resource not found: " + resource);


Mime
View raw message