You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by sy...@apache.org on 2015/05/31 00:20:52 UTC

[1/2] lucenenet git commit: More work on Analysis.Common

Repository: lucenenet
Updated Branches:
  refs/heads/master 40684b823 -> f47779a7e


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f47779a7/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 a760b2c..78aacd7 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Util/CharArrayMap.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Util/CharArrayMap.cs
@@ -4,6 +4,7 @@ using System.Collections.Generic;
 using System.Diagnostics;
 using System.Text;
 using Lucene.Net.Support;
+using Lucene.Net.Util;
 
 namespace Lucene.Net.Analysis.Util
 {
@@ -58,7 +59,7 @@ namespace Lucene.Net.Analysis.Util
 	  private readonly CharacterUtils charUtils;
 	  private bool ignoreCase;
 	  private int count;
-	  internal readonly Version matchVersion; // package private because used in CharArraySet
+	  internal readonly LuceneVersion matchVersion; // package private because used in CharArraySet
 	  internal char[][] keys; // package private because used in CharArraySet's non Set-conform CharArraySetIterator
 	  internal V[] values; // package private because used in CharArraySet's non Set-conform CharArraySetIterator
 
@@ -73,16 +74,16 @@ namespace Lucene.Net.Analysis.Util
 	  /// <param name="ignoreCase">
 	  ///          <code>false</code> if and only if the set should be case sensitive
 	  ///          otherwise <code>true</code>. </param>
-	  public CharArrayMap(Lucene.Net.Util.LuceneVersion matchVersion, int startSize, bool ignoreCase)
+	  public CharArrayMap(LuceneVersion matchVersion, int startSize, bool ignoreCase)
 	  {
 		this.ignoreCase = ignoreCase;
-		int size_Renamed = INIT_SIZE;
-		while (startSize + (startSize >> 2) > size_Renamed)
+		int size = INIT_SIZE;
+		while (startSize + (startSize >> 2) > size)
 		{
-		  size_Renamed <<= 1;
+		  size <<= 1;
 		}
-		keys = new char[size_Renamed][];
-		values = (V[]) new object[size_Renamed];
+		keys = new char[size][];
+		values = new V[size];
 		this.charUtils = CharacterUtils.GetInstance(matchVersion);
 		this.matchVersion = matchVersion;
 	  }
@@ -98,9 +99,13 @@ namespace Lucene.Net.Analysis.Util
 	  /// <param name="ignoreCase">
 	  ///          <code>false</code> if and only if the set should be case sensitive
 	  ///          otherwise <code>true</code>. </param>
-	  public CharArrayMap<T1>(Version matchVersion, IDictionary<T1> c, bool ignoreCase) where T1 : V : this(matchVersion, c.Count, ignoreCase)
+	  public CharArrayMap(LuceneVersion matchVersion, IDictionary<object, V> c, bool ignoreCase)
+          : this(matchVersion, c.Count, ignoreCase)
 	  {
-		putAll(c);
+	      foreach (var v in c)
+	      {
+	          Add(v);
+	      }
 	  }
 
 	  /// <summary>
@@ -115,58 +120,74 @@ namespace Lucene.Net.Analysis.Util
 		this.matchVersion = toCopy.matchVersion;
 	  }
 
-	  /// <summary>
+	    public void Add(KeyValuePair<object, V> item)
+	    {
+	        Put(item.Key, item.Value);
+	    }
+
+	    /// <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 virtual void Clear()
 	  {
 		count = 0;
 		Arrays.Fill(keys, null);
-		Arrays.Fill(values, null);
+		Arrays.Fill(values, default(V));
 	  }
 
