lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [1/4] lucenenet git commit: More Analysis porting fixes
Date Sun, 09 Nov 2014 04:47:57 GMT
Repository: lucenenet
Updated Branches:
  refs/heads/master 6f6f938ef -> cd3ee1366


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cd3ee136/src/Lucene.Net.Analysis.Common/Analysis/Util/ElisionFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Util/ElisionFilter.cs b/src/Lucene.Net.Analysis.Common/Analysis/Util/ElisionFilter.cs
index 2571ccd..d14fb0e 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Util/ElisionFilter.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Util/ElisionFilter.cs
@@ -1,80 +1,77 @@
-namespace org.apache.lucene.analysis.util
-{
-
-	/*
-	 * 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 Lucene.Net.Analysis.Tokenattributes;
 
-	using CharTermAttribute = org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
-
-	/// <summary>
-	/// Removes elisions from a <seealso cref="TokenStream"/>. For example, "l'avion" (the plane) will be
-	/// tokenized as "avion" (plane).
-	/// </summary>
-	/// <seealso cref= <a href="http://fr.wikipedia.org/wiki/%C3%89lision">Elision in Wikipedia</a> </seealso>
-	public sealed class ElisionFilter : TokenFilter
-	{
-	  private readonly CharArraySet articles;
-	  private readonly CharTermAttribute termAtt = addAttribute(typeof(CharTermAttribute));
+namespace Lucene.Net.Analysis.Util
+{
 
-	  /// <summary>
-	  /// Constructs an elision filter with a Set of stop words </summary>
-	  /// <param name="input"> the source <seealso cref="TokenStream"/> </param>
-	  /// <param name="articles"> a set of stopword articles </param>
-	  public ElisionFilter(TokenStream input, CharArraySet articles) : base(input)
-	  {
-		this.articles = articles;
-	  }
+    /*
+     * 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>
+    /// Removes elisions from a <seealso cref="TokenStream"/>. For example, "l'avion" (the plane) will be
+    /// tokenized as "avion" (plane).
+    /// </summary>
+    /// <seealso cref= <a href="http://fr.wikipedia.org/wiki/%C3%89lision">Elision in Wikipedia</a> </seealso>
+    public sealed class ElisionFilter : TokenFilter
+    {
+        private readonly CharArraySet articles;
+        private readonly CharTermAttribute termAtt = addAttribute(typeof(CharTermAttribute));
 
-	  /// <summary>
-	  /// Increments the <seealso cref="TokenStream"/> with a <seealso cref="CharTermAttribute"/> without elisioned start
-	  /// </summary>
-//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()
-	  {
-		if (input.incrementToken())
-		{
-		  char[] termBuffer = termAtt.buffer();
-		  int termLength = termAtt.length();
+        /// <summary>
+        /// Constructs an elision filter with a Set of stop words </summary>
+        /// <param name="input"> the source <seealso cref="TokenStream"/> </param>
+        /// <param name="articles"> a set of stopword articles </param>
+        public ElisionFilter(TokenStream input, CharArraySet articles)
+            : base(input)
+        {
+            this.articles = articles;
+        }
 
-		  int index = -1;
-		  for (int i = 0; i < termLength; i++)
-		  {
-			char ch = termBuffer[i];
-			if (ch == '\'' || ch == '\u2019')
-			{
-			  index = i;
-			  break;
-			}
-		  }
+        /// <summary>
+        /// Increments the <seealso cref="TokenStream"/> with a <seealso cref="CharTermAttribute"/> without elisioned start
+        /// </summary>
+        public override bool IncrementToken()
+        {
+            if (input.IncrementToken())
+            {
+                char[] termBuffer = termAtt.Buffer();
+                int termLength = termAtt.Length;
 
-		  // An apostrophe has been found. If the prefix is an article strip it off.
-		  if (index >= 0 && articles.contains(termBuffer, 0, index))
-		  {
-			termAtt.copyBuffer(termBuffer, index + 1, termLength - (index + 1));
-		  }
+                int index = -1;
+                for (int i = 0; i < termLength; i++)
+                {
+                    char ch = termBuffer[i];
+                    if (ch == '\'' || ch == '\u2019')
+                    {
+                        index = i;
+                        break;
+                    }
+                }
 
-		  return true;
-		}
-		else
-		{
-		  return false;
-		}
-	  }
-	}
+                // An apostrophe has been found. If the prefix is an article strip it off.
+                if (index >= 0 && articles.Contains(termBuffer, 0, index))
+                {
+                    termAtt.CopyBuffer(termBuffer, index + 1, termLength - (index + 1));
+                }
 
+                return true;
+            }
+            else
+            {
+                return false;
+            }
+        }
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cd3ee136/src/Lucene.Net.Analysis.Common/Analysis/Util/FilesystemResourceLoader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Util/FilesystemResourceLoader.cs b/src/Lucene.Net.Analysis.Common/Analysis/Util/FilesystemResourceLoader.cs
index 598fef8..60044dd 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Util/FilesystemResourceLoader.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Util/FilesystemResourceLoader.cs
@@ -1,6 +1,7 @@
 using System;
+using System.IO;
 
-namespace org.apache.lucene.analysis.util
+namespace Lucene.Net.Analysis.Util
 {
 
 	/*
@@ -80,9 +81,7 @@ namespace org.apache.lucene.analysis.util
 		this.@delegate = @delegate;
 	  }
 
-//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)
 	  {
 		try
 		{

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cd3ee136/src/Lucene.Net.Analysis.Common/Analysis/Util/FilteringTokenFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Util/FilteringTokenFilter.cs b/src/Lucene.Net.Analysis.Common/Analysis/Util/FilteringTokenFilter.cs
index 0feb6b8..d5eb9fd 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Util/FilteringTokenFilter.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Util/FilteringTokenFilter.cs
@@ -1,5 +1,7 @@
 using System;
 using Lucene.Net.Analysis.Tokenattributes;
+using Lucene.Net.Util;
+using Version = Lucene.Net.Util.Version;
 
 namespace Lucene.Net.Analysis.Util
 {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cd3ee136/src/Lucene.Net.Analysis.Common/Analysis/Util/MultiTermAwareComponent.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Util/MultiTermAwareComponent.cs b/src/Lucene.Net.Analysis.Common/Analysis/Util/MultiTermAwareComponent.cs
index 64cdb36..fda0459 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Util/MultiTermAwareComponent.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Util/MultiTermAwareComponent.cs
@@ -1,39 +1,36 @@
-using Lucene.Net.Analysis.Util;
-
-namespace org.apache.lucene.analysis.util
+namespace Lucene.Net.Analysis.Util
 {
 
-	/*
-	 * 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>
-	/// Add to any analysis factory component to allow returning an
-	/// analysis component factory for use with partial terms in prefix queries,
-	/// wildcard queries, range query endpoints, regex queries, etc.
-	/// 
-	/// @lucene.experimental
-	/// </summary>
-	public interface MultiTermAwareComponent
-	{
-	  /// <summary>
-	  /// Returns an analysis component to handle analysis if multi-term queries.
-	  /// The returned component must be a TokenizerFactory, TokenFilterFactory or CharFilterFactory.
-	  /// </summary>
-	  AbstractAnalysisFactory MultiTermComponent {get;}
-	}
+    /*
+     * 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>
+    /// Add to any analysis factory component to allow returning an
+    /// analysis component factory for use with partial terms in prefix queries,
+    /// wildcard queries, range query endpoints, regex queries, etc.
+    /// 
+    /// @lucene.experimental
+    /// </summary>
+    public interface MultiTermAwareComponent
+    {
+        /// <summary>
+        /// Returns an analysis component to handle analysis if multi-term queries.
+        /// The returned component must be a TokenizerFactory, TokenFilterFactory or CharFilterFactory.
+        /// </summary>
+        AbstractAnalysisFactory MultiTermComponent { get; }
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cd3ee136/src/Lucene.Net.Analysis.Common/Analysis/Util/OpenStringBuilder.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Util/OpenStringBuilder.cs b/src/Lucene.Net.Analysis.Common/Analysis/Util/OpenStringBuilder.cs
index ead67a2..4081e36 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Util/OpenStringBuilder.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Util/OpenStringBuilder.cs
@@ -1,6 +1,6 @@
 using System;
 
-namespace org.apache.lucene.analysis.util
+namespace Lucene.Net.Analysis.Util
 {
 
 	/*

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cd3ee136/src/Lucene.Net.Analysis.Common/Analysis/Util/ResourceLoader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Util/ResourceLoader.cs b/src/Lucene.Net.Analysis.Common/Analysis/Util/ResourceLoader.cs
index 3e4bc1f..4d95bc0 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Util/ResourceLoader.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Util/ResourceLoader.cs
@@ -1,49 +1,48 @@
 using System;
+using System.IO;
 
-namespace org.apache.lucene.analysis.util
+namespace Lucene.Net.Analysis.Util
 {
 
-	/*
-	 * 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>
-	/// Abstraction for loading resources (streams, files, and classes).
-	/// </summary>
-	public interface ResourceLoader
-	{
-
-	  /// <summary>
-	  /// Opens a named resource
-	  /// </summary>
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: public java.io.InputStream openResource(String resource) throws java.io.IOException;
-	  InputStream openResource(string resource);
-
-
-	  /// <summary>
-	  /// Finds class of the name and expected type
-	  /// </summary>
-	  Type findClass<T>(string cname, Type expectedType);
-
-	  /// <summary>
-	  /// Creates an instance of the name and expected type
-	  /// </summary>
-	  // TODO: fix exception handling
-	  T newInstance<T>(string cname, Type expectedType);
-	}
+    /*
+     * 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>
+    /// Abstraction for loading resources (streams, files, and classes).
+    /// </summary>
+    public interface ResourceLoader
+    {
+
+        /// <summary>
+        /// Opens a named resource
+        /// </summary>
+        Stream OpenResource(string resource);
+
+
+        /// <summary>
+        /// Finds class of the name and expected type
+        /// </summary>
+        Type FindClass<T>(string cname, Type expectedType);
+
+        /// <summary>
+        /// Creates an instance of the name and expected type
+        /// </summary>
+        // TODO: fix exception handling
+        T NewInstance<T>(string cname, Type expectedType);
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cd3ee136/src/Lucene.Net.Analysis.Common/Analysis/Util/ResourceLoaderAware.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Util/ResourceLoaderAware.cs b/src/Lucene.Net.Analysis.Common/Analysis/Util/ResourceLoaderAware.cs
index 97fe682..eceb3e6 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Util/ResourceLoaderAware.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Util/ResourceLoaderAware.cs
@@ -15,24 +15,23 @@
  * limitations under the License.
  */
 
-namespace org.apache.lucene.analysis.util
-{
+using org.apache.lucene.analysis.util;
 
-	/// <summary>
-	/// Interface for a component that needs to be initialized by
-	/// an implementation of <seealso cref="ResourceLoader"/>.
-	/// </summary>
-	/// <seealso cref= ResourceLoader </seealso>
-	public interface ResourceLoaderAware
-	{
+namespace Lucene.Net.Analysis.Util
+{
 
-	  /// <summary>
-	  /// Initializes this component with the provided ResourceLoader
-	  /// (used for loading classes, files, etc).
-	  /// </summary>
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: void inform(ResourceLoader loader) throws java.io.IOException;
-	  void inform(ResourceLoader loader);
-	}
+    /// <summary>
+    /// Interface for a component that needs to be initialized by
+    /// an implementation of <seealso cref="ResourceLoader"/>.
+    /// </summary>
+    /// <seealso cref= ResourceLoader </seealso>
+    public interface ResourceLoaderAware
+    {
 
+        /// <summary>
+        /// Initializes this component with the provided ResourceLoader
+        /// (used for loading classes, files, etc).
+        /// </summary>
+        void Inform(ResourceLoader loader);
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cd3ee136/src/Lucene.Net.Analysis.Common/Analysis/Util/RollingCharBuffer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Util/RollingCharBuffer.cs b/src/Lucene.Net.Analysis.Common/Analysis/Util/RollingCharBuffer.cs
index 1aae904..bac5fb6 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Util/RollingCharBuffer.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Util/RollingCharBuffer.cs
@@ -1,200 +1,176 @@
 using System;
 using System.Diagnostics;
+using System.IO;
+using Lucene.Net.Util;
 
-namespace org.apache.lucene.analysis.util
+namespace Lucene.Net.Analysis.Util
 {
 
-	/*
-	 * 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 ArrayUtil = org.apache.lucene.util.ArrayUtil;
-	using RamUsageEstimator = org.apache.lucene.util.RamUsageEstimator;
-
-	/// <summary>
-	/// Acts like a forever growing char[] as you read
-	///  characters into it from the provided reader, but
-	///  internally it uses a circular buffer to only hold the
-	///  characters that haven't been freed yet.  This is like a
-	///  PushbackReader, except you don't have to specify
-	///  up-front the max size of the buffer, but you do have to
-	///  periodically call <seealso cref="#freeBefore"/>. 
-	/// </summary>
-
-	public sealed class RollingCharBuffer
-	{
-
-	  private Reader reader;
-
-	  private char[] buffer = new char[512];
-
-	  // Next array index to write to in buffer:
-	  private int nextWrite;
-
-	  // Next absolute position to read from reader:
-	  private int nextPos;
-
-	  // How many valid chars (wrapped) are in the buffer:
-	  private int count;
-
-	  // True if we hit EOF
-	  private bool end;
-
-	  /// <summary>
-	  /// Clear array and switch to new reader. </summary>
-	  public void reset(Reader reader)
-	  {
-		this.reader = reader;
-		nextPos = 0;
-		nextWrite = 0;
-		count = 0;
-		end = false;
-	  }
-
-	  /* Absolute position read.  NOTE: pos must not jump
-	   * ahead by more than 1!  Ie, it's OK to read arbitarily
-	   * far back (just not prior to the last {@link
-	   * #freeBefore}), but NOT ok to read arbitrarily far
-	   * ahead.  Returns -1 if you hit EOF. */
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: public int get(int pos) throws java.io.IOException
-	  public int get(int pos)
-	  {
-		//System.out.println("    get pos=" + pos + " nextPos=" + nextPos + " count=" + count);
-		if (pos == nextPos)
-		{
-		  if (end)
-		  {
-			return -1;
-		  }
-		  if (count == buffer.Length)
-		  {
-			// Grow
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final char[] newBuffer = new char[org.apache.lucene.util.ArrayUtil.oversize(1+count, org.apache.lucene.util.RamUsageEstimator.NUM_BYTES_CHAR)];
-			char[] newBuffer = new char[ArrayUtil.oversize(1 + count, RamUsageEstimator.NUM_BYTES_CHAR)];
-			//System.out.println(Thread.currentThread().getName() + ": cb grow " + newBuffer.length);
-			Array.Copy(buffer, nextWrite, newBuffer, 0, buffer.Length - nextWrite);
-			Array.Copy(buffer, 0, newBuffer, buffer.Length - nextWrite, nextWrite);
-			nextWrite = buffer.Length;
-			buffer = newBuffer;
-		  }
-		  if (nextWrite == buffer.Length)
-		  {
-			nextWrite = 0;
-		  }
-
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final int toRead = buffer.length - Math.max(count, nextWrite);
-		  int toRead = buffer.Length - Math.Max(count, nextWrite);
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final int readCount = reader.read(buffer, nextWrite, toRead);
-		  int readCount = reader.read(buffer, nextWrite, toRead);
-		  if (readCount == -1)
-		  {
-			end = true;
-			return -1;
-		  }
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final int ch = buffer[nextWrite];
-		  int ch = buffer[nextWrite];
-		  nextWrite += readCount;
-		  count += readCount;
-		  nextPos += readCount;
-		  return ch;
-		}
-		else
-		{
-		  // Cannot read from future (except by 1):
-		  Debug.Assert(pos < nextPos);
-
-		  // Cannot read from already freed past:
-		  Debug.Assert(nextPos - pos <= count, "nextPos=" + nextPos + " pos=" + pos + " count=" + count);
-
-		  return buffer[getIndex(pos)];
-		}
-	  }
-
-	  // For assert:
-	  private bool inBounds(int pos)
-	  {
-		return pos >= 0 && pos < nextPos && pos >= nextPos - count;
-	  }
-
-	  private int getIndex(int pos)
-	  {
-		int index = nextWrite - (nextPos - pos);
-		if (index < 0)
-		{
-		  // Wrap:
-		  index += buffer.Length;
-		  Debug.Assert(index >= 0);
-		}
-		return index;
-	  }
-
-	  public char[] get(int posStart, int length)
-	  {
-		Debug.Assert(length > 0);
-		Debug.Assert(inBounds(posStart), "posStart=" + posStart + " length=" + length);
-		//System.out.println("    buffer.get posStart=" + posStart + " len=" + length);
-
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final int startIndex = getIndex(posStart);
-		int startIndex = getIndex(posStart);
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final int endIndex = getIndex(posStart + length);
-		int endIndex = getIndex(posStart + length);
-		//System.out.println("      startIndex=" + startIndex + " endIndex=" + endIndex);
-
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final char[] result = new char[length];
-		char[] result = new char[length];
-		if (endIndex >= startIndex && length < buffer.Length)
-		{
-		  Array.Copy(buffer, startIndex, result, 0, endIndex - startIndex);
-		}
-		else
-		{
-		  // Wrapped:
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final int part1 = buffer.length-startIndex;
-		  int part1 = buffer.Length - startIndex;
-		  Array.Copy(buffer, startIndex, result, 0, part1);
-		  Array.Copy(buffer, 0, result, buffer.Length - startIndex, length - part1);
-		}
-		return result;
-	  }
-
-	  /// <summary>
-	  /// Call this to notify us that no chars before this
-	  ///  absolute position are needed anymore. 
-	  /// </summary>
-	  public void freeBefore(int pos)
-	  {
-		Debug.Assert(pos >= 0);
-		Debug.Assert(pos <= nextPos);
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final int newCount = nextPos - pos;
-		int newCount = nextPos - pos;
-		Debug.Assert(newCount <= count, "newCount=" + newCount + " count=" + count);
-		Debug.Assert(newCount <= buffer.Length, "newCount=" + newCount + " buf.length=" + buffer.Length);
-		count = newCount;
-	  }
-	}
-
+    /*
+     * 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>
+    /// Acts like a forever growing char[] as you read
+    ///  characters into it from the provided reader, but
+    ///  internally it uses a circular buffer to only hold the
+    ///  characters that haven't been freed yet.  This is like a
+    ///  PushbackReader, except you don't have to specify
+    ///  up-front the max size of the buffer, but you do have to
+    ///  periodically call <seealso cref="#freeBefore"/>. 
+    /// </summary>
+
+    public sealed class RollingCharBuffer
+    {
+
+        private TextReader reader;
+
+        private char[] buffer = new char[512];
+
+        // Next array index to write to in buffer:
+        private int nextWrite;
+
+        // Next absolute position to read from reader:
+        private int nextPos;
+
+        // How many valid chars (wrapped) are in the buffer:
+        private int count;
+
+        // True if we hit EOF
+        private bool end;
+
+        /// <summary>
+        /// Clear array and switch to new reader. </summary>
+        public void Reset(TextReader reader)
+        {
+            this.reader = reader;
+            nextPos = 0;
+            nextWrite = 0;
+            count = 0;
+            end = false;
+        }
+
+        /* Absolute position read.  NOTE: pos must not jump
+         * ahead by more than 1!  Ie, it's OK to read arbitarily
+         * far back (just not prior to the last {@link
+         * #freeBefore}), but NOT ok to read arbitrarily far
+         * ahead.  Returns -1 if you hit EOF. */
+        public int Get(int pos)
+        {
+            //System.out.println("    get pos=" + pos + " nextPos=" + nextPos + " count=" + count);
+            if (pos == nextPos)
+            {
+                if (end)
+                {
+                    return -1;
+                }
+                if (count == buffer.Length)
+                {
+                    // Grow
+                    var newBuffer = new char[ArrayUtil.Oversize(1 + count, RamUsageEstimator.NUM_BYTES_CHAR)];
+                    //System.out.println(Thread.currentThread().getName() + ": cb grow " + newBuffer.length);
+                    Array.Copy(buffer, nextWrite, newBuffer, 0, buffer.Length - nextWrite);
+                    Array.Copy(buffer, 0, newBuffer, buffer.Length - nextWrite, nextWrite);
+                    nextWrite = buffer.Length;
+                    buffer = newBuffer;
+                }
+                if (nextWrite == buffer.Length)
+                {
+                    nextWrite = 0;
+                }
+
+                int toRead = buffer.Length - Math.Max(count, nextWrite);
+                int readCount = reader.Read(buffer, nextWrite, toRead);
+                if (readCount == -1)
+                {
+                    end = true;
+                    return -1;
+                }
+                int ch = buffer[nextWrite];
+                nextWrite += readCount;
+                count += readCount;
+                nextPos += readCount;
+                return ch;
+            }
+            else
+            {
+                // Cannot read from future (except by 1):
+                Debug.Assert(pos < nextPos);
+
+                // Cannot read from already freed past:
+                Debug.Assert(nextPos - pos <= count, "nextPos=" + nextPos + " pos=" + pos + " count=" + count);
+
+                return buffer[GetIndex(pos)];
+            }
+        }
+
+        // For assert:
+        private bool InBounds(int pos)
+        {
+            return pos >= 0 && pos < nextPos && pos >= nextPos - count;
+        }
+
+        private int GetIndex(int pos)
+        {
+            int index = nextWrite - (nextPos - pos);
+            if (index < 0)
+            {
+                // Wrap:
+                index += buffer.Length;
+                Debug.Assert(index >= 0);
+            }
+            return index;
+        }
+
+        public char[] Get(int posStart, int length)
+        {
+            Debug.Assert(length > 0);
+            Debug.Assert(InBounds(posStart), "posStart=" + posStart + " length=" + length);
+            //System.out.println("    buffer.get posStart=" + posStart + " len=" + length);
+
+            int startIndex = GetIndex(posStart);
+            int endIndex = GetIndex(posStart + length);
+            //System.out.println("      startIndex=" + startIndex + " endIndex=" + endIndex);
+
+            var result = new char[length];
+            if (endIndex >= startIndex && length < buffer.Length)
+            {
+                Array.Copy(buffer, startIndex, result, 0, endIndex - startIndex);
+            }
+            else
+            {
+                // Wrapped:
+                int part1 = buffer.Length - startIndex;
+                Array.Copy(buffer, startIndex, result, 0, part1);
+                Array.Copy(buffer, 0, result, buffer.Length - startIndex, length - part1);
+            }
+            return result;
+        }
+
+        /// <summary>
+        /// Call this to notify us that no chars before this
+        ///  absolute position are needed anymore. 
+        /// </summary>
+        public void FreeBefore(int pos)
+        {
+            Debug.Assert(pos >= 0);
+            Debug.Assert(pos <= nextPos);
+            int newCount = nextPos - pos;
+            Debug.Assert(newCount <= count, "newCount=" + newCount + " count=" + count);
+            Debug.Assert(newCount <= buffer.Length, "newCount=" + newCount + " buf.length=" + buffer.Length);
+            count = newCount;
+        }
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cd3ee136/src/Lucene.Net.Analysis.Common/Analysis/Util/SegmentingTokenizerBase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Util/SegmentingTokenizerBase.cs b/src/Lucene.Net.Analysis.Common/Analysis/Util/SegmentingTokenizerBase.cs
index 873936e..231f550 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Util/SegmentingTokenizerBase.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Util/SegmentingTokenizerBase.cs
@@ -1,7 +1,10 @@
 using System;
 using System.Diagnostics;
+using System.IO;
+using Lucene.Net.Analysis.Tokenattributes;
+using org.apache.lucene.analysis.util;
 
-namespace org.apache.lucene.analysis.util
+namespace Lucene.Net.Analysis.Util
 {
 
 	/*
@@ -22,8 +25,6 @@ namespace org.apache.lucene.analysis.util
 	 */
 
 
-	using OffsetAttribute = org.apache.lucene.analysis.tokenattributes.OffsetAttribute;
-
 	/// <summary>
 	/// Breaks text into sentences with a <seealso cref="BreakIterator"/> and
 	/// allows subclasses to decompose these sentences into words.
@@ -79,15 +80,13 @@ namespace org.apache.lucene.analysis.util
 		this.iterator = iterator;
 	  }
 
-//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 (length == 0 || !incrementWord())
+		if (length == 0 || !IncrementWord())
 		{
-		  while (!incrementSentence())
+		  while (!IncrementSentence())
 		  {
-			refill();
+			Refill();
 			if (length <= 0) // no more bytes to read;
 			{
 			  return false;
@@ -98,30 +97,24 @@ namespace org.apache.lucene.analysis.util
 		return true;
 	  }
 
-//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();
 		wrapper.setText(buffer, 0, 0);
 		iterator.Text = wrapper;
 		length = usableLength = offset = 0;
 	  }
 
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: @Override public final void end() throws java.io.IOException
-	  public override void end()
+	  public override void End()
 	  {
-		base.end();
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final int finalOffset = correctOffset(length < 0 ? offset : offset + length);
-		int finalOffset = correctOffset(length < 0 ? offset : offset + length);
-		offsetAtt.setOffset(finalOffset, finalOffset);
+		base.End();
+		int finalOffset = CorrectOffset(length < 0 ? offset : offset + length);
+		offsetAtt.SetOffset(finalOffset, finalOffset);
 	  }
 
 	  /// <summary>
 	  /// Returns the last unambiguous break position in the text. </summary>
-	  private int findSafeEnd()
+	  private int FindSafeEnd()
 	  {
 		for (int i = length - 1; i >= 0; i--)
 		{
@@ -135,9 +128,9 @@ namespace org.apache.lucene.analysis.util
 
 	  /// <summary>
 	  /// For sentence tokenization, these are the unambiguous break positions. </summary>
-	  protected internal virtual bool isSafeEnd(char ch)
+	  protected internal virtual bool IsSafeEnd(char ch)
 	  {
-		switch (ch)
+		switch ((int)ch)
 		{
 		  case 0x000D:
 		  case 0x000A:
@@ -150,47 +143,44 @@ namespace org.apache.lucene.analysis.util
 		}
 	  }
 
-	  /// <summary>
-	  /// Refill the buffer, accumulating the offset and setting usableLength to the
-	  /// last unambiguous break position
-	  /// </summary>
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: private void refill() throws java.io.IOException
-	  private void refill()
-	  {
-		offset += usableLength;
-		int leftover = length - usableLength;
-		Array.Copy(buffer, usableLength, buffer, 0, leftover);
-		int requested = buffer.Length - leftover;
-		int returned = read(input, buffer, leftover, requested);
-		length = returned < 0 ? leftover : returned + leftover;
-		if (returned < requested) // reader has been emptied, process the rest
-		{
-		  usableLength = length;
-		}
-		else // still more data to be read, find a safe-stopping place
-		{
-		  usableLength = findSafeEnd();
-		  if (usableLength < 0)
-		  {
-			usableLength = length; /*
+	    /// <summary>
+	    /// Refill the buffer, accumulating the offset and setting usableLength to the
+	    /// last unambiguous break position
+	    /// </summary>
+	    private void Refill()
+	    {
+	        offset += usableLength;
+	        int leftover = length - usableLength;
+	        Array.Copy(buffer, usableLength, buffer, 0, leftover);
+	        int requested = buffer.Length - leftover;
+	        int returned = read(input, buffer, leftover, requested);
+	        length = returned < 0 ? leftover : returned + leftover;
+	        if (returned < requested) // reader has been emptied, process the rest
+	        {
+	            usableLength = length;
+	        }
+	        else // still more data to be read, find a safe-stopping place
+	        {
+	            usableLength = FindSafeEnd();
+	            if (usableLength < 0)
+	            {
+	                usableLength = length; /*
 		  }
 	                                * more than IOBUFFER of text without breaks,
 	                                * gonna possibly truncate tokens
 	                                */
-		}
+	            }
 
-		wrapper.setText(buffer, 0, Math.Max(0, usableLength));
-		iterator.Text = wrapper;
-	  }
+	            wrapper.SetText(buffer, 0, Math.Max(0, usableLength));
+	            iterator.Text = wrapper;
+	        }
+	    }
 
-	  // TODO: refactor to a shared readFully somewhere
+	    // TODO: refactor to a shared readFully somewhere
 	  // (NGramTokenizer does this too):
 	  /// <summary>
 	  /// commons-io's readFully, but without bugs if offset != 0 </summary>
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: private static int read(java.io.Reader input, char[] buffer, int offset, int length) throws java.io.IOException
-	  private static int read(Reader input, char[] buffer, int offset, int length)
+	  private static int Read(TextReader input, char[] buffer, int offset, int length)
 	  {
 		Debug.Assert(length >= 0, "length must not be negative: " + length);
 
@@ -212,9 +202,7 @@ namespace org.apache.lucene.analysis.util
 	  /// return true if there is a token from the buffer, or null if it is
 	  /// exhausted.
 	  /// </summary>
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: private boolean incrementSentence() throws java.io.IOException
-	  private bool incrementSentence()
+	  private bool IncrementSentence()
 	  {
 		if (length == 0) // we must refill the buffer
 		{
@@ -223,7 +211,7 @@ namespace org.apache.lucene.analysis.util
 
 		while (true)
 		{
-		  int start = iterator.current();
+		  int start = iterator.Current();
 
 		  if (start == BreakIterator.DONE)
 		  {
@@ -248,11 +236,10 @@ namespace org.apache.lucene.analysis.util
 
 	  /// <summary>
 	  /// Provides the next input sentence for analysis </summary>
-	  protected internal abstract void setNextSentence(int sentenceStart, int sentenceEnd);
+	  protected internal abstract void SetNextSentence(int sentenceStart, int sentenceEnd);
 
 	  /// <summary>
 	  /// Returns true if another word is available </summary>
-	  protected internal abstract bool incrementWord();
+	  protected internal abstract bool IncrementWord();
 	}
-
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cd3ee136/src/Lucene.Net.Analysis.Common/Analysis/Util/StemmerUtil.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Util/StemmerUtil.cs b/src/Lucene.Net.Analysis.Common/Analysis/Util/StemmerUtil.cs
index e8a1ddc..145c064 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Util/StemmerUtil.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Util/StemmerUtil.cs
@@ -1,153 +1,146 @@
 using System;
 using System.Diagnostics;
 
-namespace org.apache.lucene.analysis.util
+namespace Lucene.Net.Analysis.Util
 {
 
-	/*
-	 * 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>
-	/// Some commonly-used stemming functions
-	/// 
-	/// @lucene.internal
-	/// </summary>
-	public class StemmerUtil
-	{
-	  /// <summary>
-	  /// no instance </summary>
-	  private StemmerUtil()
-	  {
-	  }
+    /// <summary>
+    /// Some commonly-used stemming functions
+    /// 
+    /// @lucene.internal
+    /// </summary>
+    public class StemmerUtil
+    {
+        /// <summary>
+        /// no instance </summary>
+        private StemmerUtil()
+        {
+        }
 
-	  /// <summary>
-	  /// Returns true if the character array starts with the suffix.
-	  /// </summary>
-	  /// <param name="s"> Input Buffer </param>
-	  /// <param name="len"> length of input buffer </param>
-	  /// <param name="prefix"> Prefix string to test </param>
-	  /// <returns> true if <code>s</code> starts with <code>prefix</code> </returns>
-	  public static bool StartsWith(char[] s, int len, string prefix)
-	  {
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final int prefixLen = prefix.length();
-		int prefixLen = prefix.Length;
-		if (prefixLen > len)
-		{
-		  return false;
-		}
-		for (int i = 0; i < prefixLen; i++)
-		{
-		  if (s[i] != prefix[i])
-		  {
-			return false;
-		  }
-		}
-		return true;
-	  }
+        /// <summary>
+        /// Returns true if the character array starts with the suffix.
+        /// </summary>
+        /// <param name="s"> Input Buffer </param>
+        /// <param name="len"> length of input buffer </param>
+        /// <param name="prefix"> Prefix string to test </param>
+        /// <returns> true if <code>s</code> starts with <code>prefix</code> </returns>
+        public static bool StartsWith(char[] s, int len, string prefix)
+        {
+            int prefixLen = prefix.Length;
+            if (prefixLen > len)
+            {
+                return false;
+            }
+            for (int i = 0; i < prefixLen; i++)
+            {
+                if (s[i] != prefix[i])
+                {
+                    return false;
+                }
+            }
+            return true;
+        }
 
-	  /// <summary>
-	  /// Returns true if the character array ends with the suffix.
-	  /// </summary>
-	  /// <param name="s"> Input Buffer </param>
-	  /// <param name="len"> length of input buffer </param>
-	  /// <param name="suffix"> Suffix string to test </param>
-	  /// <returns> true if <code>s</code> ends with <code>suffix</code> </returns>
-	  public static bool EndsWith(char[] s, int len, string suffix)
-	  {
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final int suffixLen = suffix.length();
-		int suffixLen = suffix.Length;
-		if (suffixLen > len)
-		{
-		  return false;
-		}
-		for (int i = suffixLen - 1; i >= 0; i--)
-		{
-		  if (s[len - (suffixLen - i)] != suffix[i])
-		  {
-			return false;
-		  }
-		}
+        /// <summary>
+        /// Returns true if the character array ends with the suffix.
+        /// </summary>
+        /// <param name="s"> Input Buffer </param>
+        /// <param name="len"> length of input buffer </param>
+        /// <param name="suffix"> Suffix string to test </param>
+        /// <returns> true if <code>s</code> ends with <code>suffix</code> </returns>
+        public static bool EndsWith(char[] s, int len, string suffix)
+        {
+            int suffixLen = suffix.Length;
+            if (suffixLen > len)
+            {
+                return false;
+            }
+            for (int i = suffixLen - 1; i >= 0; i--)
+            {
+                if (s[len - (suffixLen - i)] != suffix[i])
+                {
+                    return false;
+                }
+            }
 
-		return true;
-	  }
+            return true;
+        }
 
-	  /// <summary>
-	  /// Returns true if the character array ends with the suffix.
-	  /// </summary>
-	  /// <param name="s"> Input Buffer </param>
-	  /// <param name="len"> length of input buffer </param>
-	  /// <param name="suffix"> Suffix string to test </param>
-	  /// <returns> true if <code>s</code> ends with <code>suffix</code> </returns>
-	  public static bool EndsWith(char[] s, int len, char[] suffix)
-	  {
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final int suffixLen = suffix.length;
-		int suffixLen = suffix.Length;
-		if (suffixLen > len)
-		{
-		  return false;
-		}
-		for (int i = suffixLen - 1; i >= 0; i--)
-		{
-		  if (s[len - (suffixLen - i)] != suffix[i])
-		  {
-			return false;
-		  }
-		}
+        /// <summary>
+        /// Returns true if the character array ends with the suffix.
+        /// </summary>
+        /// <param name="s"> Input Buffer </param>
+        /// <param name="len"> length of input buffer </param>
+        /// <param name="suffix"> Suffix string to test </param>
+        /// <returns> true if <code>s</code> ends with <code>suffix</code> </returns>
+        public static bool EndsWith(char[] s, int len, char[] suffix)
+        {
+            int suffixLen = suffix.Length;
+            if (suffixLen > len)
+            {
+                return false;
+            }
+            for (int i = suffixLen - 1; i >= 0; i--)
+            {
+                if (s[len - (suffixLen - i)] != suffix[i])
+                {
+                    return false;
+                }
+            }
 
-		return true;
-	  }
+            return true;
+        }
 
-	  /// <summary>
-	  /// Delete a character in-place
-	  /// </summary>
-	  /// <param name="s"> Input Buffer </param>
-	  /// <param name="pos"> Position of character to delete </param>
-	  /// <param name="len"> length of input buffer </param>
-	  /// <returns> length of input buffer after deletion </returns>
-	  public static int delete(char[] s, int pos, int len)
-	  {
-		Debug.Assert(pos < len);
-		if (pos < len - 1) // don't arraycopy if asked to delete last character
-		{
-		  Array.Copy(s, pos + 1, s, pos, len - pos - 1);
-		}
-		return len - 1;
-	  }
-
-	  /// <summary>
-	  /// Delete n characters in-place
-	  /// </summary>
-	  /// <param name="s"> Input Buffer </param>
-	  /// <param name="pos"> Position of character to delete </param>
-	  /// <param name="len"> Length of input buffer </param>
-	  /// <param name="nChars"> number of characters to delete </param>
-	  /// <returns> length of input buffer after deletion </returns>
-	  public static int deleteN(char[] s, int pos, int len, int nChars)
-	  {
-		Debug.Assert(pos + nChars <= len);
-		if (pos + nChars < len) // don't arraycopy if asked to delete the last characters
-		{
-		  Array.Copy(s, pos + nChars, s, pos, len - pos - nChars);
-		}
-		return len - nChars;
-	  }
-	}
+        /// <summary>
+        /// Delete a character in-place
+        /// </summary>
+        /// <param name="s"> Input Buffer </param>
+        /// <param name="pos"> Position of character to delete </param>
+        /// <param name="len"> length of input buffer </param>
+        /// <returns> length of input buffer after deletion </returns>
+        public static int Delete(char[] s, int pos, int len)
+        {
+            Debug.Assert(pos < len);
+            if (pos < len - 1) // don't arraycopy if asked to delete last character
+            {
+                Array.Copy(s, pos + 1, s, pos, len - pos - 1);
+            }
+            return len - 1;
+        }
 
+        /// <summary>
+        /// Delete n characters in-place
+        /// </summary>
+        /// <param name="s"> Input Buffer </param>
+        /// <param name="pos"> Position of character to delete </param>
+        /// <param name="len"> Length of input buffer </param>
+        /// <param name="nChars"> number of characters to delete </param>
+        /// <returns> length of input buffer after deletion </returns>
+        public static int DeleteN(char[] s, int pos, int len, int nChars)
+        {
+            Debug.Assert(pos + nChars <= len);
+            if (pos + nChars < len) // don't arraycopy if asked to delete the last characters
+            {
+                Array.Copy(s, pos + nChars, s, pos, len - pos - nChars);
+            }
+            return len - nChars;
+        }
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cd3ee136/src/Lucene.Net.Analysis.Common/Analysis/Util/StopwordAnalyzerBase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Util/StopwordAnalyzerBase.cs b/src/Lucene.Net.Analysis.Common/Analysis/Util/StopwordAnalyzerBase.cs
index 2433a83..de736a3 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Util/StopwordAnalyzerBase.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Util/StopwordAnalyzerBase.cs
@@ -1,6 +1,4 @@
-using System;
-
-/*
+/*
  * 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.
@@ -16,15 +14,14 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+using System;
+using System.IO;
+using Lucene.Net.Util;
+using Version = System.Version;
 
-namespace org.apache.lucene.analysis.util
+namespace Lucene.Net.Analysis.Util
 {
-
-
-	using IOUtils = org.apache.lucene.util.IOUtils;
-	using Version = org.apache.lucene.util.Version;
-
-	/// <summary>
+    /// <summary>
 	/// Base class for Analyzers that need to make use of stopword sets. 
 	/// 
 	/// </summary>
@@ -59,13 +56,11 @@ namespace org.apache.lucene.analysis.util
 	  ///          the Lucene version for cross version compatibility </param>
 	  /// <param name="stopwords">
 	  ///          the analyzer's stopword set </param>
-//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
-//ORIGINAL LINE: protected StopwordAnalyzerBase(final org.apache.lucene.util.Version version, final CharArraySet stopwords)
 	  protected internal StopwordAnalyzerBase(Version version, CharArraySet stopwords)
 	  {
 		matchVersion = version;
 		// analyzers should use char array set for stopwords!
-		this.stopwords = stopwords == null ? CharArraySet.EMPTY_SET : CharArraySet.unmodifiableSet(CharArraySet.copy(version, stopwords));
+		this.stopwords = stopwords == null ? CharArraySet.EMPTY_SET : CharArraySet.unmodifiableSet(CharArraySet.Copy(version, stopwords));
 	  }
 
 	  /// <summary>
@@ -73,8 +68,6 @@ namespace org.apache.lucene.analysis.util
 	  /// </summary>
 	  /// <param name="version">
 	  ///          the Lucene version for cross version compatibility </param>
-//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
-//ORIGINAL LINE: protected StopwordAnalyzerBase(final org.apache.lucene.util.Version version)
 	  protected internal StopwordAnalyzerBase(Version version) : this(version, null)
 	  {
 	  }
@@ -96,22 +89,18 @@ namespace org.apache.lucene.analysis.util
 	  ///         file </returns>
 	  /// <exception cref="IOException">
 	  ///           if loading the stopwords throws an <seealso cref="IOException"/> </exception>
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: protected static CharArraySet loadStopwordSet(final boolean ignoreCase, final Class aClass, final String resource, final String comment) throws java.io.IOException
-//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
-	  protected internal static CharArraySet loadStopwordSet(bool ignoreCase, Type aClass, string resource, string comment)
+	  protected internal static CharArraySet LoadStopwordSet(bool ignoreCase, Type aClass, string resource, string comment)
 	  {
-		Reader reader = null;
+		TextReader reader = null;
 		try
 		{
-		  reader = IOUtils.getDecodingReader(aClass.getResourceAsStream(resource), StandardCharsets.UTF_8);
-		  return WordlistLoader.getWordSet(reader, comment, new CharArraySet(Version.LUCENE_CURRENT, 16, ignoreCase));
+		  reader = IOUtils.GetDecodingReader(aClass.GetResourceAsStream(resource), StandardCharsets.UTF_8);
+		  return WordlistLoader.GetWordSet(reader, comment, new CharArraySet(Version.LUCENE_CURRENT, 16, ignoreCase));
 		}
 		finally
 		{
-		  IOUtils.close(reader);
+		  IOUtils.Close(reader);
 		}
-
 	  }
 
 	  /// <summary>
@@ -126,19 +115,17 @@ namespace org.apache.lucene.analysis.util
 	  ///         file </returns>
 	  /// <exception cref="IOException">
 	  ///           if loading the stopwords throws an <seealso cref="IOException"/> </exception>
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: protected static CharArraySet loadStopwordSet(java.io.File stopwords, org.apache.lucene.util.Version matchVersion) throws java.io.IOException
-	  protected internal static CharArraySet loadStopwordSet(File stopwords, Version matchVersion)
+	  protected internal static CharArraySet LoadStopwordSet(File stopwords, Version matchVersion)
 	  {
 		Reader reader = null;
 		try
 		{
-		  reader = IOUtils.getDecodingReader(stopwords, StandardCharsets.UTF_8);
-		  return WordlistLoader.getWordSet(reader, matchVersion);
+		  reader = IOUtils.GetDecodingReader(stopwords, StandardCharsets.UTF_8);
+		  return WordlistLoader.GetWordSet(reader, matchVersion);
 		}
 		finally
 		{
-		  IOUtils.close(reader);
+		  IOUtils.Close(reader);
 		}
 	  }
 
@@ -154,17 +141,15 @@ namespace org.apache.lucene.analysis.util
 	  ///         reader </returns>
 	  /// <exception cref="IOException">
 	  ///           if loading the stopwords throws an <seealso cref="IOException"/> </exception>
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: protected static CharArraySet loadStopwordSet(java.io.Reader stopwords, org.apache.lucene.util.Version matchVersion) throws java.io.IOException
 	  protected internal static CharArraySet loadStopwordSet(Reader stopwords, Version matchVersion)
 	  {
 		try
 		{
-		  return WordlistLoader.getWordSet(stopwords, matchVersion);
+		  return WordlistLoader.GetWordSet(stopwords, matchVersion);
 		}
 		finally
 		{
-		  IOUtils.close(stopwords);
+		  IOUtils.Close(stopwords);
 		}
 	  }
 	}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cd3ee136/src/Lucene.Net.Analysis.Common/Analysis/Util/WordlistLoader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Util/WordlistLoader.cs b/src/Lucene.Net.Analysis.Common/Analysis/Util/WordlistLoader.cs
index baf3975..36e1877 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Util/WordlistLoader.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Util/WordlistLoader.cs
@@ -1,7 +1,11 @@
 using System;
 using System.Collections.Generic;
+using System.IO;
+using Lucene.Net.Util;
+using org.apache.lucene.analysis.util;
+using Version = System.Version;
 
-namespace org.apache.lucene.analysis.util
+namespace Lucene.Net.Analysis.Util
 {
 
 	/*
@@ -20,12 +24,7 @@ namespace org.apache.lucene.analysis.util
 	 * See the License for the specific language governing permissions and
 	 * limitations under the License.
 	 */
-
-
-	using IOUtils = org.apache.lucene.util.IOUtils;
-	using Version = org.apache.lucene.util.Version;
-
-	/// <summary>
+    /// <summary>
 	/// Loader for text files that represent a list of stopwords.
 	/// </summary>
 	/// <seealso cref= IOUtils to obtain <seealso cref="Reader"/> instances
@@ -50,9 +49,7 @@ namespace org.apache.lucene.analysis.util
 	  /// <param name="reader"> Reader containing the wordlist </param>
 	  /// <param name="result"> the <seealso cref="CharArraySet"/> to fill with the readers words </param>
 	  /// <returns> the given <seealso cref="CharArraySet"/> with the reader's words </returns>
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: public static CharArraySet getWordSet(java.io.Reader reader, CharArraySet result) throws java.io.IOException
-	  public static CharArraySet getWordSet(Reader reader, CharArraySet result)
+	  public static CharArraySet GetWordSet(TextReader reader, CharArraySet result)
 	  {
 		BufferedReader br = null;
 		try
@@ -78,13 +75,11 @@ namespace org.apache.lucene.analysis.util
 	  /// Analyzer which uses LowerCaseFilter (like StandardAnalyzer).
 	  /// </summary>
 	  /// <param name="reader"> Reader containing the wordlist </param>
-	  /// <param name="matchVersion"> the Lucene <seealso cref="Version"/> </param>
+	  /// <param name="matchVersion"> the Lucene <seealso cref="System.Version"/> </param>
 	  /// <returns> A <seealso cref="CharArraySet"/> with the reader's words </returns>
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: public static CharArraySet getWordSet(java.io.Reader reader, org.apache.lucene.util.Version matchVersion) throws java.io.IOException
-	  public static CharArraySet getWordSet(Reader reader, Version matchVersion)
+	  public static CharArraySet GetWordSet(TextReader reader, Version matchVersion)
 	  {
-		return getWordSet(reader, new CharArraySet(matchVersion, INITIAL_CAPACITY, false));
+		return GetWordSet(reader, new CharArraySet(matchVersion, INITIAL_CAPACITY, false));
 	  }
 
 	  /// <summary>
@@ -97,11 +92,9 @@ namespace org.apache.lucene.analysis.util
 	  /// <param name="comment"> The string representing a comment. </param>
 	  /// <param name="matchVersion"> the Lucene <seealso cref="Version"/> </param>
 	  /// <returns> A CharArraySet with the reader's words </returns>
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: public static CharArraySet getWordSet(java.io.Reader reader, String comment, org.apache.lucene.util.Version matchVersion) throws java.io.IOException
-	  public static CharArraySet getWordSet(Reader reader, string comment, Version matchVersion)
+	  public static CharArraySet GetWordSet(TextReader reader, string comment, Version matchVersion)
 	  {
-		return getWordSet(reader, comment, new CharArraySet(matchVersion, INITIAL_CAPACITY, false));
+		return GetWordSet(reader, comment, new CharArraySet(matchVersion, INITIAL_CAPACITY, false));
 	  }
 
 	  /// <summary>
@@ -114,16 +107,14 @@ namespace org.apache.lucene.analysis.util
 	  /// <param name="comment"> The string representing a comment. </param>
 	  /// <param name="result"> the <seealso cref="CharArraySet"/> to fill with the readers words </param>
 	  /// <returns> the given <seealso cref="CharArraySet"/> with the reader's words </returns>
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: public static CharArraySet getWordSet(java.io.Reader reader, String comment, CharArraySet result) throws java.io.IOException
-	  public static CharArraySet getWordSet(Reader reader, string comment, CharArraySet result)
+	  public static CharArraySet GetWordSet(TextReader reader, string comment, CharArraySet result)
 	  {
 		BufferedReader br = null;
 		try
 		{
 		  br = getBufferedReader(reader);
 		  string word = null;
-		  while ((word = br.readLine()) != null)
+		  while ((word = br.ReadLine()) != null)
 		  {
 			if (word.StartsWith(comment, StringComparison.Ordinal) == false)
 			{
@@ -133,7 +124,7 @@ namespace org.apache.lucene.analysis.util
 		}
 		finally
 		{
-		  IOUtils.close(br);
+		  IOUtils.Close(br);
 		}
 		return result;
 	  }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cd3ee136/src/Lucene.Net.Core/Analysis/CharFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Analysis/CharFilter.cs b/src/Lucene.Net.Core/Analysis/CharFilter.cs
index 930db48..bae10b1 100644
--- a/src/Lucene.Net.Core/Analysis/CharFilter.cs
+++ b/src/Lucene.Net.Core/Analysis/CharFilter.cs
@@ -42,14 +42,14 @@ namespace Lucene.Net.Analysis
         /// <summary>
         /// The underlying character-input stream.
         /// </summary>
-        public readonly TextReader Input;
+        public readonly TextReader input;
 
         /// <summary>
         /// Create a new CharFilter wrapping the provided reader. </summary>
         /// <param name="input"> a Reader, can also be a CharFilter for chaining. </param>
         protected CharFilter(TextReader input)
         {
-            this.Input = input;
+            this.input = input;
         }
 
         /// <summary>
@@ -61,7 +61,7 @@ namespace Lucene.Net.Analysis
         /// </summary>
         public override void Close()
         {
-            Input.Close();
+            input.Close();
         }
 
         /// <summary>
@@ -78,7 +78,7 @@ namespace Lucene.Net.Analysis
         public int CorrectOffset(int currentOff)
         {
             int corrected = Correct(currentOff);
-            return (Input is CharFilter) ? ((CharFilter)Input).CorrectOffset(corrected) : corrected;
+            return (input is CharFilter) ? ((CharFilter)input).CorrectOffset(corrected) : corrected;
         }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cd3ee136/src/Lucene.Net.TestFramework/Analysis/MockCharFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Analysis/MockCharFilter.cs b/src/Lucene.Net.TestFramework/Analysis/MockCharFilter.cs
index 698ab30..e1aece0 100644
--- a/src/Lucene.Net.TestFramework/Analysis/MockCharFilter.cs
+++ b/src/Lucene.Net.TestFramework/Analysis/MockCharFilter.cs
@@ -68,7 +68,7 @@ namespace Lucene.Net.Analysis
             }
 
             // otherwise actually read one
-            int c = Input.Read();
+            int c = input.Read();
             if (c < 0)
             {
                 return c;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cd3ee136/src/Lucene.Net.Tests/core/Analysis/TestCharFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Analysis/TestCharFilter.cs b/src/Lucene.Net.Tests/core/Analysis/TestCharFilter.cs
index c6f37fd..e04ba03 100644
--- a/src/Lucene.Net.Tests/core/Analysis/TestCharFilter.cs
+++ b/src/Lucene.Net.Tests/core/Analysis/TestCharFilter.cs
@@ -62,7 +62,7 @@ namespace Lucene.Net.Analysis
 
             public override int Read(char[] cbuf, int off, int len)
             {
-                int numRead = Input.Read(cbuf, off, len);
+                int numRead = input.Read(cbuf, off, len);
                 return numRead == 0 ? -1 : numRead;
             }
 
@@ -81,7 +81,7 @@ namespace Lucene.Net.Analysis
 
             public override int Read(char[] cbuf, int off, int len)
             {
-                int numRead = Input.Read(cbuf, off, len);
+                int numRead = input.Read(cbuf, off, len);
                 return numRead == 0 ? -1 : numRead;
             }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/cd3ee136/src/Lucene.Net.Tests/core/Analysis/TestMockAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Analysis/TestMockAnalyzer.cs b/src/Lucene.Net.Tests/core/Analysis/TestMockAnalyzer.cs
index e185484..b784eef 100644
--- a/src/Lucene.Net.Tests/core/Analysis/TestMockAnalyzer.cs
+++ b/src/Lucene.Net.Tests/core/Analysis/TestMockAnalyzer.cs
@@ -277,7 +277,7 @@ namespace Lucene.Net.Analysis
                 MockCharFilter charfilter = new MockCharFilter(reader, 2);
                 MockAnalyzer analyzer = new MockAnalyzer(Random());
                 Exception priorException = null;
-                TokenStream ts = analyzer.TokenStream("bogus", charfilter.Input);
+                TokenStream ts = analyzer.TokenStream("bogus", charfilter.input);
                 try
                 {
                     ts.Reset();


Mime
View raw message