-	  /// <summary>
+	    public bool Contains(KeyValuePair<object, V> item)
+	    {
+	        throw new NotImplementedException();
+	    }
+
+	    /// <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)
 	  {
-		return keys[getSlot(text, off, len)] != null;
+		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(string cs)
 	  {
-		return keys[getSlot(cs)] != null;
+		return keys[GetSlot(cs)] != null;
 	  }
 
-	  public override bool ContainsKey(object o)
-	  {
-		if (o is char[])
-		{
-		  char[] text = (char[])o;
-		  return ContainsKey(text, 0, text.Length);
-		}
-		return ContainsKey(o.ToString());
-	  }
+	    public virtual bool ContainsKey(object o)
+	    {
+	        var c = o as char[];
+	        if (c != null)
+	        {
+	            var text = c;
+	            return ContainsKey(text, 0, text.Length);
+	        }
+	        return ContainsKey(o.ToString());
+	    }
 
-	  /// <summary>
+	    public void Add(object key, V value)
+	    {
+	        Put(key, value);
+	    }
+
+	    /// <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)
 	  {
-		return values[getSlot(text, off, 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(string cs)
 	  {
-		return values[getSlot(cs)];
+		return values[GetSlot(cs)];
 	  }
 
-	  public V Get(object o)
+	  public virtual V Get(object o)
 	  {
 	      var text = o as char[];
 		if (text != null)
@@ -216,25 +237,26 @@ namespace Lucene.Net.Analysis.Util
 
 	  /// <summary>
 	  /// Add the given mapping. </summary>
-	  public virtual V put(CharSequence text, V value)
+	  public virtual V Put(ICharSequence text, V value)
 	  {
-		return put(text.ToString(), value); // could be more efficient
+		return Put(text.ToString(), value); // could be more efficient
 	  }
 
-	  public override V put(object o, V value)
+	  public virtual V Put(object o, V value)
 	  {
-		if (o is char[])
+	      var c = o as char[];
+	      if (c != null)
 		{
-		  return put((char[])o, value);
+		  return Put(c, value);
 		}
-		return put(o.ToString(), value);
+		return Put(o.ToString(), value);
 	  }
 
 	  /// <summary>
 	  /// Add the given mapping. </summary>
-	  public virtual V put(string text, V value)
+	  public virtual V Put(string text, V value)
 	  {
-		return put(text.ToCharArray(), value);
+		return Put(text.ToCharArray(), value);
 	  }
 
 	  /// <summary>
@@ -242,13 +264,13 @@ namespace Lucene.Net.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 V put(char[] text, V value)
+	  public virtual V Put(char[] text, V value)
 	  {
 		if (ignoreCase)
 		{
 		  charUtils.ToLower(text, 0, text.Length);
 		}
-		int slot = getSlot(text, 0, text.Length);
+		int slot = GetSlot(text, 0, text.Length);
 		if (keys[slot] != null)
 		{
 		  V oldValue = values[slot];
@@ -264,23 +286,17 @@ namespace Lucene.Net.Analysis.Util
 		  Rehash();
 		}
 
-		return null;
+		return default(V);
 	  }
 
 	  private void Rehash()
 	  {
 		Debug.Assert(keys.Length == values.Length);
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final int newSize = 2*keys.length;
 		int newSize = 2 * keys.Length;
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final char[][] oldkeys = keys;
 		char[][] oldkeys = keys;
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final V[] oldvalues = values;
 		V[] oldvalues = values;
 		keys = new char[newSize][];
-		values = (V[]) new object[newSize];
+		values = new V[newSize];
 
 		for (int i = 0; i < oldkeys.Length; i++)
 		{
@@ -288,9 +304,7 @@ namespace Lucene.Net.Analysis.Util
 		  if (text != null)
 		  {
 			// todo: could be faster... no need to compare strings on collision
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final int slot = getSlot(text,0,text.length);
-			int slot = getSlot(text,0,text.Length);
+			int slot = GetSlot(text,0,text.Length);
 			keys[slot] = text;
 			values[slot] = oldvalues[i];
 		  }
@@ -303,21 +317,17 @@ namespace Lucene.Net.Analysis.Util
 		{
 		  return false;
 		}
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final int limit = off+len;
 		int limit = off + len;
 		if (ignoreCase)
 		{
 		  for (int i = 0;i < len;)
 		  {
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final int codePointAt = charUtils.codePointAt(text1, off+i, limit);
-			int codePointAt = charUtils.codePointAt(text1, off + i, limit);
-			if (char.ToLower(codePointAt) != charUtils.codePointAt(text2, i, text2.Length))
+			var codePointAt = charUtils.CodePointAt(text1, off + i, limit);
+			if (char.ToLower((char)codePointAt) != charUtils.CodePointAt(text2, i, text2.Length))
 			{
 			  return false;
 			}
-			i += char.charCount(codePointAt);
+			i += Character.CharCount(codePointAt);
 		  }
 		}
 		else
@@ -333,9 +343,9 @@ namespace Lucene.Net.Analysis.Util
 		return true;
 	  }
 
-	  private bool Equals(CharSequence text1, char[] text2)
+	    private bool Equals(ICharSequence text1, char[] text2)
 	  {
-		int len = text1.length();
+		int len = text1.Length;
 		if (len != text2.Length)
 		{
 		  return false;
@@ -344,21 +354,19 @@ namespace Lucene.Net.Analysis.Util
 		{
 		  for (int i = 0;i < len;)
 		  {
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final int codePointAt = charUtils.codePointAt(text1, i);
-			int codePointAt = charUtils.codePointAt(text1, i);
-			if (char.ToLower(codePointAt) != charUtils.codePointAt(text2, i, text2.Length))
+			int codePointAt = charUtils.CodePointAt(text1, i);
+			if (char.ToLower((char)codePointAt) != charUtils.CodePointAt(text2, i, text2.Length))
 			{
 			  return false;
 			}
-			i += char.charCount(codePointAt);
+			i += Character.CharCount(codePointAt);
 		  }
 		}
 		else
 		{
 		  for (int i = 0;i < len;i++)
 		  {
-			if (text1.charAt(i) != text2[i])
+			if (text1.CharAt(i) != text2[i])
 			{
 			  return false;
 			}
@@ -371,21 +379,17 @@ namespace Lucene.Net.Analysis.Util
 	  {
 		if (text == null)
 		{
-		  throw new System.NullReferenceException();
+		  throw new ArgumentException("text can't be null", "text");
 		}
 		int code = 0;
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final int stop = offset + len;
 		int stop = offset + len;
 		if (ignoreCase)
 		{
 		  for (int i = offset; i < stop;)
 		  {
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final int codePointAt = charUtils.codePointAt(text, i, stop);
-			int codePointAt = charUtils.codePointAt(text, i, stop);
-			code = code * 31 + char.ToLower(codePointAt);
-			i += char.charCount(codePointAt);
+			int codePointAt = charUtils.CodePointAt(text, i, stop);
+			code = code * 31 + char.ToLower((char)codePointAt);
+			i += Character.CharCount(codePointAt);
 		  }
 		}
 		else
@@ -398,39 +402,55 @@ namespace Lucene.Net.Analysis.Util
 		return code;
 	  }
 
-	  private int getHashCode(ICharSequence text)
+	  private int getHashCode(string text)
 	  {
 		if (text == null)
 		{
-		  throw new System.NullReferenceException();
+            throw new ArgumentException("text can't be null", "text");
 		}
 		int code = 0;
-		int len = text.Length();
+		int len = text.Length;
 		if (ignoreCase)
 		{
 		  for (int i = 0; i < len;)
 		  {
-			int codePointAt = charUtils.codePointAt(text, i);
-			code = code * 31 + char.ToLower(codePointAt);
-			i += char.charCount(codePointAt);
+			int codePointAt = charUtils.CodePointAt(text, i);
+			code = code * 31 + char.ToLower((char)codePointAt);
+			i += Character.CharCount(codePointAt);
 		  }
 		}
 		else
 		{
 		  for (int i = 0; i < len; i++)
 		  {
-			code = code * 31 + text.charAt(i);
+			code = code * 31 + text[i];
 		  }
 		}
 		return code;
 	  }
 
-	  public override V remove(object key)
+	  public virtual bool Remove(object key)
 	  {
 		throw new System.NotSupportedException();
 	  }
 
-	    public override int Size
+	    public bool TryGetValue(object key, out V value)
+	    {
+	        throw new NotImplementedException();
+	    }
+
+	    public V this[object key]
+	    {
+	        get { return Get(key); }
+	        set { throw new NotSupportedException(); }
+	    }
+
+	    public bool Remove(KeyValuePair<object, V> item)
+	    {
+            throw new System.NotSupportedException();
+	    }
+
+	    public int Count
 	    {
 	        get
 	        {
@@ -440,10 +460,12 @@ namespace Lucene.Net.Analysis.Util
 	        }
 	    }
 
+	    public bool IsReadOnly { get; private set; }
+
 	    public override string ToString()
 	  {
 		var sb = new StringBuilder("{");
-		foreach (KeyValuePair<object, V> entry in entrySet())
+		foreach (KeyValuePair<object, V> entry in GetEntrySet())
 		{
 		  if (sb.Length > 1)
 		  {
@@ -457,16 +479,16 @@ namespace Lucene.Net.Analysis.Util
 	  private EntrySet entrySet_Renamed = null;
 	  private CharArraySet keySet_Renamed = null;
 
-	  internal virtual EntrySet createEntrySet()
+	  internal virtual EntrySet CreateEntrySet()
 	  {
 		return new EntrySet(this, true);
 	  }
 
-	  public override EntrySet entrySet()
+	  public EntrySet GetEntrySet()
 	  {
 		if (entrySet_Renamed == null)
 		{
-		  entrySet_Renamed = createEntrySet();
+		  entrySet_Renamed = CreateEntrySet();
 		}
 		return entrySet_Renamed;
 	  }
@@ -481,47 +503,44 @@ namespace Lucene.Net.Analysis.Util
 	  /// Returns an <seealso cref="CharArraySet"/> view on the map's keys.
 	  /// The set will use the same {@code matchVersion} as this map. 
 	  /// </summary>
-//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
-//ORIGINAL LINE: @Override @SuppressWarnings({"unchecked","rawtypes"}) public final CharArraySet keySet()
-	  public override CharArraySet keySet()
+	  public CharArraySet KeySet()
 	  {
 		if (keySet_Renamed == null)
 		{
 		  // prevent adding of entries
-		  keySet_Renamed = new CharArraySetAnonymousInnerClassHelper(this, (CharArrayMap) this);
+		  keySet_Renamed = new CharArraySetAnonymousInnerClassHelper(this);
 		}
 		return keySet_Renamed;
 	  }
 
-	  private class CharArraySetAnonymousInnerClassHelper : CharArraySet
+	  private sealed class CharArraySetAnonymousInnerClassHelper : CharArraySet
 	  {
-		  private readonly CharArrayMap<V> outerInstance;
+	      internal CharArraySetAnonymousInnerClassHelper(CharArrayMap<object> map) : base(map)
+	      {
+              // TODO
+	      }
 
-		  public CharArraySetAnonymousInnerClassHelper(CharArrayMap<V> outerInstance, CharArrayMap (CharArrayMap) this) : base((CharArrayMap) this)
-		  {
-			  this.outerInstance = outerInstance;
-		  }
-
-		  public override bool add(object o)
+	      public override bool Add(object o)
 		  {
 			throw new System.NotSupportedException();
 		  }
-		  public override bool add(CharSequence text)
+		  public bool Add(ICharSequence text)
 		  {
 			throw new System.NotSupportedException();
 		  }
-		  public override bool add(string text)
+		  public override bool Add(string text)
 		  {
 			throw new System.NotSupportedException();
 		  }
-		  public override bool add(char[] text)
+		  public override bool Add(char[] text)
 		  {
 			throw new System.NotSupportedException();
 		  }
 	  }
 
 	  /// <summary>
-	  /// public iterator class so efficient methods are exposed to users </summary>
+	  /// public iterator class so efficient methods are exposed to users
+	  /// </summary>
 	  public class EntryIterator : IEnumerator<KeyValuePair<object, V>>
 	  {
 		  private readonly CharArrayMap<V> outerInstance;
@@ -534,10 +553,10 @@ namespace Lucene.Net.Analysis.Util
 		{
 			this.outerInstance = outerInstance;
 		  this.allowModify = allowModify;
-		  goNext();
+		  GoNext();
 		}
 
-		internal virtual void goNext()
+		internal void GoNext()
 		{
 		  lastPos = pos;
 		  pos++;
@@ -547,36 +566,36 @@ namespace Lucene.Net.Analysis.Util
 		  }
 		}
 
-		public override bool hasNext()
+		public bool HasNext()
 		{
 		  return pos < outerInstance.keys.Length;
 		}
 
 		/// <summary>
 		/// gets the next key... do not modify the returned char[] </summary>
-		public virtual char[] nextKey()
+		public virtual char[] NextKey()
 		{
-		  goNext();
+		  GoNext();
 		  return outerInstance.keys[lastPos];
 		}
 
 		/// <summary>
 		/// gets the next key as a newly created String object </summary>
-		public virtual string nextKeyString()
+		public virtual string NextKeyString()
 		{
-		  return new string(nextKey());
+		  return new string(NextKey());
 		}
 
 		/// <summary>
 		/// returns the value associated with the last key returned </summary>
-		public virtual V currentValue()
+		public virtual V CurrentValue()
 		{
 		  return outerInstance.values[lastPos];
 		}
 
 		/// <summary>
 		/// sets the value associated with the last key returned </summary>
-		public virtual V setValue(V value)
+		public virtual V SetValue(V value)
 		{
 		  if (!allowModify)
 		  {
@@ -588,18 +607,46 @@ namespace Lucene.Net.Analysis.Util
 		}
 
 		/// <summary>
-		/// use nextCharArray() + currentValue() for better efficiency. </summary>
-		public override KeyValuePair<object, V> next()
+		/// use nextCharArray() + currentValue() for better efficiency.
+		/// </summary>
+		public KeyValuePair<object, V> Next()
 		{
-		  goNext();
+		  GoNext();
+            //return new KeyValuePair<object, V>();
 		  return new MapEntry(outerInstance, lastPos, allowModify);
 		}
 
-		public override void remove()
+		public void Remove()
 		{
 		  throw new System.NotSupportedException();
 		}
-	  }
+
+        #region Added for better .NET support
+        public void Dispose()
+	      {	          
+	      }
+
+	      public bool MoveNext()
+	      {
+	          if (!HasNext()) return false;
+	          GoNext();
+	          return true;
+	      }
+
+	      public void Reset()
+	      {
+	          pos = -1;
+              GoNext();
+	      }
+
+          public KeyValuePair<object, V> Current { get { return new KeyValuePair<object, V>(outerInstance.keys[lastPos], outerInstance.values[lastPos]); } private set { } }
+
+	      object IEnumerator.Current
+	      {
+	          get { return CurrentValue(); }
+          }
+          #endregion
+      }
 
 	  private sealed class MapEntry : KeyValuePair<object, V>
 	  {
@@ -615,17 +662,17 @@ namespace Lucene.Net.Analysis.Util
 		  this.allowModify = allowModify;
 		}
 
-		public override object Key
+		public object Key
 		{
 			get
 			{
 			  // we must clone here, as putAll to another CharArrayMap
 			  // with other case sensitivity flag would corrupt the keys
-			  return outerInstance.keys[pos].clone();
+			  return outerInstance.keys[pos].Clone();
 			}
 		}
 
-		public override V Value
+		public V Value
 		{
 			get
 			{
@@ -633,14 +680,12 @@ namespace Lucene.Net.Analysis.Util
 			}
 		}
 
-		public override V setValue(V value)
+		public V setValue(V value)
 		{
 		  if (!allowModify)
 		  {
 			throw new System.NotSupportedException();
 		  }
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final V old = values[pos];
 		  V old = outerInstance.values[pos];
 		  outerInstance.values[pos] = value;
 		  return old;
@@ -648,13 +693,16 @@ namespace Lucene.Net.Analysis.Util
 
 		public override string ToString()
 		{
-		  return (new StringBuilder()).Append(outerInstance.keys[pos]).Append('=').Append((outerInstance.values[pos] == outerInstance) ? "(this Map)" : outerInstance.values[pos]).ToString();
+		  return (new StringBuilder())
+              .Append(outerInstance.keys[pos])
+              .Append('=')
+              .Append((outerInstance.values[pos] == outerInstance) ? "(this Map)" : outerInstance.values[pos]).ToString();
 		}
 	  }
 
 	  /// <summary>
 	  /// public EntrySet class so efficient methods are exposed to users </summary>
-	  public sealed class EntrySet : AbstractSet<KeyValuePair<object, V>>
+	  public sealed class EntrySet : ISet<KeyValuePair<object, V>>
 	  {
 		  private readonly CharArrayMap<V> outerInstance;
 
@@ -666,51 +714,38 @@ namespace Lucene.Net.Analysis.Util
 		  this.allowModify = allowModify;
 		}
 
-		public override EntryIterator iterator()
-		{
-		  return new EntryIterator(outerInstance, allowModify);
-		}
+	      public IEnumerator GetEnumerator()
+	      {
+              return new EntryIterator(outerInstance, allowModify);
+	      }
 
-//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
-//ORIGINAL LINE: @Override @SuppressWarnings("unchecked") public boolean contains(Object o)
-		public override bool contains(object o)
+		public override bool Contains(object o)
 		{
 		  if (!(o is DictionaryEntry))
 		  {
 			return false;
 		  }
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final java.util.Map.Entry<Object,V> e = (java.util.Map.Entry<Object,V>)o;
-		  KeyValuePair<object, V> e = (KeyValuePair<object, V>)o;
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final Object key = e.getKey();
+		  var e = (KeyValuePair<object, V>)o;
 		  object key = e.Key;
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final Object val = e.getValue();
 		  object val = e.Value;
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final Object v = get(key);
-		  object v = outerInstance.get(key);
+		  object v = outerInstance.Get(key);
 		  return v == null ? val == null : v.Equals(val);
 		}
 
-		public override bool remove(object o)
-		{
-		  throw new System.NotSupportedException();
-		}
+	      public bool Remove(KeyValuePair<object, V> item)
+	      {
+              throw new System.NotSupportedException();
+	      }
 
-		public override int size()
-		{
-		  return outerInstance.count;
-		}
+          public int Count { get { return outerInstance.count; } private set { throw new NotSupportedException(); } }
 
-		public override void clear()
+		public void Clear()
 		{
 		  if (!allowModify)
 		  {
 			throw new System.NotSupportedException();
 		  }
-		  outerInstance.clear();
+		  outerInstance.Clear();
 		}
 	  }
 
@@ -723,21 +758,21 @@ namespace Lucene.Net.Analysis.Util
 	  /// <returns> an new unmodifiable <seealso cref="CharArrayMap"/>. </returns>
 	  /// <exception cref="NullPointerException">
 	  ///           if the given map is <code>null</code>. </exception>
-	  public static CharArrayMap<V> unmodifiableMap<V>(CharArrayMap<V> map)
+	  public static CharArrayMap<V> UnmodifiableMap<V>(CharArrayMap<V> map)
 	  {
 		if (map == null)
 		{
 		  throw new System.NullReferenceException("Given map is null");
 		}
-		if (map == emptyMap() || map.Empty)
+		if (map == EmptyMap() || map.Empty)
 		{
-		  return emptyMap();
+		  return EmptyMap();
 		}
 		if (map is UnmodifiableCharArrayMap)
 		{
 		  return map;
 		}
-		return new UnmodifiableCharArrayMap<>(map);
+		return new UnmodifiableCharArrayMap<V>(map);
 	  }
 
 	  /// <summary>
@@ -760,101 +795,92 @@ namespace Lucene.Net.Analysis.Util
 	  /// <returns> a copy of the given map as a <seealso cref="CharArrayMap"/>. If the given map
 	  ///         is a <seealso cref="CharArrayMap"/> the ignoreCase property as well as the
 	  ///         matchVersion will be of the given map will be preserved. </returns>
-//JAVA TO C# CONVERTER TODO TASK: The following line could not be converted:
-	  SuppressWarnings("unchecked") public static <V> CharArrayMap<V> copy(final org.org.apache.lucene.util.Version matchVersion, final java.util.Map<?,? extends V> map)
+	 public static CharArrayMap<V> copy(LuceneVersion matchVersion, IDictionary<object, V> map)
 	  {
 		if (map == EMPTY_MAP)
 		{
-		  return emptyMap();
+		  return EmptyMap();
 		}
 		if (map is CharArrayMap)
 		{
-		  CharArrayMap<V> m = (CharArrayMap<V>) map;
+		  var m = (CharArrayMap<V>) map;
 		  // use fast path instead of iterating all values
 		  // this is even on very small sets ~10 times faster than iterating
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final char[][] keys = new char[m.keys.length][];
-		  char[][] keys = new char[m.keys.Length][];
+		  var keys = new char[m.keys.Length][];
 		  Array.Copy(m.keys, 0, keys, 0, keys.Length);
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final V[] values = (V[]) new Object[m.values.length];
-		  V[] values = (V[]) new object[m.values.Length];
+		  var values = new V[m.values.Length];
 		  Array.Copy(m.values, 0, values, 0, values.Length);
-		  m = new CharArrayMap<>(m);
-		  m.keys = keys;
-		  m.values = values;
-		  return m;
+		  m = new CharArrayMap<V>(m) {keys = keys, values = values};
+		    return m;
 		}
-		return new CharArrayMap<>(matchVersion, map, false);
+		return new CharArrayMap<V>(matchVersion, map, false);
 	  }
 
 	  /// <summary>
 	  /// Returns an empty, unmodifiable map. </summary>
-//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
-//ORIGINAL LINE: @SuppressWarnings("unchecked") public static <V> CharArrayMap<V> emptyMap()
-	  public static <V> CharArrayMap<V> emptyMap()
+	  public static CharArrayMap<char[]> EmptyMap()
 	  {
-		return (CharArrayMap<V>) EMPTY_MAP;
+		return EMPTY_MAP;
 	  }
 
 	  // package private CharArraySet instanceof check in CharArraySet
-	  static class UnmodifiableCharArrayMap<V> extends CharArrayMap<V>
+	  class UnmodifiableCharArrayMap<V> : CharArrayMap<V>
 	  {
 
-		UnmodifiableCharArrayMap(CharArrayMap<V> map)
+		public UnmodifiableCharArrayMap(CharArrayMap<V> map) : base(map)
 		{
-		  base(map);
+		  
 		}
 
-		public void clear()
+		public override void Clear()
 		{
 		  throw new System.NotSupportedException();
 		}
 
-		public V put(object o, V val)
+		public override V Put(object o, V val)
 		{
 		  throw new System.NotSupportedException();
 		}
 
-		public V put(char[] text, V val)
+		public override V Put(char[] text, V val)
 		{
 		  throw new System.NotSupportedException();
 		}
 
-		public V put(CharSequence text, V val)
+		public override V Put(ICharSequence text, V val)
 		{
 		  throw new System.NotSupportedException();
 		}
 
-		public V put(string text, V val)
+		public override V Put(string text, V val)
 		{
 		  throw new System.NotSupportedException();
 		}
 
-		public V remove(object key)
+		public override bool Remove(object key)
 		{
 		  throw new System.NotSupportedException();
 		}
 
-		EntrySet createEntrySet()
+		override EntrySet CreateEntrySet()
 		{
 		  return new EntrySet(this, false);
 		}
 	  }
 
 	  /// <summary>
-	  /// Empty <seealso cref="org.apache.lucene.analysis.util.CharArrayMap.UnmodifiableCharArrayMap"/> optimized for speed.
+	  /// Empty <seealso cref="CharArrayMap{V}.UnmodifiableCharArrayMap"/> optimized for speed.
 	  /// Contains checks will always return <code>false</code> or throw
 	  /// NPE if necessary.
 	  /// </summary>
-	  private static final class EmptyCharArrayMap<V> extends UnmodifiableCharArrayMap<V>
+	  private class EmptyCharArrayMap<V> : UnmodifiableCharArrayMap<V>
 	  {
-		EmptyCharArrayMap()
+		public EmptyCharArrayMap():base(new CharArrayMap<V>(LuceneVersion.LUCENE_CURRENT, 0, false))
 		{
-		  base(new CharArrayMap<V>(Version.LUCENE_CURRENT, 0, false));
+		  
 		}
 
-		public bool containsKey(char[] text, int off, int len)
+		public override bool ContainsKey(char[] text, int off, int len)
 		{
 		  if (text == null)
 		  {
@@ -863,7 +889,7 @@ namespace Lucene.Net.Analysis.Util
 		  return false;
 		}
 
-		public bool containsKey(CharSequence cs)
+		public bool ContainsKey(ICharSequence cs)
 		{
 		  if (cs == null)
 		  {
@@ -872,7 +898,7 @@ namespace Lucene.Net.Analysis.Util
 		  return false;
 		}
 
-		public bool containsKey(object o)
+		public override bool ContainsKey(object o)
 		{
 		  if (o == null)
 		  {
@@ -881,33 +907,32 @@ namespace Lucene.Net.Analysis.Util
 		  return false;
 		}
 
-		public V get(char[] text, int off, int len)
+		public override V Get(char[] text, int off, int len)
 		{
 		  if (text == null)
 		  {
 			throw new System.NullReferenceException();
 		  }
-		  return null;
+		  return default(V);
 		}
 
-		public V get(CharSequence cs)
+		public V Get(ICharSequence cs)
 		{
 		  if (cs == null)
 		  {
 			throw new System.NullReferenceException();
 		  }
-		  return null;
+		  return default(V);
 		}
 
-		public V get(object o)
+		public override V Get(object o)
 		{
 		  if (o == null)
 		  {
 			throw new System.NullReferenceException();
 		  }
-		  return null;
+		  return default(V);
 		}
 	  }
 	}
-
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f47779a7/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 4faa921..23ce187 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Util/CharArraySet.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Util/CharArraySet.cs
@@ -1,4 +1,5 @@
-using System.Collections.Generic;
+using System.Collections;
+using System.Collections.Generic;
 using System.Text;
 using Lucene.Net.Util;
 
@@ -70,7 +71,8 @@ namespace Lucene.Net.Analysis.Util
 	  /// <param name="ignoreCase">
 	  ///          <code>false</code> if and only if the set should be case sensitive
 	  ///          otherwise <code>true</code>. </param>
-	  public CharArraySet(Lucene.Net.Util.LuceneVersion matchVersion, int startSize, bool ignoreCase) : this(new CharArrayMap<>(matchVersion, startSize, ignoreCase))
+	  public CharArraySet(LuceneVersion matchVersion, int startSize, bool ignoreCase)
+          : this(new CharArrayMap<object>(matchVersion, startSize, ignoreCase))
 	  {
 	  }
 
@@ -85,7 +87,8 @@ namespace Lucene.Net.Analysis.Util
 	  /// <param name="ignoreCase">
 	  ///          <code>false</code> if and only if the set should be case sensitive
 	  ///          otherwise <code>true</code>. </param>
-	  public CharArraySet<T1>(LuceneVersion matchVersion, ICollection<T1> c, bool ignoreCase) : this(matchVersion, c.Count, ignoreCase)
+	  public CharArraySet(LuceneVersion matchVersion, ICollection<T> c, bool ignoreCase)
+          : this(matchVersion, c.Count, ignoreCase)
 	  {
 		AddAll(c);
 	  }
@@ -96,8 +99,8 @@ namespace Lucene.Net.Analysis.Util
 	  {
 		this.map = map;
 	  }
-
-	  /// <summary>
+      
+        /// <summary>
 	  /// Clears all entries in this set. This method is supported for reusing, but not <seealso cref="Set#remove"/>. </summary>
 	  public void Clear()
 	  {
@@ -125,16 +128,26 @@ namespace Lucene.Net.Analysis.Util
 		return map.ContainsKey(o);
 	  }
 
-	  public bool Add(object o)
+        public void CopyTo(object[] array, int arrayIndex)
+        {
+            throw new System.NotImplementedException();
+        }
+
+        public bool Remove(object item)
+        {
+            throw new System.NotImplementedException();
+        }
+
+        public virtual bool Add(object o)
 	  {
-		return map.put(o, PLACEHOLDER) == null;
+		return map.Put(o, PLACEHOLDER) == null;
 	  }
 
 	  /// <summary>
 	  /// Add this String into the set </summary>
 	  public virtual bool Add(string text)
 	  {
-		return map.put(text, PLACEHOLDER) == null;
+		return map.Put(text, PLACEHOLDER) == null;
 	  }
 
 	  /// <summary>
@@ -144,19 +157,21 @@ namespace Lucene.Net.Analysis.Util
 	  /// </summary>
 	  public virtual bool Add(char[] text)
 	  {
-		return map.put(text, PLACEHOLDER) == null;
+		return map.Put(text, PLACEHOLDER) == null;
 	  }
 
-        public override int Size
+        public int Count
         {
             get
             {
                 {
-                    return map.size();
+                    return map.Count;
                 }
             }
         }
 
+        public bool IsReadOnly { get; private set; }
+
         /// <summary>
 	  /// Returns an unmodifiable <seealso cref="CharArraySet"/>. This allows to provide
 	  /// unmodifiable views of internal sets for "read-only" use.
@@ -166,7 +181,7 @@ namespace Lucene.Net.Analysis.Util
 	  /// <returns> an new unmodifiable <seealso cref="CharArraySet"/>. </returns>
 	  /// <exception cref="NullPointerException">
 	  ///           if the given set is <code>null</code>. </exception>
-	  public static CharArraySet unmodifiableSet(CharArraySet set)
+	  public static CharArraySet UnmodifiableSet(CharArraySet set)
 	  {
 		if (set == null)
 		{
@@ -218,15 +233,21 @@ namespace Lucene.Net.Analysis.Util
 	  }
 
 	  /// <summary>
-	  /// Returns an <seealso cref="Iterator"/> for {@code char[]} instances in this set.
+	  /// Returns an <seealso cref="IEnumerator"/> for {@code char[]} instances in this set.
 	  /// </summary>
-	  public override IEnumerator<object> iterator()
-	  {
-		// use the AbstractSet#keySet()'s iterator (to not produce endless recursion)
-		return map.originalKeySet().GetEnumerator();
-	  }
+        public IEnumerator GetEnumerator()
+        {
+            // use the AbstractSet#keySet()'s iterator (to not produce endless recursion)
+            return map.originalKeySet().GetEnumerator();
+        }
+
+        IEnumerator<object> IEnumerable<object>.GetEnumerator()
+        {
+            // use the AbstractSet#keySet()'s iterator (to not produce endless recursion)
+            return map.originalKeySet().GetEnumerator();
+        }
 
-	  public override string ToString()
+        public override string ToString()
 	  {
 		var sb = new StringBuilder("[");
 		foreach (object item in this)
@@ -246,6 +267,62 @@ namespace Lucene.Net.Analysis.Util
 		}
 		return sb.Append(']').ToString();
 	  }
-	}
 
+        #region Not used by the Java implementation anyway
+        void ICollection<object>.Add(object item)
+        {
+            throw new System.NotImplementedException();
+        }
+
+        public void UnionWith(IEnumerable<object> other)
+        {
+            throw new System.NotImplementedException();
+        }
+
+        public void IntersectWith(IEnumerable<object> other)
+        {
+            throw new System.NotImplementedException();
+        }
+
+        public void ExceptWith(IEnumerable<object> other)
+        {
+            throw new System.NotImplementedException();
+        }
+
+        public void SymmetricExceptWith(IEnumerable<object> other)
+        {
+            throw new System.NotImplementedException();
+        }
+
+        public bool IsSubsetOf(IEnumerable<object> other)
+        {
+            throw new System.NotImplementedException();
+        }
+
+        public bool IsSupersetOf(IEnumerable<object> other)
+        {
+            throw new System.NotImplementedException();
+        }
+
+        public bool IsProperSupersetOf(IEnumerable<object> other)
+        {
+            throw new System.NotImplementedException();
+        }
+
+        public bool IsProperSubsetOf(IEnumerable<object> other)
+        {
+            throw new System.NotImplementedException();
+        }
+
+        public bool Overlaps(IEnumerable<object> other)
+        {
+            throw new System.NotImplementedException();
+        }
+
+        public bool SetEquals(IEnumerable<object> other)
+        {
+            throw new System.NotImplementedException();
+        }
+        #endregion
+	}
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f47779a7/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 4d2e076..004b368 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Util/CharacterUtils.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Util/CharacterUtils.cs
@@ -78,6 +78,7 @@ namespace Lucene.Net.Analysis.Util
         ///           - if the value offset is negative or not less than the length of
         ///           the character sequence. </exception>
         public abstract int CodePointAt(string seq, int offset);
+        public abstract int CodePointAt(ICharSequence seq, int offset);
 
         /// <summary>
         /// Returns the code point at the given index of the char array where only elements
@@ -258,11 +259,11 @@ namespace Lucene.Net.Analysis.Util
 
         private sealed class Java5CharacterUtils : CharacterUtils
         {
-            internal Java5CharacterUtils()
+            public override int CodePointAt(string seq, int offset)
             {
+                return Character.CodePointAt(seq, offset);
             }
-
-            public override int CodePointAt(string seq, int offset)
+            public override int CodePointAt(ICharSequence seq, int offset)
             {
                 return Character.CodePointAt(seq, offset);
             }
@@ -326,14 +327,14 @@ namespace Lucene.Net.Analysis.Util
 
         private sealed class Java4CharacterUtils : CharacterUtils
         {
-            internal Java4CharacterUtils()
-            {
-            }
-
             public override int CodePointAt(string seq, int offset)
             {
                 return seq[offset];
             }
+            public override int CodePointAt(ICharSequence seq, int offset)
+            {
+                return seq.CharAt(offset);
+            }
 
             public override int CodePointAt(char[] chars, int offset, int limit)
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f47779a7/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 915f4a6..5462c94 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Util/StopwordAnalyzerBase.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Util/StopwordAnalyzerBase.cs
@@ -61,7 +61,7 @@ namespace Lucene.Net.Analysis.Util
 	  {
 		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>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f47779a7/src/Lucene.Net.Core/Support/Character.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Support/Character.cs b/src/Lucene.Net.Core/Support/Character.cs
index fc90896..f1bd183 100644
--- a/src/Lucene.Net.Core/Support/Character.cs
+++ b/src/Lucene.Net.Core/Support/Character.cs
@@ -105,6 +105,8 @@ namespace Lucene.Net.Support
 
         public static int ToLowerCase(int codePoint)
         {
+            // LUCENENET TODO do we really need this? what's wrong with char.ToLower() ?
+
             var str = UnicodeUtil.NewString(new[] {codePoint}, 0, 1);
 
             str = str.ToLower();


[2/2] lucenenet git commit: More work on Analysis.Common

Posted by sy...@apache.org.
More work on Analysis.Common


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

Branch: refs/heads/master
Commit: f47779a7efb30d4ab3cfaa7d7e1bdae5b614fa7f
Parents: 40684b8
Author: Itamar Syn-Hershko <it...@code972.com>
Authored: Sun May 31 01:20:39 2015 +0300
Committer: Itamar Syn-Hershko <it...@code972.com>
Committed: Sun May 31 01:20:39 2015 +0300

----------------------------------------------------------------------
 .../Compound/hyphenation/PatternParser.cs       |   1 +
 .../Analysis/Core/StopAnalyzer.cs               |   2 +-
 .../Analysis/Miscellaneous/PatternAnalyzer.cs   |   2 +-
 .../Miscellaneous/SingleTokenTokenStream.cs     |  39 +-
 .../Miscellaneous/StemmerOverrideFilter.cs      |  51 +--
 .../Analysis/Miscellaneous/TrimFilter.cs        | 159 +++----
 .../Analysis/Miscellaneous/TrimFilterFactory.cs | 110 +++--
 .../Miscellaneous/WordDelimiterIterator.cs      |   9 +-
 .../Pattern/PatternCaptureGroupFilterFactory.cs |  12 +-
 .../Pattern/PatternCaptureGroupTokenFilter.cs   |  20 +-
 .../Payloads/DelimitedPayloadTokenFilter.cs     | 145 +++----
 .../Analysis/Shingle/ShingleFilter.cs           |  36 +-
 .../Analysis/Standard/ClassicTokenizerImpl.cs   |   4 +-
 .../Analysis/Standard/StandardTokenizerImpl.cs  |  26 +-
 .../Standard/StandardTokenizerInterface.cs      | 125 +++---
 .../Analysis/Util/AbstractAnalysisFactory.cs    |  29 +-
 .../Analysis/Util/CharArrayIterator.cs          |  20 +-
 .../Analysis/Util/CharArrayMap.cs               | 419 ++++++++++---------
 .../Analysis/Util/CharArraySet.cs               | 117 +++++-
 .../Analysis/Util/CharacterUtils.cs             |  15 +-
 .../Analysis/Util/StopwordAnalyzerBase.cs       |   2 +-
 src/Lucene.Net.Core/Support/Character.cs        |   2 +
 22 files changed, 686 insertions(+), 659 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f47779a7/src/Lucene.Net.Analysis.Common/Analysis/Compound/hyphenation/PatternParser.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Compound/hyphenation/PatternParser.cs b/src/Lucene.Net.Analysis.Common/Analysis/Compound/hyphenation/PatternParser.cs
index 383dee2..1d012c4 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Compound/hyphenation/PatternParser.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Compound/hyphenation/PatternParser.cs
@@ -17,6 +17,7 @@
 using System;
 using System.Collections;
 using System.Collections.Generic;
+using System.IO;
 using System.Text;
 
 namespace Lucene.Net.Analysis.Compound.Hyphenation

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f47779a7/src/Lucene.Net.Analysis.Common/Analysis/Core/StopAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Core/StopAnalyzer.cs b/src/Lucene.Net.Analysis.Common/Analysis/Core/StopAnalyzer.cs
index e51dbc1..5c2f34a 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Core/StopAnalyzer.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Core/StopAnalyzer.cs
@@ -50,7 +50,7 @@ namespace Lucene.Net.Analysis.Core
 	  {
 		IList<string> stopWords = Arrays.AsList("a", "an", "and", "are", "as", "at", "be", "but", "by", "for", "if", "in", "into", "is", "it", "no", "not", "of", "on", "or", "such", "that", "the", "their", "then", "there", "these", "they", "this", "to", "was", "will", "with");
 		var stopSet = new CharArraySet(LuceneVersion.LUCENE_CURRENT, stopWords, false);
-		ENGLISH_STOP_WORDS_SET = CharArraySet.unmodifiableSet(stopSet);
+		ENGLISH_STOP_WORDS_SET = CharArraySet.UnmodifiableSet(stopSet);
 	  }
 
 	  /// <summary>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f47779a7/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/PatternAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/PatternAnalyzer.cs b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/PatternAnalyzer.cs
index c20a7c3..6c28927 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/PatternAnalyzer.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/PatternAnalyzer.cs
@@ -67,7 +67,7 @@ namespace Lucene.Net.Analysis.Miscellaneous
         /// <code>"\\s+"</code>; Divides text at whitespaces (Character.isWhitespace(c)) </summary>
         public static readonly Pattern WHITESPACE_PATTERN = Pattern.compile("\\s+");
 
-        private static readonly CharArraySet EXTENDED_ENGLISH_STOP_WORDS = CharArraySet.unmodifiableSet(new CharArraySet(LuceneVersion.LUCENE_CURRENT, Arrays.asList("a", "about", "above", "across", "adj", "after", "afterwards", "again", "against", "albeit", "all", "almost", "alone", "along", "already", "also", "although", "always", "among", "amongst", "an", "and", "another", "any", "anyhow", "anyone", "anything", "anywhere", "are", "around", "as", "at", "be", "became", "because", "become", "becomes", "becoming", "been", "before", "beforehand", "behind", "being", "below", "beside", "besides", "between", "beyond", "both", "but", "by", "can", "cannot", "co", "could", "down", "during", "each", "eg", "either", "else", "elsewhere", "enough", "etc", "even", "ever", "every", "everyone", "everything", "everywhere", "except", "few", "first", "for", "former", "formerly", "from", "further", "had", "has", "have", "he", "hence", "her", "here", "hereafter", "hereby", "herein", "hereupon", "hers", 
 "herself", "him", "himself", "his", "how", "however", "i", "ie", "if", "in", "inc", "indeed", "into", "is", "it", "its", "itself", "last", "latter", "latterly", "least", "less", "ltd", "many", "may", "me", "meanwhile", "might", "more", "moreover", "most", "mostly", "much", "must", "my", "myself", "namely", "neither", "never", "nevertheless", "next", "no", "nobody", "none", "noone", "nor", "not", "nothing", "now", "nowhere", "of", "off", "often", "on", "once one", "only", "onto", "or", "other", "others", "otherwise", "our", "ours", "ourselves", "out", "over", "own", "per", "perhaps", "rather", "s", "same", "seem", "seemed", "seeming", "seems", "several", "she", "should", "since", "so", "some", "somehow", "someone", "something", "sometime", "sometimes", "somewhere", "still", "such", "t", "than", "that", "the", "their", "them", "themselves", "then", "thence", "there", "thereafter", "thereby", "therefor", "therein", "thereupon", "these", "they", "this", "those", "though", "through", "th
 roughout", "thru", "thus", "to", "together", "too", "toward", "towards", "under", "until", "up", "upon", "us", "very", "via", "was", "we", "well", "were", "what", "whatever", "whatsoever", "when", "whence", "whenever", "whensoever", "where", "whereafter", "whereas", "whereat", "whereby", "wherefrom", "wherein", "whereinto", "whereof", "whereon", "whereto", "whereunto", "whereupon", "wherever", "wherewith", "whether", "which", "whichever", "whichsoever", "while", "whilst", "whither", "who", "whoever", "whole", "whom", "whomever", "whomsoever", "whose", "whosoever", "why", "will", "with", "within", "without", "would", "xsubj", "xcal", "xauthor", "xother ", "xnote", "yet", "you", "your", "yours", "yourself", "yourselves"), true));
+        private static readonly CharArraySet EXTENDED_ENGLISH_STOP_WORDS = CharArraySet.UnmodifiableSet(new CharArraySet(LuceneVersion.LUCENE_CURRENT, Arrays.asList("a", "about", "above", "across", "adj", "after", "afterwards", "again", "against", "albeit", "all", "almost", "alone", "along", "already", "also", "although", "always", "among", "amongst", "an", "and", "another", "any", "anyhow", "anyone", "anything", "anywhere", "are", "around", "as", "at", "be", "became", "because", "become", "becomes", "becoming", "been", "before", "beforehand", "behind", "being", "below", "beside", "besides", "between", "beyond", "both", "but", "by", "can", "cannot", "co", "could", "down", "during", "each", "eg", "either", "else", "elsewhere", "enough", "etc", "even", "ever", "every", "everyone", "everything", "everywhere", "except", "few", "first", "for", "former", "formerly", "from", "further", "had", "has", "have", "he", "hence", "her", "here", "hereafter", "hereby", "herein", "hereupon", "hers", 
 "herself", "him", "himself", "his", "how", "however", "i", "ie", "if", "in", "inc", "indeed", "into", "is", "it", "its", "itself", "last", "latter", "latterly", "least", "less", "ltd", "many", "may", "me", "meanwhile", "might", "more", "moreover", "most", "mostly", "much", "must", "my", "myself", "namely", "neither", "never", "nevertheless", "next", "no", "nobody", "none", "noone", "nor", "not", "nothing", "now", "nowhere", "of", "off", "often", "on", "once one", "only", "onto", "or", "other", "others", "otherwise", "our", "ours", "ourselves", "out", "over", "own", "per", "perhaps", "rather", "s", "same", "seem", "seemed", "seeming", "seems", "several", "she", "should", "since", "so", "some", "somehow", "someone", "something", "sometime", "sometimes", "somewhere", "still", "such", "t", "than", "that", "the", "their", "them", "themselves", "then", "thence", "there", "thereafter", "thereby", "therefor", "therein", "thereupon", "these", "they", "this", "those", "though", "through", "th
 roughout", "thru", "thus", "to", "together", "too", "toward", "towards", "under", "until", "up", "upon", "us", "very", "via", "was", "we", "well", "were", "what", "whatever", "whatsoever", "when", "whence", "whenever", "whensoever", "where", "whereafter", "whereas", "whereat", "whereby", "wherefrom", "wherein", "whereinto", "whereof", "whereon", "whereto", "whereunto", "whereupon", "wherever", "wherewith", "whether", "which", "whichever", "whichsoever", "while", "whilst", "whither", "who", "whoever", "whole", "whom", "whomever", "whomsoever", "whose", "whosoever", "why", "will", "with", "within", "without", "would", "xsubj", "xcal", "xauthor", "xother ", "xnote", "yet", "you", "your", "yours", "yourself", "yourselves"), true));
 
         /// <summary>
         /// A lower-casing word analyzer with English stop words (can be shared

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f47779a7/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/SingleTokenTokenStream.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/SingleTokenTokenStream.cs b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/SingleTokenTokenStream.cs
index 435247c..c5b0559 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/SingleTokenTokenStream.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/SingleTokenTokenStream.cs
@@ -1,6 +1,8 @@
 using System.Diagnostics;
+using Lucene.Net.Analysis.Tokenattributes;
+using Lucene.Net.Util;
 
-namespace org.apache.lucene.analysis.miscellaneous
+namespace Lucene.Net.Analysis.Miscellaneous
 {
 
 	/*
@@ -19,11 +21,7 @@ namespace org.apache.lucene.analysis.miscellaneous
 	 * See the License for the specific language governing permissions and
 	 * limitations under the License.
 	 */
-
-	using AttributeImpl = org.apache.lucene.util.AttributeImpl;
-	using CharTermAttribute = org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
-
-	/// <summary>
+    /// <summary>
 	/// A <seealso cref="TokenStream"/> containing a single token.
 	/// </summary>
 	public sealed class SingleTokenTokenStream : TokenStream
@@ -39,13 +37,13 @@ namespace org.apache.lucene.analysis.miscellaneous
 	  {
 
 		Debug.Assert(token != null);
-		this.singleToken = token.clone();
+		this.singleToken = token.Clone();
 
-		tokenAtt = (AttributeImpl) addAttribute(typeof(CharTermAttribute));
-		assert(tokenAtt is Token);
+        tokenAtt = AddAttribute <ICharTermAttribute>();
+		Debug.Assert(tokenAtt is Token);
 	  }
 
-	  public override bool incrementToken()
+	  public override bool IncrementToken()
 	  {
 		if (exhausted)
 		{
@@ -53,27 +51,22 @@ namespace org.apache.lucene.analysis.miscellaneous
 		}
 		else
 		{
-		  clearAttributes();
-		  singleToken.copyTo(tokenAtt);
+		  ClearAttributes();
+		  singleToken.CopyTo(tokenAtt);
 		  exhausted = true;
 		  return true;
 		}
 	  }
 
-	  public override void reset()
+	  public override void Reset()
 	  {
 		exhausted = false;
 	  }
 
-	  public Token getToken()
-	  {
-		return singleToken.clone();
-	  }
-
-	  public void setToken(Token token)
-	  {
-		this.singleToken = token.clone();
-	  }
+        public Token Token
+        {
+            get { return (Token) singleToken.Clone(); }
+            set { this.singleToken = (Token) value.Clone(); }
+        }
 	}
-
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f47779a7/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/StemmerOverrideFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/StemmerOverrideFilter.cs b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/StemmerOverrideFilter.cs
index 078ff66..a89fbe3 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/StemmerOverrideFilter.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/StemmerOverrideFilter.cs
@@ -1,6 +1,11 @@
 using System.Collections.Generic;
+using System.IO;
+using Lucene.Net.Analysis.Tokenattributes;
+using Lucene.Net.Support;
+using Lucene.Net.Util;
+using Lucene.Net.Util.Fst;
 
-namespace org.apache.lucene.analysis.miscellaneous
+namespace Lucene.Net.Analysis.Miscellaneous
 {
 
 	/*
@@ -19,21 +24,7 @@ namespace org.apache.lucene.analysis.miscellaneous
 	 * See the License for the specific language governing permissions and
 	 * limitations under the License.
 	 */
-
-	using CharTermAttribute = org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
-	using KeywordAttribute = org.apache.lucene.analysis.tokenattributes.KeywordAttribute;
-	using BytesRef = org.apache.lucene.util.BytesRef;
-	using BytesRefHash = org.apache.lucene.util.BytesRefHash;
-	using CharsRef = org.apache.lucene.util.CharsRef;
-	using IntsRef = org.apache.lucene.util.IntsRef;
-	using UnicodeUtil = org.apache.lucene.util.UnicodeUtil;
-	using ByteSequenceOutputs = org.apache.lucene.util.fst.ByteSequenceOutputs;
-	using FST = org.apache.lucene.util.fst.FST;
-	using Arc = org.apache.lucene.util.fst.FST.Arc;
-	using BytesReader = org.apache.lucene.util.fst.FST.BytesReader;
-
-
-	/// <summary>
+    /// <summary>
 	/// Provides the ability to override any <seealso cref="KeywordAttribute"/> aware stemmer
 	/// with custom dictionary-based stemming.
 	/// </summary>
@@ -41,8 +32,8 @@ namespace org.apache.lucene.analysis.miscellaneous
 	{
 	  private readonly StemmerOverrideMap stemmerOverrideMap;
 
-	  private readonly CharTermAttribute termAtt = addAttribute(typeof(CharTermAttribute));
-	  private readonly KeywordAttribute keywordAtt = addAttribute(typeof(KeywordAttribute));
+	  private readonly ICharTermAttribute termAtt = addAttribute(typeof(CharTermAttribute));
+	  private readonly IKeywordAttribute keywordAtt = addAttribute(typeof(KeywordAttribute));
 	  private readonly FST.BytesReader fstReader;
 	  private readonly FST.Arc<BytesRef> scratchArc = new FST.Arc<BytesRef>();
 	  private readonly CharsRef spare = new CharsRef();
@@ -55,19 +46,15 @@ namespace org.apache.lucene.analysis.miscellaneous
 	  /// so that they will not be stemmed with stemmers down the chain.
 	  /// </para>
 	  /// </summary>
-//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
-//ORIGINAL LINE: public StemmerOverrideFilter(final org.apache.lucene.analysis.TokenStream input, final StemmerOverrideMap stemmerOverrideMap)
 	  public StemmerOverrideFilter(TokenStream input, StemmerOverrideMap stemmerOverrideMap) : base(input)
 	  {
 		this.stemmerOverrideMap = stemmerOverrideMap;
 		fstReader = stemmerOverrideMap.BytesReader;
 	  }
 
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: @Override public boolean incrementToken() throws java.io.IOException
-	  public override bool incrementToken()
+	  public override bool IncrementToken()
 	  {
-		if (input.incrementToken())
+		if (input.IncrementToken())
 		{
 		  if (fstReader == null)
 		  {
@@ -76,15 +63,11 @@ namespace org.apache.lucene.analysis.miscellaneous
 		  }
 		  if (!keywordAtt.Keyword) // don't muck with already-keyworded terms
 		  {
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final org.apache.lucene.util.BytesRef stem = stemmerOverrideMap.get(termAtt.buffer(), termAtt.length(), scratchArc, fstReader);
-			BytesRef stem = stemmerOverrideMap.get(termAtt.buffer(), termAtt.length(), scratchArc, fstReader);
+			BytesRef stem = stemmerOverrideMap.get(termAtt.Buffer(), termAtt.Length, scratchArc, fstReader);
 			if (stem != null)
 			{
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final char[] buffer = spare.chars = termAtt.buffer();
-			  char[] buffer = spare.chars = termAtt.buffer();
-			  UnicodeUtil.UTF8toUTF16(stem.bytes, stem.offset, stem.length, spare);
+			  char[] buffer = spare.chars = termAtt.Buffer();
+			  UnicodeUtil.UTF8toUTF16(stem.Bytes, stem.Offset, stem.Length, spare);
 			  if (spare.chars != buffer)
 			  {
 				termAtt.copyBuffer(spare.chars, spare.offset, spare.length);
@@ -202,17 +185,13 @@ namespace org.apache.lucene.analysis.miscellaneous
 		/// <param name="input"> the input char sequence </param>
 		/// <param name="output"> the stemmer override output char sequence </param>
 		/// <returns> <code>false</code> iff the input has already been added to this builder otherwise <code>true</code>. </returns>
-		public virtual bool add(CharSequence input, CharSequence output)
+		public virtual bool add(ICharSequence input, ICharSequence output)
 		{
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final int length = input.length();
 		  int length = input.length();
 		  if (ignoreCase)
 		  {
 			// convert on the fly to lowercase
 			charsSpare.grow(length);
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final char[] buffer = charsSpare.chars;
 			char[] buffer = charsSpare.chars;
 			for (int i = 0; i < length;)
 			{

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f47779a7/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/TrimFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/TrimFilter.cs b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/TrimFilter.cs
index 6e57cc6..e7732e2 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/TrimFilter.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/TrimFilter.cs
@@ -16,94 +16,97 @@
  */
 using System;
 using Lucene.Net.Analysis.Tokenattributes;
+using Lucene.Net.Util;
 
 namespace Lucene.Net.Analysis.Miscellaneous
 {
     /// <summary>
-	/// Trims leading and trailing whitespace from Tokens in the stream.
-	/// <para>As of Lucene 4.4, this filter does not support updateOffsets=true anymore
-	/// as it can lead to broken token streams.
-	/// </para>
-	/// </summary>
-	public sealed class TrimFilter : TokenFilter
-	{
+    /// Trims leading and trailing whitespace from Tokens in the stream.
+    /// <para>As of Lucene 4.4, this filter does not support updateOffsets=true anymore
+    /// as it can lead to broken token streams.
+    /// </para>
+    /// </summary>
+    public sealed class TrimFilter : TokenFilter
+    {
 
-	  internal readonly bool updateOffsets;
-	  private readonly ICharTermAttribute termAtt = addAttribute(typeof(CharTermAttribute));
-	  private readonly IOffsetAttribute offsetAtt = addAttribute(typeof(OffsetAttribute));
+        internal readonly bool updateOffsets;
+        private readonly ICharTermAttribute termAtt;
+        private readonly IOffsetAttribute offsetAtt;
 
-	  /// <summary>
-	  /// Create a new <seealso cref="TrimFilter"/>. </summary>
-	  /// <param name="version">       the Lucene match version </param>
-	  /// <param name="in">            the stream to consume </param>
-	  /// <param name="updateOffsets"> whether to update offsets </param>
-	  /// @deprecated Offset updates are not supported anymore as of Lucene 4.4. 
-	  [Obsolete("Offset updates are not supported anymore as of Lucene 4.4.")]
-	  public TrimFilter(Version version, TokenStream @in, bool updateOffsets) : base(@in)
-	  {
-		if (updateOffsets && version.onOrAfter(Version.LUCENE_44))
-		{
-		  throw new System.ArgumentException("updateOffsets=true is not supported anymore as of Lucene 4.4");
-		}
-		this.updateOffsets = updateOffsets;
-	  }
+        /// <summary>
+        /// Create a new <seealso cref="TrimFilter"/>. </summary>
+        /// <param name="version">       the Lucene match version </param>
+        /// <param name="in">            the stream to consume </param>
+        /// <param name="updateOffsets"> whether to update offsets </param>
+        /// @deprecated Offset updates are not supported anymore as of Lucene 4.4. 
+        [Obsolete("Offset updates are not supported anymore as of Lucene 4.4.")]
+        public TrimFilter(LuceneVersion version, TokenStream @in, bool updateOffsets)
+            : base(@in)
+        {
+            if (updateOffsets && version.OnOrAfter(LuceneVersion.LUCENE_44))
+            {
+                throw new System.ArgumentException("updateOffsets=true is not supported anymore as of Lucene 4.4");
+            }
+            termAtt = AddAttribute<ICharTermAttribute>();
+            offsetAtt = AddAttribute<IOffsetAttribute>();
+            this.updateOffsets = updateOffsets;
+        }
 
-	  /// <summary>
-	  /// Create a new <seealso cref="TrimFilter"/> on top of <code>in</code>. </summary>
-	  public TrimFilter(Version version, TokenStream @in) : this(version, @in, false)
-	  {
-	  }
+        /// <summary>
+        /// Create a new <seealso cref="TrimFilter"/> on top of <code>in</code>. </summary>
+        public TrimFilter(LuceneVersion version, TokenStream @in)
+            : this(version, @in, false)
+        {
+        }
 
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: @Override public boolean incrementToken() throws java.io.IOException
-	  public override bool incrementToken()
-	  {
-		if (!input.incrementToken())
-		{
-			return false;
-		}
+        public override bool IncrementToken()
+        {
+            if (!input.IncrementToken())
+            {
+                return false;
+            }
 
-		char[] termBuffer = termAtt.buffer();
-		int len = termAtt.length();
-		//TODO: Is this the right behavior or should we return false?  Currently, "  ", returns true, so I think this should
-		//also return true
-		if (len == 0)
-		{
-		  return true;
-		}
-		int start = 0;
-		int end = 0;
-		int endOff = 0;
+            char[] termBuffer = termAtt.Buffer();
+            int len = termAtt.Length;
+            //TODO: Is this the right behavior or should we return false?  Currently, "  ", returns true, so I think this should
+            //also return true
+            if (len == 0)
+            {
+                return true;
+            }
+            int start = 0;
+            int end = 0;
+            int endOff = 0;
 
-		// eat the first characters
-		for (start = 0; start < len && char.IsWhiteSpace(termBuffer[start]); start++)
-		{
-		}
-		// eat the end characters
-		for (end = len; end >= start && char.IsWhiteSpace(termBuffer[end - 1]); end--)
-		{
-		  endOff++;
-		}
-		if (start > 0 || end < len)
-		{
-		  if (start < end)
-		  {
-			termAtt.copyBuffer(termBuffer, start, (end - start));
-		  }
-		  else
-		  {
-			termAtt.setEmpty();
-		  }
-		  if (updateOffsets && len == offsetAtt.endOffset() - offsetAtt.startOffset())
-		  {
-			int newStart = offsetAtt.startOffset() + start;
-			int newEnd = offsetAtt.endOffset() - (start < end ? endOff:0);
-			offsetAtt.setOffset(newStart, newEnd);
-		  }
-		}
+            // eat the first characters
+            for (start = 0; start < len && char.IsWhiteSpace(termBuffer[start]); start++)
+            {
+            }
+            // eat the end characters
+            for (end = len; end >= start && char.IsWhiteSpace(termBuffer[end - 1]); end--)
+            {
+                endOff++;
+            }
+            if (start > 0 || end < len)
+            {
+                if (start < end)
+                {
+                    termAtt.CopyBuffer(termBuffer, start, (end - start));
+                }
+                else
+                {
+                    termAtt.SetEmpty();
+                }
+                if (updateOffsets && len == offsetAtt.EndOffset() - offsetAtt.StartOffset())
+                {
+                    int newStart = offsetAtt.StartOffset() + start;
+                    int newEnd = offsetAtt.EndOffset() - (start < end ? endOff : 0);
+                    offsetAtt.SetOffset(newStart, newEnd);
+                }
+            }
 
-		return true;
-	  }
-	}
+            return true;
+        }
+    }
 
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f47779a7/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/TrimFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/TrimFilterFactory.cs b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/TrimFilterFactory.cs
index 8ed68ac..864003b 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/TrimFilterFactory.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/TrimFilterFactory.cs
@@ -1,64 +1,58 @@
 using System.Collections.Generic;
-using Lucene.Net.Analysis.Miscellaneous;
-using TokenFilterFactory = Lucene.Net.Analysis.Util.TokenFilterFactory;
+using Lucene.Net.Analysis.Util;
 
-namespace org.apache.lucene.analysis.miscellaneous
+namespace Lucene.Net.Analysis.Miscellaneous
 {
 
-	/*
-	 * 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;
-
-	/// <summary>
-	/// Factory for <seealso cref="TrimFilter"/>.
-	/// <pre class="prettyprint">
-	/// &lt;fieldType name="text_trm" class="solr.TextField" positionIncrementGap="100"&gt;
-	///   &lt;analyzer&gt;
-	///     &lt;tokenizer class="solr.NGramTokenizerFactory"/&gt;
-	///     &lt;filter class="solr.TrimFilterFactory" /&gt;
-	///   &lt;/analyzer&gt;
-	/// &lt;/fieldType&gt;</pre>
-	/// </summary>
-	/// <seealso cref= TrimFilter </seealso>
-	public class TrimFilterFactory : TokenFilterFactory
-	{
-
-	  protected internal readonly bool updateOffsets;
-
-	  /// <summary>
-	  /// Creates a new TrimFilterFactory </summary>
-	  public TrimFilterFactory(IDictionary<string, string> args) : base(args)
-	  {
-		updateOffsets = getBoolean(args, "updateOffsets", false);
-		if (args.Count > 0)
-		{
-		  throw new System.ArgumentException("Unknown parameters: " + args);
-		}
-	  }
-
-	  public override TrimFilter create(TokenStream input)
-	  {
-//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
-//ORIGINAL LINE: @SuppressWarnings("deprecation") final org.apache.lucene.analysis.miscellaneous.TrimFilter filter = new org.apache.lucene.analysis.miscellaneous.TrimFilter(luceneMatchVersion, input, updateOffsets);
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-		  TrimFilter filter = new TrimFilter(luceneMatchVersion, input, updateOffsets);
-		return filter;
-	  }
-	}
+    /*
+     * 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="TrimFilter"/>.
+    /// <pre class="prettyprint">
+    /// &lt;fieldType name="text_trm" class="solr.TextField" positionIncrementGap="100"&gt;
+    ///   &lt;analyzer&gt;
+    ///     &lt;tokenizer class="solr.NGramTokenizerFactory"/&gt;
+    ///     &lt;filter class="solr.TrimFilterFactory" /&gt;
+    ///   &lt;/analyzer&gt;
+    /// &lt;/fieldType&gt;</pre>
+    /// </summary>
+    /// <seealso cref= TrimFilter </seealso>
+    public class TrimFilterFactory : TokenFilterFactory
+    {
+
+        protected internal readonly bool updateOffsets;
+
+        /// <summary>
+        /// Creates a new TrimFilterFactory </summary>
+        public TrimFilterFactory(IDictionary<string, string> args)
+            : base(args)
+        {
+            updateOffsets = getBoolean(args, "updateOffsets", false);
+            if (args.Count > 0)
+            {
+                throw new System.ArgumentException("Unknown parameters: " + args);
+            }
+        }
+
+        public override TokenStream Create(TokenStream input)
+        {
+            var filter = new TrimFilter(luceneMatchVersion, input, updateOffsets);
+            return filter;
+        }
+    }
 
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f47779a7/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/WordDelimiterIterator.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/WordDelimiterIterator.cs b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/WordDelimiterIterator.cs
index e43d407..3fff248 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/WordDelimiterIterator.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/WordDelimiterIterator.cs
@@ -1,7 +1,4 @@
-using Lucene.Net.Analysis.Miscellaneous;
-using Lucene.Net.Support;
-
-namespace org.apache.lucene.analysis.miscellaneous
+namespace Lucene.Net.Analysis.Miscellaneous
 {
 
 	/*
@@ -21,10 +18,6 @@ namespace org.apache.lucene.analysis.miscellaneous
 	 * limitations under the License.
 	 */
 
-	using org.apache.lucene.analysis.miscellaneous;
-//JAVA TO C# CONVERTER TODO TASK: This Java 'import static' statement cannot be converted to C#:
-//	import static org.apache.lucene.analysis.miscellaneous.WordDelimiterFilter.*;
-
 	/// <summary>
 	/// A BreakIterator-like API for iterating over subwords in text, according to WordDelimiterFilter rules.
 	/// @lucene.internal

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f47779a7/src/Lucene.Net.Analysis.Common/Analysis/Pattern/PatternCaptureGroupFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Pattern/PatternCaptureGroupFilterFactory.cs b/src/Lucene.Net.Analysis.Common/Analysis/Pattern/PatternCaptureGroupFilterFactory.cs
index 5b47526..4772417 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Pattern/PatternCaptureGroupFilterFactory.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Pattern/PatternCaptureGroupFilterFactory.cs
@@ -1,7 +1,7 @@
 using System.Collections.Generic;
-using TokenFilterFactory = Lucene.Net.Analysis.Util.TokenFilterFactory;
+using Lucene.Net.Analysis.Util;
 
-namespace org.apache.lucene.analysis.pattern
+namespace Lucene.Net.Analysis.Pattern
 {
 
 	/*
@@ -20,11 +20,7 @@ namespace org.apache.lucene.analysis.pattern
 	 * See the License for the specific language governing permissions and
 	 * limitations under the License.
 	 */
-
-
-	using TokenFilterFactory = TokenFilterFactory;
-
-	/// <summary>
+    /// <summary>
 	/// Factory for <seealso cref="PatternCaptureGroupTokenFilter"/>. 
 	/// <pre class="prettyprint">
 	/// &lt;fieldType name="text_ptncapturegroup" class="solr.TextField" positionIncrementGap="100"&gt;
@@ -45,7 +41,7 @@ namespace org.apache.lucene.analysis.pattern
 		pattern = getPattern(args, "pattern");
 		preserveOriginal = args.ContainsKey("preserve_original") ? bool.Parse(args["preserve_original"]) : true;
 	  }
-	  public override PatternCaptureGroupTokenFilter create(TokenStream input)
+	  public override TokenStream Create(TokenStream input)
 	  {
 		return new PatternCaptureGroupTokenFilter(input, preserveOriginal, pattern);
 	  }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f47779a7/src/Lucene.Net.Analysis.Common/Analysis/Pattern/PatternCaptureGroupTokenFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Pattern/PatternCaptureGroupTokenFilter.cs b/src/Lucene.Net.Analysis.Common/Analysis/Pattern/PatternCaptureGroupTokenFilter.cs
index 887b749..689ac8e 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Pattern/PatternCaptureGroupTokenFilter.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Pattern/PatternCaptureGroupTokenFilter.cs
@@ -1,6 +1,7 @@
 using System.Diagnostics;
+using Lucene.Net.Analysis.Tokenattributes;
 
-namespace org.apache.lucene.analysis.pattern
+namespace Lucene.Net.Analysis.Pattern
 {
 
 	/*
@@ -19,12 +20,7 @@ namespace org.apache.lucene.analysis.pattern
 	 * See the License for the specific language governing permissions and
 	 * limitations under the License.
 	 */
-
-	using CharTermAttribute = org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
-	using PositionIncrementAttribute = org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
-	using CharsRef = org.apache.lucene.util.CharsRef;
-
-	/// <summary>
+    /// <summary>
 	/// CaptureGroup uses Java regexes to emit multiple tokens - one for each capture
 	/// group in one or more patterns.
 	/// 
@@ -69,7 +65,7 @@ namespace org.apache.lucene.analysis.pattern
 	public sealed class PatternCaptureGroupTokenFilter : TokenFilter
 	{
 
-	  private readonly CharTermAttribute charTermAttr = addAttribute(typeof(CharTermAttribute));
+	  private readonly ICharTermAttribute charTermAttr = addAttribute(typeof(CharTermAttribute));
 	  private readonly PositionIncrementAttribute posAttr = addAttribute(typeof(PositionIncrementAttribute));
 	  private State state;
 	  private readonly Matcher[] matchers;
@@ -118,11 +114,7 @@ namespace org.apache.lucene.analysis.pattern
 		  {
 			while (currentGroup[i] < groupCounts[i] + 1)
 			{
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final int start = matcher.start(currentGroup[i]);
 			  int start = matcher.start(currentGroup[i]);
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final int end = matcher.end(currentGroup[i]);
 			  int end = matcher.end(currentGroup[i]);
 			  if (start == end || preserveOriginal && start == 0 && spare.length == end)
 			  {
@@ -176,8 +168,8 @@ namespace org.apache.lucene.analysis.pattern
 
 		char[] buffer = charTermAttr.buffer();
 		int length = charTermAttr.length();
-		spare.copyChars(buffer, 0, length);
-		state = captureState();
+		spare.CopyChars(buffer, 0, length);
+		state = CaptureState();
 
 		for (int i = 0; i < matchers.Length; i++)
 		{

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f47779a7/src/Lucene.Net.Analysis.Common/Analysis/Payloads/DelimitedPayloadTokenFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Payloads/DelimitedPayloadTokenFilter.cs b/src/Lucene.Net.Analysis.Common/Analysis/Payloads/DelimitedPayloadTokenFilter.cs
index 1c03b4e..e577319 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Payloads/DelimitedPayloadTokenFilter.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Payloads/DelimitedPayloadTokenFilter.cs
@@ -1,82 +1,75 @@
-namespace org.apache.lucene.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.
-	 */
-
-	using PayloadAttribute = org.apache.lucene.analysis.tokenattributes.PayloadAttribute;
-	using CharTermAttribute = org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
+using Lucene.Net.Analysis.Tokenattributes;
+using org.apache.lucene.analysis.payloads;
 
-
-	/// <summary>
-	/// Characters before the delimiter are the "token", those after are the payload.
-	/// <p/>
-	/// For example, if the delimiter is '|', then for the string "foo|bar", foo is the token
-	/// and "bar" is a payload.
-	/// <p/>
-	/// Note, you can also include a <seealso cref="org.apache.lucene.analysis.payloads.PayloadEncoder"/> to convert the payload in an appropriate way (from characters to bytes).
-	/// <p/>
-	/// Note make sure your Tokenizer doesn't split on the delimiter, or this won't work
-	/// </summary>
-	/// <seealso cref= PayloadEncoder </seealso>
-	public sealed class DelimitedPayloadTokenFilter : TokenFilter
-	{
-	  public const char DEFAULT_DELIMITER = '|';
-	  private readonly char delimiter;
-	  private readonly CharTermAttribute termAtt = addAttribute(typeof(CharTermAttribute));
-	  private readonly PayloadAttribute payAtt = addAttribute(typeof(PayloadAttribute));
-	  private readonly PayloadEncoder encoder;
+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.
+     */
+    /// <summary>
+    /// Characters before the delimiter are the "token", those after are the payload.
+    /// <p/>
+    /// For example, if the delimiter is '|', then for the string "foo|bar", foo is the token
+    /// and "bar" is a payload.
+    /// <p/>
+    /// Note, you can also include a <seealso cref="org.apache.lucene.analysis.payloads.PayloadEncoder"/> to convert the payload in an appropriate way (from characters to bytes).
+    /// <p/>
+    /// Note make sure your Tokenizer doesn't split on the delimiter, or this won't work
+    /// </summary>
+    /// <seealso cref= PayloadEncoder </seealso>
+    public sealed class DelimitedPayloadTokenFilter : TokenFilter
+    {
+        public const char DEFAULT_DELIMITER = '|';
+        private readonly char delimiter;
+        private readonly ICharTermAttribute termAtt = addAttribute(typeof(CharTermAttribute));
+        private readonly IPayloadAttribute payAtt = addAttribute(typeof(PayloadAttribute));
+        private readonly PayloadEncoder encoder;
 
 
-	  public DelimitedPayloadTokenFilter(TokenStream input, char delimiter, PayloadEncoder encoder) : base(input)
-	  {
-		this.delimiter = delimiter;
-		this.encoder = encoder;
-	  }
+        public DelimitedPayloadTokenFilter(TokenStream input, char delimiter, PayloadEncoder encoder)
+            : base(input)
+        {
+            this.delimiter = delimiter;
+            this.encoder = encoder;
+        }
 
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: @Override public boolean incrementToken() throws java.io.IOException
-	  public override bool incrementToken()
-	  {
-		if (input.incrementToken())
-		{
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final char[] buffer = termAtt.buffer();
-		  char[] buffer = termAtt.buffer();
-//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
-//ORIGINAL LINE: final int length = termAtt.length();
-		  int length = termAtt.length();
-		  for (int i = 0; i < length; i++)
-		  {
-			if (buffer[i] == delimiter)
-			{
-			  payAtt.Payload = encoder.encode(buffer, i + 1, (length - (i + 1)));
-			  termAtt.Length = i; // simply set a new length
-			  return true;
-			}
-		  }
-		  // we have not seen the delimiter
-		  payAtt.Payload = null;
-		  return true;
-		}
-		else
-		{
-			return false;
-		}
-	  }
-	}
+        public override bool IncrementToken()
+        {
+            if (input.IncrementToken())
+            {
+                char[] buffer = termAtt.Buffer();
+                int length = termAtt.Length;
+                for (int i = 0; i < length; i++)
+                {
+                    if (buffer[i] == delimiter)
+                    {
+                        payAtt.Payload = encoder.encode(buffer, i + 1, (length - (i + 1)));
+                        termAtt.Length = i; // simply set a new length
+                        return true;
+                    }
+                }
+                // we have not seen the delimiter
+                payAtt.Payload = null;
+                return true;
+            }
+            else
+            {
+                return false;
+            }
+        }
+    }
 
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f47779a7/src/Lucene.Net.Analysis.Common/Analysis/Shingle/ShingleFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Shingle/ShingleFilter.cs b/src/Lucene.Net.Analysis.Common/Analysis/Shingle/ShingleFilter.cs
index 9bdc341..a9b7dfd 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Shingle/ShingleFilter.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Shingle/ShingleFilter.cs
@@ -1,6 +1,8 @@
 using System;
 using System.Collections.Generic;
+using System.IO;
 using System.Text;
+using Lucene.Net.Analysis;
 
 namespace org.apache.lucene.analysis.shingle
 {
@@ -23,14 +25,6 @@ namespace org.apache.lucene.analysis.shingle
 	 */
 
 
-	using CharTermAttribute = org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
-	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 TypeAttribute = org.apache.lucene.analysis.tokenattributes.TypeAttribute;
-	using AttributeSource = org.apache.lucene.util.AttributeSource;
-
-
 	/// <summary>
 	/// <para>A ShingleFilter constructs shingles (token n-grams) from a token stream.
 	/// In other words, it creates combinations of tokens as a single token.
@@ -329,9 +323,7 @@ namespace org.apache.lucene.analysis.shingle
 		  }
 	  }
 
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: @Override public boolean incrementToken() throws java.io.IOException
-	  public override bool incrementToken()
+	  public override bool IncrementToken()
 	  {
 		bool tokenAvailable = false;
 		int builtGramSize = 0;
@@ -407,8 +399,6 @@ namespace org.apache.lucene.analysis.shingle
 	  /// <param name="target"> Where to put the new token; if null, a new instance is created. </param>
 	  /// <returns> On success, the populated token; null otherwise </returns>
 	  /// <exception cref="IOException"> if the input stream has a problem </exception>
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: private InputWindowToken getNextToken(InputWindowToken target) throws java.io.IOException
 	  private InputWindowToken getNextToken(InputWindowToken target)
 	  {
 		InputWindowToken newTarget = target;
@@ -507,17 +497,15 @@ namespace org.apache.lucene.analysis.shingle
 		return newTarget;
 	  }
 
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: @Override public void end() throws java.io.IOException
-	  public override void end()
+	  public override void End()
 	  {
 		if (!exhausted)
 		{
-		  base.end();
+		  base.End();
 		}
 		else
 		{
-		  restoreState(endState);
+		  RestoreState(endState);
 		}
 	  }
 
@@ -530,8 +518,6 @@ namespace org.apache.lucene.analysis.shingle
 	  /// </para>
 	  /// </summary>
 	  /// <exception cref="IOException"> if there's a problem getting the next token </exception>
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: private void shiftInputWindow() throws java.io.IOException
 	  private void shiftInputWindow()
 	  {
 		InputWindowToken firstToken = null;
@@ -574,11 +560,9 @@ namespace org.apache.lucene.analysis.shingle
 		isOutputHere = false;
 	  }
 
-//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();
 		gramSize.reset();
 		inputWindow.Clear();
 		nextInputStreamToken = null;
@@ -715,8 +699,8 @@ namespace org.apache.lucene.analysis.shingle
 		{
 			this.outerInstance = outerInstance;
 		  this.attSource = attSource;
-		  this.termAtt = attSource.getAttribute(typeof(CharTermAttribute));
-		  this.offsetAtt = attSource.getAttribute(typeof(OffsetAttribute));
+		  this.termAtt = attSource.GetAttribute(typeof(CharTermAttribute));
+		  this.offsetAtt = attSource.GetAttribute(typeof(OffsetAttribute));
 		}
 	  }
 	}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f47779a7/src/Lucene.Net.Analysis.Common/Analysis/Standard/ClassicTokenizerImpl.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Standard/ClassicTokenizerImpl.cs b/src/Lucene.Net.Analysis.Common/Analysis/Standard/ClassicTokenizerImpl.cs
index f2ad424..0798ff9 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Standard/ClassicTokenizerImpl.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Standard/ClassicTokenizerImpl.cs
@@ -40,7 +40,7 @@ namespace Lucene.Net.Analysis.Standard
 
 	  /// <summary>
 	  /// This character denotes the end of file </summary>
-	  public const int StandardTokenizerInterface_Fields;
+	  //public const int StandardTokenizerInterface_Fields;
 
 	  /// <summary>
 	  /// initial size of the lookahead buffer </summary>
@@ -537,8 +537,6 @@ namespace Lucene.Net.Analysis.Standard
 	  /// </summary>
 	  /// <returns>      the next token </returns>
 	  /// <exception cref="java.io.IOException">  if any I/O-Error occurs </exception>
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: public int getNextToken() throws java.io.IOException
 	  public virtual int NextToken
 	  {
 		  get

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f47779a7/src/Lucene.Net.Analysis.Common/Analysis/Standard/StandardTokenizerImpl.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Standard/StandardTokenizerImpl.cs b/src/Lucene.Net.Analysis.Common/Analysis/Standard/StandardTokenizerImpl.cs
index 44a9bbe..c78982c 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Standard/StandardTokenizerImpl.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Standard/StandardTokenizerImpl.cs
@@ -1,6 +1,8 @@
 using System;
 /* The following code was generated by JFlex 1.5.1 */
+using System.IO;
 using Lucene.Net.Analysis.Standard;
+using Lucene.Net.Analysis.Tokenattributes;
 
 namespace org.apache.lucene.analysis.standard
 {
@@ -45,7 +47,7 @@ namespace org.apache.lucene.analysis.standard
 
 	  /// <summary>
 	  /// This character denotes the end of file </summary>
-	  public const int StandardTokenizerInterface_Fields;
+	  //public const int StandardTokenizerInterface_Fields;
 
 	  /// <summary>
 	  /// initial size of the lookahead buffer </summary>
@@ -210,7 +212,7 @@ namespace org.apache.lucene.analysis.standard
 
 	  /// <summary>
 	  /// the input device </summary>
-	  private java.io.Reader zzReader;
+	  private TextReader zzReader;
 
 	  /// <summary>
 	  /// the current state of the DFA </summary>
@@ -307,9 +309,9 @@ namespace org.apache.lucene.analysis.standard
 	  /// <summary>
 	  /// Fills CharTermAttribute with the current token text.
 	  /// </summary>
-	  public void getText(CharTermAttribute t)
+	  public void getText(ICharTermAttribute t)
 	  {
-		t.copyBuffer(zzBuffer, zzStartRead, zzMarkedPos - zzStartRead);
+		t.CopyBuffer(zzBuffer, zzStartRead, zzMarkedPos - zzStartRead);
 	  }
 
 
@@ -317,7 +319,7 @@ namespace org.apache.lucene.analysis.standard
 	  /// Creates a new scanner
 	  /// </summary>
 	  /// <param name="in">  the java.io.Reader to read input from. </param>
-	  public StandardTokenizerImpl(java.io.Reader @in)
+	  public StandardTokenizerImpl(TextReader @in)
 	  {
 		this.zzReader = @in;
 	  }
@@ -379,7 +381,7 @@ namespace org.apache.lucene.analysis.standard
 		}
 
 		/* finally: fill the buffer with new input */
-		int numRead = zzReader.read(zzBuffer, zzEndRead, zzBuffer.Length - zzEndRead);
+		int numRead = zzReader.Read(zzBuffer, zzEndRead, zzBuffer.Length - zzEndRead);
 
 		if (numRead > 0)
 		{
@@ -389,8 +391,8 @@ namespace org.apache.lucene.analysis.standard
 		// unlikely but not impossible: read 0 characters, but not at end of stream    
 		if (numRead == 0)
 		{
-		  int c = zzReader.read();
-		  if (c == -1)
+		  int c = zzReader.Read();
+		  if (c <= 0)
 		  {
 			return true;
 		  }
@@ -409,8 +411,6 @@ namespace org.apache.lucene.analysis.standard
 	  /// <summary>
 	  /// Closes the input stream.
 	  /// </summary>
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: public final void yyclose() throws java.io.IOException
 	  public void yyclose()
 	  {
 		zzAtEOF = true; // indicate end of file
@@ -418,7 +418,7 @@ namespace org.apache.lucene.analysis.standard
 
 		if (zzReader != null)
 		{
-		  zzReader.close();
+		  zzReader.Dispose();
 		}
 	  }
 
@@ -434,7 +434,7 @@ namespace org.apache.lucene.analysis.standard
 	  /// Internal scan buffer is resized down to its initial length, if it has grown.
 	  /// </summary>
 	  /// <param name="reader">   the new input stream  </param>
-	  public void yyreset(java.io.Reader reader)
+	  public void yyreset(TextReader reader)
 	  {
 		zzReader = reader;
 		zzAtBOL = true;
@@ -557,8 +557,6 @@ namespace org.apache.lucene.analysis.standard
 	  /// </summary>
 	  /// <returns>      the next token </returns>
 	  /// <exception cref="java.io.IOException">  if any I/O-Error occurs </exception>
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: public int getNextToken() throws java.io.IOException
 	  public int NextToken
 	  {
 		  get

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f47779a7/src/Lucene.Net.Analysis.Common/Analysis/Standard/StandardTokenizerInterface.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Standard/StandardTokenizerInterface.cs b/src/Lucene.Net.Analysis.Common/Analysis/Standard/StandardTokenizerInterface.cs
index ee84322..b066d2f 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Standard/StandardTokenizerInterface.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Standard/StandardTokenizerInterface.cs
@@ -1,77 +1,76 @@
-namespace org.apache.lucene.analysis.standard
-{
+using System.IO;
+using Lucene.Net.Analysis.Tokenattributes;
 
-	/*
-	 * 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.
-	 */
+namespace Lucene.Net.Analysis.Standard
+{
 
-	using CharTermAttribute = org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
+    /*
+     * 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>
-	/// Internal interface for supporting versioned grammars.
-	/// @lucene.internal 
-	/// </summary>
-	public interface StandardTokenizerInterface
-	{
+    /// <summary>
+    /// Internal interface for supporting versioned grammars.
+    /// @lucene.internal 
+    /// </summary>
+    public interface StandardTokenizerInterface
+    {
 
-	  /// <summary>
-	  /// This character denotes the end of file </summary>
+        /// <summary>
+        /// This character denotes the end of file </summary>
 
-	  /// <summary>
-	  /// Copies the matched text into the CharTermAttribute
-	  /// </summary>
-	  void getText(CharTermAttribute t);
+        /// <summary>
+        /// Copies the matched text into the CharTermAttribute
+        /// </summary>
+        void getText(ICharTermAttribute t);
 
-	  /// <summary>
-	  /// Returns the current position.
-	  /// </summary>
-	  int yychar();
+        /// <summary>
+        /// Returns the current position.
+        /// </summary>
+        int yychar();
 
-	  /// <summary>
-	  /// Resets the scanner to read from a new input stream.
-	  /// Does not close the old reader.
-	  /// 
-	  /// All internal variables are reset, the old input stream 
-	  /// <b>cannot</b> be reused (internal buffer is discarded and lost).
-	  /// Lexical state is set to <tt>ZZ_INITIAL</tt>.
-	  /// </summary>
-	  /// <param name="reader">   the new input stream  </param>
-	  void yyreset(Reader reader);
+        /// <summary>
+        /// Resets the scanner to read from a new input stream.
+        /// Does not close the old reader.
+        /// 
+        /// All internal variables are reset, the old input stream 
+        /// <b>cannot</b> be reused (internal buffer is discarded and lost).
+        /// Lexical state is set to <tt>ZZ_INITIAL</tt>.
+        /// </summary>
+        /// <param name="reader">   the new input stream  </param>
+        void yyreset(TextReader reader);
 
-	  /// <summary>
-	  /// Returns the length of the matched text region.
-	  /// </summary>
-	  int yylength();
+        /// <summary>
+        /// Returns the length of the matched text region.
+        /// </summary>
+        int yylength();
 
-	  /// <summary>
-	  /// Resumes scanning until the next regular expression is matched,
-	  /// the end of input is encountered or an I/O-Error occurs.
-	  /// </summary>
-	  /// <returns>      the next token, <seealso cref="#YYEOF"/> on end of stream </returns>
-	  /// <exception cref="IOException">  if any I/O-Error occurs </exception>
-//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
-//ORIGINAL LINE: public int getNextToken() throws java.io.IOException;
-	  int NextToken {get;}
+        /// <summary>
+        /// Resumes scanning until the next regular expression is matched,
+        /// the end of input is encountered or an I/O-Error occurs.
+        /// </summary>
+        /// <returns>      the next token, <seealso cref="#YYEOF"/> on end of stream </returns>
+        /// <exception cref="IOException">  if any I/O-Error occurs </exception>
+        int NextToken { get; }
 
-	}
+    }
 
-	public static class StandardTokenizerInterface_Fields
-	{
-	  public const int YYEOF = -1;
-	}
+    public static class StandardTokenizerInterface_Fields
+    {
+        public const int YYEOF = -1;
+    }
 
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f47779a7/src/Lucene.Net.Analysis.Common/Analysis/Util/AbstractAnalysisFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Util/AbstractAnalysisFactory.cs b/src/Lucene.Net.Analysis.Common/Analysis/Util/AbstractAnalysisFactory.cs
index 64dde54..27d2531 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Util/AbstractAnalysisFactory.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Util/AbstractAnalysisFactory.cs
@@ -93,12 +93,13 @@ namespace Lucene.Net.Analysis.Util
         }
 
         public virtual string require(IDictionary<string, string> args, string name)
-        {
-            string s = args.Remove(name);
-            if (s == null)
+        {            
+            string s;
+            if (!args.TryGetValue(name, out s))
             {
                 throw new System.ArgumentException("Configuration Error: missing parameter '" + name + "'");
             }
+            args.Remove(name);
             return s;
         }
         public virtual string require(IDictionary<string, string> args, string name, ICollection<string> allowedValues)
@@ -134,14 +135,12 @@ namespace Lucene.Net.Analysis.Util
                 throw new System.ArgumentException("Configuration Error: '" + name + "' value must be one of " + allowedValues);
             }
         }
-        public virtual string get(IDictionary<string, string> args, string name)
+        public virtual string get(IDictionary<string, string> args, string name, string defaultVal = null)
         {
-            return args.Remove(name); // defaultVal = null
-        }
-        public virtual string get(IDictionary<string, string> args, string name, string defaultVal)
-        {
-            string s = args.Remove(name);
-            return s == null ? defaultVal : s;
+            string s;
+            if (args.TryGetValue(name, out s))
+                args.Remove(name);
+            return s ?? defaultVal;
         }
         public virtual string get(IDictionary<string, string> args, string name, ICollection<string> allowedValues)
         {
@@ -153,9 +152,10 @@ namespace Lucene.Net.Analysis.Util
         }
         public virtual string get(IDictionary<string, string> args, string name, ICollection<string> allowedValues, string defaultVal, bool caseSensitive)
         {
-            string s = args.Remove(name);
-            if (s == null)
+            string s = null;
+            if (args.TryGetValue(name, out s))
             {
+                args.Remove(name);
                 return defaultVal;
             }
             else
@@ -177,7 +177,8 @@ namespace Lucene.Net.Analysis.Util
                         }
                     }
                 }
-                throw new System.ArgumentException("Configuration Error: '" + name + "' value must be one of " + allowedValues);
+                throw new System.ArgumentException("Configuration Error: '" + name + "' value must be one of " +
+                                                   allowedValues);
             }
         }
 
@@ -359,7 +360,7 @@ namespace Lucene.Net.Analysis.Util
             IList<string> result = new List<string>();
             foreach (string file in fileNames.Split("(?<!\\\\),", true))
             {
-                result.Add(file.replaceAll("\\\\(?=,)", ""));
+                result.Add(file.ReplaceAll("\\\\(?=,)", ""));
             }
 
             return result;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f47779a7/src/Lucene.Net.Analysis.Common/Analysis/Util/CharArrayIterator.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Util/CharArrayIterator.cs b/src/Lucene.Net.Analysis.Common/Analysis/Util/CharArrayIterator.cs
index 1d1c44b..b4f4b96 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Util/CharArrayIterator.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Util/CharArrayIterator.cs
@@ -25,7 +25,7 @@ namespace org.apache.lucene.analysis.util
 	/// A CharacterIterator used internally for use with <seealso cref="BreakIterator"/>
 	/// @lucene.internal
 	/// </summary>
-	public abstract class CharArrayIterator : CharacterIterator
+	public abstract class CharArrayIterator //: CharacterIterator
 	{
 	  private char[] array;
 	  private int start;
@@ -63,8 +63,6 @@ namespace org.apache.lucene.analysis.util
 	  /// <param name="array"> text buffer to examine </param>
 	  /// <param name="start"> offset into buffer </param>
 	  /// <param name="length"> maximum length to examine </param>
-//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
-//ORIGINAL LINE: public void setText(final char array[] , int start, int length)
 	  public virtual void setText(char[] array, int start, int length)
 	  {
 		this.array = array;
@@ -74,17 +72,17 @@ namespace org.apache.lucene.analysis.util
 		this.limit = start + length;
 	  }
 
-	  public override char current()
+	  public override char Current()
 	  {
 		return (index == limit) ? DONE : jreBugWorkaround(array[index]);
 	  }
 
 	  protected internal abstract char jreBugWorkaround(char ch);
 
-	  public override char first()
+	  public override char First()
 	  {
 		index = start;
-		return current();
+		return Current();
 	  }
 
 	  public override int BeginIndex
@@ -111,13 +109,13 @@ namespace org.apache.lucene.analysis.util
 		  }
 	  }
 
-	  public override char last()
+	  public override char Last()
 	  {
 		index = (limit == start) ? limit : limit - 1;
 		return current();
 	  }
 
-	  public override char next()
+	  public override char Next()
 	  {
 		if (++index >= limit)
 		{
@@ -130,7 +128,7 @@ namespace org.apache.lucene.analysis.util
 		}
 	  }
 
-	  public override char previous()
+	  public override char Previous()
 	  {
 		if (--index < start)
 		{
@@ -143,7 +141,7 @@ namespace org.apache.lucene.analysis.util
 		}
 	  }
 
-	  public override char setIndex(int position)
+	  public override char SetIndex(int position)
 	  {
 		if (position < BeginIndex || position > EndIndex)
 		{
@@ -153,7 +151,7 @@ namespace org.apache.lucene.analysis.util
 		return current();
 	  }
 
-	  public override CharArrayIterator clone()
+	  public override CharArrayIterator Clone()
 	  {
 		try
 		{