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/12/10 19:38:50 UTC

[01/27] lucenenet git commit: adding converted analysis common tests

Repository: lucenenet
Updated Branches:
  refs/heads/master 812e1c541 -> 092aab40f


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Wikipedia/WikipediaTokenizerTest.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Wikipedia/WikipediaTokenizerTest.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Wikipedia/WikipediaTokenizerTest.cs
new file mode 100644
index 0000000..ff0bfd4
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Wikipedia/WikipediaTokenizerTest.cs
@@ -0,0 +1,180 @@
+using System;
+using System.Collections.Generic;
+
+/*
+ * 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 org.apache.lucene.analysis.wikipedia
+{
+
+
+	using FlagsAttribute = org.apache.lucene.analysis.tokenattributes.FlagsAttribute;
+
+//JAVA TO C# CONVERTER TODO TASK: This Java 'import static' statement cannot be converted to C#:
+//	import static org.apache.lucene.analysis.wikipedia.WikipediaTokenizer.*;
+
+	/// <summary>
+	/// Basic Tests for <seealso cref="WikipediaTokenizer"/>
+	/// 
+	/// </summary>
+	public class WikipediaTokenizerTest : BaseTokenStreamTestCase
+	{
+	  protected internal const string LINK_PHRASES = "click [[link here again]] click [http://lucene.apache.org here again] [[Category:a b c d]]";
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testSimple() throws Exception
+	  public virtual void testSimple()
+	  {
+		string text = "This is a [[Category:foo]]";
+		WikipediaTokenizer tf = new WikipediaTokenizer(new StringReader(text));
+		assertTokenStreamContents(tf, new string[] {"This", "is", "a", "foo"}, new int[] {0, 5, 8, 21}, new int[] {4, 7, 9, 24}, new string[] {"<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", CATEGORY}, new int[] {1, 1, 1, 1}, text.Length);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testHandwritten() throws Exception
+	  public virtual void testHandwritten()
+	  {
+		// make sure all tokens are in only one type
+		string test = "[[link]] This is a [[Category:foo]] Category  This is a linked [[:Category:bar none withstanding]] " + "Category This is (parens) This is a [[link]]  This is an external URL [http://lucene.apache.org] " + "Here is ''italics'' and ''more italics'', '''bold''' and '''''five quotes''''' " + " This is a [[link|display info]]  This is a period.  Here is $3.25 and here is 3.50.  Here's Johnny.  " + "==heading== ===sub head=== followed by some text  [[Category:blah| ]] " + "''[[Category:ital_cat]]''  here is some that is ''italics [[Category:foo]] but is never closed." + "'''same [[Category:foo]] goes for this '''''and2 [[Category:foo]] and this" + " [http://foo.boo.com/test/test/ Test Test] [http://foo.boo.com/test/test/test.html Test Test]" + " [http://foo.boo.com/test/test/test.html?g=b&c=d Test Test] <ref>Citation</ref> <sup>martian</sup> <span class=\"glue\">code</span>";
+
+		WikipediaTokenizer tf = new WikipediaTokenizer(new StringReader(test));
+		assertTokenStreamContents(tf, new string[] {"link", "This", "is", "a", "foo", "Category", "This", "is", "a", "linked", "bar", "none", "withstanding", "Category", "This", "is", "parens", "This", "is", "a", "link", "This", "is", "an", "external", "URL", "http://lucene.apache.org", "Here", "is", "italics", "and", "more", "italics", "bold", "and", "five", "quotes", "This", "is", "a", "link", "display", "info", "This", "is", "a", "period", "Here", "is", "3.25", "and", "here", "is", "3.50", "Here's", "Johnny", "heading", "sub", "head", "followed", "by", "some", "text", "blah", "ital", "cat", "here", "is", "some", "that", "is", "italics", "foo", "but", "is", "never", "closed", "same", "foo", "goes", "for", "this", "and2", "foo", "and", "this", "http://foo.boo.com/test/test/", "Test", "Test", "http://foo.boo.com/test/test/test.html", "Test", "Test", "http://foo.boo.com/test/test/test.html?g=b&c=d", "Test", "Test", "Citation", "martian", "code"}, new string[] {INTERNAL_LINK, "<ALPHANUM>", 
 "<ALPHANUM>", "<ALPHANUM>", CATEGORY, "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", CATEGORY, CATEGORY, CATEGORY, "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", INTERNAL_LINK, "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", EXTERNAL_LINK_URL, "<ALPHANUM>", "<ALPHANUM>", ITALICS, "<ALPHANUM>", ITALICS, ITALICS, BOLD, "<ALPHANUM>", BOLD_ITALICS, BOLD_ITALICS, "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", INTERNAL_LINK, INTERNAL_LINK, INTERNAL_LINK, "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<NUM>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<NUM>", "<APOSTROPHE>", "<ALPHANUM>", HEADING, SUB_HEADING, SUB_HEADING, "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", CATEGORY, CATEGORY, CATEGORY, "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", ITALICS, CATEGORY, "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", BOLD, CATEGOR
 Y, "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", BOLD_ITALICS, CATEGORY, "<ALPHANUM>", "<ALPHANUM>", EXTERNAL_LINK_URL, EXTERNAL_LINK, EXTERNAL_LINK, EXTERNAL_LINK_URL, EXTERNAL_LINK, EXTERNAL_LINK, EXTERNAL_LINK_URL, EXTERNAL_LINK, EXTERNAL_LINK, CITATION, "<ALPHANUM>", "<ALPHANUM>"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testLinkPhrases() throws Exception
+	  public virtual void testLinkPhrases()
+	  {
+		WikipediaTokenizer tf = new WikipediaTokenizer(new StringReader(LINK_PHRASES));
+		checkLinkPhrases(tf);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: private void checkLinkPhrases(WikipediaTokenizer tf) throws java.io.IOException
+	  private void checkLinkPhrases(WikipediaTokenizer tf)
+	  {
+		assertTokenStreamContents(tf, new string[] {"click", "link", "here", "again", "click", "http://lucene.apache.org", "here", "again", "a", "b", "c", "d"}, new int[] {1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testLinks() throws Exception
+	  public virtual void testLinks()
+	  {
+		string test = "[http://lucene.apache.org/java/docs/index.html#news here] [http://lucene.apache.org/java/docs/index.html?b=c here] [https://lucene.apache.org/java/docs/index.html?b=c here]";
+		WikipediaTokenizer tf = new WikipediaTokenizer(new StringReader(test));
+		assertTokenStreamContents(tf, new string[] {"http://lucene.apache.org/java/docs/index.html#news", "here", "http://lucene.apache.org/java/docs/index.html?b=c", "here", "https://lucene.apache.org/java/docs/index.html?b=c", "here"}, new string[] {EXTERNAL_LINK_URL, EXTERNAL_LINK, EXTERNAL_LINK_URL, EXTERNAL_LINK, EXTERNAL_LINK_URL, EXTERNAL_LINK});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testLucene1133() throws Exception
+	  public virtual void testLucene1133()
+	  {
+		ISet<string> untoks = new HashSet<string>();
+		untoks.Add(WikipediaTokenizer.CATEGORY);
+		untoks.Add(WikipediaTokenizer.ITALICS);
+		//should be exactly the same, regardless of untoks
+		WikipediaTokenizer tf = new WikipediaTokenizer(new StringReader(LINK_PHRASES), WikipediaTokenizer.TOKENS_ONLY, untoks);
+		checkLinkPhrases(tf);
+		string test = "[[Category:a b c d]] [[Category:e f g]] [[link here]] [[link there]] ''italics here'' something ''more italics'' [[Category:h   i   j]]";
+		tf = new WikipediaTokenizer(new StringReader(test), WikipediaTokenizer.UNTOKENIZED_ONLY, untoks);
+		assertTokenStreamContents(tf, new string[] {"a b c d", "e f g", "link", "here", "link", "there", "italics here", "something", "more italics", "h   i   j"}, new int[] {11, 32, 42, 47, 56, 61, 71, 86, 98, 124}, new int[] {18, 37, 46, 51, 60, 66, 83, 95, 110, 133}, new int[] {1, 1, 1, 1, 1, 1, 1, 1, 1, 1});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBoth() throws Exception
+	  public virtual void testBoth()
+	  {
+		ISet<string> untoks = new HashSet<string>();
+		untoks.Add(WikipediaTokenizer.CATEGORY);
+		untoks.Add(WikipediaTokenizer.ITALICS);
+		string test = "[[Category:a b c d]] [[Category:e f g]] [[link here]] [[link there]] ''italics here'' something ''more italics'' [[Category:h   i   j]]";
+		//should output all the indivual tokens plus the untokenized tokens as well.  Untokenized tokens
+		WikipediaTokenizer tf = new WikipediaTokenizer(new StringReader(test), WikipediaTokenizer.BOTH, untoks);
+		assertTokenStreamContents(tf, new string[] {"a b c d", "a", "b", "c", "d", "e f g", "e", "f", "g", "link", "here", "link", "there", "italics here", "italics", "here", "something", "more italics", "more", "italics", "h   i   j", "h", "i", "j"}, new int[] {11, 11, 13, 15, 17, 32, 32, 34, 36, 42, 47, 56, 61, 71, 71, 79, 86, 98, 98, 103, 124, 124, 128, 132}, new int[] {18, 12, 14, 16, 18, 37, 33, 35, 37, 46, 51, 60, 66, 83, 78, 83, 95, 110, 102, 110, 133, 125, 129, 133}, new int[] {1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0, 1, 1});
+
+		// now check the flags, TODO: add way to check flags from BaseTokenStreamTestCase?
+		tf = new WikipediaTokenizer(new StringReader(test), WikipediaTokenizer.BOTH, untoks);
+		int[] expectedFlags = new int[] {UNTOKENIZED_TOKEN_FLAG, 0, 0, 0, 0, UNTOKENIZED_TOKEN_FLAG, 0, 0, 0, 0, 0, 0, 0, UNTOKENIZED_TOKEN_FLAG, 0, 0, 0, UNTOKENIZED_TOKEN_FLAG, 0, 0, UNTOKENIZED_TOKEN_FLAG, 0, 0, 0};
+		FlagsAttribute flagsAtt = tf.addAttribute(typeof(FlagsAttribute));
+		tf.reset();
+		for (int i = 0; i < expectedFlags.Length; i++)
+		{
+		  assertTrue(tf.incrementToken());
+		  assertEquals("flags " + i, expectedFlags[i], flagsAtt.Flags);
+		}
+		assertFalse(tf.incrementToken());
+		tf.close();
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper(this);
+		checkRandomData(random(), a, 1000 * RANDOM_MULTIPLIER);
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly WikipediaTokenizerTest outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper(WikipediaTokenizerTest outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new WikipediaTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, tokenizer);
+		  }
+	  }
+
+	  /// <summary>
+	  /// blast some random large strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomHugeStrings() throws Exception
+	  public virtual void testRandomHugeStrings()
+	  {
+		Random random = random();
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper2(this);
+		checkRandomData(random, a, 100 * RANDOM_MULTIPLIER, 8192);
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly WikipediaTokenizerTest outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper2(WikipediaTokenizerTest outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new WikipediaTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, tokenizer);
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Collation/TestCollationKeyAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Collation/TestCollationKeyAnalyzer.cs b/src/Lucene.Net.Tests.Analysis.Common/Collation/TestCollationKeyAnalyzer.cs
new file mode 100644
index 0000000..5f2f274
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Collation/TestCollationKeyAnalyzer.cs
@@ -0,0 +1,126 @@
+namespace org.apache.lucene.collation
+{
+
+	/*
+	 * 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 Analyzer = org.apache.lucene.analysis.Analyzer;
+	using CollationTestBase = org.apache.lucene.analysis.CollationTestBase;
+	using BytesRef = org.apache.lucene.util.BytesRef;
+	using SuppressCodecs = org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
+
+
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @SuppressCodecs("Lucene3x") public class TestCollationKeyAnalyzer extends org.apache.lucene.analysis.CollationTestBase
+	public class TestCollationKeyAnalyzer : CollationTestBase
+	{
+		private bool InstanceFieldsInitialized = false;
+
+		public TestCollationKeyAnalyzer()
+		{
+			if (!InstanceFieldsInitialized)
+			{
+				InitializeInstanceFields();
+				InstanceFieldsInitialized = true;
+			}
+		}
+
+		private void InitializeInstanceFields()
+		{
+			analyzer = new CollationKeyAnalyzer(TEST_VERSION_CURRENT, collator);
+			firstRangeBeginning = new BytesRef(collator.getCollationKey(firstRangeBeginningOriginal).toByteArray());
+			firstRangeEnd = new BytesRef(collator.getCollationKey(firstRangeEndOriginal).toByteArray());
+			secondRangeBeginning = new BytesRef(collator.getCollationKey(secondRangeBeginningOriginal).toByteArray());
+			secondRangeEnd = new BytesRef(collator.getCollationKey(secondRangeEndOriginal).toByteArray());
+		}
+
+	  // the sort order of Ø versus U depends on the version of the rules being used
+	  // for the inherited root locale: Ø's order isnt specified in Locale.US since 
+	  // its not used in english.
+	  private bool oStrokeFirst = Collator.getInstance(new Locale("")).compare("Ø", "U") < 0;
+
+	  // Neither Java 1.4.2 nor 1.5.0 has Farsi Locale collation available in
+	  // RuleBasedCollator.  However, the Arabic Locale seems to order the Farsi
+	  // characters properly.
+	  private Collator collator = Collator.getInstance(new Locale("ar"));
+	  private Analyzer analyzer;
+
+	  private BytesRef firstRangeBeginning;
+	  private BytesRef firstRangeEnd;
+	  private BytesRef secondRangeBeginning;
+	  private BytesRef secondRangeEnd;
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testInitVars() throws Exception
+	  public virtual void testInitVars()
+	  {
+		CollationKey sortKey = collator.getCollationKey(firstRangeBeginningOriginal);
+		sbyte[] data = sortKey.toByteArray();
+		BytesRef r = new BytesRef(data);
+
+	  }
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFarsiRangeFilterCollating() throws Exception
+	  public virtual void testFarsiRangeFilterCollating()
+	  {
+		testFarsiRangeFilterCollating(analyzer, firstRangeBeginning, firstRangeEnd, secondRangeBeginning, secondRangeEnd);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFarsiRangeQueryCollating() throws Exception
+	  public virtual void testFarsiRangeQueryCollating()
+	  {
+		testFarsiRangeQueryCollating(analyzer, firstRangeBeginning, firstRangeEnd, secondRangeBeginning, secondRangeEnd);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFarsiTermRangeQuery() throws Exception
+	  public virtual void testFarsiTermRangeQuery()
+	  {
+		testFarsiTermRangeQuery(analyzer, firstRangeBeginning, firstRangeEnd, secondRangeBeginning, secondRangeEnd);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCollationKeySort() throws Exception
+	  public virtual void testCollationKeySort()
+	  {
+		Analyzer usAnalyzer = new CollationKeyAnalyzer(TEST_VERSION_CURRENT, Collator.getInstance(Locale.US));
+		Analyzer franceAnalyzer = new CollationKeyAnalyzer(TEST_VERSION_CURRENT, Collator.getInstance(Locale.FRANCE));
+		Analyzer swedenAnalyzer = new CollationKeyAnalyzer(TEST_VERSION_CURRENT, Collator.getInstance(new Locale("sv", "se")));
+		Analyzer denmarkAnalyzer = new CollationKeyAnalyzer(TEST_VERSION_CURRENT, Collator.getInstance(new Locale("da", "dk")));
+
+		// The ICU Collator and Sun java.text.Collator implementations differ in their
+		// orderings - "BFJDH" is the ordering for java.text.Collator for Locale.US.
+		testCollationKeySort(usAnalyzer, franceAnalyzer, swedenAnalyzer, denmarkAnalyzer, oStrokeFirst ? "BFJHD" : "BFJDH", "EACGI", "BJDFH", "BJDHF");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testThreadSafe() throws Exception
+	  public virtual void testThreadSafe()
+	  {
+		int iters = 20 * RANDOM_MULTIPLIER;
+		for (int i = 0; i < iters; i++)
+		{
+		  Collator collator = Collator.getInstance(Locale.GERMAN);
+		  collator.Strength = Collator.PRIMARY;
+		  assertThreadSafe(new CollationKeyAnalyzer(TEST_VERSION_CURRENT, collator));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Collation/TestCollationKeyFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Collation/TestCollationKeyFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Collation/TestCollationKeyFilter.cs
new file mode 100644
index 0000000..47a48c6
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Collation/TestCollationKeyFilter.cs
@@ -0,0 +1,125 @@
+using System;
+
+namespace org.apache.lucene.collation
+{
+
+	/*
+	 * 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 org.apache.lucene.analysis;
+	using KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+	using BytesRef = org.apache.lucene.util.BytesRef;
+
+
+	/// @deprecated remove when CollationKeyFilter is removed. 
+	[Obsolete("remove when CollationKeyFilter is removed.")]
+	public class TestCollationKeyFilter : CollationTestBase
+	{
+		private bool InstanceFieldsInitialized = false;
+
+		public TestCollationKeyFilter()
+		{
+			if (!InstanceFieldsInitialized)
+			{
+				InitializeInstanceFields();
+				InstanceFieldsInitialized = true;
+			}
+		}
+
+		private void InitializeInstanceFields()
+		{
+			analyzer = new TestAnalyzer(this, collator);
+			firstRangeBeginning = new BytesRef(encodeCollationKey(collator.getCollationKey(firstRangeBeginningOriginal).toByteArray()));
+			firstRangeEnd = new BytesRef(encodeCollationKey(collator.getCollationKey(firstRangeEndOriginal).toByteArray()));
+			secondRangeBeginning = new BytesRef(encodeCollationKey(collator.getCollationKey(secondRangeBeginningOriginal).toByteArray()));
+			secondRangeEnd = new BytesRef(encodeCollationKey(collator.getCollationKey(secondRangeEndOriginal).toByteArray()));
+		}
+
+	  // the sort order of Ø versus U depends on the version of the rules being used
+	  // for the inherited root locale: Ø's order isnt specified in Locale.US since 
+	  // its not used in english.
+	  internal bool oStrokeFirst = Collator.getInstance(new Locale("")).compare("Ø", "U") < 0;
+
+	  // Neither Java 1.4.2 nor 1.5.0 has Farsi Locale collation available in
+	  // RuleBasedCollator.  However, the Arabic Locale seems to order the Farsi
+	  // characters properly.
+	  private Collator collator = Collator.getInstance(new Locale("ar"));
+	  private Analyzer analyzer;
+
+	  private BytesRef firstRangeBeginning;
+	  private BytesRef firstRangeEnd;
+	  private BytesRef secondRangeBeginning;
+	  private BytesRef secondRangeEnd;
+
+
+	  public sealed class TestAnalyzer : Analyzer
+	  {
+		  private readonly TestCollationKeyFilter outerInstance;
+
+		internal Collator _collator;
+
+		internal TestAnalyzer(TestCollationKeyFilter outerInstance, Collator collator)
+		{
+			this.outerInstance = outerInstance;
+		  _collator = collator;
+		}
+
+		public override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		{
+		  Tokenizer result = new KeywordTokenizer(reader);
+		  return new TokenStreamComponents(result, new CollationKeyFilter(result, _collator));
+		}
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFarsiRangeFilterCollating() throws Exception
+	  public virtual void testFarsiRangeFilterCollating()
+	  {
+		testFarsiRangeFilterCollating(analyzer, firstRangeBeginning, firstRangeEnd, secondRangeBeginning, secondRangeEnd);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFarsiRangeQueryCollating() throws Exception
+	  public virtual void testFarsiRangeQueryCollating()
+	  {
+		testFarsiRangeQueryCollating(analyzer, firstRangeBeginning, firstRangeEnd, secondRangeBeginning, secondRangeEnd);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFarsiTermRangeQuery() throws Exception
+	  public virtual void testFarsiTermRangeQuery()
+	  {
+		testFarsiTermRangeQuery(analyzer, firstRangeBeginning, firstRangeEnd, secondRangeBeginning, secondRangeEnd);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCollationKeySort() throws Exception
+	  public virtual void testCollationKeySort()
+	  {
+		Analyzer usAnalyzer = new TestAnalyzer(this, Collator.getInstance(Locale.US));
+		Analyzer franceAnalyzer = new TestAnalyzer(this, Collator.getInstance(Locale.FRANCE));
+		Analyzer swedenAnalyzer = new TestAnalyzer(this, Collator.getInstance(new Locale("sv", "se")));
+		Analyzer denmarkAnalyzer = new TestAnalyzer(this, Collator.getInstance(new Locale("da", "dk")));
+
+		// The ICU Collator and Sun java.text.Collator implementations differ in their
+		// orderings - "BFJDH" is the ordering for java.text.Collator for Locale.US.
+		testCollationKeySort(usAnalyzer, franceAnalyzer, swedenAnalyzer, denmarkAnalyzer, oStrokeFirst ? "BFJHD" : "BFJDH", "EACGI", "BJDFH", "BJDHF");
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Collation/TestCollationKeyFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Collation/TestCollationKeyFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Collation/TestCollationKeyFilterFactory.cs
new file mode 100644
index 0000000..72ae784
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Collation/TestCollationKeyFilterFactory.cs
@@ -0,0 +1,152 @@
+using System.Collections.Generic;
+
+namespace org.apache.lucene.collation
+{
+
+	/*
+	 * 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 MockTokenizer = org.apache.lucene.analysis.MockTokenizer;
+	using TokenStream = org.apache.lucene.analysis.TokenStream;
+	using CharTermAttribute = org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
+	using BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+	using StringMockResourceLoader = org.apache.lucene.analysis.util.StringMockResourceLoader;
+	using TokenFilterFactory = org.apache.lucene.analysis.util.TokenFilterFactory;
+
+	public class TestCollationKeyFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+
+	  /*
+	   * Turkish has some funny casing.
+	   * This test shows how you can solve this kind of thing easily with collation.
+	   * Instead of using LowerCaseFilter, use a turkish collator with primary strength.
+	   * Then things will sort and match correctly.
+	   */
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBasicUsage() throws Exception
+	  public virtual void testBasicUsage()
+	  {
+		string turkishUpperCase = "I WİLL USE TURKİSH CASING";
+		string turkishLowerCase = "ı will use turkish casıng";
+		TokenFilterFactory factory = tokenFilterFactory("CollationKey", "language", "tr", "strength", "primary");
+		TokenStream tsUpper = factory.create(new MockTokenizer(new StringReader(turkishUpperCase), MockTokenizer.KEYWORD, false));
+		TokenStream tsLower = factory.create(new MockTokenizer(new StringReader(turkishLowerCase), MockTokenizer.KEYWORD, false));
+		assertCollatesToSame(tsUpper, tsLower);
+	  }
+
+	  /*
+	   * Test usage of the decomposition option for unicode normalization.
+	   */
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNormalization() throws Exception
+	  public virtual void testNormalization()
+	  {
+		string turkishUpperCase = "I W\u0049\u0307LL USE TURKİSH CASING";
+		string turkishLowerCase = "ı will use turkish casıng";
+		TokenFilterFactory factory = tokenFilterFactory("CollationKey", "language", "tr", "strength", "primary", "decomposition", "canonical");
+		TokenStream tsUpper = factory.create(new MockTokenizer(new StringReader(turkishUpperCase), MockTokenizer.KEYWORD, false));
+		TokenStream tsLower = factory.create(new MockTokenizer(new StringReader(turkishLowerCase), MockTokenizer.KEYWORD, false));
+		assertCollatesToSame(tsUpper, tsLower);
+	  }
+
+	  /*
+	   * Test usage of the K decomposition option for unicode normalization.
+	   * This works even with identical strength.
+	   */
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFullDecomposition() throws Exception
+	  public virtual void testFullDecomposition()
+	  {
+		string fullWidth = "Testing";
+		string halfWidth = "Testing";
+		TokenFilterFactory factory = tokenFilterFactory("CollationKey", "language", "zh", "strength", "identical", "decomposition", "full");
+		TokenStream tsFull = factory.create(new MockTokenizer(new StringReader(fullWidth), MockTokenizer.KEYWORD, false));
+		TokenStream tsHalf = factory.create(new MockTokenizer(new StringReader(halfWidth), MockTokenizer.KEYWORD, false));
+		assertCollatesToSame(tsFull, tsHalf);
+	  }
+
+	  /*
+	   * Test secondary strength, for english case is not significant.
+	   */
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testSecondaryStrength() throws Exception
+	  public virtual void testSecondaryStrength()
+	  {
+		string upperCase = "TESTING";
+		string lowerCase = "testing";
+		TokenFilterFactory factory = tokenFilterFactory("CollationKey", "language", "en", "strength", "secondary", "decomposition", "no");
+		TokenStream tsUpper = factory.create(new MockTokenizer(new StringReader(upperCase), MockTokenizer.KEYWORD, false));
+		TokenStream tsLower = factory.create(new MockTokenizer(new StringReader(lowerCase), MockTokenizer.KEYWORD, false));
+		assertCollatesToSame(tsUpper, tsLower);
+	  }
+
+	  /*
+	   * For german, you might want oe to sort and match with o umlaut.
+	   * This is not the default, but you can make a customized ruleset to do this.
+	   *
+	   * The default is DIN 5007-1, this shows how to tailor a collator to get DIN 5007-2 behavior.
+	   *  http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4423383
+	   */
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCustomRules() throws Exception
+	  public virtual void testCustomRules()
+	  {
+		RuleBasedCollator baseCollator = (RuleBasedCollator) Collator.getInstance(new Locale("de", "DE"));
+
+		string DIN5007_2_tailorings = "& ae , a\u0308 & AE , A\u0308" + "& oe , o\u0308 & OE , O\u0308" + "& ue , u\u0308 & UE , u\u0308";
+
+		RuleBasedCollator tailoredCollator = new RuleBasedCollator(baseCollator.Rules + DIN5007_2_tailorings);
+		string tailoredRules = tailoredCollator.Rules;
+		//
+		// at this point, you would save these tailoredRules to a file, 
+		// and use the custom parameter.
+		//
+		string germanUmlaut = "Töne";
+		string germanOE = "Toene";
+		IDictionary<string, string> args = new Dictionary<string, string>();
+		args["custom"] = "rules.txt";
+		args["strength"] = "primary";
+		CollationKeyFilterFactory factory = new CollationKeyFilterFactory(args);
+		factory.inform(new StringMockResourceLoader(tailoredRules));
+		TokenStream tsUmlaut = factory.create(new MockTokenizer(new StringReader(germanUmlaut), MockTokenizer.KEYWORD, false));
+		TokenStream tsOE = factory.create(new MockTokenizer(new StringReader(germanOE), MockTokenizer.KEYWORD, false));
+
+		assertCollatesToSame(tsUmlaut, tsOE);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: private void assertCollatesToSame(org.apache.lucene.analysis.TokenStream stream1, org.apache.lucene.analysis.TokenStream stream2) throws java.io.IOException
+	  private void assertCollatesToSame(TokenStream stream1, TokenStream stream2)
+	  {
+		stream1.reset();
+		stream2.reset();
+		CharTermAttribute term1 = stream1.addAttribute(typeof(CharTermAttribute));
+		CharTermAttribute term2 = stream2.addAttribute(typeof(CharTermAttribute));
+		assertTrue(stream1.incrementToken());
+		assertTrue(stream2.incrementToken());
+		assertEquals(term1.ToString(), term2.ToString());
+		assertFalse(stream1.incrementToken());
+		assertFalse(stream2.incrementToken());
+		stream1.end();
+		stream2.end();
+		stream1.close();
+		stream2.close();
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/DateTimeHelperClass.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/DateTimeHelperClass.cs b/src/Lucene.Net.Tests.Analysis.Common/DateTimeHelperClass.cs
new file mode 100644
index 0000000..0bd49c4
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/DateTimeHelperClass.cs
@@ -0,0 +1,15 @@
+//---------------------------------------------------------------------------------------------------------
+//	Copyright © 2007 - 2015 Tangible Software Solutions Inc.
+//	This class can be used by anyone provided that the copyright notice remains intact.
+//
+//	This class is used to replace calls to Java's System.currentTimeMillis with the C# equivalent.
+//	Unix time is defined as the number of seconds that have elapsed since midnight UTC, 1 January 1970.
+//---------------------------------------------------------------------------------------------------------
+internal static class DateTimeHelperClass
+{
+	private static readonly System.DateTime Jan1st1970 = new System.DateTime(1970, 1, 1, 0, 0, 0, System.DateTimeKind.Utc);
+	internal static long CurrentUnixTimeMillis()
+	{
+		return (long)(System.DateTime.UtcNow - Jan1st1970).TotalMilliseconds;
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/HashMapHelperClass.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/HashMapHelperClass.cs b/src/Lucene.Net.Tests.Analysis.Common/HashMapHelperClass.cs
new file mode 100644
index 0000000..0c925be
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/HashMapHelperClass.cs
@@ -0,0 +1,26 @@
+//---------------------------------------------------------------------------------------------------------
+//	Copyright © 2007 - 2015 Tangible Software Solutions Inc.
+//	This class can be used by anyone provided that the copyright notice remains intact.
+//
+//	This class is used to replace calls to some Java HashMap or Hashtable methods.
+//---------------------------------------------------------------------------------------------------------
+using System.Collections.Generic;
+internal static class HashMapHelperClass
+{
+	internal static HashSet<KeyValuePair<TKey, TValue>> SetOfKeyValuePairs<TKey, TValue>(this IDictionary<TKey, TValue> dictionary)
+	{
+		HashSet<KeyValuePair<TKey, TValue>> entries = new HashSet<KeyValuePair<TKey, TValue>>();
+		foreach (KeyValuePair<TKey, TValue> keyValuePair in dictionary)
+		{
+			entries.Add(keyValuePair);
+		}
+		return entries;
+	}
+
+	internal static TValue GetValueOrNull<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, TKey key)
+	{
+		TValue ret;
+		dictionary.TryGetValue(key, out ret);
+		return ret;
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/StringHelperClass.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/StringHelperClass.cs b/src/Lucene.Net.Tests.Analysis.Common/StringHelperClass.cs
new file mode 100644
index 0000000..3bcece0
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/StringHelperClass.cs
@@ -0,0 +1,90 @@
+//-------------------------------------------------------------------------------------------
+//	Copyright © 2007 - 2015 Tangible Software Solutions Inc.
+//	This class can be used by anyone provided that the copyright notice remains intact.
+//
+//	This class is used to convert some aspects of the Java String class.
+//-------------------------------------------------------------------------------------------
+internal static class StringHelperClass
+{
+	//----------------------------------------------------------------------------------
+	//	This method replaces the Java String.substring method when 'start' is a
+	//	method call or calculated value to ensure that 'start' is obtained just once.
+	//----------------------------------------------------------------------------------
+	internal static string SubstringSpecial(this string self, int start, int end)
+	{
+		return self.Substring(start, end - start);
+	}
+
+	//------------------------------------------------------------------------------------
+	//	This method is used to replace calls to the 2-arg Java String.startsWith method.
+	//------------------------------------------------------------------------------------
+	internal static bool StartsWith(this string self, string prefix, int toffset)
+	{
+		return self.IndexOf(prefix, toffset, System.StringComparison.Ordinal) == toffset;
+	}
+
+	//------------------------------------------------------------------------------
+	//	This method is used to replace most calls to the Java String.split method.
+	//------------------------------------------------------------------------------
+	internal static string[] Split(this string self, string regexDelimiter, bool trimTrailingEmptyStrings)
+	{
+		string[] splitArray = System.Text.RegularExpressions.Regex.Split(self, regexDelimiter);
+
+		if (trimTrailingEmptyStrings)
+		{
+			if (splitArray.Length > 1)
+			{
+				for (int i = splitArray.Length; i > 0; i--)
+				{
+					if (splitArray[i - 1].Length > 0)
+					{
+						if (i < splitArray.Length)
+							System.Array.Resize(ref splitArray, i);
+
+						break;
+					}
+				}
+			}
+		}
+
+		return splitArray;
+	}
+
+	//-----------------------------------------------------------------------------
+	//	These methods are used to replace calls to some Java String constructors.
+	//-----------------------------------------------------------------------------
+	internal static string NewString(sbyte[] bytes)
+	{
+		return NewString(bytes, 0, bytes.Length);
+	}
+	internal static string NewString(sbyte[] bytes, int index, int count)
+	{
+		return System.Text.Encoding.UTF8.GetString((byte[])(object)bytes, index, count);
+	}
+	internal static string NewString(sbyte[] bytes, string encoding)
+	{
+		return NewString(bytes, 0, bytes.Length, encoding);
+	}
+	internal static string NewString(sbyte[] bytes, int index, int count, string encoding)
+	{
+		return System.Text.Encoding.GetEncoding(encoding).GetString((byte[])(object)bytes, index, count);
+	}
+
+	//--------------------------------------------------------------------------------
+	//	These methods are used to replace calls to the Java String.getBytes methods.
+	//--------------------------------------------------------------------------------
+	internal static sbyte[] GetBytes(this string self)
+	{
+		return GetSBytesForEncoding(System.Text.Encoding.UTF8, self);
+	}
+	internal static sbyte[] GetBytes(this string self, string encoding)
+	{
+		return GetSBytesForEncoding(System.Text.Encoding.GetEncoding(encoding), self);
+	}
+	private static sbyte[] GetSBytesForEncoding(System.Text.Encoding encoding, string s)
+	{
+		sbyte[] sbytes = new sbyte[encoding.GetByteCount(s)];
+		encoding.GetBytes(s, 0, s.Length, (byte[])(object)sbytes, 0);
+		return sbytes;
+	}
+}
\ No newline at end of file


[27/27] lucenenet git commit: add project

Posted by sy...@apache.org.
add project


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

Branch: refs/heads/master
Commit: 092aab40f4fe18761ec6ad047cda5a0e5b17dcbd
Parents: c64856a
Author: Laimonas Simutis <la...@gmail.com>
Authored: Sun Dec 6 09:04:40 2015 -0500
Committer: Laimonas Simutis <la...@gmail.com>
Committed: Sun Dec 6 09:04:40 2015 -0500

----------------------------------------------------------------------
 .../Lucene.Net.Tests.Analysis.Common.csproj     | 59 ++++++++++++++++++++
 .../Properties/AssemblyInfo.cs                  | 35 ++++++++++++
 2 files changed, 94 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/092aab40/src/Lucene.Net.Tests.Analysis.Common/Lucene.Net.Tests.Analysis.Common.csproj
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Lucene.Net.Tests.Analysis.Common.csproj b/src/Lucene.Net.Tests.Analysis.Common/Lucene.Net.Tests.Analysis.Common.csproj
new file mode 100644
index 0000000..cd7c90a
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Lucene.Net.Tests.Analysis.Common.csproj
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{C54FE8FA-7986-4C94-B872-D5BFF7C6C74E}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>Lucene.Net.Tests.Analysis.Common</RootNamespace>
+    <AssemblyName>Lucene.Net.Tests.Analysis.Common</AssemblyName>
+    <TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\Lucene.Net.Core\Lucene.Net.csproj">
+      <Project>{5d4ad9be-1ffb-41ab-9943-25737971bf57}</Project>
+      <Name>Lucene.Net</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\Lucene.Net.TestFramework\Lucene.Net.TestFramework.csproj">
+      <Project>{b2c0d749-ce34-4f62-a15e-00cb2ff5ddb3}</Project>
+      <Name>Lucene.Net.TestFramework</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/092aab40/src/Lucene.Net.Tests.Analysis.Common/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Properties/AssemblyInfo.cs b/src/Lucene.Net.Tests.Analysis.Common/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..3cd094c
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Properties/AssemblyInfo.cs
@@ -0,0 +1,35 @@
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Lucene.Net.Tests.Analysis.Common")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Lucene.Net.Tests.Analysis.Common")]
+[assembly: AssemblyCopyright("Copyright ©  2015")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("fd602350-abed-4d1e-ad7b-709d18b0b464")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]


[12/27] lucenenet git commit: adding converted analysis common tests

Posted by sy...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestKeywordRepeatFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestKeywordRepeatFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestKeywordRepeatFilter.cs
new file mode 100644
index 0000000..e9674ba
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestKeywordRepeatFilter.cs
@@ -0,0 +1,48 @@
+namespace org.apache.lucene.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 SnowballFilter = org.apache.lucene.analysis.snowball.SnowballFilter;
+
+
+	public class TestKeywordRepeatFilter : BaseTokenStreamTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBasic() throws java.io.IOException
+	  public virtual void testBasic()
+	  {
+		TokenStream ts = new RemoveDuplicatesTokenFilter(new SnowballFilter(new KeywordRepeatFilter(new MockTokenizer(new StringReader("the birds are flying"), MockTokenizer.WHITESPACE, false)), "English"));
+		assertTokenStreamContents(ts, new string[] {"the", "birds", "bird", "are", "flying", "fli"}, new int[] {1,1,0,1,1,0});
+	  }
+
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testComposition() throws java.io.IOException
+	  public virtual void testComposition()
+	  {
+		TokenStream ts = new RemoveDuplicatesTokenFilter(new SnowballFilter(new KeywordRepeatFilter(new KeywordRepeatFilter(new MockTokenizer(new StringReader("the birds are flying"), MockTokenizer.WHITESPACE, false))), "English"));
+		assertTokenStreamContents(ts, new string[] {"the", "birds", "bird", "are", "flying", "fli"}, new int[] {1,1,0,1,1,0});
+	  }
+
+
+
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestLengthFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestLengthFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestLengthFilter.cs
new file mode 100644
index 0000000..750f4cf
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestLengthFilter.cs
@@ -0,0 +1,86 @@
+namespace org.apache.lucene.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 org.apache.lucene.analysis;
+	using KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+	using Version = org.apache.lucene.util.Version;
+
+
+	using KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+	using Test = org.junit.Test;
+
+	public class TestLengthFilter : BaseTokenStreamTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFilterNoPosIncr() throws Exception
+	  public virtual void testFilterNoPosIncr()
+	  {
+		TokenStream stream = new MockTokenizer(new StringReader("short toolong evenmuchlongertext a ab toolong foo"), MockTokenizer.WHITESPACE, false);
+		LengthFilter filter = new LengthFilter(Version.LUCENE_43, false, stream, 2, 6);
+		assertTokenStreamContents(filter, new string[]{"short", "ab", "foo"}, new int[]{1, 1, 1});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFilterWithPosIncr() throws Exception
+	  public virtual void testFilterWithPosIncr()
+	  {
+		TokenStream stream = new MockTokenizer(new StringReader("short toolong evenmuchlongertext a ab toolong foo"), MockTokenizer.WHITESPACE, false);
+		LengthFilter filter = new LengthFilter(TEST_VERSION_CURRENT, stream, 2, 6);
+		assertTokenStreamContents(filter, new string[]{"short", "ab", "foo"}, new int[]{1, 4, 2});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestLengthFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestLengthFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new LengthFilter(TEST_VERSION_CURRENT, tokenizer, 0, 5));
+		  }
+	  }
+
+	  /// <summary>
+	  /// checking the validity of constructor arguments
+	  /// </summary>
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @Test(expected = IllegalArgumentException.class) public void testIllegalArguments() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public virtual void testIllegalArguments()
+	  {
+		new LengthFilter(TEST_VERSION_CURRENT, new MockTokenizer(new StringReader("accept only valid arguments")), -4, -1);
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestLengthFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestLengthFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestLengthFilterFactory.cs
new file mode 100644
index 0000000..6c990ab
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestLengthFilterFactory.cs
@@ -0,0 +1,85 @@
+namespace org.apache.lucene.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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+	using ClasspathResourceLoader = org.apache.lucene.analysis.util.ClasspathResourceLoader;
+	using Version = org.apache.lucene.util.Version;
+
+	public class TestLengthFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void test() throws Exception
+	  public virtual void test()
+	  {
+		Reader reader = new StringReader("foo foobar super-duper-trooper");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("Length", Version.LUCENE_43, new ClasspathResourceLoader(this.GetType()), "min", "4", "max", "10", "enablePositionIncrements", "false").create(stream);
+		assertTokenStreamContents(stream, new string[] {"foobar"}, new int[] {1});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testPositionIncrements() throws Exception
+	  public virtual void testPositionIncrements()
+	  {
+		Reader reader = new StringReader("foo foobar super-duper-trooper");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("Length", LengthFilterFactory.MIN_KEY, "4", LengthFilterFactory.MAX_KEY, "10").create(stream);
+		assertTokenStreamContents(stream, new string[] {"foobar"}, new int[] {2});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("Length", LengthFilterFactory.MIN_KEY, "4", LengthFilterFactory.MAX_KEY, "5", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+
+	  /// <summary>
+	  /// Test that invalid arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testInvalidArguments() throws Exception
+	  public virtual void testInvalidArguments()
+	  {
+		try
+		{
+		  Reader reader = new StringReader("foo foobar super-duper-trooper");
+		  TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		  tokenFilterFactory("Length", LengthFilterFactory.MIN_KEY, "5", LengthFilterFactory.MAX_KEY, "4").create(stream);
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("maximum length must not be greater than minimum length"));
+		}
+	  }
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestLimitTokenCountAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestLimitTokenCountAnalyzer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestLimitTokenCountAnalyzer.cs
new file mode 100644
index 0000000..425b4a4
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestLimitTokenCountAnalyzer.cs
@@ -0,0 +1,103 @@
+using System.Text;
+
+namespace org.apache.lucene.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 Document = org.apache.lucene.document.Document;
+	using Field = org.apache.lucene.document.Field;
+	using DirectoryReader = org.apache.lucene.index.DirectoryReader;
+	using IndexReader = org.apache.lucene.index.IndexReader;
+	using IndexWriter = org.apache.lucene.index.IndexWriter;
+	using IndexWriterConfig = org.apache.lucene.index.IndexWriterConfig;
+	using Term = org.apache.lucene.index.Term;
+	using Directory = org.apache.lucene.store.Directory;
+	using TestUtil = org.apache.lucene.util.TestUtil;
+
+	public class TestLimitTokenCountAnalyzer : BaseTokenStreamTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testLimitTokenCountAnalyzer() throws java.io.IOException
+	  public virtual void testLimitTokenCountAnalyzer()
+	  {
+		foreach (bool consumeAll in new bool[] {true, false})
+		{
+		  MockAnalyzer mock = new MockAnalyzer(random());
+
+		  // if we are consuming all tokens, we can use the checks, 
+		  // otherwise we can't
+		  mock.EnableChecks = consumeAll;
+		  Analyzer a = new LimitTokenCountAnalyzer(mock, 2, consumeAll);
+
+		  // dont use assertAnalyzesTo here, as the end offset is not the end of the string (unless consumeAll is true, in which case its correct)!
+		  assertTokenStreamContents(a.tokenStream("dummy", "1  2     3  4  5"), new string[] {"1", "2"}, new int[] {0, 3}, new int[] {1, 4}, consumeAll ? 16 : null);
+		  assertTokenStreamContents(a.tokenStream("dummy", "1 2 3 4 5"), new string[] {"1", "2"}, new int[] {0, 2}, new int[] {1, 3}, consumeAll ? 9 : null);
+
+		  // less than the limit, ensure we behave correctly
+		  assertTokenStreamContents(a.tokenStream("dummy", "1  "), new string[] {"1"}, new int[] {0}, new int[] {1}, consumeAll ? 3 : null);
+
+		  // equal to limit
+		  assertTokenStreamContents(a.tokenStream("dummy", "1  2  "), new string[] {"1", "2"}, new int[] {0, 3}, new int[] {1, 4}, consumeAll ? 6 : null);
+		}
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testLimitTokenCountIndexWriter() throws java.io.IOException
+	  public virtual void testLimitTokenCountIndexWriter()
+	  {
+
+		foreach (bool consumeAll in new bool[] {true, false})
+		{
+		  Directory dir = newDirectory();
+		  int limit = TestUtil.Next(random(), 50, 101000);
+		  MockAnalyzer mock = new MockAnalyzer(random());
+
+		  // if we are consuming all tokens, we can use the checks, 
+		  // otherwise we can't
+		  mock.EnableChecks = consumeAll;
+		  Analyzer a = new LimitTokenCountAnalyzer(mock, limit, consumeAll);
+
+		  IndexWriter writer = new IndexWriter(dir, new IndexWriterConfig(TEST_VERSION_CURRENT, a));
+
+		  Document doc = new Document();
+		  StringBuilder b = new StringBuilder();
+		  for (int i = 1;i < limit;i++)
+		  {
+			b.Append(" a");
+		  }
+		  b.Append(" x");
+		  b.Append(" z");
+		  doc.add(newTextField("field", b.ToString(), Field.Store.NO));
+		  writer.addDocument(doc);
+		  writer.close();
+
+		  IndexReader reader = DirectoryReader.open(dir);
+		  Term t = new Term("field", "x");
+		  assertEquals(1, reader.docFreq(t));
+		  t = new Term("field", "z");
+		  assertEquals(0, reader.docFreq(t));
+		  reader.close();
+		  dir.close();
+		}
+	  }
+
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestLimitTokenCountFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestLimitTokenCountFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestLimitTokenCountFilter.cs
new file mode 100644
index 0000000..3e5f7df
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestLimitTokenCountFilter.cs
@@ -0,0 +1,48 @@
+namespace org.apache.lucene.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 Test = org.junit.Test;
+
+	public class TestLimitTokenCountFilter : BaseTokenStreamTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void test() throws Exception
+	  public virtual void test()
+	  {
+		foreach (bool consumeAll in new bool[]{true, false})
+		{
+		  MockTokenizer tokenizer = new MockTokenizer(new StringReader("A1 B2 C3 D4 E5 F6"), MockTokenizer.WHITESPACE, false);
+		  tokenizer.EnableChecks = consumeAll;
+		  TokenStream stream = new LimitTokenCountFilter(tokenizer, 3, consumeAll);
+		  assertTokenStreamContents(stream, new string[]{"A1", "B2", "C3"});
+		}
+	  }
+
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @Test(expected = IllegalArgumentException.class) public void testIllegalArguments() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public virtual void testIllegalArguments()
+	  {
+		new LimitTokenCountFilter(new MockTokenizer(new StringReader("A1 B2 C3 D4 E5 F6"), MockTokenizer.WHITESPACE, false), -1);
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestLimitTokenCountFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestLimitTokenCountFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestLimitTokenCountFilterFactory.cs
new file mode 100644
index 0000000..3aec928
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestLimitTokenCountFilterFactory.cs
@@ -0,0 +1,79 @@
+using System;
+
+namespace org.apache.lucene.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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+
+	public class TestLimitTokenCountFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void test() throws Exception
+	  public virtual void test()
+	  {
+		foreach (bool consumeAll in new bool[]{true, false})
+		{
+		  Reader reader = new StringReader("A1 B2 C3 D4 E5 F6");
+		  MockTokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		  tokenizer.EnableChecks = consumeAll;
+		  TokenStream stream = tokenizer;
+		  stream = tokenFilterFactory("LimitTokenCount", LimitTokenCountFilterFactory.MAX_TOKEN_COUNT_KEY, "3", LimitTokenCountFilterFactory.CONSUME_ALL_TOKENS_KEY, Convert.ToString(consumeAll)).create(stream);
+		  assertTokenStreamContents(stream, new string[]{"A1", "B2", "C3"});
+		}
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRequired() throws Exception
+	  public virtual void testRequired()
+	  {
+		// param is required
+		try
+		{
+		  tokenFilterFactory("LimitTokenCount");
+		  fail();
+		}
+		catch (System.ArgumentException e)
+		{
+		  assertTrue("exception doesn't mention param: " + e.Message, 0 < e.Message.indexOf(LimitTokenCountFilterFactory.MAX_TOKEN_COUNT_KEY));
+		}
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("LimitTokenCount", LimitTokenCountFilterFactory.MAX_TOKEN_COUNT_KEY, "3", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestLimitTokenPositionFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestLimitTokenPositionFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestLimitTokenPositionFilter.cs
new file mode 100644
index 0000000..435e6fc
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestLimitTokenPositionFilter.cs
@@ -0,0 +1,104 @@
+namespace org.apache.lucene.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 SynonymFilter = org.apache.lucene.analysis.synonym.SynonymFilter;
+	using SynonymMap = org.apache.lucene.analysis.synonym.SynonymMap;
+	using CharsRef = org.apache.lucene.util.CharsRef;
+	using Test = org.junit.Test;
+
+
+	public class TestLimitTokenPositionFilter : BaseTokenStreamTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMaxPosition2() throws java.io.IOException
+	  public virtual void testMaxPosition2()
+	  {
+		foreach (bool consumeAll in new bool[]{true, false})
+		{
+		  Analyzer a = new AnalyzerAnonymousInnerClassHelper(this);
+
+		  // don't use assertAnalyzesTo here, as the end offset is not the end of the string (unless consumeAll is true, in which case its correct)!
+		  assertTokenStreamContents(a.tokenStream("dummy", "1  2     3  4  5"), new string[]{"1", "2"}, new int[]{0, 3}, new int[]{1, 4}, consumeAll ? 16 : null);
+		  assertTokenStreamContents(a.tokenStream("dummy", new StringReader("1 2 3 4 5")), new string[]{"1", "2"}, new int[]{0, 2}, new int[]{1, 3}, consumeAll ? 9 : null);
+
+		  // less than the limit, ensure we behave correctly
+		  assertTokenStreamContents(a.tokenStream("dummy", "1  "), new string[]{"1"}, new int[]{0}, new int[]{1}, consumeAll ? 3 : null);
+
+		  // equal to limit
+		  assertTokenStreamContents(a.tokenStream("dummy", "1  2  "), new string[]{"1", "2"}, new int[]{0, 3}, new int[]{1, 4}, consumeAll ? 6 : null);
+		}
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestLimitTokenPositionFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestLimitTokenPositionFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			MockTokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			// if we are consuming all tokens, we can use the checks, otherwise we can't
+			tokenizer.EnableChecks = consumeAll;
+			return new TokenStreamComponents(tokenizer, new LimitTokenPositionFilter(tokenizer, 2, consumeAll));
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMaxPosition3WithSynomyms() throws java.io.IOException
+	  public virtual void testMaxPosition3WithSynomyms()
+	  {
+		foreach (bool consumeAll in new bool[]{true, false})
+		{
+		  MockTokenizer tokenizer = new MockTokenizer(new StringReader("one two three four five"), MockTokenizer.WHITESPACE, false);
+		  // if we are consuming all tokens, we can use the checks, otherwise we can't
+		  tokenizer.EnableChecks = consumeAll;
+
+		  SynonymMap.Builder builder = new SynonymMap.Builder(true);
+		  builder.add(new CharsRef("one"), new CharsRef("first"), true);
+		  builder.add(new CharsRef("one"), new CharsRef("alpha"), true);
+		  builder.add(new CharsRef("one"), new CharsRef("beguine"), true);
+		  CharsRef multiWordCharsRef = new CharsRef();
+		  SynonymMap.Builder.join(new string[]{"and", "indubitably", "single", "only"}, multiWordCharsRef);
+		  builder.add(new CharsRef("one"), multiWordCharsRef, true);
+		  SynonymMap.Builder.join(new string[]{"dopple", "ganger"}, multiWordCharsRef);
+		  builder.add(new CharsRef("two"), multiWordCharsRef, true);
+		  SynonymMap synonymMap = builder.build();
+		  TokenStream stream = new SynonymFilter(tokenizer, synonymMap, true);
+		  stream = new LimitTokenPositionFilter(stream, 3, consumeAll);
+
+		  // "only", the 4th word of multi-word synonym "and indubitably single only" is not emitted, since its position is greater than 3.
+		  assertTokenStreamContents(stream, new string[]{"one", "first", "alpha", "beguine", "and", "two", "indubitably", "dopple", "three", "single", "ganger"}, new int[]{1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0});
+		}
+	  }
+
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @Test(expected = IllegalArgumentException.class) public void testIllegalArguments() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public virtual void testIllegalArguments()
+	  {
+		new LimitTokenPositionFilter(new MockTokenizer(new StringReader("one two three four five")), 0);
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestLimitTokenPositionFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestLimitTokenPositionFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestLimitTokenPositionFilterFactory.cs
new file mode 100644
index 0000000..22d8255
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestLimitTokenPositionFilterFactory.cs
@@ -0,0 +1,105 @@
+using System;
+
+namespace org.apache.lucene.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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+
+	public class TestLimitTokenPositionFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMaxPosition1() throws Exception
+	  public virtual void testMaxPosition1()
+	  {
+		foreach (bool consumeAll in new bool[]{true, false})
+		{
+		  Reader reader = new StringReader("A1 B2 C3 D4 E5 F6");
+		  MockTokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		  // if we are consuming all tokens, we can use the checks, otherwise we can't
+		  tokenizer.EnableChecks = consumeAll;
+		  TokenStream stream = tokenizer;
+		  stream = tokenFilterFactory("LimitTokenPosition", LimitTokenPositionFilterFactory.MAX_TOKEN_POSITION_KEY, "1", LimitTokenPositionFilterFactory.CONSUME_ALL_TOKENS_KEY, Convert.ToString(consumeAll)).create(stream);
+		  assertTokenStreamContents(stream, new string[]{"A1"});
+		}
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMissingParam() throws Exception
+	  public virtual void testMissingParam()
+	  {
+		try
+		{
+		  tokenFilterFactory("LimitTokenPosition");
+		  fail();
+		}
+		catch (System.ArgumentException e)
+		{
+		  assertTrue("exception doesn't mention param: " + e.Message, 0 < e.Message.indexOf(LimitTokenPositionFilterFactory.MAX_TOKEN_POSITION_KEY));
+		}
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMaxPosition1WithShingles() throws Exception
+	  public virtual void testMaxPosition1WithShingles()
+	  {
+		foreach (bool consumeAll in new bool[]{true, false})
+		{
+		  Reader reader = new StringReader("one two three four five");
+		  MockTokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		  // if we are consuming all tokens, we can use the checks, otherwise we can't
+		  tokenizer.EnableChecks = consumeAll;
+		  TokenStream stream = tokenizer;
+		  stream = tokenFilterFactory("Shingle", "minShingleSize", "2", "maxShingleSize", "3", "outputUnigrams", "true").create(stream);
+		  stream = tokenFilterFactory("LimitTokenPosition", LimitTokenPositionFilterFactory.MAX_TOKEN_POSITION_KEY, "1", LimitTokenPositionFilterFactory.CONSUME_ALL_TOKENS_KEY, Convert.ToString(consumeAll)).create(stream);
+		  assertTokenStreamContents(stream, new string[]{"one", "one two", "one two three"});
+		}
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testConsumeAllTokens() throws Exception
+	  public virtual void testConsumeAllTokens()
+	  {
+		Reader reader = new StringReader("A1 B2 C3 D4 E5 F6");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("LimitTokenPosition", "maxTokenPosition", "3", "consumeAllTokens", "true").create(stream);
+		assertTokenStreamContents(stream, new string[] {"A1", "B2", "C3"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("LimitTokenPosition", "maxTokenPosition", "3", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestLucene47WordDelimiterFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestLucene47WordDelimiterFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestLucene47WordDelimiterFilter.cs
new file mode 100644
index 0000000..2e01f3a
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestLucene47WordDelimiterFilter.cs
@@ -0,0 +1,446 @@
+using System;
+using System.Collections.Generic;
+
+/*
+ * 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 org.apache.lucene.analysis.miscellaneous
+{
+
+	using org.apache.lucene.analysis;
+	using KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+	using StopFilter = org.apache.lucene.analysis.core.StopFilter;
+	using StandardAnalyzer = org.apache.lucene.analysis.standard.StandardAnalyzer;
+	using PositionIncrementAttribute = org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
+	using CharTermAttribute = org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
+	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+	using Test = org.junit.Test;
+
+
+//JAVA TO C# CONVERTER TODO TASK: This Java 'import static' statement cannot be converted to C#:
+//	import static org.apache.lucene.analysis.miscellaneous.WordDelimiterFilter.*;
+//JAVA TO C# CONVERTER TODO TASK: This Java 'import static' statement cannot be converted to C#:
+//	import static org.apache.lucene.analysis.miscellaneous.WordDelimiterIterator.DEFAULT_WORD_DELIM_TABLE;
+
+	/// <summary>
+	/// New WordDelimiterFilter tests... most of the tests are in ConvertedLegacyTest
+	/// TODO: should explicitly test things like protWords and not rely on
+	/// the factory tests in Solr.
+	/// </summary>
+	[Obsolete]
+	public class TestLucene47WordDelimiterFilter : BaseTokenStreamTestCase
+	  /// <summary>
+	  ///*
+	  /// public void testPerformance() throws IOException {
+	  ///  String s = "now is the time-for all good men to come to-the aid of their country.";
+	  ///  Token tok = new Token();
+	  ///  long start = System.currentTimeMillis();
+	  ///  int ret=0;
+	  ///  for (int i=0; i<1000000; i++) {
+	  ///    StringReader r = new StringReader(s);
+	  ///    TokenStream ts = new WhitespaceTokenizer(r);
+	  ///    ts = new WordDelimiterFilter(ts, 1,1,1,1,0);
+	  /// 
+	  ///    while (ts.next(tok) != null) ret++;
+	  ///  }
+	  /// 
+	  ///  System.out.println("ret="+ret+" time="+(System.currentTimeMillis()-start));
+	  /// }
+	  /// **
+	  /// </summary>
+	{
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @Test public void testOffsets() throws java.io.IOException
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+		public virtual void testOffsets()
+		{
+		int flags = GENERATE_WORD_PARTS | GENERATE_NUMBER_PARTS | CATENATE_ALL | SPLIT_ON_CASE_CHANGE | SPLIT_ON_NUMERICS | STEM_ENGLISH_POSSESSIVE;
+		// test that subwords and catenated subwords have
+		// the correct offsets.
+		TokenFilter wdf = new Lucene47WordDelimiterFilter(new SingleTokenTokenStream(new Token("foo-bar", 5, 12)), DEFAULT_WORD_DELIM_TABLE, flags, null);
+
+		assertTokenStreamContents(wdf, new string[] {"foo", "bar", "foobar"}, new int[] {5, 9, 5}, new int[] {8, 12, 12}, null, null, null, null, false);
+
+		wdf = new Lucene47WordDelimiterFilter(new SingleTokenTokenStream(new Token("foo-bar", 5, 6)), DEFAULT_WORD_DELIM_TABLE, flags, null);
+
+		assertTokenStreamContents(wdf, new string[] {"foo", "bar", "foobar"}, new int[] {5, 5, 5}, new int[] {6, 6, 6}, null, null, null, null, false);
+		}
+
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @Test public void testOffsetChange() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public virtual void testOffsetChange()
+	  {
+		int flags = GENERATE_WORD_PARTS | GENERATE_NUMBER_PARTS | CATENATE_ALL | SPLIT_ON_CASE_CHANGE | SPLIT_ON_NUMERICS | STEM_ENGLISH_POSSESSIVE;
+		TokenFilter wdf = new Lucene47WordDelimiterFilter(new SingleTokenTokenStream(new Token("übelkeit)", 7, 16)), DEFAULT_WORD_DELIM_TABLE, flags, null);
+
+		assertTokenStreamContents(wdf, new string[] {"übelkeit"}, new int[] {7}, new int[] {15});
+	  }
+
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @Test public void testOffsetChange2() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public virtual void testOffsetChange2()
+	  {
+		int flags = GENERATE_WORD_PARTS | GENERATE_NUMBER_PARTS | CATENATE_ALL | SPLIT_ON_CASE_CHANGE | SPLIT_ON_NUMERICS | STEM_ENGLISH_POSSESSIVE;
+		TokenFilter wdf = new Lucene47WordDelimiterFilter(new SingleTokenTokenStream(new Token("(übelkeit", 7, 17)), DEFAULT_WORD_DELIM_TABLE, flags, null);
+
+		assertTokenStreamContents(wdf, new string[] {"übelkeit"}, new int[] {8}, new int[] {17});
+	  }
+
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @Test public void testOffsetChange3() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public virtual void testOffsetChange3()
+	  {
+		int flags = GENERATE_WORD_PARTS | GENERATE_NUMBER_PARTS | CATENATE_ALL | SPLIT_ON_CASE_CHANGE | SPLIT_ON_NUMERICS | STEM_ENGLISH_POSSESSIVE;
+		TokenFilter wdf = new Lucene47WordDelimiterFilter(new SingleTokenTokenStream(new Token("(übelkeit", 7, 16)), DEFAULT_WORD_DELIM_TABLE, flags, null);
+
+		assertTokenStreamContents(wdf, new string[] {"übelkeit"}, new int[] {8}, new int[] {16});
+	  }
+
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @Test public void testOffsetChange4() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public virtual void testOffsetChange4()
+	  {
+		int flags = GENERATE_WORD_PARTS | GENERATE_NUMBER_PARTS | CATENATE_ALL | SPLIT_ON_CASE_CHANGE | SPLIT_ON_NUMERICS | STEM_ENGLISH_POSSESSIVE;
+		TokenFilter wdf = new Lucene47WordDelimiterFilter(new SingleTokenTokenStream(new Token("(foo,bar)", 7, 16)), DEFAULT_WORD_DELIM_TABLE, flags, null);
+
+		assertTokenStreamContents(wdf, new string[] {"foo", "bar", "foobar"}, new int[] {8, 12, 8}, new int[] {11, 15, 15}, null, null, null, null, false);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void doSplit(final String input, String... output) throws Exception
+//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
+	  public virtual void doSplit(string input, params string[] output)
+	  {
+		int flags = GENERATE_WORD_PARTS | GENERATE_NUMBER_PARTS | SPLIT_ON_CASE_CHANGE | SPLIT_ON_NUMERICS | STEM_ENGLISH_POSSESSIVE;
+		MockTokenizer tokenizer = new MockTokenizer(new StringReader(input), MockTokenizer.KEYWORD, false);
+		TokenFilter wdf = new Lucene47WordDelimiterFilter(tokenizer, WordDelimiterIterator.DEFAULT_WORD_DELIM_TABLE, flags, null);
+
+		assertTokenStreamContents(wdf, output);
+	  }
+
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @Test public void testSplits() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public virtual void testSplits()
+	  {
+		doSplit("basic-split","basic","split");
+		doSplit("camelCase","camel","Case");
+
+		// non-space marking symbol shouldn't cause split
+		// this is an example in Thai    
+		doSplit("\u0e1a\u0e49\u0e32\u0e19","\u0e1a\u0e49\u0e32\u0e19");
+		// possessive followed by delimiter
+		doSplit("test's'", "test");
+
+		// some russian upper and lowercase
+		doSplit("Роберт", "Роберт");
+		// now cause a split (russian camelCase)
+		doSplit("РобЕрт", "Роб", "Ерт");
+
+		// a composed titlecase character, don't split
+		doSplit("aDžungla", "aDžungla");
+
+		// a modifier letter, don't split
+		doSplit("ســـــــــــــــــلام", "ســـــــــــــــــلام");
+
+		// enclosing mark, don't split
+		doSplit("test⃝", "test⃝");
+
+		// combining spacing mark (the virama), don't split
+		doSplit("हिन्दी", "हिन्दी");
+
+		// don't split non-ascii digits
+		doSplit("١٢٣٤", "١٢٣٤");
+
+		// don't split supplementaries into unpaired surrogates
+		doSplit("𠀀𠀀", "𠀀𠀀");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void doSplitPossessive(int stemPossessive, final String input, final String... output) throws Exception
+//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
+	  public virtual void doSplitPossessive(int stemPossessive, string input, params string[] output)
+	  {
+		int flags = GENERATE_WORD_PARTS | GENERATE_NUMBER_PARTS | SPLIT_ON_CASE_CHANGE | SPLIT_ON_NUMERICS;
+		flags |= (stemPossessive == 1) ? STEM_ENGLISH_POSSESSIVE : 0;
+		MockTokenizer tokenizer = new MockTokenizer(new StringReader(input), MockTokenizer.KEYWORD, false);
+		TokenFilter wdf = new Lucene47WordDelimiterFilter(tokenizer, flags, null);
+
+		assertTokenStreamContents(wdf, output);
+	  }
+
+	  /*
+	   * Test option that allows disabling the special "'s" stemming, instead treating the single quote like other delimiters. 
+	   */
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @Test public void testPossessives() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public virtual void testPossessives()
+	  {
+		doSplitPossessive(1, "ra's", "ra");
+		doSplitPossessive(0, "ra's", "ra", "s");
+	  }
+
+	  /*
+	   * Set a large position increment gap of 10 if the token is "largegap" or "/"
+	   */
+	  private sealed class LargePosIncTokenFilter : TokenFilter
+	  {
+		  private readonly TestLucene47WordDelimiterFilter outerInstance;
+
+		internal CharTermAttribute termAtt = addAttribute(typeof(CharTermAttribute));
+		internal PositionIncrementAttribute posIncAtt = addAttribute(typeof(PositionIncrementAttribute));
+
+		protected internal LargePosIncTokenFilter(TestLucene47WordDelimiterFilter outerInstance, TokenStream input) : base(input)
+		{
+			this.outerInstance = outerInstance;
+		}
+
+//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())
+		  {
+			if (termAtt.ToString().Equals("largegap") || termAtt.ToString().Equals("/"))
+			{
+			  posIncAtt.PositionIncrement = 10;
+			}
+			return true;
+		  }
+		  else
+		  {
+			return false;
+		  }
+		}
+	  }
+
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @Test public void testPositionIncrements() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public virtual void testPositionIncrements()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int flags = GENERATE_WORD_PARTS | GENERATE_NUMBER_PARTS | CATENATE_ALL | SPLIT_ON_CASE_CHANGE | SPLIT_ON_NUMERICS | STEM_ENGLISH_POSSESSIVE;
+		int flags = GENERATE_WORD_PARTS | GENERATE_NUMBER_PARTS | CATENATE_ALL | SPLIT_ON_CASE_CHANGE | SPLIT_ON_NUMERICS | STEM_ENGLISH_POSSESSIVE;
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.util.CharArraySet protWords = new org.apache.lucene.analysis.util.CharArraySet(TEST_VERSION_CURRENT, new HashSet<>(Arrays.asList("NUTCH")), false);
+		CharArraySet protWords = new CharArraySet(TEST_VERSION_CURRENT, new HashSet<>("NUTCH"), false);
+
+		/* analyzer that uses whitespace + wdf */
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper(this, flags, protWords);
+
+		/* in this case, works as expected. */
+		assertAnalyzesTo(a, "LUCENE / SOLR", new string[] {"LUCENE", "SOLR"}, new int[] {0, 9}, new int[] {6, 13}, null, new int[] {1, 1}, null, false);
+
+		/* only in this case, posInc of 2 ?! */
+		assertAnalyzesTo(a, "LUCENE / solR", new string[] {"LUCENE", "sol", "R", "solR"}, new int[] {0, 9, 12, 9}, new int[] {6, 12, 13, 13}, null, new int[] {1, 1, 1, 0}, null, false);
+
+		assertAnalyzesTo(a, "LUCENE / NUTCH SOLR", new string[] {"LUCENE", "NUTCH", "SOLR"}, new int[] {0, 9, 15}, new int[] {6, 14, 19}, null, new int[] {1, 1, 1}, null, false);
+
+		/* analyzer that will consume tokens with large position increments */
+		Analyzer a2 = new AnalyzerAnonymousInnerClassHelper2(this, flags, protWords);
+
+		/* increment of "largegap" is preserved */
+		assertAnalyzesTo(a2, "LUCENE largegap SOLR", new string[] {"LUCENE", "largegap", "SOLR"}, new int[] {0, 7, 16}, new int[] {6, 15, 20}, null, new int[] {1, 10, 1}, null, false);
+
+		/* the "/" had a position increment of 10, where did it go?!?!! */
+		assertAnalyzesTo(a2, "LUCENE / SOLR", new string[] {"LUCENE", "SOLR"}, new int[] {0, 9}, new int[] {6, 13}, null, new int[] {1, 11}, null, false);
+
+		/* in this case, the increment of 10 from the "/" is carried over */
+		assertAnalyzesTo(a2, "LUCENE / solR", new string[] {"LUCENE", "sol", "R", "solR"}, new int[] {0, 9, 12, 9}, new int[] {6, 12, 13, 13}, null, new int[] {1, 11, 1, 0}, null, false);
+
+		assertAnalyzesTo(a2, "LUCENE / NUTCH SOLR", new string[] {"LUCENE", "NUTCH", "SOLR"}, new int[] {0, 9, 15}, new int[] {6, 14, 19}, null, new int[] {1, 11, 1}, null, false);
+
+		Analyzer a3 = new AnalyzerAnonymousInnerClassHelper3(this, flags, protWords);
+
+		assertAnalyzesTo(a3, "lucene.solr", new string[] {"lucene", "solr", "lucenesolr"}, new int[] {0, 7, 0}, new int[] {6, 11, 11}, null, new int[] {1, 1, 0}, null, false);
+
+		/* the stopword should add a gap here */
+		assertAnalyzesTo(a3, "the lucene.solr", new string[] {"lucene", "solr", "lucenesolr"}, new int[] {4, 11, 4}, new int[] {10, 15, 15}, null, new int[] {2, 1, 0}, null, false);
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestLucene47WordDelimiterFilter outerInstance;
+
+		  private int flags;
+		  private CharArraySet protWords;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestLucene47WordDelimiterFilter outerInstance, int flags, CharArraySet protWords)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.flags = flags;
+			  this.protWords = protWords;
+		  }
+
+		  public override TokenStreamComponents createComponents(string field, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(tokenizer, new Lucene47WordDelimiterFilter(tokenizer, flags, protWords));
+		  }
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestLucene47WordDelimiterFilter outerInstance;
+
+		  private int flags;
+		  private CharArraySet protWords;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestLucene47WordDelimiterFilter outerInstance, int flags, CharArraySet protWords)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.flags = flags;
+			  this.protWords = protWords;
+		  }
+
+		  public override TokenStreamComponents createComponents(string field, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(tokenizer, new Lucene47WordDelimiterFilter(new LargePosIncTokenFilter(outerInstance, tokenizer), flags, protWords));
+		  }
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper3 : Analyzer
+	  {
+		  private readonly TestLucene47WordDelimiterFilter outerInstance;
+
+		  private int flags;
+		  private CharArraySet protWords;
+
+		  public AnalyzerAnonymousInnerClassHelper3(TestLucene47WordDelimiterFilter outerInstance, int flags, CharArraySet protWords)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.flags = flags;
+			  this.protWords = protWords;
+		  }
+
+		  public override TokenStreamComponents createComponents(string field, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			StopFilter filter = new StopFilter(TEST_VERSION_CURRENT, tokenizer, StandardAnalyzer.STOP_WORDS_SET);
+			return new TokenStreamComponents(tokenizer, new Lucene47WordDelimiterFilter(filter, flags, protWords));
+		  }
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		int numIterations = atLeast(5);
+		for (int i = 0; i < numIterations; i++)
+		{
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int flags = random().nextInt(512);
+		  int flags = random().Next(512);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.util.CharArraySet protectedWords;
+		  CharArraySet protectedWords;
+		  if (random().nextBoolean())
+		  {
+			protectedWords = new CharArraySet(TEST_VERSION_CURRENT, new HashSet<>("a", "b", "cd"), false);
+		  }
+		  else
+		  {
+			protectedWords = null;
+		  }
+
+		  Analyzer a = new AnalyzerAnonymousInnerClassHelper4(this, flags, protectedWords);
+		  checkRandomData(random(), a, 200, 20, false, false);
+		}
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper4 : Analyzer
+	  {
+		  private readonly TestLucene47WordDelimiterFilter outerInstance;
+
+		  private int flags;
+		  private CharArraySet protectedWords;
+
+		  public AnalyzerAnonymousInnerClassHelper4(TestLucene47WordDelimiterFilter outerInstance, int flags, CharArraySet protectedWords)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.flags = flags;
+			  this.protectedWords = protectedWords;
+		  }
+
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(tokenizer, new Lucene47WordDelimiterFilter(tokenizer, flags, protectedWords));
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Random random = random();
+		for (int i = 0; i < 512; i++)
+		{
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int flags = i;
+		  int flags = i;
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.util.CharArraySet protectedWords;
+		  CharArraySet protectedWords;
+		  if (random.nextBoolean())
+		  {
+			protectedWords = new CharArraySet(TEST_VERSION_CURRENT, new HashSet<>("a", "b", "cd"), false);
+		  }
+		  else
+		  {
+			protectedWords = null;
+		  }
+
+		  Analyzer a = new AnalyzerAnonymousInnerClassHelper5(this, flags, protectedWords);
+		  // depending upon options, this thing may or may not preserve the empty term
+		  checkAnalysisConsistency(random, a, random.nextBoolean(), "");
+		}
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper5 : Analyzer
+	  {
+		  private readonly TestLucene47WordDelimiterFilter outerInstance;
+
+		  private int flags;
+		  private CharArraySet protectedWords;
+
+		  public AnalyzerAnonymousInnerClassHelper5(TestLucene47WordDelimiterFilter outerInstance, int flags, CharArraySet protectedWords)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.flags = flags;
+			  this.protectedWords = protectedWords;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new Lucene47WordDelimiterFilter(tokenizer, flags, protectedWords));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestPerFieldAnalyzerWrapper.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestPerFieldAnalyzerWrapper.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestPerFieldAnalyzerWrapper.cs
new file mode 100644
index 0000000..f9139f6
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestPerFieldAnalyzerWrapper.cs
@@ -0,0 +1,110 @@
+using System.Collections.Generic;
+
+namespace org.apache.lucene.analysis.miscellaneous
+{
+
+
+	using org.apache.lucene.analysis;
+	using SimpleAnalyzer = org.apache.lucene.analysis.core.SimpleAnalyzer;
+	using WhitespaceAnalyzer = org.apache.lucene.analysis.core.WhitespaceAnalyzer;
+	using CharTermAttribute = org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
+	using IOUtils = org.apache.lucene.util.IOUtils;
+
+	/*
+	 * 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.
+	 */
+
+	public class TestPerFieldAnalyzerWrapper : BaseTokenStreamTestCase
+	{
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testPerField() throws Exception
+	  public virtual void testPerField()
+	  {
+		string text = "Qwerty";
+
+		IDictionary<string, Analyzer> analyzerPerField = new Dictionary<string, Analyzer>();
+		analyzerPerField["special"] = new SimpleAnalyzer(TEST_VERSION_CURRENT);
+
+		PerFieldAnalyzerWrapper analyzer = new PerFieldAnalyzerWrapper(new WhitespaceAnalyzer(TEST_VERSION_CURRENT), analyzerPerField);
+
+		TokenStream tokenStream = analyzer.tokenStream("field", text);
+		try
+		{
+		  CharTermAttribute termAtt = tokenStream.getAttribute(typeof(CharTermAttribute));
+		  tokenStream.reset();
+
+		  assertTrue(tokenStream.incrementToken());
+		  assertEquals("WhitespaceAnalyzer does not lowercase", "Qwerty", termAtt.ToString());
+		  assertFalse(tokenStream.incrementToken());
+		  tokenStream.end();
+		}
+		finally
+		{
+		  IOUtils.closeWhileHandlingException(tokenStream);
+		}
+
+		tokenStream = analyzer.tokenStream("special", text);
+		try
+		{
+		  CharTermAttribute termAtt = tokenStream.getAttribute(typeof(CharTermAttribute));
+		  tokenStream.reset();
+
+		  assertTrue(tokenStream.incrementToken());
+		  assertEquals("SimpleAnalyzer lowercases", "qwerty", termAtt.ToString());
+		  assertFalse(tokenStream.incrementToken());
+		  tokenStream.end();
+		}
+		finally
+		{
+		  IOUtils.closeWhileHandlingException(tokenStream);
+		}
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCharFilters() throws Exception
+	  public virtual void testCharFilters()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper(this);
+		assertAnalyzesTo(a, "ab", new string[] {"aab"}, new int[] {0}, new int[] {2});
+
+		// now wrap in PFAW
+		PerFieldAnalyzerWrapper p = new PerFieldAnalyzerWrapper(a, System.Linq.Enumerable.Empty<string, Analyzer>());
+
+		assertAnalyzesTo(p, "ab", new string[] {"aab"}, new int[] {0}, new int[] {2});
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestPerFieldAnalyzerWrapper outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestPerFieldAnalyzerWrapper outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			return new TokenStreamComponents(new MockTokenizer(reader));
+		  }
+
+		  protected internal override Reader initReader(string fieldName, Reader reader)
+		  {
+			return new MockCharFilter(reader, 7);
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestPrefixAndSuffixAwareTokenFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestPrefixAndSuffixAwareTokenFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestPrefixAndSuffixAwareTokenFilter.cs
new file mode 100644
index 0000000..8defa09
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestPrefixAndSuffixAwareTokenFilter.cs
@@ -0,0 +1,42 @@
+namespace org.apache.lucene.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.
+	 */
+
+
+
+	public class TestPrefixAndSuffixAwareTokenFilter : BaseTokenStreamTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void test() throws java.io.IOException
+	  public virtual void test()
+	  {
+
+		PrefixAndSuffixAwareTokenFilter ts = new PrefixAndSuffixAwareTokenFilter(new SingleTokenTokenStream(createToken("^", 0, 0)), new MockTokenizer(new StringReader("hello world"), MockTokenizer.WHITESPACE, false), new SingleTokenTokenStream(createToken("$", 0, 0)));
+
+		assertTokenStreamContents(ts, new string[] {"^", "hello", "world", "$"}, new int[] {0, 0, 6, 11}, new int[] {0, 5, 11, 11});
+	  }
+
+	  private static Token createToken(string term, int start, int offset)
+	  {
+		return new Token(term, start, offset);
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestPrefixAwareTokenFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestPrefixAwareTokenFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestPrefixAwareTokenFilter.cs
new file mode 100644
index 0000000..7ef11d0
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestPrefixAwareTokenFilter.cs
@@ -0,0 +1,50 @@
+namespace org.apache.lucene.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.
+	 */
+
+
+
+	public class TestPrefixAwareTokenFilter : BaseTokenStreamTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void test() throws java.io.IOException
+	  public virtual void test()
+	  {
+
+		PrefixAwareTokenFilter ts;
+
+		ts = new PrefixAwareTokenFilter(new SingleTokenTokenStream(createToken("a", 0, 1)), new SingleTokenTokenStream(createToken("b", 0, 1)));
+		assertTokenStreamContents(ts, new string[] {"a", "b"}, new int[] {0, 1}, new int[] {1, 2});
+
+		// prefix and suffix using 2x prefix
+
+		ts = new PrefixAwareTokenFilter(new SingleTokenTokenStream(createToken("^", 0, 0)), new MockTokenizer(new StringReader("hello world"), MockTokenizer.WHITESPACE, false));
+		ts = new PrefixAwareTokenFilter(ts, new SingleTokenTokenStream(createToken("$", 0, 0)));
+
+		assertTokenStreamContents(ts, new string[] {"^", "hello", "world", "$"}, new int[] {0, 0, 6, 11}, new int[] {0, 5, 11, 11});
+	  }
+
+	  private static Token createToken(string term, int start, int offset)
+	  {
+		return new Token(term, start, offset);
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestRemoveDuplicatesTokenFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestRemoveDuplicatesTokenFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestRemoveDuplicatesTokenFilter.cs
new file mode 100644
index 0000000..801ac17
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestRemoveDuplicatesTokenFilter.cs
@@ -0,0 +1,231 @@
+using System.Collections.Generic;
+
+/*
+ * 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 org.apache.lucene.analysis.miscellaneous
+{
+
+	using KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+	using SynonymFilter = org.apache.lucene.analysis.synonym.SynonymFilter;
+	using SynonymMap = org.apache.lucene.analysis.synonym.SynonymMap;
+	using OffsetAttribute = org.apache.lucene.analysis.tokenattributes.OffsetAttribute;
+	using PositionIncrementAttribute = org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
+	using CharTermAttribute = org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
+	using CharsRef = org.apache.lucene.util.CharsRef;
+	using TestUtil = org.apache.lucene.util.TestUtil;
+
+
+	public class TestRemoveDuplicatesTokenFilter : BaseTokenStreamTestCase
+	{
+
+	  public static Token tok(int pos, string t, int start, int end)
+	  {
+		Token tok = new Token(t,start,end);
+		tok.PositionIncrement = pos;
+		return tok;
+	  }
+	  public static Token tok(int pos, string t)
+	  {
+		return tok(pos, t, 0,0);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testDups(final String expected, final org.apache.lucene.analysis.Token... tokens) throws Exception
+//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
+	  public virtual void testDups(string expected, params Token[] tokens)
+	  {
+
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final java.util.Iterator<org.apache.lucene.analysis.Token> toks = java.util.Arrays.asList(tokens).iterator();
+		IEnumerator<Token> toks = Arrays.asList(tokens).GetEnumerator();
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.TokenStream ts = new RemoveDuplicatesTokenFilter((new org.apache.lucene.analysis.TokenStream()
+		TokenStream ts = new RemoveDuplicatesTokenFilter((new TokenStreamAnonymousInnerClassHelper(this, toks)));
+
+		assertTokenStreamContents(ts, expected.Split("\\s", true));
+	  }
+
+	  private class TokenStreamAnonymousInnerClassHelper : TokenStream
+	  {
+		  private readonly TestRemoveDuplicatesTokenFilter outerInstance;
+
+		  private IEnumerator<Token> toks;
+
+		  public TokenStreamAnonymousInnerClassHelper(TestRemoveDuplicatesTokenFilter outerInstance, IEnumerator<Token> toks)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.toks = toks;
+			  termAtt = addAttribute(typeof(CharTermAttribute));
+			  offsetAtt = addAttribute(typeof(OffsetAttribute));
+			  posIncAtt = addAttribute(typeof(PositionIncrementAttribute));
+		  }
+
+		  internal CharTermAttribute termAtt;
+		  internal OffsetAttribute offsetAtt;
+		  internal PositionIncrementAttribute posIncAtt;
+		  public override bool incrementToken()
+		  {
+//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
+			if (toks.hasNext())
+			{
+			  clearAttributes();
+//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
+			  Token tok = toks.next();
+			  termAtt.setEmpty().append(tok);
+			  offsetAtt.setOffset(tok.startOffset(), tok.endOffset());
+			  posIncAtt.PositionIncrement = tok.PositionIncrement;
+			  return true;
+			}
+			else
+			{
+			  return false;
+			}
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNoDups() throws Exception
+	  public virtual void testNoDups()
+	  {
+
+		testDups("A B B C D E",tok(1,"A", 0, 4),tok(1,"B", 5, 10),tok(1,"B",11, 15),tok(1,"C",16, 20),tok(0,"D",16, 20),tok(1,"E",21, 25));
+
+	  }
+
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testSimpleDups() throws Exception
+	  public virtual void testSimpleDups()
+	  {
+
+		testDups("A B C D E",tok(1,"A", 0, 4),tok(1,"B", 5, 10),tok(0,"B",11, 15),tok(1,"C",16, 20),tok(0,"D",16, 20),tok(1,"E",21, 25));
+
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testComplexDups() throws Exception
+	  public virtual void testComplexDups()
+	  {
+
+		testDups("A B C D E F G H I J K",tok(1,"A"),tok(1,"B"),tok(0,"B"),tok(1,"C"),tok(1,"D"),tok(0,"D"),tok(0,"D"),tok(1,"E"),tok(1,"F"),tok(0,"F"),tok(1,"G"),tok(0,"H"),tok(0,"H"),tok(1,"I"),tok(1,"J"),tok(0,"K"),tok(0,"J"));
+
+	  }
+
+	  // some helper methods for the below test with synonyms
+	  private string randomNonEmptyString()
+	  {
+		while (true)
+		{
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final String s = org.apache.lucene.util.TestUtil.randomUnicodeString(random()).trim();
+		  string s = TestUtil.randomUnicodeString(random()).trim();
+		  if (s.Length != 0 && s.IndexOf('\u0000') == -1)
+		  {
+			return s;
+		  }
+		}
+	  }
+
+	  private void add(SynonymMap.Builder b, string input, string output, bool keepOrig)
+	  {
+		b.add(new CharsRef(input.replaceAll(" +", "\u0000")), new CharsRef(output.replaceAll(" +", "\u0000")), keepOrig);
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int numIters = atLeast(10);
+		int numIters = atLeast(10);
+		for (int i = 0; i < numIters; i++)
+		{
+		  SynonymMap.Builder b = new SynonymMap.Builder(random().nextBoolean());
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int numEntries = atLeast(10);
+		  int numEntries = atLeast(10);
+		  for (int j = 0; j < numEntries; j++)
+		  {
+			add(b, randomNonEmptyString(), randomNonEmptyString(), random().nextBoolean());
+		  }
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.synonym.SynonymMap map = b.build();
+		  SynonymMap map = b.build();
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final boolean ignoreCase = random().nextBoolean();
+		  bool ignoreCase = random().nextBoolean();
+
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.Analyzer analyzer = new org.apache.lucene.analysis.Analyzer()
+		  Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper(this, map, ignoreCase);
+
+		  checkRandomData(random(), analyzer, 200);
+		}
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestRemoveDuplicatesTokenFilter outerInstance;
+
+		  private SynonymMap map;
+		  private bool ignoreCase;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestRemoveDuplicatesTokenFilter outerInstance, SynonymMap map, bool ignoreCase)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.map = map;
+			  this.ignoreCase = ignoreCase;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.SIMPLE, true);
+			TokenStream stream = new SynonymFilter(tokenizer, map, ignoreCase);
+			return new TokenStreamComponents(tokenizer, new RemoveDuplicatesTokenFilter(stream));
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper2(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestRemoveDuplicatesTokenFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestRemoveDuplicatesTokenFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new RemoveDuplicatesTokenFilter(tokenizer));
+		  }
+	  }
+
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestRemoveDuplicatesTokenFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestRemoveDuplicatesTokenFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestRemoveDuplicatesTokenFilterFactory.cs
new file mode 100644
index 0000000..0d07750
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestRemoveDuplicatesTokenFilterFactory.cs
@@ -0,0 +1,70 @@
+namespace org.apache.lucene.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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure this factory is working </summary>
+	public class TestRemoveDuplicatesTokenFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+
+	  public static Token tok(int pos, string t, int start, int end)
+	  {
+		Token tok = new Token(t,start,end);
+		tok.PositionIncrement = pos;
+		return tok;
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testDups(final String expected, final org.apache.lucene.analysis.Token... tokens) throws Exception
+//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
+	  public virtual void testDups(string expected, params Token[] tokens)
+	  {
+		TokenStream stream = new CannedTokenStream(tokens);
+		stream = tokenFilterFactory("RemoveDuplicates").create(stream);
+		assertTokenStreamContents(stream, expected.Split("\\s", true));
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testSimpleDups() throws Exception
+	  public virtual void testSimpleDups()
+	  {
+		testDups("A B C D E",tok(1,"A", 0, 4),tok(1,"B", 5, 10),tok(0,"B",11, 15),tok(1,"C",16, 20),tok(0,"D",16, 20),tok(1,"E",21, 25));
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("RemoveDuplicates", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestScandinavianFoldingFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestScandinavianFoldingFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestScandinavianFoldingFilter.cs
new file mode 100644
index 0000000..b087859
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestScandinavianFoldingFilter.cs
@@ -0,0 +1,155 @@
+namespace org.apache.lucene.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 KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+
+	public class TestScandinavianFoldingFilter : BaseTokenStreamTestCase
+	{
+
+
+	  private Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper();
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  public AnalyzerAnonymousInnerClassHelper()
+		  {
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string field, Reader reader)
+		  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.Tokenizer tokenizer = new org.apache.lucene.analysis.MockTokenizer(reader, org.apache.lucene.analysis.MockTokenizer.WHITESPACE, false);
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.TokenStream stream = new ScandinavianFoldingFilter(tokenizer);
+			TokenStream stream = new ScandinavianFoldingFilter(tokenizer);
+			return new TokenStreamComponents(tokenizer, stream);
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void test() throws Exception
+	  public virtual void test()
+	  {
+
+		checkOneTerm(analyzer, "aeäaeeea", "aaaeea"); // should not cause ArrayOutOfBoundsException
+
+		checkOneTerm(analyzer, "aeäaeeeae", "aaaeea");
+		checkOneTerm(analyzer, "aeaeeeae", "aaeea");
+
+		checkOneTerm(analyzer, "bøen", "boen");
+		checkOneTerm(analyzer, "åene", "aene");
+
+
+		checkOneTerm(analyzer, "blåbærsyltetøj", "blabarsyltetoj");
+		checkOneTerm(analyzer, "blaabaarsyltetoej", "blabarsyltetoj");
+		checkOneTerm(analyzer, "blåbärsyltetöj", "blabarsyltetoj");
+
+		checkOneTerm(analyzer, "raksmorgas", "raksmorgas");
+		checkOneTerm(analyzer, "räksmörgås", "raksmorgas");
+		checkOneTerm(analyzer, "ræksmørgås", "raksmorgas");
+		checkOneTerm(analyzer, "raeksmoergaas", "raksmorgas");
+		checkOneTerm(analyzer, "ræksmörgaos", "raksmorgas");
+
+
+		checkOneTerm(analyzer, "ab", "ab");
+		checkOneTerm(analyzer, "ob", "ob");
+		checkOneTerm(analyzer, "Ab", "Ab");
+		checkOneTerm(analyzer, "Ob", "Ob");
+
+		checkOneTerm(analyzer, "å", "a");
+
+		checkOneTerm(analyzer, "aa", "a");
+		checkOneTerm(analyzer, "aA", "a");
+		checkOneTerm(analyzer, "ao", "a");
+		checkOneTerm(analyzer, "aO", "a");
+
+		checkOneTerm(analyzer, "AA", "A");
+		checkOneTerm(analyzer, "Aa", "A");
+		checkOneTerm(analyzer, "Ao", "A");
+		checkOneTerm(analyzer, "AO", "A");
+
+		checkOneTerm(analyzer, "æ", "a");
+		checkOneTerm(analyzer, "ä", "a");
+
+		checkOneTerm(analyzer, "Æ", "A");
+		checkOneTerm(analyzer, "Ä", "A");
+
+		checkOneTerm(analyzer, "ae", "a");
+		checkOneTerm(analyzer, "aE", "a");
+
+		checkOneTerm(analyzer, "Ae", "A");
+		checkOneTerm(analyzer, "AE", "A");
+
+
+		checkOneTerm(analyzer, "ö", "o");
+		checkOneTerm(analyzer, "ø", "o");
+		checkOneTerm(analyzer, "Ö", "O");
+		checkOneTerm(analyzer, "Ø", "O");
+
+
+		checkOneTerm(analyzer, "oo", "o");
+		checkOneTerm(analyzer, "oe", "o");
+		checkOneTerm(analyzer, "oO", "o");
+		checkOneTerm(analyzer, "oE", "o");
+
+		checkOneTerm(analyzer, "Oo", "O");
+		checkOneTerm(analyzer, "Oe", "O");
+		checkOneTerm(analyzer, "OO", "O");
+		checkOneTerm(analyzer, "OE", "O");
+	  }
+
+	  /// <summary>
+	  /// check that the empty string doesn't cause issues </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws Exception
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper2(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestScandinavianFoldingFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestScandinavianFoldingFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new ScandinavianFoldingFilter(tokenizer));
+		  }
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomData() throws Exception
+	  public virtual void testRandomData()
+	  {
+		checkRandomData(random(), analyzer, 1000 * RANDOM_MULTIPLIER);
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestScandinavianFoldingFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestScandinavianFoldingFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestScandinavianFoldingFilterFactory.cs
new file mode 100644
index 0000000..c7969cd
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestScandinavianFoldingFilterFactory.cs
@@ -0,0 +1,53 @@
+namespace org.apache.lucene.analysis.miscellaneous
+{
+
+	/// <summary>
+	/// Copyright 2004 The Apache Software Foundation
+	/// 
+	/// Licensed 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>
+
+	using BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+
+	public class TestScandinavianFoldingFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStemming() throws Exception
+	  public virtual void testStemming()
+	  {
+		Reader reader = new StringReader("räksmörgås");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("ScandinavianFolding").create(stream);
+		assertTokenStreamContents(stream, new string[] {"raksmorgas"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("ScandinavianFolding", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+}
\ No newline at end of file


[06/27] lucenenet git commit: adding converted analysis common tests

Posted by sy...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Shingle/ShingleFilterTest.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Shingle/ShingleFilterTest.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Shingle/ShingleFilterTest.cs
new file mode 100644
index 0000000..cf8311f
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Shingle/ShingleFilterTest.cs
@@ -0,0 +1,716 @@
+using System;
+
+namespace org.apache.lucene.analysis.shingle
+{
+
+	/*
+	 * 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 KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+	using WhitespaceTokenizer = org.apache.lucene.analysis.core.WhitespaceTokenizer;
+	using org.apache.lucene.analysis.tokenattributes;
+
+	public class ShingleFilterTest : BaseTokenStreamTestCase
+	{
+
+	  public static readonly Token[] TEST_TOKEN = new Token[] {createToken("please", 0, 6), createToken("divide", 7, 13), createToken("this", 14, 18), createToken("sentence", 19, 27), createToken("into", 28, 32), createToken("shingles", 33, 39)};
+
+	  public static readonly int[] UNIGRAM_ONLY_POSITION_INCREMENTS = new int[] {1, 1, 1, 1, 1, 1};
+
+	  public static readonly string[] UNIGRAM_ONLY_TYPES = new string[] {"word", "word", "word", "word", "word", "word"};
+
+	  public static Token[] testTokenWithHoles;
+
+	  public static readonly Token[] BI_GRAM_TOKENS = new Token[] {createToken("please", 0, 6), createToken("please divide", 0, 13), createToken("divide", 7, 13), createToken("divide this", 7, 18), createToken("this", 14, 18), createToken("this sentence", 14, 27), createToken("sentence", 19, 27), createToken("sentence into", 19, 32), createToken("into", 28, 32), createToken("into shingles", 28, 39), createToken("shingles", 33, 39)};
+
+	  public static readonly int[] BI_GRAM_POSITION_INCREMENTS = new int[] {1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1};
+
+	  public static readonly string[] BI_GRAM_TYPES = new string[] {"word", "shingle", "word", "shingle", "word", "shingle", "word", "shingle", "word", "shingle", "word"};
+
+	  public static readonly Token[] BI_GRAM_TOKENS_WITH_HOLES = new Token[] {createToken("please", 0, 6), createToken("please divide", 0, 13), createToken("divide", 7, 13), createToken("divide _", 7, 19), createToken("_ sentence", 19, 27), createToken("sentence", 19, 27), createToken("sentence _", 19, 33), createToken("_ shingles", 33, 39), createToken("shingles", 33, 39)};
+
+	  public static readonly int[] BI_GRAM_POSITION_INCREMENTS_WITH_HOLES = new int[] {1, 0, 1, 0, 1, 1, 0, 1, 1};
+
+	  private static readonly string[] BI_GRAM_TYPES_WITH_HOLES = new string[] {"word", "shingle", "word", "shingle", "shingle", "word", "shingle", "shingle", "word"};
+
+	  public static readonly Token[] BI_GRAM_TOKENS_WITHOUT_UNIGRAMS = new Token[] {createToken("please divide", 0, 13), createToken("divide this", 7, 18), createToken("this sentence", 14, 27), createToken("sentence into", 19, 32), createToken("into shingles", 28, 39)};
+
+	  public static readonly int[] BI_GRAM_POSITION_INCREMENTS_WITHOUT_UNIGRAMS = new int[] {1, 1, 1, 1, 1};
+
+	  public static readonly string[] BI_GRAM_TYPES_WITHOUT_UNIGRAMS = new string[] {"shingle", "shingle", "shingle", "shingle", "shingle"};
+
+	  public static readonly Token[] BI_GRAM_TOKENS_WITH_HOLES_WITHOUT_UNIGRAMS = new Token[] {createToken("please divide", 0, 13), createToken("divide _", 7, 19), createToken("_ sentence", 19, 27), createToken("sentence _", 19, 33), createToken("_ shingles", 33, 39)};
+
+	  public static readonly int[] BI_GRAM_POSITION_INCREMENTS_WITH_HOLES_WITHOUT_UNIGRAMS = new int[] {1, 1, 1, 1, 1, 1};
+
+
+	  public static readonly Token[] TEST_SINGLE_TOKEN = new Token[] {createToken("please", 0, 6)};
+
+	  public static readonly Token[] SINGLE_TOKEN = new Token[] {createToken("please", 0, 6)};
+
+	  public static readonly int[] SINGLE_TOKEN_INCREMENTS = new int[] {1};
+
+	  public static readonly string[] SINGLE_TOKEN_TYPES = new string[] {"word"};
+
+	  public static readonly Token[] EMPTY_TOKEN_ARRAY = new Token[] { };
+
+	  public static readonly int[] EMPTY_TOKEN_INCREMENTS_ARRAY = new int[] { };
+
+	  public static readonly string[] EMPTY_TOKEN_TYPES_ARRAY = new string[] { };
+
+	  public static readonly Token[] TRI_GRAM_TOKENS = new Token[] {createToken("please", 0, 6), createToken("please divide", 0, 13), createToken("please divide this", 0, 18), createToken("divide", 7, 13), createToken("divide this", 7, 18), createToken("divide this sentence", 7, 27), createToken("this", 14, 18), createToken("this sentence", 14, 27), createToken("this sentence into", 14, 32), createToken("sentence", 19, 27), createToken("sentence into", 19, 32), createToken("sentence into shingles", 19, 39), createToken("into", 28, 32), createToken("into shingles", 28, 39), createToken("shingles", 33, 39)};
+
+	  public static readonly int[] TRI_GRAM_POSITION_INCREMENTS = new int[] {1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1};
+
+	  public static readonly string[] TRI_GRAM_TYPES = new string[] {"word", "shingle", "shingle", "word", "shingle", "shingle", "word", "shingle", "shingle", "word", "shingle", "shingle", "word", "shingle", "word"};
+
+	  public static readonly Token[] TRI_GRAM_TOKENS_WITHOUT_UNIGRAMS = new Token[] {createToken("please divide", 0, 13), createToken("please divide this", 0, 18), createToken("divide this", 7, 18), createToken("divide this sentence", 7, 27), createToken("this sentence", 14, 27), createToken("this sentence into", 14, 32), createToken("sentence into", 19, 32), createToken("sentence into shingles", 19, 39), createToken("into shingles", 28, 39)};
+
+	  public static readonly int[] TRI_GRAM_POSITION_INCREMENTS_WITHOUT_UNIGRAMS = new int[] {1, 0, 1, 0, 1, 0, 1, 0, 1};
+
+	  public static readonly string[] TRI_GRAM_TYPES_WITHOUT_UNIGRAMS = new string[] {"shingle", "shingle", "shingle", "shingle", "shingle", "shingle", "shingle", "shingle", "shingle"};
+
+	  public static readonly Token[] FOUR_GRAM_TOKENS = new Token[] {createToken("please", 0, 6), createToken("please divide", 0, 13), createToken("please divide this", 0, 18), createToken("please divide this sentence", 0, 27), createToken("divide", 7, 13), createToken("divide this", 7, 18), createToken("divide this sentence", 7, 27), createToken("divide this sentence into", 7, 32), createToken("this", 14, 18), createToken("this sentence", 14, 27), createToken("this sentence into", 14, 32), createToken("this sentence into shingles", 14, 39), createToken("sentence", 19, 27), createToken("sentence into", 19, 32), createToken("sentence into shingles", 19, 39), createToken("into", 28, 32), createToken("into shingles", 28, 39), createToken("shingles", 33, 39)};
+
+	  public static readonly int[] FOUR_GRAM_POSITION_INCREMENTS = new int[] {1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1};
+
+	  public static readonly string[] FOUR_GRAM_TYPES = new string[] {"word", "shingle", "shingle", "shingle", "word", "shingle", "shingle", "shingle", "word", "shingle", "shingle", "shingle", "word", "shingle", "shingle", "word", "shingle", "word"};
+
+	  public static readonly Token[] FOUR_GRAM_TOKENS_WITHOUT_UNIGRAMS = new Token[] {createToken("please divide", 0, 13), createToken("please divide this", 0, 18), createToken("please divide this sentence", 0, 27), createToken("divide this", 7, 18), createToken("divide this sentence", 7, 27), createToken("divide this sentence into", 7, 32), createToken("this sentence", 14, 27), createToken("this sentence into", 14, 32), createToken("this sentence into shingles", 14, 39), createToken("sentence into", 19, 32), createToken("sentence into shingles", 19, 39), createToken("into shingles", 28, 39)};
+
+	  public static readonly int[] FOUR_GRAM_POSITION_INCREMENTS_WITHOUT_UNIGRAMS = new int[] {1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1};
+
+	  public static readonly string[] FOUR_GRAM_TYPES_WITHOUT_UNIGRAMS = new string[] {"shingle", "shingle", "shingle", "shingle", "shingle", "shingle", "shingle", "shingle", "shingle", "shingle", "shingle", "shingle"};
+
+	  public static readonly Token[] TRI_GRAM_TOKENS_MIN_TRI_GRAM = new Token[] {createToken("please", 0, 6), createToken("please divide this", 0, 18), createToken("divide", 7, 13), createToken("divide this sentence", 7, 27), createToken("this", 14, 18), createToken("this sentence into", 14, 32), createToken("sentence", 19, 27), createToken("sentence into shingles", 19, 39), createToken("into", 28, 32), createToken("shingles", 33, 39)};
+
+	  public static readonly int[] TRI_GRAM_POSITION_INCREMENTS_MIN_TRI_GRAM = new int[] {1, 0, 1, 0, 1, 0, 1, 0, 1, 1};
+
+	  public static readonly string[] TRI_GRAM_TYPES_MIN_TRI_GRAM = new string[] {"word", "shingle", "word", "shingle", "word", "shingle", "word", "shingle", "word", "word"};
+
+	  public static readonly Token[] TRI_GRAM_TOKENS_WITHOUT_UNIGRAMS_MIN_TRI_GRAM = new Token[] {createToken("please divide this", 0, 18), createToken("divide this sentence", 7, 27), createToken("this sentence into", 14, 32), createToken("sentence into shingles", 19, 39)};
+
+	  public static readonly int[] TRI_GRAM_POSITION_INCREMENTS_WITHOUT_UNIGRAMS_MIN_TRI_GRAM = new int[] {1, 1, 1, 1};
+
+	  public static readonly string[] TRI_GRAM_TYPES_WITHOUT_UNIGRAMS_MIN_TRI_GRAM = new string[] {"shingle", "shingle", "shingle", "shingle"};
+
+	  public static readonly Token[] FOUR_GRAM_TOKENS_MIN_TRI_GRAM = new Token[] {createToken("please", 0, 6), createToken("please divide this", 0, 18), createToken("please divide this sentence", 0, 27), createToken("divide", 7, 13), createToken("divide this sentence", 7, 27), createToken("divide this sentence into", 7, 32), createToken("this", 14, 18), createToken("this sentence into", 14, 32), createToken("this sentence into shingles", 14, 39), createToken("sentence", 19, 27), createToken("sentence into shingles", 19, 39), createToken("into", 28, 32), createToken("shingles", 33, 39)};
+
+	  public static readonly int[] FOUR_GRAM_POSITION_INCREMENTS_MIN_TRI_GRAM = new int[] {1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1};
+
+	  public static readonly string[] FOUR_GRAM_TYPES_MIN_TRI_GRAM = new string[] {"word", "shingle", "shingle", "word", "shingle", "shingle", "word", "shingle", "shingle", "word", "shingle", "word", "word"};
+
+	  public static readonly Token[] FOUR_GRAM_TOKENS_WITHOUT_UNIGRAMS_MIN_TRI_GRAM = new Token[] {createToken("please divide this", 0, 18), createToken("please divide this sentence", 0, 27), createToken("divide this sentence", 7, 27), createToken("divide this sentence into", 7, 32), createToken("this sentence into", 14, 32), createToken("this sentence into shingles", 14, 39), createToken("sentence into shingles", 19, 39)};
+
+	  public static readonly int[] FOUR_GRAM_POSITION_INCREMENTS_WITHOUT_UNIGRAMS_MIN_TRI_GRAM = new int[] {1, 0, 1, 0, 1, 0, 1};
+
+	  public static readonly string[] FOUR_GRAM_TYPES_WITHOUT_UNIGRAMS_MIN_TRI_GRAM = new string[] {"shingle", "shingle", "shingle", "shingle", "shingle", "shingle", "shingle"};
+
+	  public static readonly Token[] FOUR_GRAM_TOKENS_MIN_FOUR_GRAM = new Token[] {createToken("please", 0, 6), createToken("please divide this sentence", 0, 27), createToken("divide", 7, 13), createToken("divide this sentence into", 7, 32), createToken("this", 14, 18), createToken("this sentence into shingles", 14, 39), createToken("sentence", 19, 27), createToken("into", 28, 32), createToken("shingles", 33, 39)};
+
+	  public static readonly int[] FOUR_GRAM_POSITION_INCREMENTS_MIN_FOUR_GRAM = new int[] {1, 0, 1, 0, 1, 0, 1, 1, 1};
+
+	  public static readonly string[] FOUR_GRAM_TYPES_MIN_FOUR_GRAM = new string[] {"word", "shingle", "word", "shingle", "word", "shingle", "word", "word", "word"};
+
+	  public static readonly Token[] FOUR_GRAM_TOKENS_WITHOUT_UNIGRAMS_MIN_FOUR_GRAM = new Token[] {createToken("please divide this sentence", 0, 27), createToken("divide this sentence into", 7, 32), createToken("this sentence into shingles", 14, 39)};
+
+	  public static readonly int[] FOUR_GRAM_POSITION_INCREMENTS_WITHOUT_UNIGRAMS_MIN_FOUR_GRAM = new int[] {1, 1, 1};
+
+	  public static readonly string[] FOUR_GRAM_TYPES_WITHOUT_UNIGRAMS_MIN_FOUR_GRAM = new string[] {"shingle", "shingle", "shingle"};
+
+	  public static readonly Token[] BI_GRAM_TOKENS_NO_SEPARATOR = new Token[] {createToken("please", 0, 6), createToken("pleasedivide", 0, 13), createToken("divide", 7, 13), createToken("dividethis", 7, 18), createToken("this", 14, 18), createToken("thissentence", 14, 27), createToken("sentence", 19, 27), createToken("sentenceinto", 19, 32), createToken("into", 28, 32), createToken("intoshingles", 28, 39), createToken("shingles", 33, 39)};
+
+	  public static readonly int[] BI_GRAM_POSITION_INCREMENTS_NO_SEPARATOR = new int[] {1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1};
+
+	  public static readonly string[] BI_GRAM_TYPES_NO_SEPARATOR = new string[] {"word", "shingle", "word", "shingle", "word", "shingle", "word", "shingle", "word", "shingle", "word"};
+
+	  public static readonly Token[] BI_GRAM_TOKENS_WITHOUT_UNIGRAMS_NO_SEPARATOR = new Token[] {createToken("pleasedivide", 0, 13), createToken("dividethis", 7, 18), createToken("thissentence", 14, 27), createToken("sentenceinto", 19, 32), createToken("intoshingles", 28, 39)};
+
+	  public static readonly int[] BI_GRAM_POSITION_INCREMENTS_WITHOUT_UNIGRAMS_NO_SEPARATOR = new int[] {1, 1, 1, 1, 1};
+
+	  public static readonly string[] BI_GRAM_TYPES_WITHOUT_UNIGRAMS_NO_SEPARATOR = new string[] {"shingle", "shingle", "shingle", "shingle", "shingle"};
+
+	  public static readonly Token[] TRI_GRAM_TOKENS_NO_SEPARATOR = new Token[] {createToken("please", 0, 6), createToken("pleasedivide", 0, 13), createToken("pleasedividethis", 0, 18), createToken("divide", 7, 13), createToken("dividethis", 7, 18), createToken("dividethissentence", 7, 27), createToken("this", 14, 18), createToken("thissentence", 14, 27), createToken("thissentenceinto", 14, 32), createToken("sentence", 19, 27), createToken("sentenceinto", 19, 32), createToken("sentenceintoshingles", 19, 39), createToken("into", 28, 32), createToken("intoshingles", 28, 39), createToken("shingles", 33, 39)};
+
+	  public static readonly int[] TRI_GRAM_POSITION_INCREMENTS_NO_SEPARATOR = new int[] {1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1};
+
+	  public static readonly string[] TRI_GRAM_TYPES_NO_SEPARATOR = new string[] {"word", "shingle", "shingle", "word", "shingle", "shingle", "word", "shingle", "shingle", "word", "shingle", "shingle", "word", "shingle", "word"};
+
+	  public static readonly Token[] TRI_GRAM_TOKENS_WITHOUT_UNIGRAMS_NO_SEPARATOR = new Token[] {createToken("pleasedivide", 0, 13), createToken("pleasedividethis", 0, 18), createToken("dividethis", 7, 18), createToken("dividethissentence", 7, 27), createToken("thissentence", 14, 27), createToken("thissentenceinto", 14, 32), createToken("sentenceinto", 19, 32), createToken("sentenceintoshingles", 19, 39), createToken("intoshingles", 28, 39)};
+
+	  public static readonly int[] TRI_GRAM_POSITION_INCREMENTS_WITHOUT_UNIGRAMS_NO_SEPARATOR = new int[] {1, 0, 1, 0, 1, 0, 1, 0, 1};
+
+	  public static readonly string[] TRI_GRAM_TYPES_WITHOUT_UNIGRAMS_NO_SEPARATOR = new string[] {"shingle", "shingle", "shingle", "shingle", "shingle", "shingle", "shingle", "shingle", "shingle"};
+
+	  public static readonly Token[] BI_GRAM_TOKENS_ALT_SEPARATOR = new Token[] {createToken("please", 0, 6), createToken("please<SEP>divide", 0, 13), createToken("divide", 7, 13), createToken("divide<SEP>this", 7, 18), createToken("this", 14, 18), createToken("this<SEP>sentence", 14, 27), createToken("sentence", 19, 27), createToken("sentence<SEP>into", 19, 32), createToken("into", 28, 32), createToken("into<SEP>shingles", 28, 39), createToken("shingles", 33, 39)};
+
+	  public static readonly int[] BI_GRAM_POSITION_INCREMENTS_ALT_SEPARATOR = new int[] {1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1};
+
+	  public static readonly string[] BI_GRAM_TYPES_ALT_SEPARATOR = new string[] {"word", "shingle", "word", "shingle", "word", "shingle", "word", "shingle", "word", "shingle", "word"};
+
+	  public static readonly Token[] BI_GRAM_TOKENS_WITHOUT_UNIGRAMS_ALT_SEPARATOR = new Token[] {createToken("please<SEP>divide", 0, 13), createToken("divide<SEP>this", 7, 18), createToken("this<SEP>sentence", 14, 27), createToken("sentence<SEP>into", 19, 32), createToken("into<SEP>shingles", 28, 39)};
+
+	  public static readonly int[] BI_GRAM_POSITION_INCREMENTS_WITHOUT_UNIGRAMS_ALT_SEPARATOR = new int[] {1, 1, 1, 1, 1};
+
+	  public static readonly string[] BI_GRAM_TYPES_WITHOUT_UNIGRAMS_ALT_SEPARATOR = new string[] {"shingle", "shingle", "shingle", "shingle", "shingle"};
+
+	  public static readonly Token[] TRI_GRAM_TOKENS_ALT_SEPARATOR = new Token[] {createToken("please", 0, 6), createToken("please<SEP>divide", 0, 13), createToken("please<SEP>divide<SEP>this", 0, 18), createToken("divide", 7, 13), createToken("divide<SEP>this", 7, 18), createToken("divide<SEP>this<SEP>sentence", 7, 27), createToken("this", 14, 18), createToken("this<SEP>sentence", 14, 27), createToken("this<SEP>sentence<SEP>into", 14, 32), createToken("sentence", 19, 27), createToken("sentence<SEP>into", 19, 32), createToken("sentence<SEP>into<SEP>shingles", 19, 39), createToken("into", 28, 32), createToken("into<SEP>shingles", 28, 39), createToken("shingles", 33, 39)};
+
+	  public static readonly int[] TRI_GRAM_POSITION_INCREMENTS_ALT_SEPARATOR = new int[] {1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1};
+
+	  public static readonly string[] TRI_GRAM_TYPES_ALT_SEPARATOR = new string[] {"word", "shingle", "shingle", "word", "shingle", "shingle", "word", "shingle", "shingle", "word", "shingle", "shingle", "word", "shingle", "word"};
+
+	  public static readonly Token[] TRI_GRAM_TOKENS_WITHOUT_UNIGRAMS_ALT_SEPARATOR = new Token[] {createToken("please<SEP>divide", 0, 13), createToken("please<SEP>divide<SEP>this", 0, 18), createToken("divide<SEP>this", 7, 18), createToken("divide<SEP>this<SEP>sentence", 7, 27), createToken("this<SEP>sentence", 14, 27), createToken("this<SEP>sentence<SEP>into", 14, 32), createToken("sentence<SEP>into", 19, 32), createToken("sentence<SEP>into<SEP>shingles", 19, 39), createToken("into<SEP>shingles", 28, 39)};
+
+	  public static readonly int[] TRI_GRAM_POSITION_INCREMENTS_WITHOUT_UNIGRAMS_ALT_SEPARATOR = new int[] {1, 0, 1, 0, 1, 0, 1, 0, 1};
+
+	  public static readonly string[] TRI_GRAM_TYPES_WITHOUT_UNIGRAMS_ALT_SEPARATOR = new string[] {"shingle", "shingle", "shingle", "shingle", "shingle", "shingle", "shingle", "shingle", "shingle"};
+
+	  public static readonly Token[] TRI_GRAM_TOKENS_NULL_SEPARATOR = new Token[] {createToken("please", 0, 6), createToken("pleasedivide", 0, 13), createToken("pleasedividethis", 0, 18), createToken("divide", 7, 13), createToken("dividethis", 7, 18), createToken("dividethissentence", 7, 27), createToken("this", 14, 18), createToken("thissentence", 14, 27), createToken("thissentenceinto", 14, 32), createToken("sentence", 19, 27), createToken("sentenceinto", 19, 32), createToken("sentenceintoshingles", 19, 39), createToken("into", 28, 32), createToken("intoshingles", 28, 39), createToken("shingles", 33, 39)};
+
+	  public static readonly int[] TRI_GRAM_POSITION_INCREMENTS_NULL_SEPARATOR = new int[] {1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1};
+
+	  public static readonly string[] TRI_GRAM_TYPES_NULL_SEPARATOR = new string[] {"word", "shingle", "shingle", "word", "shingle", "shingle", "word", "shingle", "shingle", "word", "shingle", "shingle", "word", "shingle", "word"};
+
+	  public static readonly Token[] TEST_TOKEN_POS_INCR_EQUAL_TO_N = new Token[] {createToken("please", 0, 6), createToken("divide", 7, 13), createToken("this", 14, 18), createToken("sentence", 29, 37, 3), createToken("into", 38, 42), createToken("shingles", 43, 49)};
+
+	  public static readonly Token[] TRI_GRAM_TOKENS_POS_INCR_EQUAL_TO_N = new Token[] {createToken("please", 0, 6), createToken("please divide", 0, 13), createToken("please divide this", 0, 18), createToken("divide", 7, 13), createToken("divide this", 7, 18), createToken("divide this _", 7, 29), createToken("this", 14, 18), createToken("this _", 14, 29), createToken("this _ _", 14, 29), createToken("_ _ sentence", 29, 37), createToken("_ sentence", 29, 37), createToken("_ sentence into", 29, 42), createToken("sentence", 29, 37), createToken("sentence into", 29, 42), createToken("sentence into shingles", 29, 49), createToken("into", 38, 42), createToken("into shingles", 38, 49), createToken("shingles", 43, 49)};
+
+	  public static readonly int[] TRI_GRAM_POSITION_INCREMENTS_POS_INCR_EQUAL_TO_N = new int[] {1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1};
+
+	  public static readonly string[] TRI_GRAM_TYPES_POS_INCR_EQUAL_TO_N = new string[] {"word", "shingle", "shingle", "word", "shingle", "shingle", "word", "shingle", "shingle", "shingle", "shingle", "shingle", "word", "shingle", "shingle", "word", "shingle", "word"};
+
+	  public static readonly Token[] TRI_GRAM_TOKENS_POS_INCR_EQUAL_TO_N_WITHOUT_UNIGRAMS = new Token[] {createToken("please divide", 0, 13), createToken("please divide this", 0, 18), createToken("divide this", 7, 18), createToken("divide this _", 7, 29), createToken("this _", 14, 29), createToken("this _ _", 14, 29), createToken("_ _ sentence", 29, 37), createToken("_ sentence", 29, 37), createToken("_ sentence into", 29, 42), createToken("sentence into", 29, 42), createToken("sentence into shingles", 29, 49), createToken("into shingles", 38, 49)};
+
+	  public static readonly int[] TRI_GRAM_POSITION_INCREMENTS_POS_INCR_EQUAL_TO_N_WITHOUT_UNIGRAMS = new int[] {1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1};
+
+	  public static readonly string[] TRI_GRAM_TYPES_POS_INCR_EQUAL_TO_N_WITHOUT_UNIGRAMS = new string[] {"shingle", "shingle", "shingle", "shingle", "shingle", "shingle", "shingle", "shingle", "shingle", "shingle", "shingle", "shingle"};
+
+	  public static readonly Token[] TEST_TOKEN_POS_INCR_GREATER_THAN_N = new Token[] {createToken("please", 0, 6), createToken("divide", 57, 63, 8), createToken("this", 64, 68), createToken("sentence", 69, 77), createToken("into", 78, 82), createToken("shingles", 83, 89)};
+
+	  public static readonly Token[] TRI_GRAM_TOKENS_POS_INCR_GREATER_THAN_N = new Token[] {createToken("please", 0, 6), createToken("please _", 0, 57), createToken("please _ _", 0, 57), createToken("_ _ divide", 57, 63), createToken("_ divide", 57, 63), createToken("_ divide this", 57, 68), createToken("divide", 57, 63), createToken("divide this", 57, 68), createToken("divide this sentence", 57, 77), createToken("this", 64, 68), createToken("this sentence", 64, 77), createToken("this sentence into", 64, 82), createToken("sentence", 69, 77), createToken("sentence into", 69, 82), createToken("sentence into shingles", 69, 89), createToken("into", 78, 82), createToken("into shingles", 78, 89), createToken("shingles", 83, 89)};
+
+	  public static readonly int[] TRI_GRAM_POSITION_INCREMENTS_POS_INCR_GREATER_THAN_N = new int[] {1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1};
+	  public static readonly string[] TRI_GRAM_TYPES_POS_INCR_GREATER_THAN_N = new string[] {"word", "shingle", "shingle", "shingle", "shingle", "shingle", "word", "shingle", "shingle", "word", "shingle", "shingle", "word", "shingle", "shingle", "word", "shingle", "word"};
+
+	  public static readonly Token[] TRI_GRAM_TOKENS_POS_INCR_GREATER_THAN_N_WITHOUT_UNIGRAMS = new Token[] {createToken("please _", 0, 57), createToken("please _ _", 0, 57), createToken("_ _ divide", 57, 63), createToken("_ divide", 57, 63), createToken("_ divide this", 57, 68), createToken("divide this", 57, 68), createToken("divide this sentence", 57, 77), createToken("this sentence", 64, 77), createToken("this sentence into", 64, 82), createToken("sentence into", 69, 82), createToken("sentence into shingles", 69, 89), createToken("into shingles", 78, 89)};
+
+	  public static readonly int[] TRI_GRAM_POSITION_INCREMENTS_POS_INCR_GREATER_THAN_N_WITHOUT_UNIGRAMS = new int[] {1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1};
+
+	  public static readonly string[] TRI_GRAM_TYPES_POS_INCR_GREATER_THAN_N_WITHOUT_UNIGRAMS = new string[] {"shingle", "shingle", "shingle", "shingle", "shingle", "shingle", "shingle", "shingle", "shingle", "shingle", "shingle", "shingle"};
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Override public void setUp() throws Exception
+	  public override void setUp()
+	  {
+		base.setUp();
+		testTokenWithHoles = new Token[] {createToken("please", 0, 6), createToken("divide", 7, 13), createToken("sentence", 19, 27, 2), createToken("shingles", 33, 39, 2)};
+	  }
+
+	  /*
+	   * Class under test for void ShingleFilter(TokenStream, int)
+	   */
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBiGramFilter() throws java.io.IOException
+	  public virtual void testBiGramFilter()
+	  {
+		this.shingleFilterTest(2, TEST_TOKEN, BI_GRAM_TOKENS, BI_GRAM_POSITION_INCREMENTS, BI_GRAM_TYPES, true);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBiGramFilterWithHoles() throws java.io.IOException
+	  public virtual void testBiGramFilterWithHoles()
+	  {
+		this.shingleFilterTest(2, testTokenWithHoles, BI_GRAM_TOKENS_WITH_HOLES, BI_GRAM_POSITION_INCREMENTS_WITH_HOLES, BI_GRAM_TYPES_WITH_HOLES, true);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBiGramFilterWithoutUnigrams() throws java.io.IOException
+	  public virtual void testBiGramFilterWithoutUnigrams()
+	  {
+		this.shingleFilterTest(2, TEST_TOKEN, BI_GRAM_TOKENS_WITHOUT_UNIGRAMS, BI_GRAM_POSITION_INCREMENTS_WITHOUT_UNIGRAMS, BI_GRAM_TYPES_WITHOUT_UNIGRAMS, false);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBiGramFilterWithHolesWithoutUnigrams() throws java.io.IOException
+	  public virtual void testBiGramFilterWithHolesWithoutUnigrams()
+	  {
+		this.shingleFilterTest(2, testTokenWithHoles, BI_GRAM_TOKENS_WITH_HOLES_WITHOUT_UNIGRAMS, BI_GRAM_POSITION_INCREMENTS_WITH_HOLES_WITHOUT_UNIGRAMS, BI_GRAM_TYPES_WITHOUT_UNIGRAMS, false);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBiGramFilterWithSingleToken() throws java.io.IOException
+	  public virtual void testBiGramFilterWithSingleToken()
+	  {
+		this.shingleFilterTest(2, TEST_SINGLE_TOKEN, SINGLE_TOKEN, SINGLE_TOKEN_INCREMENTS, SINGLE_TOKEN_TYPES, true);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBiGramFilterWithSingleTokenWithoutUnigrams() throws java.io.IOException
+	  public virtual void testBiGramFilterWithSingleTokenWithoutUnigrams()
+	  {
+		this.shingleFilterTest(2, TEST_SINGLE_TOKEN, EMPTY_TOKEN_ARRAY, EMPTY_TOKEN_INCREMENTS_ARRAY, EMPTY_TOKEN_TYPES_ARRAY, false);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBiGramFilterWithEmptyTokenStream() throws java.io.IOException
+	  public virtual void testBiGramFilterWithEmptyTokenStream()
+	  {
+		this.shingleFilterTest(2, EMPTY_TOKEN_ARRAY, EMPTY_TOKEN_ARRAY, EMPTY_TOKEN_INCREMENTS_ARRAY, EMPTY_TOKEN_TYPES_ARRAY, true);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBiGramFilterWithEmptyTokenStreamWithoutUnigrams() throws java.io.IOException
+	  public virtual void testBiGramFilterWithEmptyTokenStreamWithoutUnigrams()
+	  {
+		this.shingleFilterTest(2, EMPTY_TOKEN_ARRAY, EMPTY_TOKEN_ARRAY, EMPTY_TOKEN_INCREMENTS_ARRAY, EMPTY_TOKEN_TYPES_ARRAY, false);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTriGramFilter() throws java.io.IOException
+	  public virtual void testTriGramFilter()
+	  {
+		this.shingleFilterTest(3, TEST_TOKEN, TRI_GRAM_TOKENS, TRI_GRAM_POSITION_INCREMENTS, TRI_GRAM_TYPES, true);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTriGramFilterWithoutUnigrams() throws java.io.IOException
+	  public virtual void testTriGramFilterWithoutUnigrams()
+	  {
+		this.shingleFilterTest(3, TEST_TOKEN, TRI_GRAM_TOKENS_WITHOUT_UNIGRAMS, TRI_GRAM_POSITION_INCREMENTS_WITHOUT_UNIGRAMS, TRI_GRAM_TYPES_WITHOUT_UNIGRAMS, false);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFourGramFilter() throws java.io.IOException
+	  public virtual void testFourGramFilter()
+	  {
+		this.shingleFilterTest(4, TEST_TOKEN, FOUR_GRAM_TOKENS, FOUR_GRAM_POSITION_INCREMENTS, FOUR_GRAM_TYPES, true);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFourGramFilterWithoutUnigrams() throws java.io.IOException
+	  public virtual void testFourGramFilterWithoutUnigrams()
+	  {
+		this.shingleFilterTest(4, TEST_TOKEN, FOUR_GRAM_TOKENS_WITHOUT_UNIGRAMS, FOUR_GRAM_POSITION_INCREMENTS_WITHOUT_UNIGRAMS, FOUR_GRAM_TYPES_WITHOUT_UNIGRAMS, false);
+	  }
+
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTriGramFilterMinTriGram() throws java.io.IOException
+	  public virtual void testTriGramFilterMinTriGram()
+	  {
+		this.shingleFilterTest(3, 3, TEST_TOKEN, TRI_GRAM_TOKENS_MIN_TRI_GRAM, TRI_GRAM_POSITION_INCREMENTS_MIN_TRI_GRAM, TRI_GRAM_TYPES_MIN_TRI_GRAM, true);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTriGramFilterWithoutUnigramsMinTriGram() throws java.io.IOException
+	  public virtual void testTriGramFilterWithoutUnigramsMinTriGram()
+	  {
+		this.shingleFilterTest(3, 3, TEST_TOKEN, TRI_GRAM_TOKENS_WITHOUT_UNIGRAMS_MIN_TRI_GRAM, TRI_GRAM_POSITION_INCREMENTS_WITHOUT_UNIGRAMS_MIN_TRI_GRAM, TRI_GRAM_TYPES_WITHOUT_UNIGRAMS_MIN_TRI_GRAM, false);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFourGramFilterMinTriGram() throws java.io.IOException
+	  public virtual void testFourGramFilterMinTriGram()
+	  {
+		this.shingleFilterTest(3, 4, TEST_TOKEN, FOUR_GRAM_TOKENS_MIN_TRI_GRAM, FOUR_GRAM_POSITION_INCREMENTS_MIN_TRI_GRAM, FOUR_GRAM_TYPES_MIN_TRI_GRAM, true);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFourGramFilterWithoutUnigramsMinTriGram() throws java.io.IOException
+	  public virtual void testFourGramFilterWithoutUnigramsMinTriGram()
+	  {
+		this.shingleFilterTest(3, 4, TEST_TOKEN, FOUR_GRAM_TOKENS_WITHOUT_UNIGRAMS_MIN_TRI_GRAM, FOUR_GRAM_POSITION_INCREMENTS_WITHOUT_UNIGRAMS_MIN_TRI_GRAM, FOUR_GRAM_TYPES_WITHOUT_UNIGRAMS_MIN_TRI_GRAM, false);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFourGramFilterMinFourGram() throws java.io.IOException
+	  public virtual void testFourGramFilterMinFourGram()
+	  {
+		this.shingleFilterTest(4, 4, TEST_TOKEN, FOUR_GRAM_TOKENS_MIN_FOUR_GRAM, FOUR_GRAM_POSITION_INCREMENTS_MIN_FOUR_GRAM, FOUR_GRAM_TYPES_MIN_FOUR_GRAM, true);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFourGramFilterWithoutUnigramsMinFourGram() throws java.io.IOException
+	  public virtual void testFourGramFilterWithoutUnigramsMinFourGram()
+	  {
+		this.shingleFilterTest(4, 4, TEST_TOKEN, FOUR_GRAM_TOKENS_WITHOUT_UNIGRAMS_MIN_FOUR_GRAM, FOUR_GRAM_POSITION_INCREMENTS_WITHOUT_UNIGRAMS_MIN_FOUR_GRAM, FOUR_GRAM_TYPES_WITHOUT_UNIGRAMS_MIN_FOUR_GRAM, false);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBiGramFilterNoSeparator() throws java.io.IOException
+	  public virtual void testBiGramFilterNoSeparator()
+	  {
+		this.shingleFilterTest("", 2, 2, TEST_TOKEN, BI_GRAM_TOKENS_NO_SEPARATOR, BI_GRAM_POSITION_INCREMENTS_NO_SEPARATOR, BI_GRAM_TYPES_NO_SEPARATOR, true);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBiGramFilterWithoutUnigramsNoSeparator() throws java.io.IOException
+	  public virtual void testBiGramFilterWithoutUnigramsNoSeparator()
+	  {
+		this.shingleFilterTest("", 2, 2, TEST_TOKEN, BI_GRAM_TOKENS_WITHOUT_UNIGRAMS_NO_SEPARATOR, BI_GRAM_POSITION_INCREMENTS_WITHOUT_UNIGRAMS_NO_SEPARATOR, BI_GRAM_TYPES_WITHOUT_UNIGRAMS_NO_SEPARATOR, false);
+	  }
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTriGramFilterNoSeparator() throws java.io.IOException
+	  public virtual void testTriGramFilterNoSeparator()
+	  {
+		this.shingleFilterTest("", 2, 3, TEST_TOKEN, TRI_GRAM_TOKENS_NO_SEPARATOR, TRI_GRAM_POSITION_INCREMENTS_NO_SEPARATOR, TRI_GRAM_TYPES_NO_SEPARATOR, true);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTriGramFilterWithoutUnigramsNoSeparator() throws java.io.IOException
+	  public virtual void testTriGramFilterWithoutUnigramsNoSeparator()
+	  {
+		this.shingleFilterTest("", 2, 3, TEST_TOKEN, TRI_GRAM_TOKENS_WITHOUT_UNIGRAMS_NO_SEPARATOR, TRI_GRAM_POSITION_INCREMENTS_WITHOUT_UNIGRAMS_NO_SEPARATOR, TRI_GRAM_TYPES_WITHOUT_UNIGRAMS_NO_SEPARATOR, false);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBiGramFilterAltSeparator() throws java.io.IOException
+	  public virtual void testBiGramFilterAltSeparator()
+	  {
+		this.shingleFilterTest("<SEP>", 2, 2, TEST_TOKEN, BI_GRAM_TOKENS_ALT_SEPARATOR, BI_GRAM_POSITION_INCREMENTS_ALT_SEPARATOR, BI_GRAM_TYPES_ALT_SEPARATOR, true);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBiGramFilterWithoutUnigramsAltSeparator() throws java.io.IOException
+	  public virtual void testBiGramFilterWithoutUnigramsAltSeparator()
+	  {
+		this.shingleFilterTest("<SEP>", 2, 2, TEST_TOKEN, BI_GRAM_TOKENS_WITHOUT_UNIGRAMS_ALT_SEPARATOR, BI_GRAM_POSITION_INCREMENTS_WITHOUT_UNIGRAMS_ALT_SEPARATOR, BI_GRAM_TYPES_WITHOUT_UNIGRAMS_ALT_SEPARATOR, false);
+	  }
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTriGramFilterAltSeparator() throws java.io.IOException
+	  public virtual void testTriGramFilterAltSeparator()
+	  {
+		this.shingleFilterTest("<SEP>", 2, 3, TEST_TOKEN, TRI_GRAM_TOKENS_ALT_SEPARATOR, TRI_GRAM_POSITION_INCREMENTS_ALT_SEPARATOR, TRI_GRAM_TYPES_ALT_SEPARATOR, true);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTriGramFilterWithoutUnigramsAltSeparator() throws java.io.IOException
+	  public virtual void testTriGramFilterWithoutUnigramsAltSeparator()
+	  {
+		this.shingleFilterTest("<SEP>", 2, 3, TEST_TOKEN, TRI_GRAM_TOKENS_WITHOUT_UNIGRAMS_ALT_SEPARATOR, TRI_GRAM_POSITION_INCREMENTS_WITHOUT_UNIGRAMS_ALT_SEPARATOR, TRI_GRAM_TYPES_WITHOUT_UNIGRAMS_ALT_SEPARATOR, false);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTriGramFilterNullSeparator() throws java.io.IOException
+	  public virtual void testTriGramFilterNullSeparator()
+	  {
+		this.shingleFilterTest(null, 2, 3, TEST_TOKEN, TRI_GRAM_TOKENS_NULL_SEPARATOR, TRI_GRAM_POSITION_INCREMENTS_NULL_SEPARATOR, TRI_GRAM_TYPES_NULL_SEPARATOR, true);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testPositionIncrementEqualToN() throws java.io.IOException
+	  public virtual void testPositionIncrementEqualToN()
+	  {
+		this.shingleFilterTest(2, 3, TEST_TOKEN_POS_INCR_EQUAL_TO_N, TRI_GRAM_TOKENS_POS_INCR_EQUAL_TO_N, TRI_GRAM_POSITION_INCREMENTS_POS_INCR_EQUAL_TO_N, TRI_GRAM_TYPES_POS_INCR_EQUAL_TO_N, true);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testPositionIncrementEqualToNWithoutUnigrams() throws java.io.IOException
+	  public virtual void testPositionIncrementEqualToNWithoutUnigrams()
+	  {
+		this.shingleFilterTest(2, 3, TEST_TOKEN_POS_INCR_EQUAL_TO_N, TRI_GRAM_TOKENS_POS_INCR_EQUAL_TO_N_WITHOUT_UNIGRAMS, TRI_GRAM_POSITION_INCREMENTS_POS_INCR_EQUAL_TO_N_WITHOUT_UNIGRAMS, TRI_GRAM_TYPES_POS_INCR_EQUAL_TO_N_WITHOUT_UNIGRAMS, false);
+	  }
+
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testPositionIncrementGreaterThanN() throws java.io.IOException
+	  public virtual void testPositionIncrementGreaterThanN()
+	  {
+		this.shingleFilterTest(2, 3, TEST_TOKEN_POS_INCR_GREATER_THAN_N, TRI_GRAM_TOKENS_POS_INCR_GREATER_THAN_N, TRI_GRAM_POSITION_INCREMENTS_POS_INCR_GREATER_THAN_N, TRI_GRAM_TYPES_POS_INCR_GREATER_THAN_N, true);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testPositionIncrementGreaterThanNWithoutUnigrams() throws java.io.IOException
+	  public virtual void testPositionIncrementGreaterThanNWithoutUnigrams()
+	  {
+		this.shingleFilterTest(2, 3, TEST_TOKEN_POS_INCR_GREATER_THAN_N, TRI_GRAM_TOKENS_POS_INCR_GREATER_THAN_N_WITHOUT_UNIGRAMS, TRI_GRAM_POSITION_INCREMENTS_POS_INCR_GREATER_THAN_N_WITHOUT_UNIGRAMS, TRI_GRAM_TYPES_POS_INCR_GREATER_THAN_N_WITHOUT_UNIGRAMS, false);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testReset() throws Exception
+	  public virtual void testReset()
+	  {
+		Tokenizer wsTokenizer = new WhitespaceTokenizer(TEST_VERSION_CURRENT, new StringReader("please divide this sentence"));
+		TokenStream filter = new ShingleFilter(wsTokenizer, 2);
+		assertTokenStreamContents(filter, new string[]{"please","please divide","divide","divide this","this","this sentence","sentence"}, new int[]{0,0,7,7,14,14,19}, new int[]{6,13,13,18,18,27,27}, new string[]{TypeAttribute.DEFAULT_TYPE,"shingle",TypeAttribute.DEFAULT_TYPE,"shingle",TypeAttribute.DEFAULT_TYPE,"shingle",TypeAttribute.DEFAULT_TYPE}, new int[]{1,0,1,0,1,0,1});
+		wsTokenizer.Reader = new StringReader("please divide this sentence");
+		assertTokenStreamContents(filter, new string[]{"please","please divide","divide","divide this","this","this sentence","sentence"}, new int[]{0,0,7,7,14,14,19}, new int[]{6,13,13,18,18,27,27}, new string[]{TypeAttribute.DEFAULT_TYPE,"shingle",TypeAttribute.DEFAULT_TYPE,"shingle",TypeAttribute.DEFAULT_TYPE,"shingle",TypeAttribute.DEFAULT_TYPE}, new int[]{1,0,1,0,1,0,1});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testOutputUnigramsIfNoShinglesSingleTokenCase() throws java.io.IOException
+	  public virtual void testOutputUnigramsIfNoShinglesSingleTokenCase()
+	  {
+		// Single token input with outputUnigrams==false is the primary case where
+		// enabling this option should alter program behavior.
+		this.shingleFilterTest(2, 2, TEST_SINGLE_TOKEN, SINGLE_TOKEN, SINGLE_TOKEN_INCREMENTS, SINGLE_TOKEN_TYPES, false, true);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testOutputUnigramsIfNoShinglesWithSimpleBigram() throws java.io.IOException
+	  public virtual void testOutputUnigramsIfNoShinglesWithSimpleBigram()
+	  {
+		// Here we expect the same result as with testBiGramFilter().
+		this.shingleFilterTest(2, 2, TEST_TOKEN, BI_GRAM_TOKENS, BI_GRAM_POSITION_INCREMENTS, BI_GRAM_TYPES, true, true);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testOutputUnigramsIfNoShinglesWithSimpleUnigramlessBigram() throws java.io.IOException
+	  public virtual void testOutputUnigramsIfNoShinglesWithSimpleUnigramlessBigram()
+	  {
+		// Here we expect the same result as with testBiGramFilterWithoutUnigrams().
+		this.shingleFilterTest(2, 2, TEST_TOKEN, BI_GRAM_TOKENS_WITHOUT_UNIGRAMS, BI_GRAM_POSITION_INCREMENTS_WITHOUT_UNIGRAMS, BI_GRAM_TYPES_WITHOUT_UNIGRAMS, false, true);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testOutputUnigramsIfNoShinglesWithMultipleInputTokens() throws java.io.IOException
+	  public virtual void testOutputUnigramsIfNoShinglesWithMultipleInputTokens()
+	  {
+		// Test when the minimum shingle size is greater than the number of input tokens
+		this.shingleFilterTest(7, 7, TEST_TOKEN, TEST_TOKEN, UNIGRAM_ONLY_POSITION_INCREMENTS, UNIGRAM_ONLY_TYPES, false, true);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: protected void shingleFilterTest(int maxSize, org.apache.lucene.analysis.Token[] tokensToShingle, org.apache.lucene.analysis.Token[] tokensToCompare, int[] positionIncrements, String[] types, boolean outputUnigrams) throws java.io.IOException
+	  protected internal virtual void shingleFilterTest(int maxSize, Token[] tokensToShingle, Token[] tokensToCompare, int[] positionIncrements, string[] types, bool outputUnigrams)
+	  {
+
+		ShingleFilter filter = new ShingleFilter(new CannedTokenStream(tokensToShingle), maxSize);
+		filter.OutputUnigrams = outputUnigrams;
+		shingleFilterTestCommon(filter, tokensToCompare, positionIncrements, types);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: protected void shingleFilterTest(int minSize, int maxSize, org.apache.lucene.analysis.Token[] tokensToShingle, org.apache.lucene.analysis.Token[] tokensToCompare, int[] positionIncrements, String[] types, boolean outputUnigrams) throws java.io.IOException
+	  protected internal virtual void shingleFilterTest(int minSize, int maxSize, Token[] tokensToShingle, Token[] tokensToCompare, int[] positionIncrements, string[] types, bool outputUnigrams)
+	  {
+		ShingleFilter filter = new ShingleFilter(new CannedTokenStream(tokensToShingle), minSize, maxSize);
+		filter.OutputUnigrams = outputUnigrams;
+		shingleFilterTestCommon(filter, tokensToCompare, positionIncrements, types);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: protected void shingleFilterTest(int minSize, int maxSize, org.apache.lucene.analysis.Token[] tokensToShingle, org.apache.lucene.analysis.Token[] tokensToCompare, int[] positionIncrements, String[] types, boolean outputUnigrams, boolean outputUnigramsIfNoShingles) throws java.io.IOException
+	  protected internal virtual void shingleFilterTest(int minSize, int maxSize, Token[] tokensToShingle, Token[] tokensToCompare, int[] positionIncrements, string[] types, bool outputUnigrams, bool outputUnigramsIfNoShingles)
+	  {
+		ShingleFilter filter = new ShingleFilter(new CannedTokenStream(tokensToShingle), minSize, maxSize);
+		filter.OutputUnigrams = outputUnigrams;
+		filter.OutputUnigramsIfNoShingles = outputUnigramsIfNoShingles;
+		shingleFilterTestCommon(filter, tokensToCompare, positionIncrements, types);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: protected void shingleFilterTest(String tokenSeparator, int minSize, int maxSize, org.apache.lucene.analysis.Token[] tokensToShingle, org.apache.lucene.analysis.Token[] tokensToCompare, int[] positionIncrements, String[] types, boolean outputUnigrams) throws java.io.IOException
+	  protected internal virtual void shingleFilterTest(string tokenSeparator, int minSize, int maxSize, Token[] tokensToShingle, Token[] tokensToCompare, int[] positionIncrements, string[] types, bool outputUnigrams)
+	  {
+		ShingleFilter filter = new ShingleFilter(new CannedTokenStream(tokensToShingle), minSize, maxSize);
+		filter.TokenSeparator = tokenSeparator;
+		filter.OutputUnigrams = outputUnigrams;
+		shingleFilterTestCommon(filter, tokensToCompare, positionIncrements, types);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: protected void shingleFilterTestCommon(ShingleFilter filter, org.apache.lucene.analysis.Token[] tokensToCompare, int[] positionIncrements, String[] types) throws java.io.IOException
+	  protected internal virtual void shingleFilterTestCommon(ShingleFilter filter, Token[] tokensToCompare, int[] positionIncrements, string[] types)
+	  {
+		string[] text = new string[tokensToCompare.Length];
+		int[] startOffsets = new int[tokensToCompare.Length];
+		int[] endOffsets = new int[tokensToCompare.Length];
+
+		for (int i = 0; i < tokensToCompare.Length; i++)
+		{
+		  text[i] = new string(tokensToCompare[i].buffer(),0, tokensToCompare[i].length());
+		  startOffsets[i] = tokensToCompare[i].startOffset();
+		  endOffsets[i] = tokensToCompare[i].endOffset();
+		}
+
+		assertTokenStreamContents(filter, text, startOffsets, endOffsets, types, positionIncrements);
+	  }
+
+	  private static Token createToken(string term, int start, int offset)
+	  {
+		return createToken(term, start, offset, 1);
+	  }
+
+	  private static Token createToken(string term, int start, int offset, int positionIncrement)
+	  {
+		Token token = new Token(start, offset);
+		token.copyBuffer(term.ToCharArray(), 0, term.Length);
+		token.PositionIncrement = positionIncrement;
+		return token;
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper(this);
+		checkRandomData(random(), a, 1000 * RANDOM_MULTIPLIER);
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly ShingleFilterTest outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper(ShingleFilterTest outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(tokenizer, new ShingleFilter(tokenizer));
+		  }
+	  }
+
+	  /// <summary>
+	  /// blast some random large strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomHugeStrings() throws Exception
+	  public virtual void testRandomHugeStrings()
+	  {
+		Random random = random();
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper2(this);
+		checkRandomData(random, a, 100 * RANDOM_MULTIPLIER, 8192);
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly ShingleFilterTest outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper2(ShingleFilterTest outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(tokenizer, new ShingleFilter(tokenizer));
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper3(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper3 : Analyzer
+	  {
+		  private readonly ShingleFilterTest outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper3(ShingleFilterTest outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new ShingleFilter(tokenizer));
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTrailingHole1() throws java.io.IOException
+	  public virtual void testTrailingHole1()
+	  {
+		// Analyzing "wizard of", where of is removed as a
+		// stopword leaving a trailing hole:
+		Token[] inputTokens = new Token[] {createToken("wizard", 0, 6)};
+		ShingleFilter filter = new ShingleFilter(new CannedTokenStream(1, 9, inputTokens), 2, 2);
+
+		assertTokenStreamContents(filter, new string[] {"wizard", "wizard _"}, new int[] {0, 0}, new int[] {6, 9}, new int[] {1, 0}, 9);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTrailingHole2() throws java.io.IOException
+	  public virtual void testTrailingHole2()
+	  {
+		// Analyzing "purple wizard of", where of is removed as a
+		// stopword leaving a trailing hole:
+		Token[] inputTokens = new Token[] {createToken("purple", 0, 6), createToken("wizard", 7, 13)};
+		ShingleFilter filter = new ShingleFilter(new CannedTokenStream(1, 16, inputTokens), 2, 2);
+
+		assertTokenStreamContents(filter, new string[] {"purple", "purple wizard", "wizard", "wizard _"}, new int[] {0, 0, 7, 7}, new int[] {6, 13, 13, 16}, new int[] {1, 0, 1, 0}, 16);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTwoTrailingHoles() throws java.io.IOException
+	  public virtual void testTwoTrailingHoles()
+	  {
+		// Analyzing "purple wizard of the", where of and the are removed as a
+		// stopwords, leaving two trailing holes:
+		Token[] inputTokens = new Token[] {createToken("purple", 0, 6), createToken("wizard", 7, 13)};
+		ShingleFilter filter = new ShingleFilter(new CannedTokenStream(2, 20, inputTokens), 2, 2);
+
+		assertTokenStreamContents(filter, new string[] {"purple", "purple wizard", "wizard", "wizard _"}, new int[] {0, 0, 7, 7}, new int[] {6, 13, 13, 20}, new int[] {1, 0, 1, 0}, 20);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTwoTrailingHolesTriShingle() throws java.io.IOException
+	  public virtual void testTwoTrailingHolesTriShingle()
+	  {
+		// Analyzing "purple wizard of the", where of and the are removed as a
+		// stopwords, leaving two trailing holes:
+		Token[] inputTokens = new Token[] {createToken("purple", 0, 6), createToken("wizard", 7, 13)};
+		ShingleFilter filter = new ShingleFilter(new CannedTokenStream(2, 20, inputTokens), 2, 3);
+
+		assertTokenStreamContents(filter, new string[] {"purple", "purple wizard", "purple wizard _", "wizard", "wizard _", "wizard _ _"}, new int[] {0, 0, 0, 7, 7, 7}, new int[] {6, 13, 20, 13, 20, 20}, new int[] {1, 0, 0, 1, 0, 0}, 20);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTwoTrailingHolesTriShingleWithTokenFiller() throws java.io.IOException
+	  public virtual void testTwoTrailingHolesTriShingleWithTokenFiller()
+	  {
+		// Analyzing "purple wizard of the", where of and the are removed as a
+		// stopwords, leaving two trailing holes:
+		Token[] inputTokens = new Token[] {createToken("purple", 0, 6), createToken("wizard", 7, 13)};
+		ShingleFilter filter = new ShingleFilter(new CannedTokenStream(2, 20, inputTokens), 2, 3);
+		filter.FillerToken = "--";
+
+		assertTokenStreamContents(filter, new string[]{"purple", "purple wizard", "purple wizard --", "wizard", "wizard --", "wizard -- --"}, new int[]{0, 0, 0, 7, 7, 7}, new int[]{6, 13, 20, 13, 20, 20}, new int[]{1, 0, 0, 1, 0, 0}, 20);
+
+		 filter = new ShingleFilter(new CannedTokenStream(2, 20, inputTokens), 2, 3);
+		filter.FillerToken = "";
+
+		assertTokenStreamContents(filter, new string[]{"purple", "purple wizard", "purple wizard ", "wizard", "wizard ", "wizard  "}, new int[]{0, 0, 0, 7, 7, 7}, new int[]{6, 13, 20, 13, 20, 20}, new int[]{1, 0, 0, 1, 0, 0}, 20);
+
+
+		filter = new ShingleFilter(new CannedTokenStream(2, 20, inputTokens), 2, 3);
+		filter.FillerToken = null;
+
+		assertTokenStreamContents(filter, new string[] {"purple", "purple wizard", "purple wizard ", "wizard", "wizard ", "wizard  "}, new int[] {0, 0, 0, 7, 7, 7}, new int[] {6, 13, 20, 13, 20, 20}, new int[] {1, 0, 0, 1, 0, 0}, 20);
+
+
+		filter = new ShingleFilter(new CannedTokenStream(2, 20, inputTokens), 2, 3);
+		filter.FillerToken = null;
+		filter.TokenSeparator = null;
+
+		assertTokenStreamContents(filter, new string[] {"purple", "purplewizard", "purplewizard", "wizard", "wizard", "wizard"}, new int[] {0, 0, 0, 7, 7, 7}, new int[] {6, 13, 20, 13, 20, 20}, new int[] {1, 0, 0, 1, 0, 0}, 20);
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Shingle/TestShingleFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Shingle/TestShingleFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Shingle/TestShingleFilterFactory.cs
new file mode 100644
index 0000000..36c2928
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Shingle/TestShingleFilterFactory.cs
@@ -0,0 +1,224 @@
+namespace org.apache.lucene.analysis.shingle
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the Shingle filter factory works.
+	/// </summary>
+	public class TestShingleFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+	  /// <summary>
+	  /// Test the defaults
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testDefaults() throws Exception
+	  public virtual void testDefaults()
+	  {
+		Reader reader = new StringReader("this is a test");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("Shingle").create(stream);
+		assertTokenStreamContents(stream, new string[] {"this", "this is", "is", "is a", "a", "a test", "test"});
+	  }
+
+	  /// <summary>
+	  /// Test with unigrams disabled
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNoUnigrams() throws Exception
+	  public virtual void testNoUnigrams()
+	  {
+		Reader reader = new StringReader("this is a test");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("Shingle", "outputUnigrams", "false").create(stream);
+		assertTokenStreamContents(stream, new string[] {"this is", "is a", "a test"});
+	  }
+
+	  /// <summary>
+	  /// Test with a higher max shingle size
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMaxShingleSize() throws Exception
+	  public virtual void testMaxShingleSize()
+	  {
+		Reader reader = new StringReader("this is a test");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("Shingle", "maxShingleSize", "3").create(stream);
+		assertTokenStreamContents(stream, new string[] {"this", "this is", "this is a", "is", "is a", "is a test", "a", "a test", "test"});
+	  }
+
+	  /// <summary>
+	  /// Test with higher min (and max) shingle size
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMinShingleSize() throws Exception
+	  public virtual void testMinShingleSize()
+	  {
+		Reader reader = new StringReader("this is a test");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("Shingle", "minShingleSize", "3", "maxShingleSize", "4").create(stream);
+		assertTokenStreamContents(stream, new string[] {"this", "this is a", "this is a test", "is", "is a test", "a", "test"});
+	  }
+
+	  /// <summary>
+	  /// Test with higher min (and max) shingle size and with unigrams disabled
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMinShingleSizeNoUnigrams() throws Exception
+	  public virtual void testMinShingleSizeNoUnigrams()
+	  {
+		Reader reader = new StringReader("this is a test");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("Shingle", "minShingleSize", "3", "maxShingleSize", "4", "outputUnigrams", "false").create(stream);
+		assertTokenStreamContents(stream, new string[] {"this is a", "this is a test", "is a test"});
+	  }
+
+	  /// <summary>
+	  /// Test with higher same min and max shingle size
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEqualMinAndMaxShingleSize() throws Exception
+	  public virtual void testEqualMinAndMaxShingleSize()
+	  {
+		Reader reader = new StringReader("this is a test");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("Shingle", "minShingleSize", "3", "maxShingleSize", "3").create(stream);
+		assertTokenStreamContents(stream, new string[] {"this", "this is a", "is", "is a test", "a", "test"});
+	  }
+
+	  /// <summary>
+	  /// Test with higher same min and max shingle size and with unigrams disabled
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEqualMinAndMaxShingleSizeNoUnigrams() throws Exception
+	  public virtual void testEqualMinAndMaxShingleSizeNoUnigrams()
+	  {
+		Reader reader = new StringReader("this is a test");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("Shingle", "minShingleSize", "3", "maxShingleSize", "3", "outputUnigrams", "false").create(stream);
+		assertTokenStreamContents(stream, new string[] {"this is a", "is a test"});
+	  }
+
+	  /// <summary>
+	  /// Test with a non-default token separator
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTokenSeparator() throws Exception
+	  public virtual void testTokenSeparator()
+	  {
+		Reader reader = new StringReader("this is a test");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("Shingle", "tokenSeparator", "=BLAH=").create(stream);
+		assertTokenStreamContents(stream, new string[] {"this", "this=BLAH=is", "is", "is=BLAH=a", "a", "a=BLAH=test", "test"});
+	  }
+
+	  /// <summary>
+	  /// Test with a non-default token separator and with unigrams disabled
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTokenSeparatorNoUnigrams() throws Exception
+	  public virtual void testTokenSeparatorNoUnigrams()
+	  {
+		Reader reader = new StringReader("this is a test");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("Shingle", "tokenSeparator", "=BLAH=", "outputUnigrams", "false").create(stream);
+		assertTokenStreamContents(stream, new string[] {"this=BLAH=is", "is=BLAH=a", "a=BLAH=test"});
+	  }
+
+	  /// <summary>
+	  /// Test with an empty token separator
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTokenSeparator() throws Exception
+	  public virtual void testEmptyTokenSeparator()
+	  {
+		Reader reader = new StringReader("this is a test");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("Shingle", "tokenSeparator", "").create(stream);
+		assertTokenStreamContents(stream, new string[] {"this", "thisis", "is", "isa", "a", "atest", "test"});
+	  }
+
+	  /// <summary>
+	  /// Test with higher min (and max) shingle size 
+	  /// and with a non-default token separator
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMinShingleSizeAndTokenSeparator() throws Exception
+	  public virtual void testMinShingleSizeAndTokenSeparator()
+	  {
+		Reader reader = new StringReader("this is a test");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("Shingle", "minShingleSize", "3", "maxShingleSize", "4", "tokenSeparator", "=BLAH=").create(stream);
+		assertTokenStreamContents(stream, new string[] {"this", "this=BLAH=is=BLAH=a", "this=BLAH=is=BLAH=a=BLAH=test", "is", "is=BLAH=a=BLAH=test", "a", "test"});
+	  }
+
+	  /// <summary>
+	  /// Test with higher min (and max) shingle size 
+	  /// and with a non-default token separator
+	  /// and with unigrams disabled
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMinShingleSizeAndTokenSeparatorNoUnigrams() throws Exception
+	  public virtual void testMinShingleSizeAndTokenSeparatorNoUnigrams()
+	  {
+		Reader reader = new StringReader("this is a test");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("Shingle", "minShingleSize", "3", "maxShingleSize", "4", "tokenSeparator", "=BLAH=", "outputUnigrams", "false").create(stream);
+		assertTokenStreamContents(stream, new string[] {"this=BLAH=is=BLAH=a", "this=BLAH=is=BLAH=a=BLAH=test", "is=BLAH=a=BLAH=test"});
+	  }
+
+	  /// <summary>
+	  /// Test with unigrams disabled except when there are no shingles, with
+	  /// a single input token. Using default min/max shingle sizes: 2/2.  No
+	  /// shingles will be created, since there are fewer input tokens than
+	  /// min shingle size.  However, because outputUnigramsIfNoShingles is
+	  /// set to true, even though outputUnigrams is set to false, one
+	  /// unigram should be output.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testOutputUnigramsIfNoShingles() throws Exception
+	  public virtual void testOutputUnigramsIfNoShingles()
+	  {
+		Reader reader = new StringReader("test");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("Shingle", "outputUnigrams", "false", "outputUnigramsIfNoShingles", "true").create(stream);
+		assertTokenStreamContents(stream, new string[] {"test"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("Shingle", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Sinks/DateRecognizerSinkTokenizerTest.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Sinks/DateRecognizerSinkTokenizerTest.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Sinks/DateRecognizerSinkTokenizerTest.cs
new file mode 100644
index 0000000..a23933c
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Sinks/DateRecognizerSinkTokenizerTest.cs
@@ -0,0 +1,52 @@
+namespace org.apache.lucene.analysis.sinks
+{
+
+	/// <summary>
+	/// Copyright 2004 The Apache Software Foundation
+	/// 
+	/// Licensed 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>
+
+
+
+	public class DateRecognizerSinkTokenizerTest : BaseTokenStreamTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void test() throws java.io.IOException
+	  public virtual void test()
+	  {
+		DateRecognizerSinkFilter sinkFilter = new DateRecognizerSinkFilter(new SimpleDateFormat("MM/dd/yyyy", Locale.ROOT));
+		string test = "The quick red fox jumped over the lazy brown dogs on 7/11/2006  The dogs finally reacted on 7/12/2006";
+		TeeSinkTokenFilter tee = new TeeSinkTokenFilter(new MockTokenizer(new StringReader(test), MockTokenizer.WHITESPACE, false));
+		TeeSinkTokenFilter.SinkTokenStream sink = tee.newSinkTokenStream(sinkFilter);
+		int count = 0;
+
+		tee.reset();
+		while (tee.incrementToken())
+		{
+		  count++;
+		}
+		assertTrue(count + " does not equal: " + 18, count == 18);
+
+		int sinkCount = 0;
+		sink.reset();
+		while (sink.incrementToken())
+		{
+		  sinkCount++;
+		}
+		assertTrue("sink Size: " + sinkCount + " is not: " + 2, sinkCount == 2);
+
+	  }
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Sinks/TestTeeSinkTokenFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Sinks/TestTeeSinkTokenFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Sinks/TestTeeSinkTokenFilter.cs
new file mode 100644
index 0000000..eb161cd
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Sinks/TestTeeSinkTokenFilter.cs
@@ -0,0 +1,357 @@
+using System;
+using System.Text;
+
+namespace org.apache.lucene.analysis.sinks
+{
+
+	/// <summary>
+	/// Copyright 2004 The Apache Software Foundation
+	/// 
+	/// Licensed 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>
+
+
+	using org.apache.lucene.analysis;
+	using LowerCaseFilter = org.apache.lucene.analysis.core.LowerCaseFilter;
+	using StandardFilter = org.apache.lucene.analysis.standard.StandardFilter;
+	using StandardTokenizer = org.apache.lucene.analysis.standard.StandardTokenizer;
+	using CharTermAttribute = org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
+	using PositionIncrementAttribute = org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
+	using Document = org.apache.lucene.document.Document;
+	using Field = org.apache.lucene.document.Field;
+	using FieldType = org.apache.lucene.document.FieldType;
+	using TextField = org.apache.lucene.document.TextField;
+	using DirectoryReader = org.apache.lucene.index.DirectoryReader;
+	using DocsAndPositionsEnum = org.apache.lucene.index.DocsAndPositionsEnum;
+	using IndexReader = org.apache.lucene.index.IndexReader;
+	using IndexWriter = org.apache.lucene.index.IndexWriter;
+	using Terms = org.apache.lucene.index.Terms;
+	using TermsEnum = org.apache.lucene.index.TermsEnum;
+	using DocIdSetIterator = org.apache.lucene.search.DocIdSetIterator;
+	using Directory = org.apache.lucene.store.Directory;
+	using AttributeSource = org.apache.lucene.util.AttributeSource;
+	using English = org.apache.lucene.util.English;
+
+
+	/// <summary>
+	/// tests for the TestTeeSinkTokenFilter
+	/// </summary>
+	public class TestTeeSinkTokenFilter : BaseTokenStreamTestCase
+	{
+	  protected internal StringBuilder buffer1;
+	  protected internal StringBuilder buffer2;
+	  protected internal string[] tokens1;
+	  protected internal string[] tokens2;
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Override public void setUp() throws Exception
+	  public override void setUp()
+	  {
+		base.setUp();
+		tokens1 = new string[]{"The", "quick", "Burgundy", "Fox", "jumped", "over", "the", "lazy", "Red", "Dogs"};
+		tokens2 = new string[]{"The", "Lazy", "Dogs", "should", "stay", "on", "the", "porch"};
+		buffer1 = new StringBuilder();
+
+		for (int i = 0; i < tokens1.Length; i++)
+		{
+		  buffer1.Append(tokens1[i]).Append(' ');
+		}
+		buffer2 = new StringBuilder();
+		for (int i = 0; i < tokens2.Length; i++)
+		{
+		  buffer2.Append(tokens2[i]).Append(' ');
+		}
+	  }
+
+	  internal static readonly TeeSinkTokenFilter.SinkFilter theFilter = new SinkFilterAnonymousInnerClassHelper();
+
+	  private class SinkFilterAnonymousInnerClassHelper : TeeSinkTokenFilter.SinkFilter
+	  {
+		  public SinkFilterAnonymousInnerClassHelper()
+		  {
+		  }
+
+		  public override bool accept(AttributeSource a)
+		  {
+			CharTermAttribute termAtt = a.getAttribute(typeof(CharTermAttribute));
+			return termAtt.ToString().Equals("The", StringComparison.CurrentCultureIgnoreCase);
+		  }
+	  }
+
+	  internal static readonly TeeSinkTokenFilter.SinkFilter dogFilter = new SinkFilterAnonymousInnerClassHelper2();
+
+	  private class SinkFilterAnonymousInnerClassHelper2 : TeeSinkTokenFilter.SinkFilter
+	  {
+		  public SinkFilterAnonymousInnerClassHelper2()
+		  {
+		  }
+
+		  public override bool accept(AttributeSource a)
+		  {
+			CharTermAttribute termAtt = a.getAttribute(typeof(CharTermAttribute));
+			return termAtt.ToString().Equals("Dogs", StringComparison.CurrentCultureIgnoreCase);
+		  }
+	  }
+
+	  // LUCENE-1448
+	  // TODO: instead of testing it this way, we can test 
+	  // with BaseTokenStreamTestCase now...
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEndOffsetPositionWithTeeSinkTokenFilter() throws Exception
+	  public virtual void testEndOffsetPositionWithTeeSinkTokenFilter()
+	  {
+		Directory dir = newDirectory();
+		Analyzer analyzer = new MockAnalyzer(random(), MockTokenizer.WHITESPACE, false);
+		IndexWriter w = new IndexWriter(dir, newIndexWriterConfig(TEST_VERSION_CURRENT, analyzer));
+		Document doc = new Document();
+		TokenStream tokenStream = analyzer.tokenStream("field", "abcd   ");
+		TeeSinkTokenFilter tee = new TeeSinkTokenFilter(tokenStream);
+		TokenStream sink = tee.newSinkTokenStream();
+		FieldType ft = new FieldType(TextField.TYPE_NOT_STORED);
+		ft.StoreTermVectors = true;
+		ft.StoreTermVectorOffsets = true;
+		ft.StoreTermVectorPositions = true;
+		Field f1 = new Field("field", tee, ft);
+		Field f2 = new Field("field", sink, ft);
+		doc.add(f1);
+		doc.add(f2);
+		w.addDocument(doc);
+		w.close();
+
+		IndexReader r = DirectoryReader.open(dir);
+		Terms vector = r.getTermVectors(0).terms("field");
+		assertEquals(1, vector.size());
+		TermsEnum termsEnum = vector.iterator(null);
+		termsEnum.next();
+		assertEquals(2, termsEnum.totalTermFreq());
+		DocsAndPositionsEnum positions = termsEnum.docsAndPositions(null, null);
+		assertTrue(positions.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
+		assertEquals(2, positions.freq());
+		positions.nextPosition();
+		assertEquals(0, positions.startOffset());
+		assertEquals(4, positions.endOffset());
+		positions.nextPosition();
+		assertEquals(8, positions.startOffset());
+		assertEquals(12, positions.endOffset());
+		assertEquals(DocIdSetIterator.NO_MORE_DOCS, positions.nextDoc());
+		r.close();
+		dir.close();
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testGeneral() throws java.io.IOException
+	  public virtual void testGeneral()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final TeeSinkTokenFilter source = new TeeSinkTokenFilter(new MockTokenizer(new java.io.StringReader(buffer1.toString()), MockTokenizer.WHITESPACE, false));
+		TeeSinkTokenFilter source = new TeeSinkTokenFilter(new MockTokenizer(new StringReader(buffer1.ToString()), MockTokenizer.WHITESPACE, false));
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final TokenStream sink1 = source.newSinkTokenStream();
+		TokenStream sink1 = source.newSinkTokenStream();
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final TokenStream sink2 = source.newSinkTokenStream(theFilter);
+		TokenStream sink2 = source.newSinkTokenStream(theFilter);
+
+		source.addAttribute(typeof(CheckClearAttributesAttribute));
+		sink1.addAttribute(typeof(CheckClearAttributesAttribute));
+		sink2.addAttribute(typeof(CheckClearAttributesAttribute));
+
+		assertTokenStreamContents(source, tokens1);
+		assertTokenStreamContents(sink1, tokens1);
+		assertTokenStreamContents(sink2, new string[]{"The", "the"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMultipleSources() throws Exception
+	  public virtual void testMultipleSources()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final TeeSinkTokenFilter tee1 = new TeeSinkTokenFilter(new MockTokenizer(new java.io.StringReader(buffer1.toString()), MockTokenizer.WHITESPACE, false));
+		TeeSinkTokenFilter tee1 = new TeeSinkTokenFilter(new MockTokenizer(new StringReader(buffer1.ToString()), MockTokenizer.WHITESPACE, false));
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final TeeSinkTokenFilter.SinkTokenStream dogDetector = tee1.newSinkTokenStream(dogFilter);
+		TeeSinkTokenFilter.SinkTokenStream dogDetector = tee1.newSinkTokenStream(dogFilter);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final TeeSinkTokenFilter.SinkTokenStream theDetector = tee1.newSinkTokenStream(theFilter);
+		TeeSinkTokenFilter.SinkTokenStream theDetector = tee1.newSinkTokenStream(theFilter);
+		tee1.reset();
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final TokenStream source1 = new CachingTokenFilter(tee1);
+		TokenStream source1 = new CachingTokenFilter(tee1);
+
+		tee1.addAttribute(typeof(CheckClearAttributesAttribute));
+		dogDetector.addAttribute(typeof(CheckClearAttributesAttribute));
+		theDetector.addAttribute(typeof(CheckClearAttributesAttribute));
+
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final TeeSinkTokenFilter tee2 = new TeeSinkTokenFilter(new MockTokenizer(new java.io.StringReader(buffer2.toString()), MockTokenizer.WHITESPACE, false));
+		TeeSinkTokenFilter tee2 = new TeeSinkTokenFilter(new MockTokenizer(new StringReader(buffer2.ToString()), MockTokenizer.WHITESPACE, false));
+		tee2.addSinkTokenStream(dogDetector);
+		tee2.addSinkTokenStream(theDetector);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final TokenStream source2 = tee2;
+		TokenStream source2 = tee2;
+
+		assertTokenStreamContents(source1, tokens1);
+		assertTokenStreamContents(source2, tokens2);
+
+		assertTokenStreamContents(theDetector, new string[]{"The", "the", "The", "the"});
+		assertTokenStreamContents(dogDetector, new string[]{"Dogs", "Dogs"});
+
+		source1.reset();
+		TokenStream lowerCasing = new LowerCaseFilter(TEST_VERSION_CURRENT, source1);
+		string[] lowerCaseTokens = new string[tokens1.Length];
+		for (int i = 0; i < tokens1.Length; i++)
+		{
+		  lowerCaseTokens[i] = tokens1[i].ToLower(Locale.ROOT);
+		}
+		assertTokenStreamContents(lowerCasing, lowerCaseTokens);
+	  }
+
+	  /// <summary>
+	  /// Not an explicit test, just useful to print out some info on performance
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void performance() throws Exception
+	  public virtual void performance()
+	  {
+		int[] tokCount = new int[] {100, 500, 1000, 2000, 5000, 10000};
+		int[] modCounts = new int[] {1, 2, 5, 10, 20, 50, 100, 200, 500};
+		for (int k = 0; k < tokCount.Length; k++)
+		{
+		  StringBuilder buffer = new StringBuilder();
+		  Console.WriteLine("-----Tokens: " + tokCount[k] + "-----");
+		  for (int i = 0; i < tokCount[k]; i++)
+		  {
+			buffer.Append(English.intToEnglish(i).toUpperCase(Locale.ROOT)).Append(' ');
+		  }
+		  //make sure we produce the same tokens
+		  TeeSinkTokenFilter teeStream = new TeeSinkTokenFilter(new StandardFilter(TEST_VERSION_CURRENT, new StandardTokenizer(TEST_VERSION_CURRENT, new StringReader(buffer.ToString()))));
+		  TokenStream sink = teeStream.newSinkTokenStream(new ModuloSinkFilter(this, 100));
+		  teeStream.consumeAllTokens();
+		  TokenStream stream = new ModuloTokenFilter(this, new StandardFilter(TEST_VERSION_CURRENT, new StandardTokenizer(TEST_VERSION_CURRENT, new StringReader(buffer.ToString()))), 100);
+		  CharTermAttribute tfTok = stream.addAttribute(typeof(CharTermAttribute));
+		  CharTermAttribute sinkTok = sink.addAttribute(typeof(CharTermAttribute));
+		  for (int i = 0; stream.incrementToken(); i++)
+		  {
+			assertTrue(sink.incrementToken());
+			assertTrue(tfTok + " is not equal to " + sinkTok + " at token: " + i, tfTok.Equals(sinkTok) == true);
+		  }
+
+		  //simulate two fields, each being analyzed once, for 20 documents
+		  for (int j = 0; j < modCounts.Length; j++)
+		  {
+			int tfPos = 0;
+			long start = DateTimeHelperClass.CurrentUnixTimeMillis();
+			for (int i = 0; i < 20; i++)
+			{
+			  stream = new StandardFilter(TEST_VERSION_CURRENT, new StandardTokenizer(TEST_VERSION_CURRENT, new StringReader(buffer.ToString())));
+			  PositionIncrementAttribute posIncrAtt = stream.getAttribute(typeof(PositionIncrementAttribute));
+			  while (stream.incrementToken())
+			  {
+				tfPos += posIncrAtt.PositionIncrement;
+			  }
+			  stream = new ModuloTokenFilter(this, new StandardFilter(TEST_VERSION_CURRENT, new StandardTokenizer(TEST_VERSION_CURRENT, new StringReader(buffer.ToString()))), modCounts[j]);
+			  posIncrAtt = stream.getAttribute(typeof(PositionIncrementAttribute));
+			  while (stream.incrementToken())
+			  {
+				tfPos += posIncrAtt.PositionIncrement;
+			  }
+			}
+			long finish = DateTimeHelperClass.CurrentUnixTimeMillis();
+			Console.WriteLine("ModCount: " + modCounts[j] + " Two fields took " + (finish - start) + " ms");
+			int sinkPos = 0;
+			//simulate one field with one sink
+			start = DateTimeHelperClass.CurrentUnixTimeMillis();
+			for (int i = 0; i < 20; i++)
+			{
+			  teeStream = new TeeSinkTokenFilter(new StandardFilter(TEST_VERSION_CURRENT, new StandardTokenizer(TEST_VERSION_CURRENT, new StringReader(buffer.ToString()))));
+			  sink = teeStream.newSinkTokenStream(new ModuloSinkFilter(this, modCounts[j]));
+			  PositionIncrementAttribute posIncrAtt = teeStream.getAttribute(typeof(PositionIncrementAttribute));
+			  while (teeStream.incrementToken())
+			  {
+				sinkPos += posIncrAtt.PositionIncrement;
+			  }
+			  //System.out.println("Modulo--------");
+			  posIncrAtt = sink.getAttribute(typeof(PositionIncrementAttribute));
+			  while (sink.incrementToken())
+			  {
+				sinkPos += posIncrAtt.PositionIncrement;
+			  }
+			}
+			finish = DateTimeHelperClass.CurrentUnixTimeMillis();
+			Console.WriteLine("ModCount: " + modCounts[j] + " Tee fields took " + (finish - start) + " ms");
+			assertTrue(sinkPos + " does not equal: " + tfPos, sinkPos == tfPos);
+
+		  }
+		  Console.WriteLine("- End Tokens: " + tokCount[k] + "-----");
+		}
+
+	  }
+
+
+	  internal class ModuloTokenFilter : TokenFilter
+	  {
+		  private readonly TestTeeSinkTokenFilter outerInstance;
+
+
+		internal int modCount;
+
+		internal ModuloTokenFilter(TestTeeSinkTokenFilter outerInstance, TokenStream input, int mc) : base(input)
+		{
+			this.outerInstance = outerInstance;
+		  modCount = mc;
+		}
+
+		internal int count = 0;
+
+		//return every 100 tokens
+//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()
+		{
+		  bool hasNext;
+		  for (hasNext = input.incrementToken(); hasNext && count % modCount != 0; hasNext = input.incrementToken())
+		  {
+			count++;
+		  }
+		  count++;
+		  return hasNext;
+		}
+	  }
+
+	  internal class ModuloSinkFilter : TeeSinkTokenFilter.SinkFilter
+	  {
+		  private readonly TestTeeSinkTokenFilter outerInstance;
+
+		internal int count = 0;
+		internal int modCount;
+
+		internal ModuloSinkFilter(TestTeeSinkTokenFilter outerInstance, int mc)
+		{
+			this.outerInstance = outerInstance;
+		  modCount = mc;
+		}
+
+		public override bool accept(AttributeSource a)
+		{
+		  bool b = (a != null && count % modCount == 0);
+		  count++;
+		  return b;
+		}
+
+	  }
+	}
+
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Sinks/TokenRangeSinkTokenizerTest.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Sinks/TokenRangeSinkTokenizerTest.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Sinks/TokenRangeSinkTokenizerTest.cs
new file mode 100644
index 0000000..5628c39
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Sinks/TokenRangeSinkTokenizerTest.cs
@@ -0,0 +1,62 @@
+namespace org.apache.lucene.analysis.sinks
+{
+
+	/*
+	 * 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 Test = org.junit.Test;
+
+	public class TokenRangeSinkTokenizerTest : BaseTokenStreamTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void test() throws java.io.IOException
+	  public virtual void test()
+	  {
+		TokenRangeSinkFilter sinkFilter = new TokenRangeSinkFilter(2, 4);
+		string test = "The quick red fox jumped over the lazy brown dogs";
+		TeeSinkTokenFilter tee = new TeeSinkTokenFilter(new MockTokenizer(new StringReader(test), MockTokenizer.WHITESPACE, false));
+		TeeSinkTokenFilter.SinkTokenStream rangeToks = tee.newSinkTokenStream(sinkFilter);
+
+		int count = 0;
+		tee.reset();
+		while (tee.incrementToken())
+		{
+		  count++;
+		}
+
+		int sinkCount = 0;
+		rangeToks.reset();
+		while (rangeToks.incrementToken())
+		{
+		  sinkCount++;
+		}
+
+		assertTrue(count + " does not equal: " + 10, count == 10);
+		assertTrue("rangeToks Size: " + sinkCount + " is not: " + 2, sinkCount == 2);
+	  }
+
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @Test(expected = IllegalArgumentException.class) public void testIllegalArguments() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public virtual void testIllegalArguments()
+	  {
+		new TokenRangeSinkFilter(4, 2);
+	  }
+	}
+}
\ No newline at end of file


[14/27] lucenenet git commit: adding converted analysis common tests

Posted by sy...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestOptionalCondition.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestOptionalCondition.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestOptionalCondition.cs
new file mode 100644
index 0000000..cb7bb6f
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestOptionalCondition.cs
@@ -0,0 +1,50 @@
+namespace org.apache.lucene.analysis.hunspell
+{
+
+	/*
+	 * 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 BeforeClass = org.junit.BeforeClass;
+
+	public class TestOptionalCondition : StemmerTestBase
+	{
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @BeforeClass public static void beforeClass() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public static void beforeClass()
+	  {
+		init("optional-condition.aff", "condition.dic");
+	  }
+
+	  public virtual void testStemming()
+	  {
+		assertStemsTo("hello", "hello");
+		assertStemsTo("try", "try");
+		assertStemsTo("tried", "try");
+		assertStemsTo("work", "work");
+		assertStemsTo("worked", "work");
+		assertStemsTo("rework", "work");
+		assertStemsTo("reworked", "work");
+		assertStemsTo("retried");
+		assertStemsTo("workied");
+		assertStemsTo("tryed");
+		assertStemsTo("tryied");
+		assertStemsTo("helloed");
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestStemmer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestStemmer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestStemmer.cs
new file mode 100644
index 0000000..93df12e
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestStemmer.cs
@@ -0,0 +1,88 @@
+namespace org.apache.lucene.analysis.hunspell
+{
+
+	/*
+	 * 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 BeforeClass = org.junit.BeforeClass;
+
+	public class TestStemmer : StemmerTestBase
+	{
+
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @BeforeClass public static void beforeClass() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public static void beforeClass()
+	  {
+		init("simple.aff", "simple.dic");
+	  }
+
+	  public virtual void testSimpleSuffix()
+	  {
+		assertStemsTo("lucene", "lucene", "lucen");
+		assertStemsTo("mahoute", "mahout");
+	  }
+
+	  public virtual void testSimplePrefix()
+	  {
+		assertStemsTo("solr", "olr");
+	  }
+
+	  public virtual void testRecursiveSuffix()
+	  {
+		// we should not recurse here, as the suffix has no continuation!
+		assertStemsTo("abcd");
+	  }
+
+	  // all forms unmunched from dictionary
+	  public virtual void testAllStems()
+	  {
+		assertStemsTo("ab", "ab");
+		assertStemsTo("abc", "ab");
+		assertStemsTo("apach", "apach");
+		assertStemsTo("apache", "apach");
+		assertStemsTo("foo", "foo", "foo");
+		assertStemsTo("food", "foo");
+		assertStemsTo("foos", "foo");
+		assertStemsTo("lucen", "lucen");
+		assertStemsTo("lucene", "lucen", "lucene");
+		assertStemsTo("mahout", "mahout");
+		assertStemsTo("mahoute", "mahout");
+		assertStemsTo("moo", "moo");
+		assertStemsTo("mood", "moo");
+		assertStemsTo("olr", "olr");
+		assertStemsTo("solr", "olr");
+	  }
+
+	  // some bogus stuff that should not stem (empty lists)!
+	  public virtual void testBogusStems()
+	  {
+		assertStemsTo("abs");
+		assertStemsTo("abe");
+		assertStemsTo("sab");
+		assertStemsTo("sapach");
+		assertStemsTo("sapache");
+		assertStemsTo("apachee");
+		assertStemsTo("sfoo");
+		assertStemsTo("sfoos");
+		assertStemsTo("fooss");
+		assertStemsTo("lucenee");
+		assertStemsTo("solre");
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestTwoFold.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestTwoFold.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestTwoFold.cs
new file mode 100644
index 0000000..3cecced
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestTwoFold.cs
@@ -0,0 +1,45 @@
+namespace org.apache.lucene.analysis.hunspell
+{
+
+	/*
+	 * 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 BeforeClass = org.junit.BeforeClass;
+
+	public class TestTwoFold : StemmerTestBase
+	{
+
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @BeforeClass public static void beforeClass() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public static void beforeClass()
+	  {
+		init("twofold.aff", "morph.dic");
+	  }
+
+	  public virtual void testExamples()
+	  {
+		assertStemsTo("drink", "drink");
+		assertStemsTo("drinkable", "drink");
+		assertStemsTo("drinkables", "drink");
+		assertStemsTo("drinksable");
+		assertStemsTo("drinkableable");
+		assertStemsTo("drinks");
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestTwoSuffixes.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestTwoSuffixes.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestTwoSuffixes.cs
new file mode 100644
index 0000000..23141fc
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestTwoSuffixes.cs
@@ -0,0 +1,44 @@
+namespace org.apache.lucene.analysis.hunspell
+{
+
+	/*
+	 * 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 BeforeClass = org.junit.BeforeClass;
+
+	public class TestTwoSuffixes : StemmerTestBase
+	{
+
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @BeforeClass public static void beforeClass() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public static void beforeClass()
+	  {
+		init("twosuffixes.aff", "twosuffixes.dic");
+	  }
+
+	  public virtual void testExamples()
+	  {
+		assertStemsTo("drink", "drink");
+		assertStemsTo("drinkable", "drink");
+		assertStemsTo("drinks", "drink");
+		assertStemsTo("drinkableable");
+		assertStemsTo("drinkss");
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hy/TestArmenianAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hy/TestArmenianAnalyzer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hy/TestArmenianAnalyzer.cs
new file mode 100644
index 0000000..861a2e3
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hy/TestArmenianAnalyzer.cs
@@ -0,0 +1,70 @@
+namespace org.apache.lucene.analysis.hy
+{
+
+	/*
+	 * 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 CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+
+	public class TestArmenianAnalyzer : BaseTokenStreamTestCase
+	{
+	  /// <summary>
+	  /// This test fails with NPE when the 
+	  /// stopwords file is missing in classpath 
+	  /// </summary>
+	  public virtual void testResourcesAvailable()
+	  {
+		new ArmenianAnalyzer(TEST_VERSION_CURRENT);
+	  }
+
+	  /// <summary>
+	  /// test stopwords and stemming </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBasics() throws java.io.IOException
+	  public virtual void testBasics()
+	  {
+		Analyzer a = new ArmenianAnalyzer(TEST_VERSION_CURRENT);
+		// stemming
+		checkOneTerm(a, "արծիվ", "արծ");
+		checkOneTerm(a, "արծիվներ", "արծ");
+		// stopword
+		assertAnalyzesTo(a, "է", new string[] { });
+	  }
+
+	  /// <summary>
+	  /// test use of exclusion set </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testExclude() throws java.io.IOException
+	  public virtual void testExclude()
+	  {
+		CharArraySet exclusionSet = new CharArraySet(TEST_VERSION_CURRENT, asSet("արծիվներ"), false);
+		Analyzer a = new ArmenianAnalyzer(TEST_VERSION_CURRENT, ArmenianAnalyzer.DefaultStopSet, exclusionSet);
+		checkOneTerm(a, "արծիվներ", "արծիվներ");
+		checkOneTerm(a, "արծիվ", "արծ");
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), new ArmenianAnalyzer(TEST_VERSION_CURRENT), 1000 * RANDOM_MULTIPLIER);
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Id/TestIndonesianAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Id/TestIndonesianAnalyzer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Id/TestIndonesianAnalyzer.cs
new file mode 100644
index 0000000..e38ea21
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Id/TestIndonesianAnalyzer.cs
@@ -0,0 +1,70 @@
+namespace org.apache.lucene.analysis.id
+{
+
+	/*
+	 * 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 CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+
+	public class TestIndonesianAnalyzer : BaseTokenStreamTestCase
+	{
+	  /// <summary>
+	  /// This test fails with NPE when the 
+	  /// stopwords file is missing in classpath 
+	  /// </summary>
+	  public virtual void testResourcesAvailable()
+	  {
+		new IndonesianAnalyzer(TEST_VERSION_CURRENT);
+	  }
+
+	  /// <summary>
+	  /// test stopwords and stemming </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBasics() throws java.io.IOException
+	  public virtual void testBasics()
+	  {
+		Analyzer a = new IndonesianAnalyzer(TEST_VERSION_CURRENT);
+		// stemming
+		checkOneTerm(a, "peledakan", "ledak");
+		checkOneTerm(a, "pembunuhan", "bunuh");
+		// stopword
+		assertAnalyzesTo(a, "bahwa", new string[] {});
+	  }
+
+	  /// <summary>
+	  /// test use of exclusion set </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testExclude() throws java.io.IOException
+	  public virtual void testExclude()
+	  {
+		CharArraySet exclusionSet = new CharArraySet(TEST_VERSION_CURRENT, asSet("peledakan"), false);
+		Analyzer a = new IndonesianAnalyzer(TEST_VERSION_CURRENT, IndonesianAnalyzer.DefaultStopSet, exclusionSet);
+		checkOneTerm(a, "peledakan", "peledakan");
+		checkOneTerm(a, "pembunuhan", "bunuh");
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), new IndonesianAnalyzer(TEST_VERSION_CURRENT), 1000 * RANDOM_MULTIPLIER);
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Id/TestIndonesianStemFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Id/TestIndonesianStemFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Id/TestIndonesianStemFilterFactory.cs
new file mode 100644
index 0000000..5210956
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Id/TestIndonesianStemFilterFactory.cs
@@ -0,0 +1,73 @@
+namespace org.apache.lucene.analysis.id
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the Indonesian stem filter factory is working.
+	/// </summary>
+	public class TestIndonesianStemFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+	  /// <summary>
+	  /// Ensure the filter actually stems text.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStemming() throws Exception
+	  public virtual void testStemming()
+	  {
+		Reader reader = new StringReader("dibukukannya");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("IndonesianStem").create(stream);
+		assertTokenStreamContents(stream, new string[] {"buku"});
+	  }
+
+	  /// <summary>
+	  /// Test inflectional-only mode
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStemmingInflectional() throws Exception
+	  public virtual void testStemmingInflectional()
+	  {
+		Reader reader = new StringReader("dibukukannya");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("IndonesianStem", "stemDerivational", "false").create(stream);
+		assertTokenStreamContents(stream, new string[] {"dibukukan"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("IndonesianStem", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Id/TestIndonesianStemmer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Id/TestIndonesianStemmer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Id/TestIndonesianStemmer.cs
new file mode 100644
index 0000000..3b9e5f3
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Id/TestIndonesianStemmer.cs
@@ -0,0 +1,187 @@
+namespace org.apache.lucene.analysis.id
+{
+
+	/*
+	 * 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 KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+
+	/// <summary>
+	/// Tests <seealso cref="IndonesianStemmer"/>
+	/// </summary>
+	public class TestIndonesianStemmer : BaseTokenStreamTestCase
+	{
+	  /* full stemming, no stopwords */
+	  internal Analyzer a = new AnalyzerAnonymousInnerClassHelper();
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  public AnalyzerAnonymousInnerClassHelper()
+		  {
+		  }
+
+		  public override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new IndonesianStemFilter(tokenizer));
+		  }
+	  }
+
+	  /// <summary>
+	  /// Some examples from the paper </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testExamples() throws java.io.IOException
+	  public virtual void testExamples()
+	  {
+		checkOneTerm(a, "bukukah", "buku");
+		checkOneTerm(a, "adalah", "ada");
+		checkOneTerm(a, "bukupun", "buku");
+		checkOneTerm(a, "bukuku", "buku");
+		checkOneTerm(a, "bukumu", "buku");
+		checkOneTerm(a, "bukunya", "buku");
+		checkOneTerm(a, "mengukur", "ukur");
+		checkOneTerm(a, "menyapu", "sapu");
+		checkOneTerm(a, "menduga", "duga");
+		checkOneTerm(a, "menuduh", "uduh");
+		checkOneTerm(a, "membaca", "baca");
+		checkOneTerm(a, "merusak", "rusak");
+		checkOneTerm(a, "pengukur", "ukur");
+		checkOneTerm(a, "penyapu", "sapu");
+		checkOneTerm(a, "penduga", "duga");
+		checkOneTerm(a, "pembaca", "baca");
+		checkOneTerm(a, "diukur", "ukur");
+		checkOneTerm(a, "tersapu", "sapu");
+		checkOneTerm(a, "kekasih", "kasih");
+		checkOneTerm(a, "berlari", "lari");
+		checkOneTerm(a, "belajar", "ajar");
+		checkOneTerm(a, "bekerja", "kerja");
+		checkOneTerm(a, "perjelas", "jelas");
+		checkOneTerm(a, "pelajar", "ajar");
+		checkOneTerm(a, "pekerja", "kerja");
+		checkOneTerm(a, "tarikkan", "tarik");
+		checkOneTerm(a, "ambilkan", "ambil");
+		checkOneTerm(a, "mengambilkan", "ambil");
+		checkOneTerm(a, "makanan", "makan");
+		checkOneTerm(a, "janjian", "janji");
+		checkOneTerm(a, "perjanjian", "janji");
+		checkOneTerm(a, "tandai", "tanda");
+		checkOneTerm(a, "dapati", "dapat");
+		checkOneTerm(a, "mendapati", "dapat");
+		checkOneTerm(a, "pantai", "panta");
+	  }
+
+	  /// <summary>
+	  /// Some detailed analysis examples (that might not be the best) </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testIRExamples() throws java.io.IOException
+	  public virtual void testIRExamples()
+	  {
+		checkOneTerm(a, "penyalahgunaan", "salahguna");
+		checkOneTerm(a, "menyalahgunakan", "salahguna");
+		checkOneTerm(a, "disalahgunakan", "salahguna");
+
+		checkOneTerm(a, "pertanggungjawaban", "tanggungjawab");
+		checkOneTerm(a, "mempertanggungjawabkan", "tanggungjawab");
+		checkOneTerm(a, "dipertanggungjawabkan", "tanggungjawab");
+
+		checkOneTerm(a, "pelaksanaan", "laksana");
+		checkOneTerm(a, "pelaksana", "laksana");
+		checkOneTerm(a, "melaksanakan", "laksana");
+		checkOneTerm(a, "dilaksanakan", "laksana");
+
+		checkOneTerm(a, "melibatkan", "libat");
+		checkOneTerm(a, "terlibat", "libat");
+
+		checkOneTerm(a, "penculikan", "culik");
+		checkOneTerm(a, "menculik", "culik");
+		checkOneTerm(a, "diculik", "culik");
+		checkOneTerm(a, "penculik", "culik");
+
+		checkOneTerm(a, "perubahan", "ubah");
+		checkOneTerm(a, "peledakan", "ledak");
+		checkOneTerm(a, "penanganan", "tangan");
+		checkOneTerm(a, "kepolisian", "polisi");
+		checkOneTerm(a, "kenaikan", "naik");
+		checkOneTerm(a, "bersenjata", "senjata");
+		checkOneTerm(a, "penyelewengan", "seleweng");
+		checkOneTerm(a, "kecelakaan", "celaka");
+	  }
+
+	  /* inflectional-only stemming */
+	  internal Analyzer b = new AnalyzerAnonymousInnerClassHelper2();
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  public AnalyzerAnonymousInnerClassHelper2()
+		  {
+		  }
+
+		  public override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new IndonesianStemFilter(tokenizer, false));
+		  }
+	  }
+
+	  /// <summary>
+	  /// Test stemming only inflectional suffixes </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testInflectionalOnly() throws java.io.IOException
+	  public virtual void testInflectionalOnly()
+	  {
+		checkOneTerm(b, "bukunya", "buku");
+		checkOneTerm(b, "bukukah", "buku");
+		checkOneTerm(b, "bukunyakah", "buku");
+		checkOneTerm(b, "dibukukannya", "dibukukan");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testShouldntStem() throws java.io.IOException
+	  public virtual void testShouldntStem()
+	  {
+		checkOneTerm(a, "bersenjata", "senjata");
+		checkOneTerm(a, "bukukah", "buku");
+		checkOneTerm(a, "gigi", "gigi");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper3(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper3 : Analyzer
+	  {
+		  private readonly TestIndonesianStemmer outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper3(TestIndonesianStemmer outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new IndonesianStemFilter(tokenizer));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/In/TestIndicNormalizer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/In/TestIndicNormalizer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/In/TestIndicNormalizer.cs
new file mode 100644
index 0000000..846bd4b
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/In/TestIndicNormalizer.cs
@@ -0,0 +1,80 @@
+namespace org.apache.lucene.analysis.@in
+{
+
+	/*
+	 * 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 KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+
+	/// <summary>
+	/// Test IndicNormalizer
+	/// </summary>
+	public class TestIndicNormalizer : BaseTokenStreamTestCase
+	{
+	  /// <summary>
+	  /// Test some basic normalization
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBasics() throws java.io.IOException
+	  public virtual void testBasics()
+	  {
+		check("अाॅअाॅ", "ऑऑ");
+		check("अाॆअाॆ", "ऒऒ");
+		check("अाेअाे", "ओओ");
+		check("अाैअाै", "औऔ");
+		check("अाअा", "आआ");
+		check("अाैर", "और");
+		// khanda-ta
+		check("ত্‍", "ৎ");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: private void check(String input, String output) throws java.io.IOException
+	  private void check(string input, string output)
+	  {
+		Tokenizer tokenizer = new MockTokenizer(new StringReader(input), MockTokenizer.WHITESPACE, false);
+		TokenFilter tf = new IndicNormalizationFilter(tokenizer);
+		assertTokenStreamContents(tf, new string[] {output});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestIndicNormalizer outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestIndicNormalizer outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new IndicNormalizationFilter(tokenizer));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/It/TestItalianAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/It/TestItalianAnalyzer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/It/TestItalianAnalyzer.cs
new file mode 100644
index 0000000..cedacaf
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/It/TestItalianAnalyzer.cs
@@ -0,0 +1,94 @@
+namespace org.apache.lucene.analysis.it
+{
+
+	/*
+	 * 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 CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+	using Version = org.apache.lucene.util.Version;
+
+	public class TestItalianAnalyzer : BaseTokenStreamTestCase
+	{
+	  /// <summary>
+	  /// This test fails with NPE when the 
+	  /// stopwords file is missing in classpath 
+	  /// </summary>
+	  public virtual void testResourcesAvailable()
+	  {
+		new ItalianAnalyzer(TEST_VERSION_CURRENT);
+	  }
+
+	  /// <summary>
+	  /// test stopwords and stemming </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBasics() throws java.io.IOException
+	  public virtual void testBasics()
+	  {
+		Analyzer a = new ItalianAnalyzer(TEST_VERSION_CURRENT);
+		// stemming
+		checkOneTerm(a, "abbandonata", "abbandonat");
+		checkOneTerm(a, "abbandonati", "abbandonat");
+		// stopword
+		assertAnalyzesTo(a, "dallo", new string[] {});
+	  }
+
+	  /// <summary>
+	  /// test use of exclusion set </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testExclude() throws java.io.IOException
+	  public virtual void testExclude()
+	  {
+		CharArraySet exclusionSet = new CharArraySet(TEST_VERSION_CURRENT, asSet("abbandonata"), false);
+		Analyzer a = new ItalianAnalyzer(TEST_VERSION_CURRENT, ItalianAnalyzer.DefaultStopSet, exclusionSet);
+		checkOneTerm(a, "abbandonata", "abbandonata");
+		checkOneTerm(a, "abbandonati", "abbandonat");
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), new ItalianAnalyzer(TEST_VERSION_CURRENT), 1000 * RANDOM_MULTIPLIER);
+	  }
+
+	  /// <summary>
+	  /// test that the elisionfilter is working </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testContractions() throws java.io.IOException
+	  public virtual void testContractions()
+	  {
+		Analyzer a = new ItalianAnalyzer(TEST_VERSION_CURRENT);
+		assertAnalyzesTo(a, "dell'Italia", new string[] {"ital"});
+		assertAnalyzesTo(a, "l'Italiano", new string[] {"italian"});
+	  }
+
+	  /// <summary>
+	  /// test that we don't enable this before 3.2 </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testContractionsBackwards() throws java.io.IOException
+	  public virtual void testContractionsBackwards()
+	  {
+		Analyzer a = new ItalianAnalyzer(Version.LUCENE_31);
+		assertAnalyzesTo(a, "dell'Italia", new string[] {"dell'ital"});
+		assertAnalyzesTo(a, "l'Italiano", new string[] {"l'ital"});
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/It/TestItalianLightStemFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/It/TestItalianLightStemFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/It/TestItalianLightStemFilter.cs
new file mode 100644
index 0000000..9710b7b
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/It/TestItalianLightStemFilter.cs
@@ -0,0 +1,90 @@
+namespace org.apache.lucene.analysis.it
+{
+
+	/*
+	 * 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 KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+
+//JAVA TO C# CONVERTER TODO TASK: This Java 'import static' statement cannot be converted to C#:
+//	import static org.apache.lucene.analysis.VocabularyAssert.*;
+
+	/// <summary>
+	/// Simple tests for <seealso cref="ItalianLightStemFilter"/>
+	/// </summary>
+	public class TestItalianLightStemFilter : BaseTokenStreamTestCase
+	{
+	  private Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper();
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  public AnalyzerAnonymousInnerClassHelper()
+		  {
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer source = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(source, new ItalianLightStemFilter(source));
+		  }
+	  }
+
+	  /// <summary>
+	  /// Test against a vocabulary from the reference impl </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testVocabulary() throws java.io.IOException
+	  public virtual void testVocabulary()
+	  {
+		assertVocabulary(analyzer, getDataFile("itlighttestdata.zip"), "itlight.txt");
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), analyzer, 1000 * RANDOM_MULTIPLIER);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper2(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestItalianLightStemFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestItalianLightStemFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new ItalianLightStemFilter(tokenizer));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/It/TestItalianLightStemFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/It/TestItalianLightStemFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/It/TestItalianLightStemFilterFactory.cs
new file mode 100644
index 0000000..f09f646
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/It/TestItalianLightStemFilterFactory.cs
@@ -0,0 +1,57 @@
+namespace org.apache.lucene.analysis.it
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the Italian light stem factory is working.
+	/// </summary>
+	public class TestItalianLightStemFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStemming() throws Exception
+	  public virtual void testStemming()
+	  {
+		Reader reader = new StringReader("ragazzo ragazzi");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("ItalianLightStem").create(stream);
+		assertTokenStreamContents(stream, new string[] {"ragazz", "ragazz"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("ItalianLightStem", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Lv/TestLatvianAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Lv/TestLatvianAnalyzer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Lv/TestLatvianAnalyzer.cs
new file mode 100644
index 0000000..1f2a61e
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Lv/TestLatvianAnalyzer.cs
@@ -0,0 +1,70 @@
+namespace org.apache.lucene.analysis.lv
+{
+
+	/*
+	 * 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 CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+
+	public class TestLatvianAnalyzer : BaseTokenStreamTestCase
+	{
+	  /// <summary>
+	  /// This test fails with NPE when the 
+	  /// stopwords file is missing in classpath 
+	  /// </summary>
+	  public virtual void testResourcesAvailable()
+	  {
+		new LatvianAnalyzer(TEST_VERSION_CURRENT);
+	  }
+
+	  /// <summary>
+	  /// test stopwords and stemming </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBasics() throws java.io.IOException
+	  public virtual void testBasics()
+	  {
+		Analyzer a = new LatvianAnalyzer(TEST_VERSION_CURRENT);
+		// stemming
+		checkOneTerm(a, "tirgiem", "tirg");
+		checkOneTerm(a, "tirgus", "tirg");
+		// stopword
+		assertAnalyzesTo(a, "un", new string[] {});
+	  }
+
+	  /// <summary>
+	  /// test use of exclusion set </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testExclude() throws java.io.IOException
+	  public virtual void testExclude()
+	  {
+		CharArraySet exclusionSet = new CharArraySet(TEST_VERSION_CURRENT, asSet("tirgiem"), false);
+		Analyzer a = new LatvianAnalyzer(TEST_VERSION_CURRENT, LatvianAnalyzer.DefaultStopSet, exclusionSet);
+		checkOneTerm(a, "tirgiem", "tirgiem");
+		checkOneTerm(a, "tirgus", "tirg");
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), new LatvianAnalyzer(TEST_VERSION_CURRENT), 1000 * RANDOM_MULTIPLIER);
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Lv/TestLatvianStemFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Lv/TestLatvianStemFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Lv/TestLatvianStemFilterFactory.cs
new file mode 100644
index 0000000..0bb4be7
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Lv/TestLatvianStemFilterFactory.cs
@@ -0,0 +1,57 @@
+namespace org.apache.lucene.analysis.lv
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the Latvian stem factory is working.
+	/// </summary>
+	public class TestLatvianStemFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStemming() throws Exception
+	  public virtual void testStemming()
+	  {
+		Reader reader = new StringReader("tirgiem tirgus");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("LatvianStem").create(stream);
+		assertTokenStreamContents(stream, new string[] {"tirg", "tirg"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("LatvianStem", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Lv/TestLatvianStemmer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Lv/TestLatvianStemmer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Lv/TestLatvianStemmer.cs
new file mode 100644
index 0000000..b3c5610
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Lv/TestLatvianStemmer.cs
@@ -0,0 +1,328 @@
+namespace org.apache.lucene.analysis.lv
+{
+
+	/*
+	 * 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 KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+
+	/// <summary>
+	/// Basic tests for <seealso cref="LatvianStemmer"/>
+	/// </summary>
+	public class TestLatvianStemmer : BaseTokenStreamTestCase
+	{
+	  private Analyzer a = new AnalyzerAnonymousInnerClassHelper();
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  public AnalyzerAnonymousInnerClassHelper()
+		  {
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(tokenizer, new LatvianStemFilter(tokenizer));
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNouns1() throws java.io.IOException
+	  public virtual void testNouns1()
+	  {
+		// decl. I
+		checkOneTerm(a, "tēvs", "tēv"); // nom. sing.
+		checkOneTerm(a, "tēvi", "tēv"); // nom. pl.
+		checkOneTerm(a, "tēva", "tēv"); // gen. sing.
+		checkOneTerm(a, "tēvu", "tēv"); // gen. pl.
+		checkOneTerm(a, "tēvam", "tēv"); // dat. sing.
+		checkOneTerm(a, "tēviem", "tēv"); // dat. pl.
+		checkOneTerm(a, "tēvu", "tēv"); // acc. sing.
+		checkOneTerm(a, "tēvus", "tēv"); // acc. pl.
+		checkOneTerm(a, "tēvā", "tēv"); // loc. sing.
+		checkOneTerm(a, "tēvos", "tēv"); // loc. pl.
+		checkOneTerm(a, "tēvs", "tēv"); // voc. sing.
+		checkOneTerm(a, "tēvi", "tēv"); // voc. pl.
+	  }
+
+	  /// <summary>
+	  /// decl II nouns with (s,t) -> š and (d,z) -> ž
+	  /// palatalization will generally conflate to two stems
+	  /// due to the ambiguity (plural and singular).
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNouns2() throws java.io.IOException
+	  public virtual void testNouns2()
+	  {
+		// decl. II
+
+		// c -> č palatalization
+		checkOneTerm(a, "lācis", "lāc"); // nom. sing.
+		checkOneTerm(a, "lāči", "lāc"); // nom. pl.
+		checkOneTerm(a, "lāča", "lāc"); // gen. sing.
+		checkOneTerm(a, "lāču", "lāc"); // gen. pl.
+		checkOneTerm(a, "lācim", "lāc"); // dat. sing.
+		checkOneTerm(a, "lāčiem", "lāc"); // dat. pl.
+		checkOneTerm(a, "lāci", "lāc"); // acc. sing.
+		checkOneTerm(a, "lāčus", "lāc"); // acc. pl.
+		checkOneTerm(a, "lācī", "lāc"); // loc. sing.
+		checkOneTerm(a, "lāčos", "lāc"); // loc. pl.
+		checkOneTerm(a, "lāci", "lāc"); // voc. sing.
+		checkOneTerm(a, "lāči", "lāc"); // voc. pl.
+
+		// n -> ņ palatalization
+		checkOneTerm(a, "akmens", "akmen"); // nom. sing.
+		checkOneTerm(a, "akmeņi", "akmen"); // nom. pl.
+		checkOneTerm(a, "akmens", "akmen"); // gen. sing.
+		checkOneTerm(a, "akmeņu", "akmen"); // gen. pl.
+		checkOneTerm(a, "akmenim", "akmen"); // dat. sing.
+		checkOneTerm(a, "akmeņiem", "akmen"); // dat. pl.
+		checkOneTerm(a, "akmeni", "akmen"); // acc. sing.
+		checkOneTerm(a, "akmeņus", "akmen"); // acc. pl.
+		checkOneTerm(a, "akmenī", "akmen"); // loc. sing.
+		checkOneTerm(a, "akmeņos", "akmen"); // loc. pl.
+		checkOneTerm(a, "akmens", "akmen"); // voc. sing.
+		checkOneTerm(a, "akmeņi", "akmen"); // voc. pl.
+
+		// no palatalization
+		checkOneTerm(a, "kurmis", "kurm"); // nom. sing.
+		checkOneTerm(a, "kurmji", "kurm"); // nom. pl.
+		checkOneTerm(a, "kurmja", "kurm"); // gen. sing.
+		checkOneTerm(a, "kurmju", "kurm"); // gen. pl.
+		checkOneTerm(a, "kurmim", "kurm"); // dat. sing.
+		checkOneTerm(a, "kurmjiem", "kurm"); // dat. pl.
+		checkOneTerm(a, "kurmi", "kurm"); // acc. sing.
+		checkOneTerm(a, "kurmjus", "kurm"); // acc. pl.
+		checkOneTerm(a, "kurmī", "kurm"); // loc. sing.
+		checkOneTerm(a, "kurmjos", "kurm"); // loc. pl.
+		checkOneTerm(a, "kurmi", "kurm"); // voc. sing.
+		checkOneTerm(a, "kurmji", "kurm"); // voc. pl.
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNouns3() throws java.io.IOException
+	  public virtual void testNouns3()
+	  {
+		// decl III
+		checkOneTerm(a, "lietus", "liet"); // nom. sing.
+		checkOneTerm(a, "lieti", "liet"); // nom. pl.
+		checkOneTerm(a, "lietus", "liet"); // gen. sing.
+		checkOneTerm(a, "lietu", "liet"); // gen. pl.
+		checkOneTerm(a, "lietum", "liet"); // dat. sing.
+		checkOneTerm(a, "lietiem", "liet"); // dat. pl.
+		checkOneTerm(a, "lietu", "liet"); // acc. sing.
+		checkOneTerm(a, "lietus", "liet"); // acc. pl.
+		checkOneTerm(a, "lietū", "liet"); // loc. sing.
+		checkOneTerm(a, "lietos", "liet"); // loc. pl.
+		checkOneTerm(a, "lietus", "liet"); // voc. sing.
+		checkOneTerm(a, "lieti", "liet"); // voc. pl.
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNouns4() throws java.io.IOException
+	  public virtual void testNouns4()
+	  {
+		// decl IV
+		checkOneTerm(a, "lapa", "lap"); // nom. sing.
+		checkOneTerm(a, "lapas", "lap"); // nom. pl.
+		checkOneTerm(a, "lapas", "lap"); // gen. sing.
+		checkOneTerm(a, "lapu", "lap"); // gen. pl.
+		checkOneTerm(a, "lapai", "lap"); // dat. sing.
+		checkOneTerm(a, "lapām", "lap"); // dat. pl.
+		checkOneTerm(a, "lapu", "lap"); // acc. sing.
+		checkOneTerm(a, "lapas", "lap"); // acc. pl.
+		checkOneTerm(a, "lapā", "lap"); // loc. sing.
+		checkOneTerm(a, "lapās", "lap"); // loc. pl.
+		checkOneTerm(a, "lapa", "lap"); // voc. sing.
+		checkOneTerm(a, "lapas", "lap"); // voc. pl.
+
+		checkOneTerm(a, "puika", "puik"); // nom. sing.
+		checkOneTerm(a, "puikas", "puik"); // nom. pl.
+		checkOneTerm(a, "puikas", "puik"); // gen. sing.
+		checkOneTerm(a, "puiku", "puik"); // gen. pl.
+		checkOneTerm(a, "puikam", "puik"); // dat. sing.
+		checkOneTerm(a, "puikām", "puik"); // dat. pl.
+		checkOneTerm(a, "puiku", "puik"); // acc. sing.
+		checkOneTerm(a, "puikas", "puik"); // acc. pl.
+		checkOneTerm(a, "puikā", "puik"); // loc. sing.
+		checkOneTerm(a, "puikās", "puik"); // loc. pl.
+		checkOneTerm(a, "puika", "puik"); // voc. sing.
+		checkOneTerm(a, "puikas", "puik"); // voc. pl.
+	  }
+
+	  /// <summary>
+	  /// Genitive plural forms with (s,t) -> š and (d,z) -> ž
+	  /// will not conflate due to ambiguity.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNouns5() throws java.io.IOException
+	  public virtual void testNouns5()
+	  {
+		// decl V
+		// l -> ļ palatalization
+		checkOneTerm(a, "egle", "egl"); // nom. sing.
+		checkOneTerm(a, "egles", "egl"); // nom. pl.
+		checkOneTerm(a, "egles", "egl"); // gen. sing.
+		checkOneTerm(a, "egļu", "egl"); // gen. pl.
+		checkOneTerm(a, "eglei", "egl"); // dat. sing.
+		checkOneTerm(a, "eglēm", "egl"); // dat. pl.
+		checkOneTerm(a, "egli", "egl"); // acc. sing.
+		checkOneTerm(a, "egles", "egl"); // acc. pl.
+		checkOneTerm(a, "eglē", "egl"); // loc. sing.
+		checkOneTerm(a, "eglēs", "egl"); // loc. pl.
+		checkOneTerm(a, "egle", "egl"); // voc. sing.
+		checkOneTerm(a, "egles", "egl"); // voc. pl.
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNouns6() throws java.io.IOException
+	  public virtual void testNouns6()
+	  {
+		// decl VI
+
+		// no palatalization
+		checkOneTerm(a, "govs", "gov"); // nom. sing.
+		checkOneTerm(a, "govis", "gov"); // nom. pl.
+		checkOneTerm(a, "govs", "gov"); // gen. sing.
+		checkOneTerm(a, "govju", "gov"); // gen. pl.
+		checkOneTerm(a, "govij", "gov"); // dat. sing.
+		checkOneTerm(a, "govīm", "gov"); // dat. pl.
+		checkOneTerm(a, "govi ", "gov"); // acc. sing.
+		checkOneTerm(a, "govis", "gov"); // acc. pl.
+		checkOneTerm(a, "govi ", "gov"); // inst. sing.
+		checkOneTerm(a, "govīm", "gov"); // inst. pl.
+		checkOneTerm(a, "govī", "gov"); // loc. sing.
+		checkOneTerm(a, "govīs", "gov"); // loc. pl.
+		checkOneTerm(a, "govs", "gov"); // voc. sing.
+		checkOneTerm(a, "govis", "gov"); // voc. pl.
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testAdjectives() throws java.io.IOException
+	  public virtual void testAdjectives()
+	  {
+		checkOneTerm(a, "zils", "zil"); // indef. nom. masc. sing.
+		checkOneTerm(a, "zilais", "zil"); // def. nom. masc. sing.
+		checkOneTerm(a, "zili", "zil"); // indef. nom. masc. pl.
+		checkOneTerm(a, "zilie", "zil"); // def. nom. masc. pl.
+		checkOneTerm(a, "zila", "zil"); // indef. nom. fem. sing.
+		checkOneTerm(a, "zilā", "zil"); // def. nom. fem. sing.
+		checkOneTerm(a, "zilas", "zil"); // indef. nom. fem. pl.
+		checkOneTerm(a, "zilās", "zil"); // def. nom. fem. pl.
+		checkOneTerm(a, "zila", "zil"); // indef. gen. masc. sing.
+		checkOneTerm(a, "zilā", "zil"); // def. gen. masc. sing.
+		checkOneTerm(a, "zilu", "zil"); // indef. gen. masc. pl.
+		checkOneTerm(a, "zilo", "zil"); // def. gen. masc. pl.
+		checkOneTerm(a, "zilas", "zil"); // indef. gen. fem. sing.
+		checkOneTerm(a, "zilās", "zil"); // def. gen. fem. sing.
+		checkOneTerm(a, "zilu", "zil"); // indef. gen. fem. pl.
+		checkOneTerm(a, "zilo", "zil"); // def. gen. fem. pl.
+		checkOneTerm(a, "zilam", "zil"); // indef. dat. masc. sing.
+		checkOneTerm(a, "zilajam", "zil"); // def. dat. masc. sing.
+		checkOneTerm(a, "ziliem", "zil"); // indef. dat. masc. pl.
+		checkOneTerm(a, "zilajiem", "zil"); // def. dat. masc. pl.
+		checkOneTerm(a, "zilai", "zil"); // indef. dat. fem. sing.
+		checkOneTerm(a, "zilajai", "zil"); // def. dat. fem. sing.
+		checkOneTerm(a, "zilām", "zil"); // indef. dat. fem. pl.
+		checkOneTerm(a, "zilajām", "zil"); // def. dat. fem. pl.
+		checkOneTerm(a, "zilu", "zil"); // indef. acc. masc. sing.
+		checkOneTerm(a, "zilo", "zil"); // def. acc. masc. sing.
+		checkOneTerm(a, "zilus", "zil"); // indef. acc. masc. pl.
+		checkOneTerm(a, "zilos", "zil"); // def. acc. masc. pl.
+		checkOneTerm(a, "zilu", "zil"); // indef. acc. fem. sing.
+		checkOneTerm(a, "zilo", "zil"); // def. acc. fem. sing.
+		checkOneTerm(a, "zilās", "zil"); // indef. acc. fem. pl.
+		checkOneTerm(a, "zilās", "zil"); // def. acc. fem. pl.
+		checkOneTerm(a, "zilā", "zil"); // indef. loc. masc. sing.
+		checkOneTerm(a, "zilajā", "zil"); // def. loc. masc. sing.
+		checkOneTerm(a, "zilos", "zil"); // indef. loc. masc. pl.
+		checkOneTerm(a, "zilajos", "zil"); // def. loc. masc. pl.
+		checkOneTerm(a, "zilā", "zil"); // indef. loc. fem. sing.
+		checkOneTerm(a, "zilajā", "zil"); // def. loc. fem. sing.
+		checkOneTerm(a, "zilās", "zil"); // indef. loc. fem. pl.
+		checkOneTerm(a, "zilajās", "zil"); // def. loc. fem. pl.
+		checkOneTerm(a, "zilais", "zil"); // voc. masc. sing.
+		checkOneTerm(a, "zilie", "zil"); // voc. masc. pl.
+		checkOneTerm(a, "zilā", "zil"); // voc. fem. sing.
+		checkOneTerm(a, "zilās", "zil"); // voc. fem. pl.
+	  }
+
+	  /// <summary>
+	  /// Note: we intentionally don't handle the ambiguous
+	  /// (s,t) -> š and (d,z) -> ž
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testPalatalization() throws java.io.IOException
+	  public virtual void testPalatalization()
+	  {
+		checkOneTerm(a, "krāsns", "krāsn"); // nom. sing.
+		checkOneTerm(a, "krāšņu", "krāsn"); // gen. pl.
+		checkOneTerm(a, "zvaigzne", "zvaigzn"); // nom. sing.
+		checkOneTerm(a, "zvaigžņu", "zvaigzn"); // gen. pl.
+		checkOneTerm(a, "kāpslis", "kāpsl"); // nom. sing.
+		checkOneTerm(a, "kāpšļu", "kāpsl"); // gen. pl.
+		checkOneTerm(a, "zizlis", "zizl"); // nom. sing.
+		checkOneTerm(a, "zižļu", "zizl"); // gen. pl.
+		checkOneTerm(a, "vilnis", "viln"); // nom. sing.
+		checkOneTerm(a, "viļņu", "viln"); // gen. pl.
+		checkOneTerm(a, "lelle", "lell"); // nom. sing.
+		checkOneTerm(a, "leļļu", "lell"); // gen. pl.
+		checkOneTerm(a, "pinne", "pinn"); // nom. sing.
+		checkOneTerm(a, "piņņu", "pinn"); // gen. pl.
+		checkOneTerm(a, "rīkste", "rīkst"); // nom. sing.
+		checkOneTerm(a, "rīkšu", "rīkst"); // gen. pl.
+	  }
+
+	  /// <summary>
+	  /// Test some length restrictions, we require a 3+ char stem,
+	  /// with at least one vowel.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testLength() throws java.io.IOException
+	  public virtual void testLength()
+	  {
+		checkOneTerm(a, "usa", "usa"); // length
+		checkOneTerm(a, "60ms", "60ms"); // vowel count
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper2(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestLatvianStemmer outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestLatvianStemmer outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new LatvianStemFilter(tokenizer));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/PatternAnalyzerTest.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/PatternAnalyzerTest.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/PatternAnalyzerTest.cs
new file mode 100644
index 0000000..de1db38
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/PatternAnalyzerTest.cs
@@ -0,0 +1,214 @@
+using System;
+using System.Text;
+using System.Threading;
+
+namespace org.apache.lucene.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 UncaughtExceptionHandler = Thread.UncaughtExceptionHandler;
+
+	using StopAnalyzer = org.apache.lucene.analysis.core.StopAnalyzer;
+
+	/// <summary>
+	/// Verifies the behavior of PatternAnalyzer.
+	/// </summary>
+	public class PatternAnalyzerTest : BaseTokenStreamTestCase
+	{
+
+	  /// <summary>
+	  /// Test PatternAnalyzer when it is configured with a non-word pattern.
+	  /// Behavior can be similar to SimpleAnalyzer (depending upon options)
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNonWordPattern() throws java.io.IOException
+	  public virtual void testNonWordPattern()
+	  {
+		// Split on non-letter pattern, do not lowercase, no stopwords
+		PatternAnalyzer a = new PatternAnalyzer(TEST_VERSION_CURRENT, PatternAnalyzer.NON_WORD_PATTERN, false, null);
+		check(a, "The quick brown Fox,the abcd1234 (56.78) dc.", new string[] {"The", "quick", "brown", "Fox", "the", "abcd", "dc"});
+
+		// split on non-letter pattern, lowercase, english stopwords
+		PatternAnalyzer b = new PatternAnalyzer(TEST_VERSION_CURRENT, PatternAnalyzer.NON_WORD_PATTERN, true, StopAnalyzer.ENGLISH_STOP_WORDS_SET);
+		check(b, "The quick brown Fox,the abcd1234 (56.78) dc.", new string[] {"quick", "brown", "fox", "abcd", "dc"});
+	  }
+
+	  /// <summary>
+	  /// Test PatternAnalyzer when it is configured with a whitespace pattern.
+	  /// Behavior can be similar to WhitespaceAnalyzer (depending upon options)
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testWhitespacePattern() throws java.io.IOException
+	  public virtual void testWhitespacePattern()
+	  {
+		// Split on whitespace patterns, do not lowercase, no stopwords
+		PatternAnalyzer a = new PatternAnalyzer(TEST_VERSION_CURRENT, PatternAnalyzer.WHITESPACE_PATTERN, false, null);
+		check(a, "The quick brown Fox,the abcd1234 (56.78) dc.", new string[] {"The", "quick", "brown", "Fox,the", "abcd1234", "(56.78)", "dc."});
+
+		// Split on whitespace patterns, lowercase, english stopwords
+		PatternAnalyzer b = new PatternAnalyzer(TEST_VERSION_CURRENT, PatternAnalyzer.WHITESPACE_PATTERN, true, StopAnalyzer.ENGLISH_STOP_WORDS_SET);
+		check(b, "The quick brown Fox,the abcd1234 (56.78) dc.", new string[] {"quick", "brown", "fox,the", "abcd1234", "(56.78)", "dc."});
+	  }
+
+	  /// <summary>
+	  /// Test PatternAnalyzer when it is configured with a custom pattern. In this
+	  /// case, text is tokenized on the comma ","
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCustomPattern() throws java.io.IOException
+	  public virtual void testCustomPattern()
+	  {
+		// Split on comma, do not lowercase, no stopwords
+		PatternAnalyzer a = new PatternAnalyzer(TEST_VERSION_CURRENT, Pattern.compile(","), false, null);
+		check(a, "Here,Are,some,Comma,separated,words,", new string[] {"Here", "Are", "some", "Comma", "separated", "words"});
+
+		// split on comma, lowercase, english stopwords
+		PatternAnalyzer b = new PatternAnalyzer(TEST_VERSION_CURRENT, Pattern.compile(","), true, StopAnalyzer.ENGLISH_STOP_WORDS_SET);
+		check(b, "Here,Are,some,Comma,separated,words,", new string[] {"here", "some", "comma", "separated", "words"});
+	  }
+
+	  /// <summary>
+	  /// Test PatternAnalyzer against a large document.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testHugeDocument() throws java.io.IOException
+	  public virtual void testHugeDocument()
+	  {
+		StringBuilder document = new StringBuilder();
+		// 5000 a's
+		char[] largeWord = new char[5000];
+		Arrays.fill(largeWord, 'a');
+		document.Append(largeWord);
+
+		// a space
+		document.Append(' ');
+
+		// 2000 b's
+		char[] largeWord2 = new char[2000];
+		Arrays.fill(largeWord2, 'b');
+		document.Append(largeWord2);
+
+		// Split on whitespace patterns, do not lowercase, no stopwords
+		PatternAnalyzer a = new PatternAnalyzer(TEST_VERSION_CURRENT, PatternAnalyzer.WHITESPACE_PATTERN, false, null);
+		check(a, document.ToString(), new string[]
+		{
+			new string(largeWord),
+			new string(largeWord2)
+		});
+	  }
+
+	  /// <summary>
+	  /// Verify the analyzer analyzes to the expected contents. For PatternAnalyzer,
+	  /// several methods are verified:
+	  /// <ul>
+	  /// <li>Analysis with a normal Reader
+	  /// <li>Analysis with a FastStringReader
+	  /// <li>Analysis with a String
+	  /// </ul>
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: private void check(PatternAnalyzer analyzer, String document, String expected[]) throws java.io.IOException
+	  private void check(PatternAnalyzer analyzer, string document, string[] expected)
+	  {
+		// ordinary analysis of a Reader
+		assertAnalyzesTo(analyzer, document, expected);
+
+		// analysis with a "FastStringReader"
+		TokenStream ts = analyzer.tokenStream("dummy", new PatternAnalyzer.FastStringReader(document));
+		assertTokenStreamContents(ts, expected);
+
+		// analysis of a String, uses PatternAnalyzer.tokenStream(String, String)
+		TokenStream ts2 = analyzer.tokenStream("dummy", new StringReader(document));
+		assertTokenStreamContents(ts2, expected);
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		Analyzer a = new PatternAnalyzer(TEST_VERSION_CURRENT, Pattern.compile(","), true, StopAnalyzer.ENGLISH_STOP_WORDS_SET);
+
+		// dodge jre bug http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7104012
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final Thread.UncaughtExceptionHandler savedHandler = Thread.getDefaultUncaughtExceptionHandler();
+		UncaughtExceptionHandler savedHandler = Thread.DefaultUncaughtExceptionHandler;
+		Thread.DefaultUncaughtExceptionHandler = new UncaughtExceptionHandlerAnonymousInnerClassHelper(this, savedHandler);
+
+		try
+		{
+		  Thread.DefaultUncaughtExceptionHandler;
+		  checkRandomData(random(), a, 10000 * RANDOM_MULTIPLIER);
+		}
+		catch (System.IndexOutOfRangeException ex)
+		{
+		  assumeTrue("not failing due to jre bug ", !isJREBug7104012(ex));
+		  throw ex; // otherwise rethrow
+		}
+		finally
+		{
+		  Thread.DefaultUncaughtExceptionHandler = savedHandler;
+		}
+	  }
+
+	  private class UncaughtExceptionHandlerAnonymousInnerClassHelper : UncaughtExceptionHandler
+	  {
+		  private readonly PatternAnalyzerTest outerInstance;
+
+		  private UncaughtExceptionHandler savedHandler;
+
+		  public UncaughtExceptionHandlerAnonymousInnerClassHelper(PatternAnalyzerTest outerInstance, UncaughtExceptionHandler savedHandler)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.savedHandler = savedHandler;
+		  }
+
+		  public override void uncaughtException(Thread thread, Exception throwable)
+		  {
+			assumeTrue("not failing due to jre bug ", !isJREBug7104012(throwable));
+			// otherwise its some other bug, pass to default handler
+			savedHandler.uncaughtException(thread, throwable);
+		  }
+	  }
+
+	  internal static bool isJREBug7104012(Exception t)
+	  {
+		if (!(t is System.IndexOutOfRangeException))
+		{
+		  // BaseTokenStreamTestCase now wraps exc in a new RuntimeException:
+		  t = t.InnerException;
+		  if (!(t is System.IndexOutOfRangeException))
+		  {
+			return false;
+		  }
+		}
+		StackTraceElement[] trace = t.StackTrace;
+		foreach (StackTraceElement st in trace)
+		{
+		  if ("java.text.RuleBasedBreakIterator".Equals(st.ClassName) || "sun.util.locale.provider.RuleBasedBreakIterator".Equals(st.ClassName) && "lookupBackwardState".Equals(st.MethodName))
+		  {
+			return true;
+		  }
+		}
+		return false;
+	  }
+	}
+
+}
\ No newline at end of file


[02/27] lucenenet git commit: adding converted analysis common tests

Posted by sy...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestCharArraySet.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestCharArraySet.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestCharArraySet.cs
new file mode 100644
index 0000000..783c4ce
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestCharArraySet.cs
@@ -0,0 +1,593 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace org.apache.lucene.analysis.util
+{
+
+	/*
+	 * Licensed to the Apache Software Foundation (ASF) under one or more
+	 * contributor license agreements.  See the NOTICE file distributed with
+	 * this work for additional information regarding copyright ownership.
+	 * The ASF licenses this file to You under the Apache License, Version 2.0
+	 * (the "License"); you may not use this file except in compliance with
+	 * the License.  You may obtain a copy of the License at
+	 *
+	 *     http://www.apache.org/licenses/LICENSE-2.0
+	 *
+	 * Unless required by applicable law or agreed to in writing, software
+	 * distributed under the License is distributed on an "AS IS" BASIS,
+	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+	 * See the License for the specific language governing permissions and
+	 * limitations under the License.
+	 */
+
+	using LuceneTestCase = org.apache.lucene.util.LuceneTestCase;
+	using Version = org.apache.lucene.util.Version;
+
+
+	public class TestCharArraySet : LuceneTestCase
+	{
+
+	  internal static readonly string[] TEST_STOP_WORDS = new string[] {"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"};
+
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRehash() throws Exception
+	  public virtual void testRehash()
+	  {
+		CharArraySet cas = new CharArraySet(TEST_VERSION_CURRENT, 0, true);
+		for (int i = 0;i < TEST_STOP_WORDS.Length;i++)
+		{
+		  cas.add(TEST_STOP_WORDS[i]);
+		}
+		assertEquals(TEST_STOP_WORDS.Length, cas.size());
+		for (int i = 0;i < TEST_STOP_WORDS.Length;i++)
+		{
+		  assertTrue(cas.contains(TEST_STOP_WORDS[i]));
+		}
+	  }
+
+	  public virtual void testNonZeroOffset()
+	  {
+		string[] words = new string[] {"Hello","World","this","is","a","test"};
+		char[] findme = "xthisy".ToCharArray();
+		CharArraySet set = new CharArraySet(TEST_VERSION_CURRENT, 10, true);
+		set.addAll(words);
+		assertTrue(set.contains(findme, 1, 4));
+		assertTrue(set.contains(new string(findme,1,4)));
+
+		// test unmodifiable
+		set = CharArraySet.unmodifiableSet(set);
+		assertTrue(set.contains(findme, 1, 4));
+		assertTrue(set.contains(new string(findme,1,4)));
+	  }
+
+	  public virtual void testObjectContains()
+	  {
+		CharArraySet set = new CharArraySet(TEST_VERSION_CURRENT, 10, true);
+		int? val = Convert.ToInt32(1);
+		set.add(val);
+		assertTrue(set.contains(val));
+		assertTrue(set.contains(new int?(1))); // another integer
+		assertTrue(set.contains("1"));
+		assertTrue(set.contains(new char[]{'1'}));
+		// test unmodifiable
+		set = CharArraySet.unmodifiableSet(set);
+		assertTrue(set.contains(val));
+		assertTrue(set.contains(new int?(1))); // another integer
+		assertTrue(set.contains("1"));
+		assertTrue(set.contains(new char[]{'1'}));
+	  }
+
+	  public virtual void testClear()
+	  {
+		CharArraySet set = new CharArraySet(TEST_VERSION_CURRENT, 10,true);
+		set.addAll(TEST_STOP_WORDS);
+		assertEquals("Not all words added", TEST_STOP_WORDS.Length, set.size());
+		set.clear();
+		assertEquals("not empty", 0, set.size());
+		for (int i = 0;i < TEST_STOP_WORDS.Length;i++)
+		{
+		  assertFalse(set.contains(TEST_STOP_WORDS[i]));
+		}
+		set.addAll(TEST_STOP_WORDS);
+		assertEquals("Not all words added", TEST_STOP_WORDS.Length, set.size());
+		for (int i = 0;i < TEST_STOP_WORDS.Length;i++)
+		{
+		  assertTrue(set.contains(TEST_STOP_WORDS[i]));
+		}
+	  }
+
+	  public virtual void testModifyOnUnmodifiable()
+	  {
+		CharArraySet set = new CharArraySet(TEST_VERSION_CURRENT, 10, true);
+		set.addAll(TEST_STOP_WORDS);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int size = set.size();
+		int size = set.size();
+		set = CharArraySet.unmodifiableSet(set);
+		assertEquals("Set size changed due to unmodifiableSet call", size, set.size());
+		string NOT_IN_SET = "SirGallahad";
+		assertFalse("Test String already exists in set", set.contains(NOT_IN_SET));
+
+		try
+		{
+		  set.add(NOT_IN_SET.ToCharArray());
+		  fail("Modified unmodifiable set");
+		}
+		catch (System.NotSupportedException)
+		{
+		  // expected
+		  assertFalse("Test String has been added to unmodifiable set", set.contains(NOT_IN_SET));
+		  assertEquals("Size of unmodifiable set has changed", size, set.size());
+		}
+
+		try
+		{
+		  set.add(NOT_IN_SET);
+		  fail("Modified unmodifiable set");
+		}
+		catch (System.NotSupportedException)
+		{
+		  // expected
+		  assertFalse("Test String has been added to unmodifiable set", set.contains(NOT_IN_SET));
+		  assertEquals("Size of unmodifiable set has changed", size, set.size());
+		}
+
+		try
+		{
+		  set.add(new StringBuilder(NOT_IN_SET));
+		  fail("Modified unmodifiable set");
+		}
+		catch (System.NotSupportedException)
+		{
+		  // expected
+		  assertFalse("Test String has been added to unmodifiable set", set.contains(NOT_IN_SET));
+		  assertEquals("Size of unmodifiable set has changed", size, set.size());
+		}
+
+		try
+		{
+		  set.clear();
+		  fail("Modified unmodifiable set");
+		}
+		catch (System.NotSupportedException)
+		{
+		  // expected
+		  assertFalse("Changed unmodifiable set", set.contains(NOT_IN_SET));
+		  assertEquals("Size of unmodifiable set has changed", size, set.size());
+		}
+		try
+		{
+		  set.add((object) NOT_IN_SET);
+		  fail("Modified unmodifiable set");
+		}
+		catch (System.NotSupportedException)
+		{
+		  // expected
+		  assertFalse("Test String has been added to unmodifiable set", set.contains(NOT_IN_SET));
+		  assertEquals("Size of unmodifiable set has changed", size, set.size());
+		}
+
+		// This test was changed in 3.1, as a contains() call on the given Collection using the "correct" iterator's
+		// current key (now a char[]) on a Set<String> would not hit any element of the CAS and therefor never call
+		// remove() on the iterator
+		try
+		{
+		  set.removeAll(new CharArraySet(TEST_VERSION_CURRENT, TEST_STOP_WORDS, true));
+		  fail("Modified unmodifiable set");
+		}
+		catch (System.NotSupportedException)
+		{
+		  // expected
+		  assertEquals("Size of unmodifiable set has changed", size, set.size());
+		}
+
+		try
+		{
+		  set.retainAll(new CharArraySet(TEST_VERSION_CURRENT, NOT_IN_SET, true));
+		  fail("Modified unmodifiable set");
+		}
+		catch (System.NotSupportedException)
+		{
+		  // expected
+		  assertEquals("Size of unmodifiable set has changed", size, set.size());
+		}
+
+		try
+		{
+		  set.addAll(NOT_IN_SET);
+		  fail("Modified unmodifiable set");
+		}
+		catch (System.NotSupportedException)
+		{
+		  // expected
+		  assertFalse("Test String has been added to unmodifiable set", set.contains(NOT_IN_SET));
+		}
+
+		for (int i = 0; i < TEST_STOP_WORDS.Length; i++)
+		{
+		  assertTrue(set.contains(TEST_STOP_WORDS[i]));
+		}
+	  }
+
+	  public virtual void testUnmodifiableSet()
+	  {
+		CharArraySet set = new CharArraySet(TEST_VERSION_CURRENT, 10,true);
+		set.addAll(TEST_STOP_WORDS);
+		set.add(Convert.ToInt32(1));
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int size = set.size();
+		int size = set.size();
+		set = CharArraySet.unmodifiableSet(set);
+		assertEquals("Set size changed due to unmodifiableSet call", size, set.size());
+		foreach (string stopword in TEST_STOP_WORDS)
+		{
+		  assertTrue(set.contains(stopword));
+		}
+		assertTrue(set.contains(Convert.ToInt32(1)));
+		assertTrue(set.contains("1"));
+		assertTrue(set.contains(new char[]{'1'}));
+
+		try
+		{
+		  CharArraySet.unmodifiableSet(null);
+		  fail("can not make null unmodifiable");
+		}
+		catch (System.NullReferenceException)
+		{
+		  // expected
+		}
+	  }
+
+	  public virtual void testSupplementaryChars()
+	  {
+		string missing = "Term %s is missing in the set";
+		string falsePos = "Term %s is in the set but shouldn't";
+		// for reference see
+		// http://unicode.org/cldr/utility/list-unicodeset.jsp?a=[[%3ACase_Sensitive%3DTrue%3A]%26[^[\u0000-\uFFFF]]]&esc=on
+		string[] upperArr = new string[] {"Abc\ud801\udc1c", "\ud801\udc1c\ud801\udc1cCDE", "A\ud801\udc1cB"};
+		string[] lowerArr = new string[] {"abc\ud801\udc44", "\ud801\udc44\ud801\udc44cde", "a\ud801\udc44b"};
+		CharArraySet set = new CharArraySet(TEST_VERSION_CURRENT, TEST_STOP_WORDS, true);
+		foreach (string upper in upperArr)
+		{
+		  set.add(upper);
+		}
+		for (int i = 0; i < upperArr.Length; i++)
+		{
+		  assertTrue(string.format(Locale.ROOT, missing, upperArr[i]), set.contains(upperArr[i]));
+		  assertTrue(string.format(Locale.ROOT, missing, lowerArr[i]), set.contains(lowerArr[i]));
+		}
+		set = new CharArraySet(TEST_VERSION_CURRENT, TEST_STOP_WORDS, false);
+		foreach (string upper in upperArr)
+		{
+		  set.add(upper);
+		}
+		for (int i = 0; i < upperArr.Length; i++)
+		{
+		  assertTrue(string.format(Locale.ROOT, missing, upperArr[i]), set.contains(upperArr[i]));
+		  assertFalse(string.format(Locale.ROOT, falsePos, lowerArr[i]), set.contains(lowerArr[i]));
+		}
+	  }
+
+	  public virtual void testSingleHighSurrogate()
+	  {
+		string missing = "Term %s is missing in the set";
+		string falsePos = "Term %s is in the set but shouldn't";
+		string[] upperArr = new string[] {"ABC\uD800", "ABC\uD800EfG", "\uD800EfG", "\uD800\ud801\udc1cB"};
+
+		string[] lowerArr = new string[] {"abc\uD800", "abc\uD800efg", "\uD800efg", "\uD800\ud801\udc44b"};
+		CharArraySet set = new CharArraySet(TEST_VERSION_CURRENT, TEST_STOP_WORDS, true);
+		foreach (string upper in upperArr)
+		{
+		  set.add(upper);
+		}
+		for (int i = 0; i < upperArr.Length; i++)
+		{
+		  assertTrue(string.format(Locale.ROOT, missing, upperArr[i]), set.contains(upperArr[i]));
+		  assertTrue(string.format(Locale.ROOT, missing, lowerArr[i]), set.contains(lowerArr[i]));
+		}
+		set = new CharArraySet(TEST_VERSION_CURRENT, TEST_STOP_WORDS, false);
+		foreach (string upper in upperArr)
+		{
+		  set.add(upper);
+		}
+		for (int i = 0; i < upperArr.Length; i++)
+		{
+		  assertTrue(string.format(Locale.ROOT, missing, upperArr[i]), set.contains(upperArr[i]));
+		  assertFalse(string.format(Locale.ROOT, falsePos, upperArr[i]), set.contains(lowerArr[i]));
+		}
+	  }
+
+	  /// @deprecated (3.1) remove this test when lucene 3.0 "broken unicode 4" support is
+	  ///             no longer needed. 
+	  [Obsolete("(3.1) remove this test when lucene 3.0 "broken unicode 4" support is")]
+	  public virtual void testSupplementaryCharsBWCompat()
+	  {
+		string missing = "Term %s is missing in the set";
+		string falsePos = "Term %s is in the set but shouldn't";
+		// for reference see
+		// http://unicode.org/cldr/utility/list-unicodeset.jsp?a=[[%3ACase_Sensitive%3DTrue%3A]%26[^[\u0000-\uFFFF]]]&esc=on
+		string[] upperArr = new string[] {"Abc\ud801\udc1c", "\ud801\udc1c\ud801\udc1cCDE", "A\ud801\udc1cB"};
+		string[] lowerArr = new string[] {"abc\ud801\udc44", "\ud801\udc44\ud801\udc44cde", "a\ud801\udc44b"};
+		CharArraySet set = new CharArraySet(Version.LUCENE_30, TEST_STOP_WORDS, true);
+		foreach (string upper in upperArr)
+		{
+		  set.add(upper);
+		}
+		for (int i = 0; i < upperArr.Length; i++)
+		{
+		  assertTrue(string.format(Locale.ROOT, missing, upperArr[i]), set.contains(upperArr[i]));
+		  assertFalse(string.format(Locale.ROOT, falsePos, lowerArr[i]), set.contains(lowerArr[i]));
+		}
+		set = new CharArraySet(Version.LUCENE_30, TEST_STOP_WORDS, false);
+		foreach (string upper in upperArr)
+		{
+		  set.add(upper);
+		}
+		for (int i = 0; i < upperArr.Length; i++)
+		{
+		  assertTrue(string.format(Locale.ROOT,missing, upperArr[i]), set.contains(upperArr[i]));
+		  assertFalse(string.format(Locale.ROOT, falsePos, lowerArr[i]), set.contains(lowerArr[i]));
+		}
+	  }
+
+	  /// @deprecated (3.1) remove this test when lucene 3.0 "broken unicode 4" support is
+	  ///             no longer needed. 
+	  [Obsolete("(3.1) remove this test when lucene 3.0 "broken unicode 4" support is")]
+	  public virtual void testSingleHighSurrogateBWComapt()
+	  {
+		string missing = "Term %s is missing in the set";
+		string falsePos = "Term %s is in the set but shouldn't";
+		string[] upperArr = new string[] {"ABC\uD800", "ABC\uD800EfG", "\uD800EfG", "\uD800\ud801\udc1cB"};
+
+		string[] lowerArr = new string[] {"abc\uD800", "abc\uD800efg", "\uD800efg", "\uD800\ud801\udc44b"};
+		CharArraySet set = new CharArraySet(Version.LUCENE_30, TEST_STOP_WORDS, true);
+		foreach (string upper in upperArr)
+		{
+		  set.add(upper);
+		}
+		for (int i = 0; i < upperArr.Length; i++)
+		{
+		  assertTrue(string.format(Locale.ROOT, missing, upperArr[i]), set.contains(upperArr[i]));
+		  if (i == lowerArr.Length - 1)
+		  {
+			assertFalse(string.format(Locale.ROOT, falsePos, lowerArr[i]), set.contains(lowerArr[i]));
+		  }
+		  else
+		  {
+			assertTrue(string.format(Locale.ROOT, missing, lowerArr[i]), set.contains(lowerArr[i]));
+		  }
+		}
+		set = new CharArraySet(Version.LUCENE_30, TEST_STOP_WORDS, false);
+		foreach (string upper in upperArr)
+		{
+		  set.add(upper);
+		}
+		for (int i = 0; i < upperArr.Length; i++)
+		{
+		  assertTrue(string.format(Locale.ROOT, missing, upperArr[i]), set.contains(upperArr[i]));
+		  assertFalse(string.format(Locale.ROOT, falsePos, lowerArr[i]), set.contains(lowerArr[i]));
+		}
+	  }
+
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @SuppressWarnings("deprecated") public void testCopyCharArraySetBWCompat()
+	  public virtual void testCopyCharArraySetBWCompat()
+	  {
+		CharArraySet setIngoreCase = new CharArraySet(TEST_VERSION_CURRENT, 10, true);
+		CharArraySet setCaseSensitive = new CharArraySet(TEST_VERSION_CURRENT, 10, false);
+
+		IList<string> stopwords = TEST_STOP_WORDS;
+		IList<string> stopwordsUpper = new List<string>();
+		foreach (string @string in stopwords)
+		{
+		  stopwordsUpper.Add(@string.ToUpper(Locale.ROOT));
+		}
+		setIngoreCase.addAll(TEST_STOP_WORDS);
+		setIngoreCase.add(Convert.ToInt32(1));
+		setCaseSensitive.addAll(TEST_STOP_WORDS);
+		setCaseSensitive.add(Convert.ToInt32(1));
+
+		CharArraySet copy = CharArraySet.copy(TEST_VERSION_CURRENT, setIngoreCase);
+		CharArraySet copyCaseSens = CharArraySet.copy(TEST_VERSION_CURRENT, setCaseSensitive);
+
+		assertEquals(setIngoreCase.size(), copy.size());
+		assertEquals(setCaseSensitive.size(), copy.size());
+
+		assertTrue(copy.containsAll(stopwords));
+		assertTrue(copy.containsAll(stopwordsUpper));
+		assertTrue(copyCaseSens.containsAll(stopwords));
+		foreach (string @string in stopwordsUpper)
+		{
+		  assertFalse(copyCaseSens.contains(@string));
+		}
+		// test adding terms to the copy
+		IList<string> newWords = new List<string>();
+		foreach (string @string in stopwords)
+		{
+		  newWords.Add(@string + "_1");
+		}
+		copy.addAll(newWords);
+
+		assertTrue(copy.containsAll(stopwords));
+		assertTrue(copy.containsAll(stopwordsUpper));
+		assertTrue(copy.containsAll(newWords));
+		// new added terms are not in the source set
+		foreach (string @string in newWords)
+		{
+		  assertFalse(setIngoreCase.contains(@string));
+		  assertFalse(setCaseSensitive.contains(@string));
+
+		}
+	  }
+
+	  /// <summary>
+	  /// Test the static #copy() function with a CharArraySet as a source
+	  /// </summary>
+	  public virtual void testCopyCharArraySet()
+	  {
+		CharArraySet setIngoreCase = new CharArraySet(TEST_VERSION_CURRENT, 10, true);
+		CharArraySet setCaseSensitive = new CharArraySet(TEST_VERSION_CURRENT, 10, false);
+
+		IList<string> stopwords = TEST_STOP_WORDS;
+		IList<string> stopwordsUpper = new List<string>();
+		foreach (string @string in stopwords)
+		{
+		  stopwordsUpper.Add(@string.ToUpper(Locale.ROOT));
+		}
+		setIngoreCase.addAll(TEST_STOP_WORDS);
+		setIngoreCase.add(Convert.ToInt32(1));
+		setCaseSensitive.addAll(TEST_STOP_WORDS);
+		setCaseSensitive.add(Convert.ToInt32(1));
+
+		CharArraySet copy = CharArraySet.copy(TEST_VERSION_CURRENT, setIngoreCase);
+		CharArraySet copyCaseSens = CharArraySet.copy(TEST_VERSION_CURRENT, setCaseSensitive);
+
+		assertEquals(setIngoreCase.size(), copy.size());
+		assertEquals(setCaseSensitive.size(), copy.size());
+
+		assertTrue(copy.containsAll(stopwords));
+		assertTrue(copy.containsAll(stopwordsUpper));
+		assertTrue(copyCaseSens.containsAll(stopwords));
+		foreach (string @string in stopwordsUpper)
+		{
+		  assertFalse(copyCaseSens.contains(@string));
+		}
+		// test adding terms to the copy
+		IList<string> newWords = new List<string>();
+		foreach (string @string in stopwords)
+		{
+		  newWords.Add(@string + "_1");
+		}
+		copy.addAll(newWords);
+
+		assertTrue(copy.containsAll(stopwords));
+		assertTrue(copy.containsAll(stopwordsUpper));
+		assertTrue(copy.containsAll(newWords));
+		// new added terms are not in the source set
+		foreach (string @string in newWords)
+		{
+		  assertFalse(setIngoreCase.contains(@string));
+		  assertFalse(setCaseSensitive.contains(@string));
+
+		}
+	  }
+
+	  /// <summary>
+	  /// Test the static #copy() function with a JDK <seealso cref="Set"/> as a source
+	  /// </summary>
+	  public virtual void testCopyJDKSet()
+	  {
+		ISet<string> set = new HashSet<string>();
+
+		IList<string> stopwords = TEST_STOP_WORDS;
+		IList<string> stopwordsUpper = new List<string>();
+		foreach (string @string in stopwords)
+		{
+		  stopwordsUpper.Add(@string.ToUpper(Locale.ROOT));
+		}
+		set.addAll(TEST_STOP_WORDS);
+
+		CharArraySet copy = CharArraySet.copy(TEST_VERSION_CURRENT, set);
+
+		assertEquals(set.Count, copy.size());
+		assertEquals(set.Count, copy.size());
+
+		assertTrue(copy.containsAll(stopwords));
+		foreach (string @string in stopwordsUpper)
+		{
+		  assertFalse(copy.contains(@string));
+		}
+
+		IList<string> newWords = new List<string>();
+		foreach (string @string in stopwords)
+		{
+		  newWords.Add(@string + "_1");
+		}
+		copy.addAll(newWords);
+
+		assertTrue(copy.containsAll(stopwords));
+		assertTrue(copy.containsAll(newWords));
+		// new added terms are not in the source set
+		foreach (string @string in newWords)
+		{
+		  assertFalse(set.Contains(@string));
+		}
+	  }
+
+	  /// <summary>
+	  /// Tests a special case of <seealso cref="CharArraySet#copy(Version, Set)"/> where the
+	  /// set to copy is the <seealso cref="CharArraySet#EMPTY_SET"/>
+	  /// </summary>
+	  public virtual void testCopyEmptySet()
+	  {
+		assertSame(CharArraySet.EMPTY_SET, CharArraySet.copy(TEST_VERSION_CURRENT, CharArraySet.EMPTY_SET));
+	  }
+
+	  /// <summary>
+	  /// Smoketests the static empty set
+	  /// </summary>
+	  public virtual void testEmptySet()
+	  {
+		assertEquals(0, CharArraySet.EMPTY_SET.size());
+
+		assertTrue(CharArraySet.EMPTY_SET.Empty);
+		foreach (string stopword in TEST_STOP_WORDS)
+		{
+		  assertFalse(CharArraySet.EMPTY_SET.contains(stopword));
+		}
+		assertFalse(CharArraySet.EMPTY_SET.contains("foo"));
+		assertFalse(CharArraySet.EMPTY_SET.contains((object) "foo"));
+		assertFalse(CharArraySet.EMPTY_SET.contains("foo".ToCharArray()));
+		assertFalse(CharArraySet.EMPTY_SET.contains("foo".ToCharArray(),0,3));
+	  }
+
+	  /// <summary>
+	  /// Test for NPE
+	  /// </summary>
+	  public virtual void testContainsWithNull()
+	  {
+		CharArraySet set = new CharArraySet(TEST_VERSION_CURRENT, 1, true);
+		try
+		{
+		  set.contains((char[]) null, 0, 10);
+		  fail("null value must raise NPE");
+		}
+		catch (System.NullReferenceException)
+		{
+		}
+		try
+		{
+		  set.contains((CharSequence) null);
+		  fail("null value must raise NPE");
+		}
+		catch (System.NullReferenceException)
+		{
+		}
+		try
+		{
+		  set.contains((object) null);
+		  fail("null value must raise NPE");
+		}
+		catch (System.NullReferenceException)
+		{
+		}
+	  }
+
+	  public virtual void testToString()
+	  {
+		CharArraySet set = CharArraySet.copy(TEST_VERSION_CURRENT, Collections.singleton("test"));
+		assertEquals("[test]", set.ToString());
+		set.add("test2");
+		assertTrue(set.ToString().Contains(", "));
+
+		set = CharArraySet.copy(Version.LUCENE_30, Collections.singleton("test"));
+		assertEquals("[test]", set.ToString());
+		set.add("test2");
+		assertTrue(set.ToString().Contains(", "));
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestCharTokenizers.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestCharTokenizers.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestCharTokenizers.cs
new file mode 100644
index 0000000..3581c7b
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestCharTokenizers.cs
@@ -0,0 +1,268 @@
+using System.Text;
+
+namespace org.apache.lucene.analysis.util
+{
+
+	/*
+	 * Licensed to the Apache Software Foundation (ASF) under one or more
+	 * contributor license agreements.  See the NOTICE file distributed with
+	 * this work for additional information regarding copyright ownership.
+	 * The ASF licenses this file to You under the Apache License, Version 2.0
+	 * (the "License"); you may not use this file except in compliance with
+	 * the License.  You may obtain a copy of the License at
+	 *
+	 *     http://www.apache.org/licenses/LICENSE-2.0
+	 *
+	 * Unless required by applicable law or agreed to in writing, software
+	 * distributed under the License is distributed on an "AS IS" BASIS,
+	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+	 * See the License for the specific language governing permissions and
+	 * limitations under the License.
+	 */
+
+
+	using LetterTokenizer = org.apache.lucene.analysis.core.LetterTokenizer;
+	using LowerCaseTokenizer = org.apache.lucene.analysis.core.LowerCaseTokenizer;
+	using OffsetAttribute = org.apache.lucene.analysis.tokenattributes.OffsetAttribute;
+	using IOUtils = org.apache.lucene.util.IOUtils;
+	using TestUtil = org.apache.lucene.util.TestUtil;
+
+
+	/// <summary>
+	/// Testcase for <seealso cref="CharTokenizer"/> subclasses
+	/// </summary>
+	public class TestCharTokenizers : BaseTokenStreamTestCase
+	{
+
+	  /*
+	   * test to read surrogate pairs without loosing the pairing 
+	   * if the surrogate pair is at the border of the internal IO buffer
+	   */
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testReadSupplementaryChars() throws java.io.IOException
+	  public virtual void testReadSupplementaryChars()
+	  {
+		StringBuilder builder = new StringBuilder();
+		// create random input
+		int num = 1024 + random().Next(1024);
+		num *= RANDOM_MULTIPLIER;
+		for (int i = 1; i < num; i++)
+		{
+		  builder.Append("\ud801\udc1cabc");
+		  if ((i % 10) == 0)
+		  {
+			builder.Append(" ");
+		  }
+		}
+		// internal buffer size is 1024 make sure we have a surrogate pair right at the border
+		builder.Insert(1023, "\ud801\udc1c");
+		Tokenizer tokenizer = new LowerCaseTokenizer(TEST_VERSION_CURRENT, new StringReader(builder.ToString()));
+		assertTokenStreamContents(tokenizer, builder.ToString().ToLower(Locale.ROOT).split(" "));
+	  }
+
+	  /*
+	   * test to extend the buffer TermAttribute buffer internally. If the internal
+	   * alg that extends the size of the char array only extends by 1 char and the
+	   * next char to be filled in is a supplementary codepoint (using 2 chars) an
+	   * index out of bound exception is triggered.
+	   */
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testExtendCharBuffer() throws java.io.IOException
+	  public virtual void testExtendCharBuffer()
+	  {
+		for (int i = 0; i < 40; i++)
+		{
+		  StringBuilder builder = new StringBuilder();
+		  for (int j = 0; j < 1 + i; j++)
+		  {
+			builder.Append("a");
+		  }
+		  builder.Append("\ud801\udc1cabc");
+		  Tokenizer tokenizer = new LowerCaseTokenizer(TEST_VERSION_CURRENT, new StringReader(builder.ToString()));
+		  assertTokenStreamContents(tokenizer, new string[] {builder.ToString().ToLower(Locale.ROOT)});
+		}
+	  }
+
+	  /*
+	   * tests the max word length of 255 - tokenizer will split at the 255 char no matter what happens
+	   */
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMaxWordLength() throws java.io.IOException
+	  public virtual void testMaxWordLength()
+	  {
+		StringBuilder builder = new StringBuilder();
+
+		for (int i = 0; i < 255; i++)
+		{
+		  builder.Append("A");
+		}
+		Tokenizer tokenizer = new LowerCaseTokenizer(TEST_VERSION_CURRENT, new StringReader(builder.ToString() + builder.ToString()));
+		assertTokenStreamContents(tokenizer, new string[] {builder.ToString().ToLower(Locale.ROOT), builder.ToString().ToLower(Locale.ROOT)});
+	  }
+
+	  /*
+	   * tests the max word length of 255 with a surrogate pair at position 255
+	   */
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMaxWordLengthWithSupplementary() throws java.io.IOException
+	  public virtual void testMaxWordLengthWithSupplementary()
+	  {
+		StringBuilder builder = new StringBuilder();
+
+		for (int i = 0; i < 254; i++)
+		{
+		  builder.Append("A");
+		}
+		builder.Append("\ud801\udc1c");
+		Tokenizer tokenizer = new LowerCaseTokenizer(TEST_VERSION_CURRENT, new StringReader(builder.ToString() + builder.ToString()));
+		assertTokenStreamContents(tokenizer, new string[] {builder.ToString().ToLower(Locale.ROOT), builder.ToString().ToLower(Locale.ROOT)});
+	  }
+
+	  // LUCENE-3642: normalize SMP->BMP and check that offsets are correct
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCrossPlaneNormalization() throws java.io.IOException
+	  public virtual void testCrossPlaneNormalization()
+	  {
+		Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper(this);
+		int num = 1000 * RANDOM_MULTIPLIER;
+		for (int i = 0; i < num; i++)
+		{
+		  string s = TestUtil.randomUnicodeString(random());
+		  TokenStream ts = analyzer.tokenStream("foo", s);
+		  try
+		  {
+			ts.reset();
+			OffsetAttribute offsetAtt = ts.addAttribute(typeof(OffsetAttribute));
+			while (ts.incrementToken())
+			{
+			  string highlightedText = StringHelperClass.SubstringSpecial(s, offsetAtt.startOffset(), offsetAtt.endOffset());
+			  for (int j = 0, cp = 0; j < highlightedText.Length; j += char.charCount(cp))
+			  {
+				cp = char.ConvertToUtf32(highlightedText, j);
+				assertTrue("non-letter:" + cp.ToString("x"), char.IsLetter(cp));
+			  }
+			}
+			ts.end();
+		  }
+		  finally
+		  {
+			IOUtils.closeWhileHandlingException(ts);
+		  }
+		}
+		// just for fun
+		checkRandomData(random(), analyzer, num);
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestCharTokenizers outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestCharTokenizers outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new LetterTokenizerAnonymousInnerClassHelper(this, TEST_VERSION_CURRENT, reader);
+			return new TokenStreamComponents(tokenizer, tokenizer);
+		  }
+
+		  private class LetterTokenizerAnonymousInnerClassHelper : LetterTokenizer
+		  {
+			  private readonly AnalyzerAnonymousInnerClassHelper outerInstance;
+
+			  public LetterTokenizerAnonymousInnerClassHelper(AnalyzerAnonymousInnerClassHelper outerInstance, UnknownType TEST_VERSION_CURRENT, Reader reader) : base(TEST_VERSION_CURRENT, reader)
+			  {
+				  this.outerInstance = outerInstance;
+			  }
+
+			  protected internal override int normalize(int c)
+			  {
+				if (c > 0xffff)
+				{
+				  return 'δ';
+				}
+				else
+				{
+				  return c;
+				}
+			  }
+		  }
+	  }
+
+	  // LUCENE-3642: normalize BMP->SMP and check that offsets are correct
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCrossPlaneNormalization2() throws java.io.IOException
+	  public virtual void testCrossPlaneNormalization2()
+	  {
+		Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper2(this);
+		int num = 1000 * RANDOM_MULTIPLIER;
+		for (int i = 0; i < num; i++)
+		{
+		  string s = TestUtil.randomUnicodeString(random());
+		  TokenStream ts = analyzer.tokenStream("foo", s);
+		  try
+		  {
+			ts.reset();
+			OffsetAttribute offsetAtt = ts.addAttribute(typeof(OffsetAttribute));
+			while (ts.incrementToken())
+			{
+			  string highlightedText = StringHelperClass.SubstringSpecial(s, offsetAtt.startOffset(), offsetAtt.endOffset());
+			  for (int j = 0, cp = 0; j < highlightedText.Length; j += char.charCount(cp))
+			  {
+				cp = char.ConvertToUtf32(highlightedText, j);
+				assertTrue("non-letter:" + cp.ToString("x"), char.IsLetter(cp));
+			  }
+			}
+			ts.end();
+		  }
+		  finally
+		  {
+			IOUtils.closeWhileHandlingException(ts);
+		  }
+		}
+		// just for fun
+		checkRandomData(random(), analyzer, num);
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestCharTokenizers outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestCharTokenizers outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new LetterTokenizerAnonymousInnerClassHelper2(this, TEST_VERSION_CURRENT, reader);
+			return new TokenStreamComponents(tokenizer, tokenizer);
+		  }
+
+		  private class LetterTokenizerAnonymousInnerClassHelper2 : LetterTokenizer
+		  {
+			  private readonly AnalyzerAnonymousInnerClassHelper2 outerInstance;
+
+			  public LetterTokenizerAnonymousInnerClassHelper2(AnalyzerAnonymousInnerClassHelper2 outerInstance, UnknownType TEST_VERSION_CURRENT, Reader reader) : base(TEST_VERSION_CURRENT, reader)
+			  {
+				  this.outerInstance = outerInstance;
+			  }
+
+			  protected internal override int normalize(int c)
+			  {
+				if (c <= 0xffff)
+				{
+				  return 0x1043C;
+				}
+				else
+				{
+				  return c;
+				}
+			  }
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestCharacterUtils.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestCharacterUtils.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestCharacterUtils.cs
new file mode 100644
index 0000000..fb0fd6e
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestCharacterUtils.cs
@@ -0,0 +1,290 @@
+using System;
+
+namespace org.apache.lucene.analysis.util
+{
+
+	/*
+	 * Licensed to the Apache Software Foundation (ASF) under one or more
+	 * contributor license agreements.  See the NOTICE file distributed with
+	 * this work for additional information regarding copyright ownership.
+	 * The ASF licenses this file to You under the Apache License, Version 2.0
+	 * (the "License"); you may not use this file except in compliance with
+	 * the License.  You may obtain a copy of the License at
+	 *
+	 *     http://www.apache.org/licenses/LICENSE-2.0
+	 *
+	 * Unless required by applicable law or agreed to in writing, software
+	 * distributed under the License is distributed on an "AS IS" BASIS,
+	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+	 * See the License for the specific language governing permissions and
+	 * limitations under the License.
+	 */
+
+
+	using CharacterBuffer = org.apache.lucene.analysis.util.CharacterUtils.CharacterBuffer;
+	using LuceneTestCase = org.apache.lucene.util.LuceneTestCase;
+	using Version = org.apache.lucene.util.Version;
+	using TestUtil = org.apache.lucene.util.TestUtil;
+	using Test = org.junit.Test;
+
+	/// <summary>
+	/// TestCase for the <seealso cref="CharacterUtils"/> class.
+	/// </summary>
+	public class TestCharacterUtils : LuceneTestCase
+	{
+
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @Test public void testCodePointAtCharSequenceInt()
+	  public virtual void testCodePointAtCharSequenceInt()
+	  {
+		CharacterUtils java4 = CharacterUtils.getInstance(Version.LUCENE_30);
+		string cpAt3 = "Abc\ud801\udc1c";
+		string highSurrogateAt3 = "Abc\ud801";
+		assertEquals((int) 'A', java4.codePointAt(cpAt3, 0));
+		assertEquals((int) '\ud801', java4.codePointAt(cpAt3, 3));
+		assertEquals((int) '\ud801', java4.codePointAt(highSurrogateAt3, 3));
+		try
+		{
+		  java4.codePointAt(highSurrogateAt3, 4);
+		  fail("string index out of bounds");
+		}
+		catch (System.IndexOutOfRangeException)
+		{
+		}
+
+		CharacterUtils java5 = CharacterUtils.getInstance(TEST_VERSION_CURRENT);
+		assertEquals((int) 'A', java5.codePointAt(cpAt3, 0));
+		assertEquals(char.toCodePoint('\ud801', '\udc1c'), java5.codePointAt(cpAt3, 3));
+		assertEquals((int) '\ud801', java5.codePointAt(highSurrogateAt3, 3));
+		try
+		{
+		  java5.codePointAt(highSurrogateAt3, 4);
+		  fail("string index out of bounds");
+		}
+		catch (System.IndexOutOfRangeException)
+		{
+		}
+
+	  }
+
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @Test public void testCodePointAtCharArrayIntInt()
+	  public virtual void testCodePointAtCharArrayIntInt()
+	  {
+		CharacterUtils java4 = CharacterUtils.getInstance(Version.LUCENE_30);
+		char[] cpAt3 = "Abc\ud801\udc1c".ToCharArray();
+		char[] highSurrogateAt3 = "Abc\ud801".ToCharArray();
+		assertEquals((int) 'A', java4.codePointAt(cpAt3, 0, 2));
+		assertEquals((int) '\ud801', java4.codePointAt(cpAt3, 3, 5));
+		assertEquals((int) '\ud801', java4.codePointAt(highSurrogateAt3, 3, 4));
+
+		CharacterUtils java5 = CharacterUtils.getInstance(TEST_VERSION_CURRENT);
+		assertEquals((int) 'A', java5.codePointAt(cpAt3, 0, 2));
+		assertEquals(char.toCodePoint('\ud801', '\udc1c'), java5.codePointAt(cpAt3, 3, 5));
+		assertEquals((int) '\ud801', java5.codePointAt(highSurrogateAt3, 3, 4));
+	  }
+
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @Test public void testCodePointCount()
+	  public virtual void testCodePointCount()
+	  {
+		CharacterUtils java4 = CharacterUtils.Java4Instance;
+		CharacterUtils java5 = CharacterUtils.getInstance(TEST_VERSION_CURRENT);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final String s = org.apache.lucene.util.TestUtil.randomUnicodeString(random());
+		string s = TestUtil.randomUnicodeString(random());
+		assertEquals(s.Length, java4.codePointCount(s));
+		assertEquals(char.codePointCount(s, 0, s.Length), java5.codePointCount(s));
+	  }
+
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @Test public void testOffsetByCodePoint()
+	  public virtual void testOffsetByCodePoint()
+	  {
+		CharacterUtils java4 = CharacterUtils.Java4Instance;
+		CharacterUtils java5 = CharacterUtils.getInstance(TEST_VERSION_CURRENT);
+		for (int i = 0; i < 10; ++i)
+		{
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final char[] s = org.apache.lucene.util.TestUtil.randomUnicodeString(random()).toCharArray();
+		  char[] s = TestUtil.randomUnicodeString(random()).toCharArray();
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int index = org.apache.lucene.util.TestUtil.nextInt(random(), 0, s.length);
+		  int index = TestUtil.Next(random(), 0, s.Length);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int offset = random().nextInt(7) - 3;
+		  int offset = random().Next(7) - 3;
+		  try
+		  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int o = java4.offsetByCodePoints(s, 0, s.length, index, offset);
+			int o = java4.offsetByCodePoints(s, 0, s.Length, index, offset);
+			assertEquals(o, index + offset);
+		  }
+		  catch (System.IndexOutOfRangeException)
+		  {
+			assertTrue((index + offset) < 0 || (index + offset) > s.Length);
+		  }
+
+		  int o;
+		  try
+		  {
+			o = java5.offsetByCodePoints(s, 0, s.Length, index, offset);
+		  }
+		  catch (System.IndexOutOfRangeException)
+		  {
+			try
+			{
+			  char.offsetByCodePoints(s, 0, s.Length, index, offset);
+			  fail();
+			}
+			catch (System.IndexOutOfRangeException)
+			{
+			  // OK
+			}
+			o = -1;
+		  }
+		  if (o >= 0)
+		  {
+			assertEquals(char.offsetByCodePoints(s, 0, s.Length, index, offset), o);
+		  }
+		}
+	  }
+
+	  public virtual void testConversions()
+	  {
+		CharacterUtils java4 = CharacterUtils.Java4Instance;
+		CharacterUtils java5 = CharacterUtils.getInstance(TEST_VERSION_CURRENT);
+		testConversions(java4);
+		testConversions(java5);
+	  }
+
+	  private void testConversions(CharacterUtils charUtils)
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final char[] orig = org.apache.lucene.util.TestUtil.randomUnicodeString(random(), 100).toCharArray();
+		char[] orig = TestUtil.randomUnicodeString(random(), 100).toCharArray();
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int[] buf = new int[orig.length];
+		int[] buf = new int[orig.Length];
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final char[] restored = new char[buf.length];
+		char[] restored = new char[buf.Length];
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int o1 = org.apache.lucene.util.TestUtil.nextInt(random(), 0, Math.min(5, orig.length));
+		int o1 = TestUtil.Next(random(), 0, Math.Min(5, orig.Length));
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int o2 = org.apache.lucene.util.TestUtil.nextInt(random(), 0, o1);
+		int o2 = TestUtil.Next(random(), 0, o1);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int o3 = org.apache.lucene.util.TestUtil.nextInt(random(), 0, o1);
+		int o3 = TestUtil.Next(random(), 0, o1);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int codePointCount = charUtils.toCodePoints(orig, o1, orig.length - o1, buf, o2);
+		int codePointCount = charUtils.toCodePoints(orig, o1, orig.Length - o1, buf, o2);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int charCount = charUtils.toChars(buf, o2, codePointCount, restored, o3);
+		int charCount = charUtils.toChars(buf, o2, codePointCount, restored, o3);
+		assertEquals(orig.Length - o1, charCount);
+		assertArrayEquals(Arrays.copyOfRange(orig, o1, o1 + charCount), Arrays.copyOfRange(restored, o3, o3 + charCount));
+	  }
+
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @Test public void testNewCharacterBuffer()
+	  public virtual void testNewCharacterBuffer()
+	  {
+		CharacterBuffer newCharacterBuffer = CharacterUtils.newCharacterBuffer(1024);
+		assertEquals(1024, newCharacterBuffer.Buffer.length);
+		assertEquals(0, newCharacterBuffer.Offset);
+		assertEquals(0, newCharacterBuffer.Length);
+
+		newCharacterBuffer = CharacterUtils.newCharacterBuffer(2);
+		assertEquals(2, newCharacterBuffer.Buffer.length);
+		assertEquals(0, newCharacterBuffer.Offset);
+		assertEquals(0, newCharacterBuffer.Length);
+
+		try
+		{
+		  newCharacterBuffer = CharacterUtils.newCharacterBuffer(1);
+		  fail("length must be >= 2");
+		}
+		catch (System.ArgumentException)
+		{
+		}
+	  }
+
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @Test public void testFillNoHighSurrogate() throws java.io.IOException
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public virtual void testFillNoHighSurrogate()
+	  {
+		Version[] versions = new Version[] {Version.LUCENE_30, TEST_VERSION_CURRENT};
+		foreach (Version version in versions)
+		{
+		  CharacterUtils instance = CharacterUtils.getInstance(version);
+		  Reader reader = new StringReader("helloworld");
+		  CharacterBuffer buffer = CharacterUtils.newCharacterBuffer(6);
+		  assertTrue(instance.fill(buffer,reader));
+		  assertEquals(0, buffer.Offset);
+		  assertEquals(6, buffer.Length);
+		  assertEquals("hellow", new string(buffer.Buffer));
+		  assertFalse(instance.fill(buffer,reader));
+		  assertEquals(4, buffer.Length);
+		  assertEquals(0, buffer.Offset);
+
+		  assertEquals("orld", new string(buffer.Buffer, buffer.Offset, buffer.Length));
+		  assertFalse(instance.fill(buffer,reader));
+		}
+	  }
+
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @Test public void testFillJava15() throws java.io.IOException
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public virtual void testFillJava15()
+	  {
+		string input = "1234\ud801\udc1c789123\ud801\ud801\udc1c\ud801";
+		CharacterUtils instance = CharacterUtils.getInstance(TEST_VERSION_CURRENT);
+		Reader reader = new StringReader(input);
+		CharacterBuffer buffer = CharacterUtils.newCharacterBuffer(5);
+		assertTrue(instance.fill(buffer, reader));
+		assertEquals(4, buffer.Length);
+		assertEquals("1234", new string(buffer.Buffer, buffer.Offset, buffer.Length));
+		assertTrue(instance.fill(buffer, reader));
+		assertEquals(5, buffer.Length);
+		assertEquals("\ud801\udc1c789", new string(buffer.Buffer));
+		assertTrue(instance.fill(buffer, reader));
+		assertEquals(4, buffer.Length);
+		assertEquals("123\ud801", new string(buffer.Buffer, buffer.Offset, buffer.Length));
+		assertFalse(instance.fill(buffer, reader));
+		assertEquals(3, buffer.Length);
+		assertEquals("\ud801\udc1c\ud801", new string(buffer.Buffer, buffer.Offset, buffer.Length));
+		assertFalse(instance.fill(buffer, reader));
+		assertEquals(0, buffer.Length);
+	  }
+
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @Test public void testFillJava14() throws java.io.IOException
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public virtual void testFillJava14()
+	  {
+		string input = "1234\ud801\udc1c789123\ud801\ud801\udc1c\ud801";
+		CharacterUtils instance = CharacterUtils.getInstance(Version.LUCENE_30);
+		Reader reader = new StringReader(input);
+		CharacterBuffer buffer = CharacterUtils.newCharacterBuffer(5);
+		assertTrue(instance.fill(buffer, reader));
+		assertEquals(5, buffer.Length);
+		assertEquals("1234\ud801", new string(buffer.Buffer, buffer.Offset, buffer.Length));
+		assertTrue(instance.fill(buffer, reader));
+		assertEquals(5, buffer.Length);
+		assertEquals("\udc1c7891", new string(buffer.Buffer));
+		buffer = CharacterUtils.newCharacterBuffer(6);
+		assertTrue(instance.fill(buffer, reader));
+		assertEquals(6, buffer.Length);
+		assertEquals("23\ud801\ud801\udc1c\ud801", new string(buffer.Buffer, buffer.Offset, buffer.Length));
+		assertFalse(instance.fill(buffer, reader));
+
+	  }
+
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestElision.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestElision.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestElision.cs
new file mode 100644
index 0000000..4a53a04
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestElision.cs
@@ -0,0 +1,89 @@
+using System.Collections.Generic;
+
+namespace org.apache.lucene.analysis.util
+{
+
+	/*
+	 * Licensed to the Apache Software Foundation (ASF) under one or more
+	 * contributor license agreements.  See the NOTICE file distributed with
+	 * this work for additional information regarding copyright ownership.
+	 * The ASF licenses this file to You under the Apache License, Version 2.0
+	 * (the "License"); you may not use this file except in compliance with
+	 * the License.  You may obtain a copy of the License at
+	 *
+	 *     http://www.apache.org/licenses/LICENSE-2.0
+	 *
+	 * Unless required by applicable law or agreed to in writing, software
+	 * distributed under the License is distributed on an "AS IS" BASIS,
+	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+	 * See the License for the specific language governing permissions and
+	 * limitations under the License.
+	 */
+
+
+	using KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+	using FrenchAnalyzer = org.apache.lucene.analysis.fr.FrenchAnalyzer;
+	using StandardTokenizer = org.apache.lucene.analysis.standard.StandardTokenizer;
+	using CharTermAttribute = org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
+
+	/// 
+	public class TestElision : BaseTokenStreamTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testElision() throws Exception
+	  public virtual void testElision()
+	  {
+		string test = "Plop, juste pour voir l'embrouille avec O'brian. M'enfin.";
+		Tokenizer tokenizer = new StandardTokenizer(TEST_VERSION_CURRENT, new StringReader(test));
+		CharArraySet articles = new CharArraySet(TEST_VERSION_CURRENT, asSet("l", "M"), false);
+		TokenFilter filter = new ElisionFilter(tokenizer, articles);
+		IList<string> tas = filter(filter);
+		assertEquals("embrouille", tas[4]);
+		assertEquals("O'brian", tas[6]);
+		assertEquals("enfin", tas[7]);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: private java.util.List<String> filter(org.apache.lucene.analysis.TokenFilter filter) throws java.io.IOException
+	  private IList<string> filter(TokenFilter filter)
+	  {
+		IList<string> tas = new List<string>();
+		CharTermAttribute termAtt = filter.getAttribute(typeof(CharTermAttribute));
+		filter.reset();
+		while (filter.incrementToken())
+		{
+		  tas.Add(termAtt.ToString());
+		}
+		filter.end();
+		filter.close();
+		return tas;
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestElision outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestElision outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new ElisionFilter(tokenizer, FrenchAnalyzer.DEFAULT_ARTICLES));
+		  }
+	  }
+
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestElisionFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestElisionFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestElisionFilterFactory.cs
new file mode 100644
index 0000000..c349fa5
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestElisionFilterFactory.cs
@@ -0,0 +1,85 @@
+namespace org.apache.lucene.analysis.util
+{
+
+	/*
+	 * Licensed to the Apache Software Foundation (ASF) under one or more
+	 * contributor license agreements.  See the NOTICE file distributed with
+	 * this work for additional information regarding copyright ownership.
+	 * The ASF licenses this file to You under the Apache License, Version 2.0
+	 * (the "License"); you may not use this file except in compliance with
+	 * the License.  You may obtain a copy of the License at
+	 *
+	 *     http://www.apache.org/licenses/LICENSE-2.0
+	 *
+	 * Unless required by applicable law or agreed to in writing, software
+	 * distributed under the License is distributed on an "AS IS" BASIS,
+	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+	 * See the License for the specific language governing permissions and
+	 * limitations under the License.
+	 */
+
+
+
+	/// <summary>
+	/// Simple tests to ensure the French elision filter factory is working.
+	/// </summary>
+	public class TestElisionFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+	  /// <summary>
+	  /// Ensure the filter actually normalizes text.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testElision() throws Exception
+	  public virtual void testElision()
+	  {
+		Reader reader = new StringReader("l'avion");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("Elision", "articles", "frenchArticles.txt").create(stream);
+		assertTokenStreamContents(stream, new string[] {"avion"});
+	  }
+
+	  /// <summary>
+	  /// Test creating an elision filter without specifying any articles
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testDefaultArticles() throws Exception
+	  public virtual void testDefaultArticles()
+	  {
+		Reader reader = new StringReader("l'avion");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("Elision").create(stream);
+		assertTokenStreamContents(stream, new string[] {"avion"});
+	  }
+
+	  /// <summary>
+	  /// Test setting ignoreCase=true
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCaseInsensitive() throws Exception
+	  public virtual void testCaseInsensitive()
+	  {
+		Reader reader = new StringReader("L'avion");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("Elision", "articles", "frenchArticles.txt", "ignoreCase", "true").create(stream);
+		assertTokenStreamContents(stream, new string[] {"avion"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("Elision", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestFilesystemResourceLoader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestFilesystemResourceLoader.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestFilesystemResourceLoader.cs
new file mode 100644
index 0000000..b2e562e
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestFilesystemResourceLoader.cs
@@ -0,0 +1,121 @@
+using System;
+using System.Text;
+
+namespace org.apache.lucene.analysis.util
+{
+
+	/*
+	 * Licensed to the Apache Software Foundation (ASF) under one or more
+	 * contributor license agreements.  See the NOTICE file distributed with
+	 * this work for additional information regarding copyright ownership.
+	 * The ASF licenses this file to You under the Apache License, Version 2.0
+	 * (the "License"); you may not use this file except in compliance with
+	 * the License.  You may obtain a copy of the License at
+	 *
+	 *     http://www.apache.org/licenses/LICENSE-2.0
+	 *
+	 * Unless required by applicable law or agreed to in writing, software
+	 * distributed under the License is distributed on an "AS IS" BASIS,
+	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+	 * See the License for the specific language governing permissions and
+	 * limitations under the License.
+	 */
+
+
+	using IOUtils = org.apache.lucene.util.IOUtils;
+	using LuceneTestCase = org.apache.lucene.util.LuceneTestCase;
+	using TestUtil = org.apache.lucene.util.TestUtil;
+	using TestUtil = org.apache.lucene.util.TestUtil;
+
+	public class TestFilesystemResourceLoader : LuceneTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: private void assertNotFound(ResourceLoader rl) throws Exception
+	  private void assertNotFound(ResourceLoader rl)
+	  {
+		try
+		{
+		  IOUtils.closeWhileHandlingException(rl.openResource("/this-directory-really-really-really-should-not-exist/foo/bar.txt"));
+		  fail("The resource does not exist, should fail!");
+		}
+		catch (IOException)
+		{
+		  // pass
+		}
+		try
+		{
+		  rl.newInstance("org.apache.lucene.analysis.FooBarFilterFactory", typeof(TokenFilterFactory));
+		  fail("The class does not exist, should fail!");
+		}
+		catch (Exception)
+		{
+		  // pass
+		}
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: private void assertClasspathDelegation(ResourceLoader rl) throws Exception
+	  private void assertClasspathDelegation(ResourceLoader rl)
+	  {
+		// try a stopwords file from classpath
+		CharArraySet set = WordlistLoader.getSnowballWordSet(new System.IO.StreamReader(rl.openResource("org/apache/lucene/analysis/snowball/english_stop.txt"), Encoding.UTF8), TEST_VERSION_CURRENT);
+		assertTrue(set.contains("you"));
+		// try to load a class; we use string comparison because classloader may be different...
+//JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method:
+		assertEquals("org.apache.lucene.analysis.util.RollingCharBuffer", rl.newInstance("org.apache.lucene.analysis.util.RollingCharBuffer", typeof(object)).GetType().FullName);
+		// theoretically classes should also be loadable:
+		IOUtils.closeWhileHandlingException(rl.openResource("java/lang/String.class"));
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBaseDir() throws Exception
+	  public virtual void testBaseDir()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final java.io.File super = createTempDir("fsResourceLoaderBase").getAbsoluteFile();
+		File @base = createTempDir("fsResourceLoaderBase").AbsoluteFile;
+		try
+		{
+		  @base.mkdirs();
+		  Writer os = new System.IO.StreamWriter(new System.IO.FileStream(@base, "template.txt", System.IO.FileMode.Create, System.IO.FileAccess.Write), Encoding.UTF8);
+		  try
+		  {
+			os.write("foobar\n");
+		  }
+		  finally
+		  {
+			IOUtils.closeWhileHandlingException(os);
+		  }
+
+		  ResourceLoader rl = new FilesystemResourceLoader(@base);
+		  assertEquals("foobar", WordlistLoader.getLines(rl.openResource("template.txt"), StandardCharsets.UTF_8).get(0));
+		  // Same with full path name:
+		  string fullPath = (new File(@base, "template.txt")).ToString();
+		  assertEquals("foobar", WordlistLoader.getLines(rl.openResource(fullPath), StandardCharsets.UTF_8).get(0));
+		  assertClasspathDelegation(rl);
+		  assertNotFound(rl);
+
+		  // now use RL without base dir:
+		  rl = new FilesystemResourceLoader();
+		  assertEquals("foobar", WordlistLoader.getLines(rl.openResource((new File(@base, "template.txt")).ToString()), StandardCharsets.UTF_8).get(0));
+		  assertClasspathDelegation(rl);
+		  assertNotFound(rl);
+		}
+		finally
+		{
+		  TestUtil.rm(@base);
+		}
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testDelegation() throws Exception
+	  public virtual void testDelegation()
+	  {
+		ResourceLoader rl = new FilesystemResourceLoader(null, new StringMockResourceLoader("foobar\n"));
+		assertEquals("foobar", WordlistLoader.getLines(rl.openResource("template.txt"), StandardCharsets.UTF_8).get(0));
+	  }
+
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestRollingCharBuffer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestRollingCharBuffer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestRollingCharBuffer.cs
new file mode 100644
index 0000000..5e9b2b6
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestRollingCharBuffer.cs
@@ -0,0 +1,136 @@
+using System;
+
+namespace org.apache.lucene.analysis.util
+{
+
+	/*
+	 * Licensed to the Apache Software Foundation (ASF) under one or more
+	 * contributor license agreements.  See the NOTICE file distributed with
+	 * this work for additional information regarding copyright ownership.
+	 * The ASF licenses this file to You under the Apache License, Version 2.0
+	 * (the "License"); you may not use this file except in compliance with
+	 * the License.  You may obtain a copy of the License at
+	 *
+	 *     http://www.apache.org/licenses/LICENSE-2.0
+	 *
+	 * Unless required by applicable law or agreed to in writing, software
+	 * distributed under the License is distributed on an "AS IS" BASIS,
+	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+	 * See the License for the specific language governing permissions and
+	 * limitations under the License.
+	 */
+
+
+	using LuceneTestCase = org.apache.lucene.util.LuceneTestCase;
+	using TestUtil = org.apache.lucene.util.TestUtil;
+
+	public class TestRollingCharBuffer : LuceneTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void test() throws Exception
+	  public virtual void test()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int ITERS = atLeast(1000);
+		int ITERS = atLeast(1000);
+
+		RollingCharBuffer buffer = new RollingCharBuffer();
+
+		Random random = random();
+		for (int iter = 0;iter < ITERS;iter++)
+		{
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int stringLen = random.nextBoolean() ? random.nextInt(50) : random.nextInt(20000);
+		  int stringLen = random.nextBoolean() ? random.Next(50) : random.Next(20000);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final String s;
+		  string s;
+		  if (stringLen == 0)
+		  {
+			s = "";
+		  }
+		  else
+		  {
+			s = TestUtil.randomUnicodeString(random, stringLen);
+		  }
+		  if (VERBOSE)
+		  {
+			Console.WriteLine("\nTEST: iter=" + iter + " s.length()=" + s.Length);
+		  }
+		  buffer.reset(new StringReader(s));
+		  int nextRead = 0;
+		  int availCount = 0;
+		  while (nextRead < s.Length)
+		  {
+			if (VERBOSE)
+			{
+			  Console.WriteLine("  cycle nextRead=" + nextRead + " avail=" + availCount);
+			}
+			if (availCount == 0 || random.nextBoolean())
+			{
+			  // Read next char
+			  if (VERBOSE)
+			  {
+				Console.WriteLine("    new char");
+			  }
+			  assertEquals(s[nextRead], buffer.get(nextRead));
+			  nextRead++;
+			  availCount++;
+			}
+			else if (random.nextBoolean())
+			{
+			  // Read previous char
+			  int pos = TestUtil.Next(random, nextRead - availCount, nextRead - 1);
+			  if (VERBOSE)
+			  {
+				Console.WriteLine("    old char pos=" + pos);
+			  }
+			  assertEquals(s[pos], buffer.get(pos));
+			}
+			else
+			{
+			  // Read slice
+			  int length;
+			  if (availCount == 1)
+			  {
+				length = 1;
+			  }
+			  else
+			  {
+				length = TestUtil.Next(random, 1, availCount);
+			  }
+			  int start;
+			  if (length == availCount)
+			  {
+				start = nextRead - availCount;
+			  }
+			  else
+			  {
+				start = nextRead - availCount + random.Next(availCount - length);
+			  }
+			  if (VERBOSE)
+			  {
+				Console.WriteLine("    slice start=" + start + " length=" + length);
+			  }
+			  assertEquals(s.Substring(start, length), new string(buffer.get(start, length)));
+			}
+
+			if (availCount > 0 && random.Next(20) == 17)
+			{
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int toFree = random.nextInt(availCount);
+			  int toFree = random.Next(availCount);
+			  if (VERBOSE)
+			  {
+				Console.WriteLine("    free " + toFree + " (avail=" + (availCount - toFree) + ")");
+			  }
+			  buffer.freeBefore(nextRead - (availCount - toFree));
+			  availCount -= toFree;
+			}
+		  }
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestSegmentingTokenizerBase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestSegmentingTokenizerBase.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestSegmentingTokenizerBase.cs
new file mode 100644
index 0000000..0ea4c96
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestSegmentingTokenizerBase.cs
@@ -0,0 +1,251 @@
+using System.Text;
+
+namespace org.apache.lucene.analysis.util
+{
+
+	/*
+	 * Licensed to the Apache Software Foundation (ASF) under one or more
+	 * contributor license agreements.  See the NOTICE file distributed with
+	 * this work for additional information regarding copyright ownership.
+	 * The ASF licenses this file to You under the Apache License, Version 2.0
+	 * (the "License"); you may not use this file except in compliance with
+	 * the License.  You may obtain a copy of the License at
+	 *
+	 *     http://www.apache.org/licenses/LICENSE-2.0
+	 *
+	 * Unless required by applicable law or agreed to in writing, software
+	 * distributed under the License is distributed on an "AS IS" BASIS,
+	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+	 * See the License for the specific language governing permissions and
+	 * limitations under the License.
+	 */
+
+
+	using CharTermAttribute = org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
+	using OffsetAttribute = org.apache.lucene.analysis.tokenattributes.OffsetAttribute;
+	using PositionIncrementAttribute = org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
+
+	/// <summary>
+	/// Basic tests for <seealso cref="SegmentingTokenizerBase"/> </summary>
+	public class TestSegmentingTokenizerBase : BaseTokenStreamTestCase
+	{
+	  private Analyzer sentence = new AnalyzerAnonymousInnerClassHelper();
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  public AnalyzerAnonymousInnerClassHelper()
+		  {
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			return new TokenStreamComponents(new WholeSentenceTokenizer(reader));
+		  }
+	  }
+
+	  private Analyzer sentenceAndWord = new AnalyzerAnonymousInnerClassHelper2();
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  public AnalyzerAnonymousInnerClassHelper2()
+		  {
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			return new TokenStreamComponents(new SentenceAndWordTokenizer(reader));
+		  }
+	  }
+
+	  /// <summary>
+	  /// Some simple examples, just outputting the whole sentence boundaries as "terms" </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBasics() throws java.io.IOException
+	  public virtual void testBasics()
+	  {
+		assertAnalyzesTo(sentence, "The acronym for United States is U.S. but this doesn't end a sentence", new string[] {"The acronym for United States is U.S. but this doesn't end a sentence"});
+		assertAnalyzesTo(sentence, "He said, \"Are you going?\" John shook his head.", new string[] {"He said, \"Are you going?\" ", "John shook his head."});
+	  }
+
+	  /// <summary>
+	  /// Test a subclass that sets some custom attribute values </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCustomAttributes() throws java.io.IOException
+	  public virtual void testCustomAttributes()
+	  {
+		assertAnalyzesTo(sentenceAndWord, "He said, \"Are you going?\" John shook his head.", new string[] {"He", "said", "Are", "you", "going", "John", "shook", "his", "head"}, new int[] {0, 3, 10, 14, 18, 26, 31, 37, 41}, new int[] {2, 7, 13, 17, 23, 30, 36, 40, 45}, new int[] {1, 1, 1, 1, 1, 2, 1, 1, 1});
+	  }
+
+	  /// <summary>
+	  /// Tests tokenstream reuse </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testReuse() throws java.io.IOException
+	  public virtual void testReuse()
+	  {
+		assertAnalyzesTo(sentenceAndWord, "He said, \"Are you going?\"", new string[] {"He", "said", "Are", "you", "going"}, new int[] {0, 3, 10, 14, 18}, new int[] {2, 7, 13, 17, 23}, new int[] {1, 1, 1, 1, 1});
+		assertAnalyzesTo(sentenceAndWord, "John shook his head.", new string[] {"John", "shook", "his", "head"}, new int[] {0, 5, 11, 15}, new int[] {4, 10, 14, 19}, new int[] {1, 1, 1, 1});
+	  }
+
+	  /// <summary>
+	  /// Tests TokenStream.end() </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEnd() throws java.io.IOException
+	  public virtual void testEnd()
+	  {
+		// BaseTokenStreamTestCase asserts that end() is set to our StringReader's length for us here.
+		// we add some junk whitespace to the end just to test it.
+		assertAnalyzesTo(sentenceAndWord, "John shook his head          ", new string[] {"John", "shook", "his", "head"});
+		assertAnalyzesTo(sentenceAndWord, "John shook his head.          ", new string[] {"John", "shook", "his", "head"});
+	  }
+
+	  /// <summary>
+	  /// Tests terms which span across boundaries </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testHugeDoc() throws java.io.IOException
+	  public virtual void testHugeDoc()
+	  {
+		StringBuilder sb = new StringBuilder();
+		char[] whitespace = new char[4094];
+		Arrays.fill(whitespace, '\n');
+		sb.Append(whitespace);
+		sb.Append("testing 1234");
+		string input = sb.ToString();
+		assertAnalyzesTo(sentenceAndWord, input, new string[] {"testing", "1234"});
+	  }
+
+	  /// <summary>
+	  /// Tests the handling of binary/malformed data </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testHugeTerm() throws java.io.IOException
+	  public virtual void testHugeTerm()
+	  {
+		StringBuilder sb = new StringBuilder();
+		for (int i = 0; i < 10240; i++)
+		{
+		  sb.Append('a');
+		}
+		string input = sb.ToString();
+		char[] token = new char[1024];
+		Arrays.fill(token, 'a');
+		string expectedToken = new string(token);
+		string[] expected = new string[] {expectedToken, expectedToken, expectedToken, expectedToken, expectedToken, expectedToken, expectedToken, expectedToken, expectedToken, expectedToken};
+		assertAnalyzesTo(sentence, input, expected);
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), sentence, 10000 * RANDOM_MULTIPLIER);
+		checkRandomData(random(), sentenceAndWord, 10000 * RANDOM_MULTIPLIER);
+	  }
+
+	  // some tokenizers for testing
+
+	  /// <summary>
+	  /// silly tokenizer that just returns whole sentences as tokens </summary>
+	  internal class WholeSentenceTokenizer : SegmentingTokenizerBase
+	  {
+		internal int sentenceStart, sentenceEnd;
+		internal bool hasSentence;
+
+		internal CharTermAttribute termAtt = addAttribute(typeof(CharTermAttribute));
+		internal OffsetAttribute offsetAtt = addAttribute(typeof(OffsetAttribute));
+
+		public WholeSentenceTokenizer(Reader reader) : base(reader, BreakIterator.getSentenceInstance(Locale.ROOT))
+		{
+		}
+
+		protected internal override void setNextSentence(int sentenceStart, int sentenceEnd)
+		{
+		  this.sentenceStart = sentenceStart;
+		  this.sentenceEnd = sentenceEnd;
+		  hasSentence = true;
+		}
+
+		protected internal override bool incrementWord()
+		{
+		  if (hasSentence)
+		  {
+			hasSentence = false;
+			clearAttributes();
+			termAtt.copyBuffer(buffer, sentenceStart, sentenceEnd - sentenceStart);
+			offsetAtt.setOffset(correctOffset(offset + sentenceStart), correctOffset(offset + sentenceEnd));
+			return true;
+		  }
+		  else
+		  {
+			return false;
+		  }
+		}
+	  }
+
+	  /// <summary>
+	  /// simple tokenizer, that bumps posinc + 1 for tokens after a 
+	  /// sentence boundary to inhibit phrase queries without slop.
+	  /// </summary>
+	  internal class SentenceAndWordTokenizer : SegmentingTokenizerBase
+	  {
+		internal int sentenceStart, sentenceEnd;
+		internal int wordStart, wordEnd;
+		internal int posBoost = -1; // initially set to -1 so the first word in the document doesn't get a pos boost
+
+		internal CharTermAttribute termAtt = addAttribute(typeof(CharTermAttribute));
+		internal OffsetAttribute offsetAtt = addAttribute(typeof(OffsetAttribute));
+		internal PositionIncrementAttribute posIncAtt = addAttribute(typeof(PositionIncrementAttribute));
+
+		public SentenceAndWordTokenizer(Reader reader) : base(reader, BreakIterator.getSentenceInstance(Locale.ROOT))
+		{
+		}
+
+		protected internal override void setNextSentence(int sentenceStart, int sentenceEnd)
+		{
+		  this.wordStart = this.wordEnd = this.sentenceStart = sentenceStart;
+		  this.sentenceEnd = sentenceEnd;
+		  posBoost++;
+		}
+
+//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()
+		{
+		  base.reset();
+		  posBoost = -1;
+		}
+
+		protected internal override bool incrementWord()
+		{
+		  wordStart = wordEnd;
+		  while (wordStart < sentenceEnd)
+		  {
+			if (char.IsLetterOrDigit(buffer[wordStart]))
+			{
+			  break;
+			}
+			wordStart++;
+		  }
+
+		  if (wordStart == sentenceEnd)
+		  {
+			  return false;
+		  }
+
+		  wordEnd = wordStart + 1;
+		  while (wordEnd < sentenceEnd && char.IsLetterOrDigit(buffer[wordEnd]))
+		  {
+			wordEnd++;
+		  }
+
+		  clearAttributes();
+		  termAtt.copyBuffer(buffer, wordStart, wordEnd - wordStart);
+		  offsetAtt.setOffset(correctOffset(offset + wordStart), correctOffset(offset + wordEnd));
+		  posIncAtt.PositionIncrement = posIncAtt.PositionIncrement + posBoost;
+		  posBoost = 0;
+		  return true;
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestWordlistLoader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestWordlistLoader.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestWordlistLoader.cs
new file mode 100644
index 0000000..a3e5235
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestWordlistLoader.cs
@@ -0,0 +1,79 @@
+namespace org.apache.lucene.analysis.util
+{
+
+	/*
+	 * Licensed to the Apache Software Foundation (ASF) under one or more
+	 * contributor license agreements.  See the NOTICE file distributed with
+	 * this work for additional information regarding copyright ownership.
+	 * The ASF licenses this file to You under the Apache License, Version 2.0
+	 * (the "License"); you may not use this file except in compliance with
+	 * the License.  You may obtain a copy of the License at
+	 *
+	 *     http://www.apache.org/licenses/LICENSE-2.0
+	 *
+	 * Unless required by applicable law or agreed to in writing, software
+	 * distributed under the License is distributed on an "AS IS" BASIS,
+	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+	 * See the License for the specific language governing permissions and
+	 * limitations under the License.
+	 */
+
+
+	using LuceneTestCase = org.apache.lucene.util.LuceneTestCase;
+
+	public class TestWordlistLoader : LuceneTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testWordlistLoading() throws java.io.IOException
+	  public virtual void testWordlistLoading()
+	  {
+		string s = "ONE\n  two \nthree";
+		CharArraySet wordSet1 = WordlistLoader.getWordSet(new StringReader(s), TEST_VERSION_CURRENT);
+		checkSet(wordSet1);
+		CharArraySet wordSet2 = WordlistLoader.getWordSet(new System.IO.StreamReader(new StringReader(s)), TEST_VERSION_CURRENT);
+		checkSet(wordSet2);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testComments() throws Exception
+	  public virtual void testComments()
+	  {
+		string s = "ONE\n  two \nthree\n#comment";
+		CharArraySet wordSet1 = WordlistLoader.getWordSet(new StringReader(s), "#", TEST_VERSION_CURRENT);
+		checkSet(wordSet1);
+		assertFalse(wordSet1.contains("#comment"));
+		assertFalse(wordSet1.contains("comment"));
+	  }
+
+
+	  private void checkSet(CharArraySet wordset)
+	  {
+		assertEquals(3, wordset.size());
+		assertTrue(wordset.contains("ONE")); // case is not modified
+		assertTrue(wordset.contains("two")); // surrounding whitespace is removed
+		assertTrue(wordset.contains("three"));
+		assertFalse(wordset.contains("four"));
+	  }
+
+	  /// <summary>
+	  /// Test stopwords in snowball format
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testSnowballListLoading() throws java.io.IOException
+	  public virtual void testSnowballListLoading()
+	  {
+		string s = "|comment\n" + " |comment\n" + "\n" + "  \t\n" + " |comment | comment\n" + "ONE\n" + "   two   \n" + " three   four five \n" + "six seven | comment\n"; //multiple stopwords + comment -  multiple stopwords -  stopword with leading/trailing space -  stopword, in uppercase -  commented line with comment -  line with only whitespace -  blank line -  commented line with leading whitespace -  commented line
+		CharArraySet wordset = WordlistLoader.getSnowballWordSet(new StringReader(s), TEST_VERSION_CURRENT);
+		assertEquals(7, wordset.size());
+		assertTrue(wordset.contains("ONE"));
+		assertTrue(wordset.contains("two"));
+		assertTrue(wordset.contains("three"));
+		assertTrue(wordset.contains("four"));
+		assertTrue(wordset.contains("five"));
+		assertTrue(wordset.contains("six"));
+		assertTrue(wordset.contains("seven"));
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Wikipedia/TestWikipediaTokenizerFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Wikipedia/TestWikipediaTokenizerFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Wikipedia/TestWikipediaTokenizerFactory.cs
new file mode 100644
index 0000000..c87a2e5
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Wikipedia/TestWikipediaTokenizerFactory.cs
@@ -0,0 +1,56 @@
+namespace org.apache.lucene.analysis.wikipedia
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the wikipedia tokenizer is working.
+	/// </summary>
+	public class TestWikipediaTokenizerFactory : BaseTokenStreamFactoryTestCase
+	{
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTokenizer() throws Exception
+	  public virtual void testTokenizer()
+	  {
+		Reader reader = new StringReader("This is a [[Category:foo]]");
+		Tokenizer tokenizer = tokenizerFactory("Wikipedia").create(reader);
+		assertTokenStreamContents(tokenizer, new string[] {"This", "is", "a", "foo"}, new int[] {0, 5, 8, 21}, new int[] {4, 7, 9, 24}, new string[] {"<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", WikipediaTokenizer.CATEGORY}, new int[] {1, 1, 1, 1});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenizerFactory("Wikipedia", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file


[08/27] lucenenet git commit: adding converted analysis common tests

Posted by sy...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Payloads/DelimitedPayloadTokenFilterTest.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Payloads/DelimitedPayloadTokenFilterTest.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Payloads/DelimitedPayloadTokenFilterTest.cs
new file mode 100644
index 0000000..1d30cee
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Payloads/DelimitedPayloadTokenFilterTest.cs
@@ -0,0 +1,173 @@
+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 CharTermAttribute = org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
+	using PayloadAttribute = org.apache.lucene.analysis.tokenattributes.PayloadAttribute;
+	using BytesRef = org.apache.lucene.util.BytesRef;
+	using LuceneTestCase = org.apache.lucene.util.LuceneTestCase;
+
+
+	public class DelimitedPayloadTokenFilterTest : LuceneTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testPayloads() throws Exception
+	  public virtual void testPayloads()
+	  {
+		string test = "The quick|JJ red|JJ fox|NN jumped|VB over the lazy|JJ brown|JJ dogs|NN";
+		DelimitedPayloadTokenFilter filter = new DelimitedPayloadTokenFilter(new MockTokenizer(new StringReader(test), MockTokenizer.WHITESPACE, false), DelimitedPayloadTokenFilter.DEFAULT_DELIMITER, new IdentityEncoder());
+		CharTermAttribute termAtt = filter.getAttribute(typeof(CharTermAttribute));
+		PayloadAttribute payAtt = filter.getAttribute(typeof(PayloadAttribute));
+		filter.reset();
+		assertTermEquals("The", filter, termAtt, payAtt, null);
+		assertTermEquals("quick", filter, termAtt, payAtt, "JJ".GetBytes(StandardCharsets.UTF_8));
+		assertTermEquals("red", filter, termAtt, payAtt, "JJ".GetBytes(StandardCharsets.UTF_8));
+		assertTermEquals("fox", filter, termAtt, payAtt, "NN".GetBytes(StandardCharsets.UTF_8));
+		assertTermEquals("jumped", filter, termAtt, payAtt, "VB".GetBytes(StandardCharsets.UTF_8));
+		assertTermEquals("over", filter, termAtt, payAtt, null);
+		assertTermEquals("the", filter, termAtt, payAtt, null);
+		assertTermEquals("lazy", filter, termAtt, payAtt, "JJ".GetBytes(StandardCharsets.UTF_8));
+		assertTermEquals("brown", filter, termAtt, payAtt, "JJ".GetBytes(StandardCharsets.UTF_8));
+		assertTermEquals("dogs", filter, termAtt, payAtt, "NN".GetBytes(StandardCharsets.UTF_8));
+		assertFalse(filter.incrementToken());
+		filter.end();
+		filter.close();
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNext() throws Exception
+	  public virtual void testNext()
+	  {
+
+		string test = "The quick|JJ red|JJ fox|NN jumped|VB over the lazy|JJ brown|JJ dogs|NN";
+		DelimitedPayloadTokenFilter filter = new DelimitedPayloadTokenFilter(new MockTokenizer(new StringReader(test), MockTokenizer.WHITESPACE, false), DelimitedPayloadTokenFilter.DEFAULT_DELIMITER, new IdentityEncoder());
+		filter.reset();
+		assertTermEquals("The", filter, null);
+		assertTermEquals("quick", filter, "JJ".GetBytes(StandardCharsets.UTF_8));
+		assertTermEquals("red", filter, "JJ".GetBytes(StandardCharsets.UTF_8));
+		assertTermEquals("fox", filter, "NN".GetBytes(StandardCharsets.UTF_8));
+		assertTermEquals("jumped", filter, "VB".GetBytes(StandardCharsets.UTF_8));
+		assertTermEquals("over", filter, null);
+		assertTermEquals("the", filter, null);
+		assertTermEquals("lazy", filter, "JJ".GetBytes(StandardCharsets.UTF_8));
+		assertTermEquals("brown", filter, "JJ".GetBytes(StandardCharsets.UTF_8));
+		assertTermEquals("dogs", filter, "NN".GetBytes(StandardCharsets.UTF_8));
+		assertFalse(filter.incrementToken());
+		filter.end();
+		filter.close();
+	  }
+
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFloatEncoding() throws Exception
+	  public virtual void testFloatEncoding()
+	  {
+		string test = "The quick|1.0 red|2.0 fox|3.5 jumped|0.5 over the lazy|5 brown|99.3 dogs|83.7";
+		DelimitedPayloadTokenFilter filter = new DelimitedPayloadTokenFilter(new MockTokenizer(new StringReader(test), MockTokenizer.WHITESPACE, false), '|', new FloatEncoder());
+		CharTermAttribute termAtt = filter.getAttribute(typeof(CharTermAttribute));
+		PayloadAttribute payAtt = filter.getAttribute(typeof(PayloadAttribute));
+		filter.reset();
+		assertTermEquals("The", filter, termAtt, payAtt, null);
+		assertTermEquals("quick", filter, termAtt, payAtt, PayloadHelper.encodeFloat(1.0f));
+		assertTermEquals("red", filter, termAtt, payAtt, PayloadHelper.encodeFloat(2.0f));
+		assertTermEquals("fox", filter, termAtt, payAtt, PayloadHelper.encodeFloat(3.5f));
+		assertTermEquals("jumped", filter, termAtt, payAtt, PayloadHelper.encodeFloat(0.5f));
+		assertTermEquals("over", filter, termAtt, payAtt, null);
+		assertTermEquals("the", filter, termAtt, payAtt, null);
+		assertTermEquals("lazy", filter, termAtt, payAtt, PayloadHelper.encodeFloat(5.0f));
+		assertTermEquals("brown", filter, termAtt, payAtt, PayloadHelper.encodeFloat(99.3f));
+		assertTermEquals("dogs", filter, termAtt, payAtt, PayloadHelper.encodeFloat(83.7f));
+		assertFalse(filter.incrementToken());
+		filter.end();
+		filter.close();
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testIntEncoding() throws Exception
+	  public virtual void testIntEncoding()
+	  {
+		string test = "The quick|1 red|2 fox|3 jumped over the lazy|5 brown|99 dogs|83";
+		DelimitedPayloadTokenFilter filter = new DelimitedPayloadTokenFilter(new MockTokenizer(new StringReader(test), MockTokenizer.WHITESPACE, false), '|', new IntegerEncoder());
+		CharTermAttribute termAtt = filter.getAttribute(typeof(CharTermAttribute));
+		PayloadAttribute payAtt = filter.getAttribute(typeof(PayloadAttribute));
+		filter.reset();
+		assertTermEquals("The", filter, termAtt, payAtt, null);
+		assertTermEquals("quick", filter, termAtt, payAtt, PayloadHelper.encodeInt(1));
+		assertTermEquals("red", filter, termAtt, payAtt, PayloadHelper.encodeInt(2));
+		assertTermEquals("fox", filter, termAtt, payAtt, PayloadHelper.encodeInt(3));
+		assertTermEquals("jumped", filter, termAtt, payAtt, null);
+		assertTermEquals("over", filter, termAtt, payAtt, null);
+		assertTermEquals("the", filter, termAtt, payAtt, null);
+		assertTermEquals("lazy", filter, termAtt, payAtt, PayloadHelper.encodeInt(5));
+		assertTermEquals("brown", filter, termAtt, payAtt, PayloadHelper.encodeInt(99));
+		assertTermEquals("dogs", filter, termAtt, payAtt, PayloadHelper.encodeInt(83));
+		assertFalse(filter.incrementToken());
+		filter.end();
+		filter.close();
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: void assertTermEquals(String expected, org.apache.lucene.analysis.TokenStream stream, byte[] expectPay) throws Exception
+	  internal virtual void assertTermEquals(string expected, TokenStream stream, sbyte[] expectPay)
+	  {
+		CharTermAttribute termAtt = stream.getAttribute(typeof(CharTermAttribute));
+		PayloadAttribute payloadAtt = stream.getAttribute(typeof(PayloadAttribute));
+		assertTrue(stream.incrementToken());
+		assertEquals(expected, termAtt.ToString());
+		BytesRef payload = payloadAtt.Payload;
+		if (payload != null)
+		{
+		  assertTrue(payload.length + " does not equal: " + expectPay.Length, payload.length == expectPay.Length);
+		  for (int i = 0; i < expectPay.Length; i++)
+		  {
+			assertTrue(expectPay[i] + " does not equal: " + payload.bytes[i + payload.offset], expectPay[i] == payload.bytes[i + payload.offset]);
+
+		  }
+		}
+		else
+		{
+		  assertTrue("expectPay is not null and it should be", expectPay == null);
+		}
+	  }
+
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: void assertTermEquals(String expected, org.apache.lucene.analysis.TokenStream stream, org.apache.lucene.analysis.tokenattributes.CharTermAttribute termAtt, org.apache.lucene.analysis.tokenattributes.PayloadAttribute payAtt, byte[] expectPay) throws Exception
+	  internal virtual void assertTermEquals(string expected, TokenStream stream, CharTermAttribute termAtt, PayloadAttribute payAtt, sbyte[] expectPay)
+	  {
+		assertTrue(stream.incrementToken());
+		assertEquals(expected, termAtt.ToString());
+		BytesRef payload = payAtt.Payload;
+		if (payload != null)
+		{
+		  assertTrue(payload.length + " does not equal: " + expectPay.Length, payload.length == expectPay.Length);
+		  for (int i = 0; i < expectPay.Length; i++)
+		  {
+			assertTrue(expectPay[i] + " does not equal: " + payload.bytes[i + payload.offset], expectPay[i] == payload.bytes[i + payload.offset]);
+
+		  }
+		}
+		else
+		{
+		  assertTrue("expectPay is not null and it should be", expectPay == null);
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Payloads/NumericPayloadTokenFilterTest.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Payloads/NumericPayloadTokenFilterTest.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Payloads/NumericPayloadTokenFilterTest.cs
new file mode 100644
index 0000000..389413b
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Payloads/NumericPayloadTokenFilterTest.cs
@@ -0,0 +1,93 @@
+namespace org.apache.lucene.analysis.payloads
+{
+
+	/// <summary>
+	/// Copyright 2004 The Apache Software Foundation
+	/// 
+	/// Licensed 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>
+
+	using CharTermAttribute = org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
+	using PayloadAttribute = org.apache.lucene.analysis.tokenattributes.PayloadAttribute;
+	using TypeAttribute = org.apache.lucene.analysis.tokenattributes.TypeAttribute;
+
+
+	public class NumericPayloadTokenFilterTest : BaseTokenStreamTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void test() throws java.io.IOException
+	  public virtual void test()
+	  {
+		string test = "The quick red fox jumped over the lazy brown dogs";
+
+		NumericPayloadTokenFilter nptf = new NumericPayloadTokenFilter(new WordTokenFilter(this, new MockTokenizer(new StringReader(test), MockTokenizer.WHITESPACE, false)), 3, "D");
+		bool seenDogs = false;
+		CharTermAttribute termAtt = nptf.getAttribute(typeof(CharTermAttribute));
+		TypeAttribute typeAtt = nptf.getAttribute(typeof(TypeAttribute));
+		PayloadAttribute payloadAtt = nptf.getAttribute(typeof(PayloadAttribute));
+		nptf.reset();
+		while (nptf.incrementToken())
+		{
+		  if (termAtt.ToString().Equals("dogs"))
+		  {
+			seenDogs = true;
+			assertTrue(typeAtt.type() + " is not equal to " + "D", typeAtt.type().Equals("D") == true);
+			assertTrue("payloadAtt.getPayload() is null and it shouldn't be", payloadAtt.Payload != null);
+			sbyte[] bytes = payloadAtt.Payload.bytes; //safe here to just use the bytes, otherwise we should use offset, length
+			assertTrue(bytes.Length + " does not equal: " + payloadAtt.Payload.length, bytes.Length == payloadAtt.Payload.length);
+			assertTrue(payloadAtt.Payload.offset + " does not equal: " + 0, payloadAtt.Payload.offset == 0);
+			float pay = PayloadHelper.decodeFloat(bytes);
+			assertTrue(pay + " does not equal: " + 3, pay == 3);
+		  }
+		  else
+		  {
+			assertTrue(typeAtt.type() + " is not null and it should be", typeAtt.type().Equals("word"));
+		  }
+		}
+		assertTrue(seenDogs + " does not equal: " + true, seenDogs == true);
+	  }
+
+	  private sealed class WordTokenFilter : TokenFilter
+	  {
+		  private readonly NumericPayloadTokenFilterTest outerInstance;
+
+		internal readonly CharTermAttribute termAtt = addAttribute(typeof(CharTermAttribute));
+		internal readonly TypeAttribute typeAtt = addAttribute(typeof(TypeAttribute));
+
+		internal WordTokenFilter(NumericPayloadTokenFilterTest outerInstance, TokenStream input) : base(input)
+		{
+			this.outerInstance = outerInstance;
+		}
+
+//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())
+		  {
+			if (termAtt.ToString().Equals("dogs"))
+			{
+			  typeAtt.Type = "D";
+			}
+			return true;
+		  }
+		  else
+		  {
+			return false;
+		  }
+		}
+	  }
+
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Payloads/TestDelimitedPayloadTokenFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Payloads/TestDelimitedPayloadTokenFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Payloads/TestDelimitedPayloadTokenFilterFactory.cs
new file mode 100644
index 0000000..7db6e66
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Payloads/TestDelimitedPayloadTokenFilterFactory.cs
@@ -0,0 +1,90 @@
+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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	public class TestDelimitedPayloadTokenFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEncoder() throws Exception
+	  public virtual void testEncoder()
+	  {
+		Reader reader = new StringReader("the|0.1 quick|0.1 red|0.1");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("DelimitedPayload", "encoder", "float").create(stream);
+
+		stream.reset();
+		while (stream.incrementToken())
+		{
+		  PayloadAttribute payAttr = stream.getAttribute(typeof(PayloadAttribute));
+		  assertNotNull(payAttr);
+		  sbyte[] payData = payAttr.Payload.bytes;
+		  assertNotNull(payData);
+		  float payFloat = PayloadHelper.decodeFloat(payData);
+		  assertEquals(0.1f, payFloat, 0.0f);
+		}
+		stream.end();
+		stream.close();
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testDelim() throws Exception
+	  public virtual void testDelim()
+	  {
+		Reader reader = new StringReader("the*0.1 quick*0.1 red*0.1");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("DelimitedPayload", "encoder", "float", "delimiter", "*").create(stream);
+		stream.reset();
+		while (stream.incrementToken())
+		{
+		  PayloadAttribute payAttr = stream.getAttribute(typeof(PayloadAttribute));
+		  assertNotNull(payAttr);
+		  sbyte[] payData = payAttr.Payload.bytes;
+		  assertNotNull(payData);
+		  float payFloat = PayloadHelper.decodeFloat(payData);
+		  assertEquals(0.1f, payFloat, 0.0f);
+		}
+		stream.end();
+		stream.close();
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("DelimitedPayload", "encoder", "float", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Payloads/TokenOffsetPayloadTokenFilterTest.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Payloads/TokenOffsetPayloadTokenFilterTest.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Payloads/TokenOffsetPayloadTokenFilterTest.cs
new file mode 100644
index 0000000..38b71ae
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Payloads/TokenOffsetPayloadTokenFilterTest.cs
@@ -0,0 +1,56 @@
+namespace org.apache.lucene.analysis.payloads
+{
+
+	/// <summary>
+	/// Copyright 2004 The Apache Software Foundation
+	/// 
+	/// Licensed 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>
+
+	using OffsetAttribute = org.apache.lucene.analysis.tokenattributes.OffsetAttribute;
+	using PayloadAttribute = org.apache.lucene.analysis.tokenattributes.PayloadAttribute;
+	using BytesRef = org.apache.lucene.util.BytesRef;
+
+
+	public class TokenOffsetPayloadTokenFilterTest : BaseTokenStreamTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void test() throws java.io.IOException
+	  public virtual void test()
+	  {
+		string test = "The quick red fox jumped over the lazy brown dogs";
+
+		TokenOffsetPayloadTokenFilter nptf = new TokenOffsetPayloadTokenFilter(new MockTokenizer(new StringReader(test), MockTokenizer.WHITESPACE, false));
+		int count = 0;
+		PayloadAttribute payloadAtt = nptf.getAttribute(typeof(PayloadAttribute));
+		OffsetAttribute offsetAtt = nptf.getAttribute(typeof(OffsetAttribute));
+		nptf.reset();
+		while (nptf.incrementToken())
+		{
+		  BytesRef pay = payloadAtt.Payload;
+		  assertTrue("pay is null and it shouldn't be", pay != null);
+		  sbyte[] data = pay.bytes;
+		  int start = PayloadHelper.decodeInt(data, 0);
+		  assertTrue(start + " does not equal: " + offsetAtt.startOffset(), start == offsetAtt.startOffset());
+		  int end = PayloadHelper.decodeInt(data, 4);
+		  assertTrue(end + " does not equal: " + offsetAtt.endOffset(), end == offsetAtt.endOffset());
+		  count++;
+		}
+		assertTrue(count + " does not equal: " + 10, count == 10);
+
+	  }
+
+
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Payloads/TypeAsPayloadTokenFilterTest.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Payloads/TypeAsPayloadTokenFilterTest.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Payloads/TypeAsPayloadTokenFilterTest.cs
new file mode 100644
index 0000000..5796b39
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Payloads/TypeAsPayloadTokenFilterTest.cs
@@ -0,0 +1,81 @@
+namespace org.apache.lucene.analysis.payloads
+{
+
+	/// <summary>
+	/// Copyright 2004 The Apache Software Foundation
+	/// 
+	/// Licensed 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>
+
+	using PayloadAttribute = org.apache.lucene.analysis.tokenattributes.PayloadAttribute;
+	using CharTermAttribute = org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
+	using TypeAttribute = org.apache.lucene.analysis.tokenattributes.TypeAttribute;
+
+
+	public class TypeAsPayloadTokenFilterTest : BaseTokenStreamTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void test() throws java.io.IOException
+	  public virtual void test()
+	  {
+		string test = "The quick red fox jumped over the lazy brown dogs";
+
+		TypeAsPayloadTokenFilter nptf = new TypeAsPayloadTokenFilter(new WordTokenFilter(this, new MockTokenizer(new StringReader(test), MockTokenizer.WHITESPACE, false)));
+		int count = 0;
+		CharTermAttribute termAtt = nptf.getAttribute(typeof(CharTermAttribute));
+		TypeAttribute typeAtt = nptf.getAttribute(typeof(TypeAttribute));
+		PayloadAttribute payloadAtt = nptf.getAttribute(typeof(PayloadAttribute));
+		nptf.reset();
+		while (nptf.incrementToken())
+		{
+		  assertTrue(typeAtt.type() + " is not null and it should be", typeAtt.type().Equals(char.ToUpper(termAtt.buffer()[0]).ToString()));
+		  assertTrue("nextToken.getPayload() is null and it shouldn't be", payloadAtt.Payload != null);
+		  string type = payloadAtt.Payload.utf8ToString();
+		  assertTrue(type + " is not equal to " + typeAtt.type(), type.Equals(typeAtt.type()));
+		  count++;
+		}
+
+		assertTrue(count + " does not equal: " + 10, count == 10);
+	  }
+
+	  private sealed class WordTokenFilter : TokenFilter
+	  {
+		  private readonly TypeAsPayloadTokenFilterTest outerInstance;
+
+		internal readonly CharTermAttribute termAtt = addAttribute(typeof(CharTermAttribute));
+		internal readonly TypeAttribute typeAtt = addAttribute(typeof(TypeAttribute));
+
+		internal WordTokenFilter(TypeAsPayloadTokenFilterTest outerInstance, TokenStream input) : base(input)
+		{
+			this.outerInstance = outerInstance;
+		}
+
+//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())
+		  {
+			typeAtt.Type = char.ToUpper(termAtt.buffer()[0]).ToString();
+			return true;
+		  }
+		  else
+		  {
+			return false;
+		  }
+		}
+	  }
+
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Position/PositionFilterTest.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Position/PositionFilterTest.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Position/PositionFilterTest.cs
new file mode 100644
index 0000000..8af053f
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Position/PositionFilterTest.cs
@@ -0,0 +1,112 @@
+namespace org.apache.lucene.analysis.position
+{
+
+	/*
+	 * Licensed to the Apache Software Foundation (ASF) under one or more
+	 * contributor license agreements.  See the NOTICE file distributed with
+	 * this work for additional information regarding copyright ownership.
+	 * The ASF licenses this file to You under the Apache License, Version 2.0
+	 * (the "License"); you may not use this file except in compliance with
+	 * the License.  You may obtain a copy of the License at
+	 *
+	 *     http://www.apache.org/licenses/LICENSE-2.0
+	 *
+	 * Unless required by applicable law or agreed to in writing, software
+	 * distributed under the License is distributed on an "AS IS" BASIS,
+	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+	 * See the License for the specific language governing permissions and
+	 * limitations under the License.
+	 */
+
+	using ShingleFilter = org.apache.lucene.analysis.shingle.ShingleFilter;
+	using CharTermAttribute = org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
+
+	public class PositionFilterTest : BaseTokenStreamTestCase
+	{
+
+	  public class TestTokenStream : TokenStream
+	  {
+		  private readonly PositionFilterTest outerInstance;
+
+
+		protected internal int index = 0;
+		protected internal string[] testToken;
+		protected internal readonly CharTermAttribute termAtt = addAttribute(typeof(CharTermAttribute));
+
+		public TestTokenStream(PositionFilterTest outerInstance, string[] testToken) : base()
+		{
+			this.outerInstance = outerInstance;
+		  this.testToken = testToken;
+		}
+
+		public override bool incrementToken()
+		{
+		  clearAttributes();
+		  if (index < testToken.Length)
+		  {
+			termAtt.setEmpty().append(testToken[index++]);
+			return true;
+		  }
+		  else
+		  {
+			return false;
+		  }
+		}
+		public override void reset()
+		{
+		  index = 0;
+		}
+	  }
+
+	  public static readonly string[] TEST_TOKEN = new string[]{"please", "divide", "this", "sentence", "into", "shingles"};
+	  public static readonly int[] TEST_TOKEN_POSITION_INCREMENTS = new int[]{1, 0, 0, 0, 0, 0};
+	  public static readonly int[] TEST_TOKEN_NON_ZERO_POSITION_INCREMENTS = new int[]{1, 5, 5, 5, 5, 5};
+
+	  public static readonly string[] SIX_GRAM_NO_POSITIONS_TOKENS = new string[]{"please", "please divide", "please divide this", "please divide this sentence", "please divide this sentence into", "please divide this sentence into shingles", "divide", "divide this", "divide this sentence", "divide this sentence into", "divide this sentence into shingles", "this", "this sentence", "this sentence into", "this sentence into shingles", "sentence", "sentence into", "sentence into shingles", "into", "into shingles", "shingles"};
+	  public static readonly int[] SIX_GRAM_NO_POSITIONS_INCREMENTS = new int[]{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+	  public static readonly string[] SIX_GRAM_NO_POSITIONS_TYPES = new string[]{"word", "shingle", "shingle", "shingle", "shingle", "shingle", "word", "shingle", "shingle", "shingle", "shingle", "word", "shingle", "shingle", "shingle", "word", "shingle", "shingle", "word", "shingle", "word"};
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFilter() throws Exception
+	  public virtual void testFilter()
+	  {
+
+		assertTokenStreamContents(new PositionFilter(new TestTokenStream(this, TEST_TOKEN)), TEST_TOKEN, TEST_TOKEN_POSITION_INCREMENTS);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNonZeroPositionIncrement() throws Exception
+	  public virtual void testNonZeroPositionIncrement()
+	  {
+
+		assertTokenStreamContents(new PositionFilter(new TestTokenStream(this, TEST_TOKEN), 5), TEST_TOKEN, TEST_TOKEN_NON_ZERO_POSITION_INCREMENTS);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testReset() throws Exception
+	  public virtual void testReset()
+	  {
+
+		PositionFilter filter = new PositionFilter(new TestTokenStream(this, TEST_TOKEN));
+		assertTokenStreamContents(filter, TEST_TOKEN, TEST_TOKEN_POSITION_INCREMENTS);
+		filter.reset();
+		// Make sure that the reset filter provides correct position increments
+		assertTokenStreamContents(filter, TEST_TOKEN, TEST_TOKEN_POSITION_INCREMENTS);
+	  }
+
+	  /// <summary>
+	  /// Tests ShingleFilter up to six shingles against six terms.
+	  ///  Tests PositionFilter setting all but the first positionIncrement to zero. </summary> </exception>
+	  /// <exception cref="java.io.IOException"> <seealso cref= Token#next(Token) </seealso>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void test6GramFilterNoPositions() throws Exception
+	  public virtual void test6GramFilterNoPositions()
+	  {
+
+		ShingleFilter filter = new ShingleFilter(new TestTokenStream(this, TEST_TOKEN), 6);
+		assertTokenStreamContents(new PositionFilter(filter), SIX_GRAM_NO_POSITIONS_TOKENS, SIX_GRAM_NO_POSITIONS_INCREMENTS);
+	  }
+
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pt/TestPortugueseAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pt/TestPortugueseAnalyzer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pt/TestPortugueseAnalyzer.cs
new file mode 100644
index 0000000..53453be
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pt/TestPortugueseAnalyzer.cs
@@ -0,0 +1,70 @@
+namespace org.apache.lucene.analysis.pt
+{
+
+	/*
+	 * 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 CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+
+	public class TestPortugueseAnalyzer : BaseTokenStreamTestCase
+	{
+	  /// <summary>
+	  /// This test fails with NPE when the 
+	  /// stopwords file is missing in classpath 
+	  /// </summary>
+	  public virtual void testResourcesAvailable()
+	  {
+		new PortugueseAnalyzer(TEST_VERSION_CURRENT);
+	  }
+
+	  /// <summary>
+	  /// test stopwords and stemming </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBasics() throws java.io.IOException
+	  public virtual void testBasics()
+	  {
+		Analyzer a = new PortugueseAnalyzer(TEST_VERSION_CURRENT);
+		// stemming
+		checkOneTerm(a, "quilométricas", "quilometric");
+		checkOneTerm(a, "quilométricos", "quilometric");
+		// stopword
+		assertAnalyzesTo(a, "não", new string[] {});
+	  }
+
+	  /// <summary>
+	  /// test use of exclusion set </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testExclude() throws java.io.IOException
+	  public virtual void testExclude()
+	  {
+		CharArraySet exclusionSet = new CharArraySet(TEST_VERSION_CURRENT, asSet("quilométricas"), false);
+		Analyzer a = new PortugueseAnalyzer(TEST_VERSION_CURRENT, PortugueseAnalyzer.DefaultStopSet, exclusionSet);
+		checkOneTerm(a, "quilométricas", "quilométricas");
+		checkOneTerm(a, "quilométricos", "quilometric");
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), new PortugueseAnalyzer(TEST_VERSION_CURRENT), 1000 * RANDOM_MULTIPLIER);
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pt/TestPortugueseLightStemFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pt/TestPortugueseLightStemFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pt/TestPortugueseLightStemFilter.cs
new file mode 100644
index 0000000..e8fc9c7
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pt/TestPortugueseLightStemFilter.cs
@@ -0,0 +1,167 @@
+namespace org.apache.lucene.analysis.pt
+{
+
+	/*
+	 * 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 TokenStreamComponents = org.apache.lucene.analysis.Analyzer.TokenStreamComponents;
+	using KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+	using LowerCaseFilter = org.apache.lucene.analysis.core.LowerCaseFilter;
+	using SetKeywordMarkerFilter = org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter;
+	using StandardTokenizer = org.apache.lucene.analysis.standard.StandardTokenizer;
+	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+
+//JAVA TO C# CONVERTER TODO TASK: This Java 'import static' statement cannot be converted to C#:
+//	import static org.apache.lucene.analysis.VocabularyAssert.*;
+
+	/// <summary>
+	/// Simple tests for <seealso cref="PortugueseLightStemFilter"/>
+	/// </summary>
+	public class TestPortugueseLightStemFilter : BaseTokenStreamTestCase
+	{
+	  private Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper();
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  public AnalyzerAnonymousInnerClassHelper()
+		  {
+		  }
+
+		  protected internal override Analyzer.TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer source = new StandardTokenizer(TEST_VERSION_CURRENT, reader);
+			TokenStream result = new LowerCaseFilter(TEST_VERSION_CURRENT, source);
+			return new Analyzer.TokenStreamComponents(source, new PortugueseLightStemFilter(result));
+		  }
+	  }
+
+	  /// <summary>
+	  /// Test the example from the paper "Assessing the impact of stemming accuracy
+	  /// on information retrieval"
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testExamples() throws java.io.IOException
+	  public virtual void testExamples()
+	  {
+		assertAnalyzesTo(analyzer, "O debate político, pelo menos o que vem a público, parece, de modo nada " + "surpreendente, restrito a temas menores. Mas há, evidentemente, " + "grandes questões em jogo nas eleições que se aproximam.", new string[] {"o", "debat", "politic", "pelo", "meno", "o", "que", "vem", "a", "public", "parec", "de", "modo", "nada", "surpreendent", "restrit", "a", "tema", "menor", "mas", "há", "evident", "grand", "questa", "em", "jogo", "nas", "eleica", "que", "se", "aproximam"});
+	  }
+
+	  /// <summary>
+	  /// Test examples from the c implementation
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMoreExamples() throws java.io.IOException
+	  public virtual void testMoreExamples()
+	  {
+		 checkOneTerm(analyzer, "doutores", "doutor");
+		 checkOneTerm(analyzer, "doutor", "doutor");
+
+		 checkOneTerm(analyzer, "homens", "homem");
+		 checkOneTerm(analyzer, "homem", "homem");
+
+		 checkOneTerm(analyzer, "papéis", "papel");
+		 checkOneTerm(analyzer, "papel", "papel");
+
+		 checkOneTerm(analyzer, "normais", "normal");
+		 checkOneTerm(analyzer, "normal", "normal");
+
+		 checkOneTerm(analyzer, "lencóis", "lencol");
+		 checkOneTerm(analyzer, "lencol", "lencol");
+
+		 checkOneTerm(analyzer, "barris", "barril");
+		 checkOneTerm(analyzer, "barril", "barril");
+
+		 checkOneTerm(analyzer, "botões", "bota");
+		 checkOneTerm(analyzer, "botão", "bota");
+	  }
+
+	  /// <summary>
+	  /// Test against a vocabulary from the reference impl </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testVocabulary() throws java.io.IOException
+	  public virtual void testVocabulary()
+	  {
+		assertVocabulary(analyzer, getDataFile("ptlighttestdata.zip"), "ptlight.txt");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testKeyword() throws java.io.IOException
+	  public virtual void testKeyword()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.util.CharArraySet exclusionSet = new org.apache.lucene.analysis.util.CharArraySet(TEST_VERSION_CURRENT, asSet("quilométricas"), false);
+		CharArraySet exclusionSet = new CharArraySet(TEST_VERSION_CURRENT, asSet("quilométricas"), false);
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper2(this, exclusionSet);
+		checkOneTerm(a, "quilométricas", "quilométricas");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestPortugueseLightStemFilter outerInstance;
+
+		  private CharArraySet exclusionSet;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestPortugueseLightStemFilter outerInstance, CharArraySet exclusionSet)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.exclusionSet = exclusionSet;
+		  }
+
+		  protected internal override Analyzer.TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer source = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			TokenStream sink = new SetKeywordMarkerFilter(source, exclusionSet);
+			return new Analyzer.TokenStreamComponents(source, new PortugueseLightStemFilter(sink));
+		  }
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), analyzer, 1000 * RANDOM_MULTIPLIER);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper3(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper3 : Analyzer
+	  {
+		  private readonly TestPortugueseLightStemFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper3(TestPortugueseLightStemFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override Analyzer.TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new Analyzer.TokenStreamComponents(tokenizer, new PortugueseLightStemFilter(tokenizer));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pt/TestPortugueseLightStemFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pt/TestPortugueseLightStemFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pt/TestPortugueseLightStemFilterFactory.cs
new file mode 100644
index 0000000..96c4b3a
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pt/TestPortugueseLightStemFilterFactory.cs
@@ -0,0 +1,57 @@
+namespace org.apache.lucene.analysis.pt
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the Portuguese Light stem factory is working.
+	/// </summary>
+	public class TestPortugueseLightStemFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStemming() throws Exception
+	  public virtual void testStemming()
+	  {
+		Reader reader = new StringReader("evidentemente");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("PortugueseLightStem").create(stream);
+		assertTokenStreamContents(stream, new string[] {"evident"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("PortugueseLightStem", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pt/TestPortugueseMinimalStemFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pt/TestPortugueseMinimalStemFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pt/TestPortugueseMinimalStemFilter.cs
new file mode 100644
index 0000000..77a9f1f
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pt/TestPortugueseMinimalStemFilter.cs
@@ -0,0 +1,138 @@
+namespace org.apache.lucene.analysis.pt
+{
+
+	/*
+	 * 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 TokenStreamComponents = org.apache.lucene.analysis.Analyzer.TokenStreamComponents;
+	using KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+	using LowerCaseFilter = org.apache.lucene.analysis.core.LowerCaseFilter;
+	using SetKeywordMarkerFilter = org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter;
+	using StandardTokenizer = org.apache.lucene.analysis.standard.StandardTokenizer;
+	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+
+//JAVA TO C# CONVERTER TODO TASK: This Java 'import static' statement cannot be converted to C#:
+//	import static org.apache.lucene.analysis.VocabularyAssert.*;
+
+	/// <summary>
+	/// Simple tests for <seealso cref="PortugueseMinimalStemFilter"/>
+	/// </summary>
+	public class TestPortugueseMinimalStemFilter : BaseTokenStreamTestCase
+	{
+	  private Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper();
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  public AnalyzerAnonymousInnerClassHelper()
+		  {
+		  }
+
+		  protected internal override Analyzer.TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer source = new StandardTokenizer(TEST_VERSION_CURRENT, reader);
+			TokenStream result = new LowerCaseFilter(TEST_VERSION_CURRENT, source);
+			return new Analyzer.TokenStreamComponents(source, new PortugueseMinimalStemFilter(result));
+		  }
+	  }
+
+	  /// <summary>
+	  /// Test the example from the paper "Assessing the impact of stemming accuracy
+	  /// on information retrieval"
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testExamples() throws java.io.IOException
+	  public virtual void testExamples()
+	  {
+		assertAnalyzesTo(analyzer, "O debate político, pelo menos o que vem a público, parece, de modo nada " + "surpreendente, restrito a temas menores. Mas há, evidentemente, " + "grandes questões em jogo nas eleições que se aproximam.", new string[] {"o", "debate", "político", "pelo", "menos", "o", "que", "vem", "a", "público", "parece", "de", "modo", "nada", "surpreendente", "restrito", "a", "tema", "menor", "mas", "há", "evidentemente", "grande", "questão", "em", "jogo", "na", "eleição", "que", "se", "aproximam"});
+	  }
+
+	  /// <summary>
+	  /// Test against a vocabulary from the reference impl </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testVocabulary() throws java.io.IOException
+	  public virtual void testVocabulary()
+	  {
+		assertVocabulary(analyzer, getDataFile("ptminimaltestdata.zip"), "ptminimal.txt");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testKeyword() throws java.io.IOException
+	  public virtual void testKeyword()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.util.CharArraySet exclusionSet = new org.apache.lucene.analysis.util.CharArraySet(TEST_VERSION_CURRENT, asSet("quilométricas"), false);
+		CharArraySet exclusionSet = new CharArraySet(TEST_VERSION_CURRENT, asSet("quilométricas"), false);
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper2(this, exclusionSet);
+		checkOneTerm(a, "quilométricas", "quilométricas");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestPortugueseMinimalStemFilter outerInstance;
+
+		  private CharArraySet exclusionSet;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestPortugueseMinimalStemFilter outerInstance, CharArraySet exclusionSet)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.exclusionSet = exclusionSet;
+		  }
+
+		  protected internal override Analyzer.TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer source = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			TokenStream sink = new SetKeywordMarkerFilter(source, exclusionSet);
+			return new Analyzer.TokenStreamComponents(source, new PortugueseMinimalStemFilter(sink));
+		  }
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), analyzer, 1000 * RANDOM_MULTIPLIER);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper3(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper3 : Analyzer
+	  {
+		  private readonly TestPortugueseMinimalStemFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper3(TestPortugueseMinimalStemFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override Analyzer.TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new Analyzer.TokenStreamComponents(tokenizer, new PortugueseMinimalStemFilter(tokenizer));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pt/TestPortugueseMinimalStemFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pt/TestPortugueseMinimalStemFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pt/TestPortugueseMinimalStemFilterFactory.cs
new file mode 100644
index 0000000..0b71514
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pt/TestPortugueseMinimalStemFilterFactory.cs
@@ -0,0 +1,57 @@
+namespace org.apache.lucene.analysis.pt
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the Portuguese Minimal stem factory is working.
+	/// </summary>
+	public class TestPortugueseMinimalStemFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStemming() throws Exception
+	  public virtual void testStemming()
+	  {
+		Reader reader = new StringReader("questões");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("PortugueseMinimalStem").create(stream);
+		assertTokenStreamContents(stream, new string[] {"questão"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("PortugueseMinimalStem", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pt/TestPortugueseStemFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pt/TestPortugueseStemFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pt/TestPortugueseStemFilter.cs
new file mode 100644
index 0000000..7bb1d4d
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pt/TestPortugueseStemFilter.cs
@@ -0,0 +1,137 @@
+namespace org.apache.lucene.analysis.pt
+{
+
+	/*
+	 * 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.
+	 */
+
+//JAVA TO C# CONVERTER TODO TASK: This Java 'import static' statement cannot be converted to C#:
+//	import static org.apache.lucene.analysis.VocabularyAssert.assertVocabulary;
+
+
+	using KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+	using LowerCaseFilter = org.apache.lucene.analysis.core.LowerCaseFilter;
+	using SetKeywordMarkerFilter = org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter;
+	using StandardTokenizer = org.apache.lucene.analysis.standard.StandardTokenizer;
+	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+
+	/// <summary>
+	/// Simple tests for <seealso cref="PortugueseStemFilter"/>
+	/// </summary>
+	public class TestPortugueseStemFilter : BaseTokenStreamTestCase
+	{
+	  private Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper();
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  public AnalyzerAnonymousInnerClassHelper()
+		  {
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer source = new StandardTokenizer(TEST_VERSION_CURRENT, reader);
+			TokenStream result = new LowerCaseFilter(TEST_VERSION_CURRENT, source);
+			return new TokenStreamComponents(source, new PortugueseStemFilter(result));
+		  }
+	  }
+
+	  /// <summary>
+	  /// Test the example from the paper "Assessing the impact of stemming accuracy
+	  /// on information retrieval"
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testExamples() throws java.io.IOException
+	  public virtual void testExamples()
+	  {
+		assertAnalyzesTo(analyzer, "O debate político, pelo menos o que vem a público, parece, de modo nada " + "surpreendente, restrito a temas menores. Mas há, evidentemente, " + "grandes questões em jogo nas eleições que se aproximam.", new string[] {"o", "debat", "politic", "pel", "menos", "o", "que", "vem", "a", "public", "parec", "de", "mod", "nad", "surpreend", "restrit", "a", "tem", "men", "mas", "ha", "evid", "grand", "quest", "em", "jog", "na", "eleic", "que", "se", "aproxim"});
+	  }
+
+	  /// <summary>
+	  /// Test against a vocabulary from the reference impl </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testVocabulary() throws java.io.IOException
+	  public virtual void testVocabulary()
+	  {
+		assertVocabulary(analyzer, getDataFile("ptrslptestdata.zip"), "ptrslp.txt");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testKeyword() throws java.io.IOException
+	  public virtual void testKeyword()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.util.CharArraySet exclusionSet = new org.apache.lucene.analysis.util.CharArraySet(TEST_VERSION_CURRENT, asSet("quilométricas"), false);
+		CharArraySet exclusionSet = new CharArraySet(TEST_VERSION_CURRENT, asSet("quilométricas"), false);
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper2(this, exclusionSet);
+		checkOneTerm(a, "quilométricas", "quilométricas");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestPortugueseStemFilter outerInstance;
+
+		  private CharArraySet exclusionSet;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestPortugueseStemFilter outerInstance, CharArraySet exclusionSet)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.exclusionSet = exclusionSet;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer source = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			TokenStream sink = new SetKeywordMarkerFilter(source, exclusionSet);
+			return new TokenStreamComponents(source, new PortugueseStemFilter(sink));
+		  }
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), analyzer, 1000 * RANDOM_MULTIPLIER);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper3(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper3 : Analyzer
+	  {
+		  private readonly TestPortugueseStemFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper3(TestPortugueseStemFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new PortugueseStemFilter(tokenizer));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pt/TestPortugueseStemFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pt/TestPortugueseStemFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pt/TestPortugueseStemFilterFactory.cs
new file mode 100644
index 0000000..4d5379b
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pt/TestPortugueseStemFilterFactory.cs
@@ -0,0 +1,57 @@
+namespace org.apache.lucene.analysis.pt
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the Portuguese stem factory is working.
+	/// </summary>
+	public class TestPortugueseStemFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStemming() throws Exception
+	  public virtual void testStemming()
+	  {
+		Reader reader = new StringReader("maluquice");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("PortugueseStem").create(stream);
+		assertTokenStreamContents(stream, new string[] {"maluc"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("PortugueseStem", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Query/QueryAutoStopWordAnalyzerTest.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Query/QueryAutoStopWordAnalyzerTest.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Query/QueryAutoStopWordAnalyzerTest.cs
new file mode 100644
index 0000000..c1ecca5
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Query/QueryAutoStopWordAnalyzerTest.cs
@@ -0,0 +1,165 @@
+namespace org.apache.lucene.analysis.query
+{
+	/*
+	 * Licensed to the Apache Software Foundation (ASF) under one or more
+	 * contributor license agreements.  See the NOTICE file distributed with
+	 * this work for additional information regarding copyright ownership.
+	 * The ASF licenses this file to You under the Apache License, Version 2.0
+	 * (the "License"); you may not use this file except in compliance with
+	 * the License.  You may obtain a copy of the License at
+	 *
+	 *     http://www.apache.org/licenses/LICENSE-2.0
+	 *
+	 * Unless required by applicable law or agreed to in writing, software
+	 * distributed under the License is distributed on an "AS IS" BASIS,
+	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+	 * See the License for the specific language governing permissions and
+	 * limitations under the License.
+	 */
+
+	using org.apache.lucene.analysis;
+	using Document = org.apache.lucene.document.Document;
+	using Field = org.apache.lucene.document.Field;
+	using TextField = org.apache.lucene.document.TextField;
+	using DirectoryReader = org.apache.lucene.index.DirectoryReader;
+	using IndexReader = org.apache.lucene.index.IndexReader;
+	using IndexWriter = org.apache.lucene.index.IndexWriter;
+	using IndexWriterConfig = org.apache.lucene.index.IndexWriterConfig;
+	using RAMDirectory = org.apache.lucene.store.RAMDirectory;
+
+
+	public class QueryAutoStopWordAnalyzerTest : BaseTokenStreamTestCase
+	{
+	  internal string[] variedFieldValues = new string[] {"the", "quick", "brown", "fox", "jumped", "over", "the", "lazy", "boring", "dog"};
+	  internal string[] repetitiveFieldValues = new string[] {"boring", "boring", "vaguelyboring"};
+	  internal RAMDirectory dir;
+	  internal Analyzer appAnalyzer;
+	  internal IndexReader reader;
+	  internal QueryAutoStopWordAnalyzer protectedAnalyzer;
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Override public void setUp() throws Exception
+	  public override void setUp()
+	  {
+		base.setUp();
+		dir = new RAMDirectory();
+		appAnalyzer = new MockAnalyzer(random(), MockTokenizer.WHITESPACE, false);
+		IndexWriter writer = new IndexWriter(dir, new IndexWriterConfig(TEST_VERSION_CURRENT, appAnalyzer));
+		int numDocs = 200;
+		for (int i = 0; i < numDocs; i++)
+		{
+		  Document doc = new Document();
+		  string variedFieldValue = variedFieldValues[i % variedFieldValues.Length];
+		  string repetitiveFieldValue = repetitiveFieldValues[i % repetitiveFieldValues.Length];
+		  doc.add(new TextField("variedField", variedFieldValue, Field.Store.YES));
+		  doc.add(new TextField("repetitiveField", repetitiveFieldValue, Field.Store.YES));
+		  writer.addDocument(doc);
+		}
+		writer.close();
+		reader = DirectoryReader.open(dir);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Override public void tearDown() throws Exception
+	  public override void tearDown()
+	  {
+		reader.close();
+		base.tearDown();
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNoStopwords() throws Exception
+	  public virtual void testNoStopwords()
+	  {
+		// Note: an empty list of fields passed in
+		protectedAnalyzer = new QueryAutoStopWordAnalyzer(TEST_VERSION_CURRENT, appAnalyzer, reader, System.Linq.Enumerable.Empty<string>(), 1);
+		TokenStream protectedTokenStream = protectedAnalyzer.tokenStream("variedField", "quick");
+		assertTokenStreamContents(protectedTokenStream, new string[]{"quick"});
+
+		protectedTokenStream = protectedAnalyzer.tokenStream("repetitiveField", "boring");
+		assertTokenStreamContents(protectedTokenStream, new string[]{"boring"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testDefaultStopwordsAllFields() throws Exception
+	  public virtual void testDefaultStopwordsAllFields()
+	  {
+		protectedAnalyzer = new QueryAutoStopWordAnalyzer(TEST_VERSION_CURRENT, appAnalyzer, reader);
+		TokenStream protectedTokenStream = protectedAnalyzer.tokenStream("repetitiveField", "boring");
+		assertTokenStreamContents(protectedTokenStream, new string[0]); // Default stop word filtering will remove boring
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStopwordsAllFieldsMaxPercentDocs() throws Exception
+	  public virtual void testStopwordsAllFieldsMaxPercentDocs()
+	  {
+		protectedAnalyzer = new QueryAutoStopWordAnalyzer(TEST_VERSION_CURRENT, appAnalyzer, reader, 1f / 2f);
+
+		TokenStream protectedTokenStream = protectedAnalyzer.tokenStream("repetitiveField", "boring");
+		// A filter on terms in > one half of docs remove boring
+		assertTokenStreamContents(protectedTokenStream, new string[0]);
+
+		protectedTokenStream = protectedAnalyzer.tokenStream("repetitiveField", "vaguelyboring");
+		 // A filter on terms in > half of docs should not remove vaguelyBoring
+		assertTokenStreamContents(protectedTokenStream, new string[]{"vaguelyboring"});
+
+		protectedAnalyzer = new QueryAutoStopWordAnalyzer(TEST_VERSION_CURRENT, appAnalyzer, reader, 1f / 4f);
+		protectedTokenStream = protectedAnalyzer.tokenStream("repetitiveField", "vaguelyboring");
+		 // A filter on terms in > quarter of docs should remove vaguelyBoring
+		assertTokenStreamContents(protectedTokenStream, new string[0]);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStopwordsPerFieldMaxPercentDocs() throws Exception
+	  public virtual void testStopwordsPerFieldMaxPercentDocs()
+	  {
+		protectedAnalyzer = new QueryAutoStopWordAnalyzer(TEST_VERSION_CURRENT, appAnalyzer, reader, Arrays.asList("variedField"), 1f / 2f);
+		TokenStream protectedTokenStream = protectedAnalyzer.tokenStream("repetitiveField", "boring");
+		// A filter on one Field should not affect queries on another
+		assertTokenStreamContents(protectedTokenStream, new string[]{"boring"});
+
+		protectedAnalyzer = new QueryAutoStopWordAnalyzer(TEST_VERSION_CURRENT, appAnalyzer, reader, Arrays.asList("variedField", "repetitiveField"), 1f / 2f);
+		protectedTokenStream = protectedAnalyzer.tokenStream("repetitiveField", "boring");
+		// A filter on the right Field should affect queries on it
+		assertTokenStreamContents(protectedTokenStream, new string[0]);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStopwordsPerFieldMaxDocFreq() throws Exception
+	  public virtual void testStopwordsPerFieldMaxDocFreq()
+	  {
+		protectedAnalyzer = new QueryAutoStopWordAnalyzer(TEST_VERSION_CURRENT, appAnalyzer, reader, Arrays.asList("repetitiveField"), 10);
+		int numStopWords = protectedAnalyzer.getStopWords("repetitiveField").length;
+		assertTrue("Should have identified stop words", numStopWords > 0);
+
+		protectedAnalyzer = new QueryAutoStopWordAnalyzer(TEST_VERSION_CURRENT, appAnalyzer, reader, Arrays.asList("repetitiveField", "variedField"), 10);
+		int numNewStopWords = protectedAnalyzer.getStopWords("repetitiveField").length + protectedAnalyzer.getStopWords("variedField").length;
+		assertTrue("Should have identified more stop words", numNewStopWords > numStopWords);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNoFieldNamePollution() throws Exception
+	  public virtual void testNoFieldNamePollution()
+	  {
+		protectedAnalyzer = new QueryAutoStopWordAnalyzer(TEST_VERSION_CURRENT, appAnalyzer, reader, Arrays.asList("repetitiveField"), 10);
+
+		TokenStream protectedTokenStream = protectedAnalyzer.tokenStream("repetitiveField", "boring");
+		// Check filter set up OK
+		assertTokenStreamContents(protectedTokenStream, new string[0]);
+
+		protectedTokenStream = protectedAnalyzer.tokenStream("variedField", "boring");
+		// Filter should not prevent stopwords in one field being used in another
+		assertTokenStreamContents(protectedTokenStream, new string[]{"boring"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTokenStream() throws Exception
+	  public virtual void testTokenStream()
+	  {
+		QueryAutoStopWordAnalyzer a = new QueryAutoStopWordAnalyzer(TEST_VERSION_CURRENT, new MockAnalyzer(random(), MockTokenizer.WHITESPACE, false), reader, 10);
+		TokenStream ts = a.tokenStream("repetitiveField", "this boring");
+		assertTokenStreamContents(ts, new string[] {"this"});
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Reverse/TestReverseStringFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Reverse/TestReverseStringFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Reverse/TestReverseStringFilter.cs
new file mode 100644
index 0000000..72510cb
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Reverse/TestReverseStringFilter.cs
@@ -0,0 +1,169 @@
+using System;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * 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 org.apache.lucene.analysis.reverse
+{
+
+
+	using KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+	using Version = org.apache.lucene.util.Version;
+
+	public class TestReverseStringFilter : BaseTokenStreamTestCase
+	{
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFilter() throws Exception
+	  public virtual void testFilter()
+	  {
+		TokenStream stream = new MockTokenizer(new StringReader("Do have a nice day"), MockTokenizer.WHITESPACE, false); // 1-4 length string
+		ReverseStringFilter filter = new ReverseStringFilter(TEST_VERSION_CURRENT, stream);
+		assertTokenStreamContents(filter, new string[] {"oD", "evah", "a", "ecin", "yad"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFilterWithMark() throws Exception
+	  public virtual void testFilterWithMark()
+	  {
+		TokenStream stream = new MockTokenizer(new StringReader("Do have a nice day"), MockTokenizer.WHITESPACE, false); // 1-4 length string
+		ReverseStringFilter filter = new ReverseStringFilter(TEST_VERSION_CURRENT, stream, '\u0001');
+		assertTokenStreamContents(filter, new string[] {"\u0001oD", "\u0001evah", "\u0001a", "\u0001ecin", "\u0001yad"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testReverseString() throws Exception
+	  public virtual void testReverseString()
+	  {
+		assertEquals("A", ReverseStringFilter.reverse(TEST_VERSION_CURRENT, "A"));
+		assertEquals("BA", ReverseStringFilter.reverse(TEST_VERSION_CURRENT, "AB"));
+		assertEquals("CBA", ReverseStringFilter.reverse(TEST_VERSION_CURRENT, "ABC"));
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testReverseChar() throws Exception
+	  public virtual void testReverseChar()
+	  {
+		char[] buffer = new char[] {'A', 'B', 'C', 'D', 'E', 'F'};
+		ReverseStringFilter.reverse(TEST_VERSION_CURRENT, buffer, 2, 3);
+		assertEquals("ABEDCF", new string(buffer));
+	  }
+
+	  /// <summary>
+	  /// Test the broken 3.0 behavior, for back compat </summary>
+	  /// @deprecated (3.1) Remove in Lucene 5.0 
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Deprecated("(3.1) Remove in Lucene 5.0") public void testBackCompat() throws Exception
+	  [Obsolete("(3.1) Remove in Lucene 5.0")]
+	  public virtual void testBackCompat()
+	  {
+		assertEquals("\uDF05\uD866\uDF05\uD866", ReverseStringFilter.reverse(Version.LUCENE_30, "𩬅𩬅"));
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testReverseSupplementary() throws Exception
+	  public virtual void testReverseSupplementary()
+	  {
+		// supplementary at end
+		assertEquals("𩬅艱鍟䇹愯瀛", ReverseStringFilter.reverse(TEST_VERSION_CURRENT, "瀛愯䇹鍟艱𩬅"));
+		// supplementary at end - 1
+		assertEquals("a𩬅艱鍟䇹愯瀛", ReverseStringFilter.reverse(TEST_VERSION_CURRENT, "瀛愯䇹鍟艱𩬅a"));
+		// supplementary at start
+		assertEquals("fedcba𩬅", ReverseStringFilter.reverse(TEST_VERSION_CURRENT, "𩬅abcdef"));
+		// supplementary at start + 1
+		assertEquals("fedcba𩬅z", ReverseStringFilter.reverse(TEST_VERSION_CURRENT, "z𩬅abcdef"));
+		// supplementary medial
+		assertEquals("gfe𩬅dcba", ReverseStringFilter.reverse(TEST_VERSION_CURRENT, "abcd𩬅efg"));
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testReverseSupplementaryChar() throws Exception
+	  public virtual void testReverseSupplementaryChar()
+	  {
+		// supplementary at end
+		char[] buffer = "abc瀛愯䇹鍟艱𩬅".ToCharArray();
+		ReverseStringFilter.reverse(TEST_VERSION_CURRENT, buffer, 3, 7);
+		assertEquals("abc𩬅艱鍟䇹愯瀛", new string(buffer));
+		// supplementary at end - 1
+		buffer = "abc瀛愯䇹鍟艱𩬅d".ToCharArray();
+		ReverseStringFilter.reverse(TEST_VERSION_CURRENT, buffer, 3, 8);
+		assertEquals("abcd𩬅艱鍟䇹愯瀛", new string(buffer));
+		// supplementary at start
+		buffer = "abc𩬅瀛愯䇹鍟艱".ToCharArray();
+		ReverseStringFilter.reverse(TEST_VERSION_CURRENT, buffer, 3, 7);
+		assertEquals("abc艱鍟䇹愯瀛𩬅", new string(buffer));
+		// supplementary at start + 1
+		buffer = "abcd𩬅瀛愯䇹鍟艱".ToCharArray();
+		ReverseStringFilter.reverse(TEST_VERSION_CURRENT, buffer, 3, 8);
+		assertEquals("abc艱鍟䇹愯瀛𩬅d", new string(buffer));
+		// supplementary medial
+		buffer = "abc瀛愯𩬅def".ToCharArray();
+		ReverseStringFilter.reverse(TEST_VERSION_CURRENT, buffer, 3, 7);
+		assertEquals("abcfed𩬅愯瀛", new string(buffer));
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper(this);
+		checkRandomData(random(), a, 1000 * RANDOM_MULTIPLIER);
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestReverseStringFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestReverseStringFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(tokenizer, new ReverseStringFilter(TEST_VERSION_CURRENT, tokenizer));
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper2(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestReverseStringFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestReverseStringFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new ReverseStringFilter(TEST_VERSION_CURRENT, tokenizer));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Reverse/TestReverseStringFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Reverse/TestReverseStringFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Reverse/TestReverseStringFilterFactory.cs
new file mode 100644
index 0000000..25c9090
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Reverse/TestReverseStringFilterFactory.cs
@@ -0,0 +1,60 @@
+namespace org.apache.lucene.analysis.reverse
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the Reverse string filter factory is working.
+	/// </summary>
+	public class TestReverseStringFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+	  /// <summary>
+	  /// Ensure the filter actually reverses text.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testReversing() throws Exception
+	  public virtual void testReversing()
+	  {
+		Reader reader = new StringReader("simple test");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("ReverseString").create(stream);
+		assertTokenStreamContents(stream, new string[] {"elpmis", "tset"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("ReverseString", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ro/TestRomanianAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ro/TestRomanianAnalyzer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ro/TestRomanianAnalyzer.cs
new file mode 100644
index 0000000..48214d3
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ro/TestRomanianAnalyzer.cs
@@ -0,0 +1,70 @@
+namespace org.apache.lucene.analysis.ro
+{
+
+	/*
+	 * 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 CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+
+	public class TestRomanianAnalyzer : BaseTokenStreamTestCase
+	{
+	  /// <summary>
+	  /// This test fails with NPE when the 
+	  /// stopwords file is missing in classpath 
+	  /// </summary>
+	  public virtual void testResourcesAvailable()
+	  {
+		new RomanianAnalyzer(TEST_VERSION_CURRENT);
+	  }
+
+	  /// <summary>
+	  /// test stopwords and stemming </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBasics() throws java.io.IOException
+	  public virtual void testBasics()
+	  {
+		Analyzer a = new RomanianAnalyzer(TEST_VERSION_CURRENT);
+		// stemming
+		checkOneTerm(a, "absenţa", "absenţ");
+		checkOneTerm(a, "absenţi", "absenţ");
+		// stopword
+		assertAnalyzesTo(a, "îl", new string[] {});
+	  }
+
+	  /// <summary>
+	  /// test use of exclusion set </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testExclude() throws java.io.IOException
+	  public virtual void testExclude()
+	  {
+		CharArraySet exclusionSet = new CharArraySet(TEST_VERSION_CURRENT, asSet("absenţa"), false);
+		Analyzer a = new RomanianAnalyzer(TEST_VERSION_CURRENT, RomanianAnalyzer.DefaultStopSet, exclusionSet);
+		checkOneTerm(a, "absenţa", "absenţa");
+		checkOneTerm(a, "absenţi", "absenţ");
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), new RomanianAnalyzer(TEST_VERSION_CURRENT), 1000 * RANDOM_MULTIPLIER);
+	  }
+	}
+
+}
\ No newline at end of file


[25/27] lucenenet git commit: adding converted analysis common tests

Posted by sy...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Charfilter/HTMLStripCharFilterTest.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Charfilter/HTMLStripCharFilterTest.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Charfilter/HTMLStripCharFilterTest.cs
new file mode 100644
index 0000000..81bdd31
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Charfilter/HTMLStripCharFilterTest.cs
@@ -0,0 +1,570 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace org.apache.lucene.analysis.charfilter
+{
+
+	/*
+	 * 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 TestUtil = org.apache.lucene.util.TestUtil;
+
+	public class HTMLStripCharFilterTest : BaseTokenStreamTestCase
+	{
+
+	  private static Analyzer newTestAnalyzer()
+	  {
+		return new AnalyzerAnonymousInnerClassHelper();
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  public AnalyzerAnonymousInnerClassHelper()
+		  {
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(tokenizer, tokenizer);
+		  }
+
+		  protected internal override Reader initReader(string fieldName, Reader reader)
+		  {
+			return new HTMLStripCharFilter(reader);
+		  }
+	  }
+
+	  //this is some text  here is a  link  and another  link . This is an entity: & plus a <.  Here is an &
+	  //
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void test() throws Exception
+	  public virtual void test()
+	  {
+		string html = "<div class=\"foo\">this is some text</div> here is a <a href=\"#bar\">link</a> and " + "another <a href=\"http://lucene.apache.org/\">link</a>. " + "This is an entity: &amp; plus a &lt;.  Here is an &. <!-- is a comment -->";
+		string gold = "\nthis is some text\n here is a link and " + "another link. " + "This is an entity: & plus a <.  Here is an &. ";
+		assertHTMLStripsTo(html, gold, null);
+	  }
+
+	  //Some sanity checks, but not a full-fledged check
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testHTML() throws Exception
+	  public virtual void testHTML()
+	  {
+		System.IO.Stream stream = this.GetType().getResourceAsStream("htmlStripReaderTest.html");
+		HTMLStripCharFilter reader = new HTMLStripCharFilter(new System.IO.StreamReader(stream, Encoding.UTF8));
+		StringBuilder builder = new StringBuilder();
+		int ch = -1;
+		while ((ch = reader.read()) != -1)
+		{
+		  builder.Append((char)ch);
+		}
+		string str = builder.ToString();
+		assertTrue("Entity not properly escaped", str.IndexOf("&lt;", StringComparison.Ordinal) == -1); //there is one > in the text
+		assertTrue("Forrest should have been stripped out", str.IndexOf("forrest", StringComparison.Ordinal) == -1 && str.IndexOf("Forrest", StringComparison.Ordinal) == -1);
+		assertTrue("File should start with 'Welcome to Solr' after trimming", str.Trim().StartsWith("Welcome to Solr", StringComparison.Ordinal));
+
+		assertTrue("File should start with 'Foundation.' after trimming", str.Trim().EndsWith("Foundation.", StringComparison.Ordinal));
+
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMSWord14GeneratedHTML() throws Exception
+	  public virtual void testMSWord14GeneratedHTML()
+	  {
+		System.IO.Stream stream = this.GetType().getResourceAsStream("MS-Word 14 generated.htm");
+		HTMLStripCharFilter reader = new HTMLStripCharFilter(new System.IO.StreamReader(stream, Encoding.UTF8));
+		string gold = "This is a test";
+		StringBuilder builder = new StringBuilder();
+		int ch = 0;
+		while ((ch = reader.read()) != -1)
+		{
+		  builder.Append((char)ch);
+		}
+		// Compare trim()'d output to gold
+		assertEquals("'" + builder.ToString().Trim() + "' is not equal to '" + gold + "'", gold, builder.ToString().Trim());
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testGamma() throws Exception
+	  public virtual void testGamma()
+	  {
+		assertHTMLStripsTo("&Gamma;", "\u0393", new HashSet<>(Arrays.asList("reserved")));
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEntities() throws Exception
+	  public virtual void testEntities()
+	  {
+		string test = "&nbsp; &lt;foo&gt; &Uuml;bermensch &#61; &Gamma; bar &#x393;";
+		string gold = "  <foo> \u00DCbermensch = \u0393 bar \u0393";
+		assertHTMLStripsTo(test, gold, new HashSet<>(Arrays.asList("reserved")));
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMoreEntities() throws Exception
+	  public virtual void testMoreEntities()
+	  {
+		string test = "&nbsp; &lt;junk/&gt; &nbsp; &#33; &#64; and &#8217;";
+		string gold = "  <junk/>   ! @ and ’";
+		assertHTMLStripsTo(test, gold, new HashSet<>(Arrays.asList("reserved")));
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testReserved() throws Exception
+	  public virtual void testReserved()
+	  {
+		string test = "aaa bbb <reserved ccc=\"ddddd\"> eeee </reserved> ffff <reserved ggg=\"hhhh\"/> <other/>";
+		ISet<string> set = new HashSet<string>();
+		set.Add("reserved");
+		Reader reader = new HTMLStripCharFilter(new StringReader(test), set);
+		StringBuilder builder = new StringBuilder();
+		int ch = 0;
+		while ((ch = reader.read()) != -1)
+		{
+		  builder.Append((char)ch);
+		}
+		string result = builder.ToString();
+		// System.out.println("Result: " + result);
+		assertTrue("Escaped tag not preserved: " + result.IndexOf("reserved", StringComparison.Ordinal), result.IndexOf("reserved", StringComparison.Ordinal) == 9);
+		assertTrue("Escaped tag not preserved: " + result.IndexOf("reserved", 15, StringComparison.Ordinal), result.IndexOf("reserved", 15, StringComparison.Ordinal) == 38);
+		assertTrue("Escaped tag not preserved: " + result.IndexOf("reserved", 41, StringComparison.Ordinal), result.IndexOf("reserved", 41, StringComparison.Ordinal) == 54);
+		assertTrue("Other tag should be removed", result.IndexOf("other", StringComparison.Ordinal) == -1);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMalformedHTML() throws Exception
+	  public virtual void testMalformedHTML()
+	  {
+		string[] testGold = new string[] {"a <a hr<ef=aa<a>> </close</a>", "a <a hr<ef=aa> </close", "<a href=http://dmoz.org/cgi-bin/add.cgi?where=/arts/\" class=lu style=\"font-size: 9px\" target=dmoz>Submit a Site</a>", "Submit a Site", "<a href=javascript:ioSwitch('p8','http://www.csmonitor.com/') title=expand id=e8 class=expanded rel=http://www.csmonitor.com/>Christian Science", "Christian Science", "<link rel=\"alternate\" type=\"application/rss+xml\" title=\"San Francisco \" 2008 RSS Feed\" href=\"http://2008.sf.wordcamp.org/feed/\" />", "\n", "<a href=\" http://www.surgery4was.happyhost.org/video-of-arthroscopic-knee-surgery symptoms.html, heat congestive heart failure <a href=\" http://www.symptoms1bad.happyhost.org/canine", "<a href=\" http://www.surgery4was.happyhost.org/video-of-arthroscopic-knee-surgery symptoms.html, heat congestive heart failure <a href=\" http://www.symptoms1bad.happyhost.org/canine", "<a href=\"http://ucblibraries.colorado.edu/how/index.htm\"class=\"pageN
 avAreaText\">", "", "<link title=\"^\\\" 21Sta's Blog\" rel=\"search\"  type=\"application/opensearchdescription+xml\"  href=\"http://21sta.com/blog/inc/opensearch.php\" />", "\n", "<a href=\"#postcomment\" title=\"\"Leave a comment\";\">?", "?", "<a href='/modern-furniture'   ' id='21txt' class='offtab'   onMouseout=\"this.className='offtab';  return true;\" onMouseover=\"this.className='ontab';  return true;\">", "", "<a href='http://alievi.wordpress.com/category/01-todos-posts/' style='font-size: 275%; padding: 1px; margin: 1px;' title='01 - Todos Post's (83)'>", "", "The <a href=<a href=\"http://www.advancedmd.com>medical\">http://www.advancedmd.com>medical</a> practice software</a>", "The <a href=medical\">http://www.advancedmd.com>medical practice software", "<a href=\"node/21426\" class=\"clipTitle2\" title=\"Levi.com/BMX 2008 Clip of the Week 29 \"Morgan Wade Leftover Clips\"\">Levi.com/BMX 2008 Clip of the Week 29...", "Levi.com/BMX 2008 Clip of the Week 29...", "<a href=\"
 printer_friendly.php?branch=&year=&submit=go&screen=\";\">Printer Friendly", "Printer Friendly", "<a href=#\" ondragstart=\"return false\" onclick=\"window.external.AddFavorite('http://www.amazingtextures.com', 'Amazing Textures');return false\" onmouseover=\"window.status='Add to Favorites';return true\">Add to Favorites", "Add to Favorites", "<a href=\"../at_home/at_home_search.html\"../_home/at_home_search.html\">At", "At", "E-mail: <a href=\"\"mailto:XXXXXX@example.com\" \">XXXXXX@example.com </a>", "E-mail: XXXXXX@example.com ", "<li class=\"farsi\"><a title=\"A'13?\" alt=\"A'13?\" href=\"http://www.america.gov/persian\" alt=\"\" name=\"A'13?\"A'13? title=\"A'13?\">A'13?</a></li>", "\nA'13?\n", "<li><a href=\"#28\" title=\"Hubert \"Geese\" Ausby\">Hubert \"Geese\" Ausby</a></li>", "\nHubert \"Geese\" Ausby\n", "<href=\"http://anbportal.com/mms/login.asp\">", "\n", "<a href=\"", "<a href=\"", "<a href=\">", "", "<a rel=\"nofollow\" href=\"http://anissanina31.skyrock.com/18950394
 93-Hi-tout-le-monde.html\" title=\" Hi, tout le monde !>#</a>", "#", "<a href=\"http://annunciharleydavidsonusate.myblog.it/\" title=\"Annunci Moto e Accessori Harley Davidson\" target=\"_blank\"><img src=\"http://annunciharleydavidsonusate.myblog.it/images/Antipixel.gif\" /></a>", "", "<a href=\"video/addvideo&v=120838887181\" onClick=\"return confirm('Are you sure you want  add this video to your profile? If it exists some video in your profile will be overlapped by this video!!')\" \" onmouseover=\"this.className='border2'\" onmouseout=\"this.className=''\">", "", "<a href=#Services & Support>", "", "<input type=\"image\" src=\"http://apologyindex.com/ThemeFiles/83401-72905/images/btn_search.gif\"value=\"Search\" name=\"Search\" alt=\"Search\" class=\"searchimage\" onclick=\"incom ='&sc=' + document.getElementById('sel').value ; var dt ='&dt=' + document.getElementById('dt').value; var searchKeyword = document.getElementById('q').value ; searchKeyword = searchKeyword.replace(/\\s
 /g,''); if (searchKeyword.length < 3){alert('Nothing to search. Search keyword should contain atleast 3 chars.'); return false; } var al='&al=' +  document.getElementById('advancedlink').style.display ;  document.location.href='http://apologyindex.com/search.aspx?q=' + document.getElementById('q').value + incom + dt + al;\" />", "", "<input type=\"image\" src=\"images/afbe.gif\" width=\"22\" height=\"22\"  hspace=\"4\" title=\"Add to Favorite\" alt=\"Add to Favorite\"onClick=\" if(window.sidebar){ window.sidebar.addPanel(document.title,location.href,''); }else if(window.external){ window.external.AddFavorite(location.href,document.title); }else if(window.opera&&window.print) { return true; }\">", "", "<area shape=\"rect\" coords=\"12,153,115,305\" href=\"http://statenislandtalk.com/v-web/gallery/Osmundsen-family\"Art's Norwegian Roots in Rogaland\">", "\n", "<a rel=\"nofollow\" href=\"http://arth26.skyrock.com/660188240-bonzai.html\" title=\"bonza>#", "#", "<a href=  >", "", "<ahref
 =http:..", "<ahref=http:..", "<ahref=http:..>", "\n", "<ahref=\"http://aseigo.bddf.ca/cms/1025\">A", "\nA", "<a href=\"javascript:calendar_window=window.open('/calendar.aspx?formname=frmCalendar.txtDate','calendar_window','width=154,height=188');calendar_window.focus()\">", "", "<a href=\"/applications/defenseaerospace/19+rackmounts\" title=\"19\" Rackmounts\">", "", "<a href=http://www.azimprimerie.fr/flash/backup/lewes-zip-code/savage-model-110-manual.html title=savage model 110 manual rel=dofollow>", "", "<a class=\"at\" name=\"Lamborghini  href=\"http://lamborghini.coolbegin.com\">Lamborghini /a>", "Lamborghini /a>", "<A href='newslink.php?news_link=http%3A%2F%2Fwww.worldnetdaily.com%2Findex.php%3Ffa%3DPAGE.view%26pageId%3D85729&news_title=Florida QB makes 'John 3:16' hottest Google search Tebow inscribed Bible reference on eye black for championship game' TARGET=_blank>", "", "<a href=/myspace !style='color:#993333'>", "", "<meta name=3DProgId content=3DExcel.Sheet>", "\n", "<l
 ink id=3D\"shLink\" href=3D\"PSABrKelly-BADMINTONCupResults08FINAL2008_09_19=_files/sheet004.htm\">", "\n", "<td bgcolor=3D\"#FFFFFF\" nowrap>", "\n", "<a href=\"http://basnect.info/usersearch/\"predicciones-mundiales-2009\".html\">\"predicciones mundiales 2009\"</a>", "\"predicciones mundiales 2009\"", "<a class=\"comment-link\" href=\"https://www.blogger.com/comment.g?blogID=19402125&postID=114070605958684588\"location.href=https://www.blogger.com/comment.g?blogID=19402125&postID=114070605958684588;>", "", "<a href = \"/videos/Bishop\"/\" title = \"click to see more Bishop\" videos\">Bishop\"</a>", "Bishop\"", "<a href=\"http://bhaa.ie/calendar/event.php?eid=20081203150127531\"\">BHAA Eircom 2 &amp; 5 miles CC combined start</a>", "BHAA Eircom 2 & 5 miles CC combined start", "<a href=\"http://people.tribe.net/wolfmana\" onClick='setClick(\"Application[tribe].Person[bb7df210-9dc0-478c-917f-436b896bcb79]\")'\" title=\"Mana\">", "", "<a  href=\"http://blog.edu-cyberpg.com/ct.ashx?id=
 6143c528-080c-4bb2-b765-5ec56c8256d3&url=http%3a%2f%2fwww.gsa.ac.uk%2fmackintoshsketchbook%2f\"\" eudora=\"autourl\">", "", "<input type=\"text\" value=\"<search here>\">", "<input type=\"text\" value=\"\n\">", "<input type=\"text\" value=\"<search here\">", "<input type=\"text\" value=\"\n", "<input type=\"text\" value=\"search here>\">", "\">", "<input type=\"text\" value=\"&lt;search here&gt;\" onFocus=\"this.value='<search here>'\">", "", "<![if ! IE]>\n<link href=\"http://i.deviantart.com/icons/favicon.png\" rel=\"shortcut icon\"/>\n<![endif]>", "\n\n\n", "<![if supportMisalignedColumns]>\n<tr height=0 style='display:none'>\n<td width=64 style='width:48pt'></td>\n</tr>\n<![endif]>", "\n\n\n\n\n\n\n\n"};
+		for (int i = 0 ; i < testGold.Length ; i += 2)
+		{
+		  assertHTMLStripsTo(testGold[i], testGold[i + 1], null);
+		}
+	  }
+
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBufferOverflow() throws Exception
+	  public virtual void testBufferOverflow()
+	  {
+		StringBuilder testBuilder = new StringBuilder(HTMLStripCharFilter.InitialBufferSize + 50);
+		testBuilder.Append("ah<?> ??????");
+		appendChars(testBuilder, HTMLStripCharFilter.InitialBufferSize + 500);
+		Reader reader = new HTMLStripCharFilter(new System.IO.StreamReader(new StringReader(testBuilder.ToString()))); //force the use of BufferedReader
+		assertHTMLStripsTo(reader, testBuilder.ToString(), null);
+
+		testBuilder.Length = 0;
+		testBuilder.Append("<!--"); //comments
+		appendChars(testBuilder, 3 * HTMLStripCharFilter.InitialBufferSize + 500); //comments have two lookaheads
+
+		testBuilder.Append("-->foo");
+		string gold = "foo";
+		assertHTMLStripsTo(testBuilder.ToString(), gold, null);
+
+		testBuilder.Length = 0;
+		testBuilder.Append("<?");
+		appendChars(testBuilder, HTMLStripCharFilter.InitialBufferSize + 500);
+		testBuilder.Append("?>");
+		gold = "";
+		assertHTMLStripsTo(testBuilder.ToString(), gold, null);
+
+		testBuilder.Length = 0;
+		testBuilder.Append("<b ");
+		appendChars(testBuilder, HTMLStripCharFilter.InitialBufferSize + 500);
+		testBuilder.Append("/>");
+		gold = "";
+		assertHTMLStripsTo(testBuilder.ToString(), gold, null);
+	  }
+
+	  private void appendChars(StringBuilder testBuilder, int numChars)
+	  {
+		int i1 = numChars / 2;
+		for (int i = 0; i < i1; i++)
+		{
+		  testBuilder.Append('a').Append(' '); //tack on enough to go beyond the mark readahead limit, since <?> makes HTMLStripCharFilter think it is a processing instruction
+		}
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testComment() throws Exception
+	  public virtual void testComment()
+	  {
+		string test = "<!--- three dashes, still a valid comment ---> ";
+		string gold = " ";
+		assertHTMLStripsTo(test, gold, null);
+
+		test = "<! -- blah > "; // should not be recognized as a comment
+		gold = " ";
+		assertHTMLStripsTo(test, gold, null);
+
+		StringBuilder testBuilder = new StringBuilder("<!--");
+		appendChars(testBuilder, TestUtil.Next(random(), 0, 1000));
+		gold = "";
+		assertHTMLStripsTo(testBuilder.ToString(), gold, null);
+	  }
+
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void doTestOffsets(String in) throws Exception
+	  public virtual void doTestOffsets(string @in)
+	  {
+		HTMLStripCharFilter reader = new HTMLStripCharFilter(new System.IO.StreamReader(new StringReader(@in)));
+		int ch = 0;
+		int off = 0; // offset in the reader
+		int strOff = -1; // offset in the original string
+		while ((ch = reader.read()) != -1)
+		{
+		  int correctedOff = reader.correctOffset(off);
+
+		  if (ch == 'X')
+		  {
+			strOff = @in.IndexOf('X',strOff + 1);
+			assertEquals(strOff, correctedOff);
+		  }
+
+		  off++;
+		}
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testOffsets() throws Exception
+	  public virtual void testOffsets()
+	  {
+	//    doTestOffsets("hello X how X are you");
+		doTestOffsets("hello <p> X<p> how <p>X are you");
+		doTestOffsets("X &amp; X &#40; X &lt; &gt; X");
+
+		// test backtracking
+		doTestOffsets("X < &zz >X &# < X > < &l > &g < X");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: static void assertLegalOffsets(String in) throws Exception
+	  internal static void assertLegalOffsets(string @in)
+	  {
+		int length = @in.Length;
+		HTMLStripCharFilter reader = new HTMLStripCharFilter(new System.IO.StreamReader(new StringReader(@in)));
+		int ch = 0;
+		int off = 0;
+		while ((ch = reader.read()) != -1)
+		{
+		  int correction = reader.correctOffset(off);
+		  assertTrue("invalid offset correction: " + off + "->" + correction + " for doc of length: " + length, correction <= length);
+		  off++;
+		}
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testLegalOffsets() throws Exception
+	  public virtual void testLegalOffsets()
+	  {
+		assertLegalOffsets("hello world");
+		assertLegalOffsets("hello &#x world");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandom() throws Exception
+	  public virtual void testRandom()
+	  {
+		int numRounds = RANDOM_MULTIPLIER * 1000;
+		checkRandomData(random(), newTestAnalyzer(), numRounds);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomHugeStrings() throws Exception
+	  public virtual void testRandomHugeStrings()
+	  {
+		int numRounds = RANDOM_MULTIPLIER * 100;
+		checkRandomData(random(), newTestAnalyzer(), numRounds, 8192);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCloseBR() throws Exception
+	  public virtual void testCloseBR()
+	  {
+		checkAnalysisConsistency(random(), newTestAnalyzer(), random().nextBoolean(), " Secretary)</br> [[M");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testServerSideIncludes() throws Exception
+	  public virtual void testServerSideIncludes()
+	  {
+		string test = "one<img src=\"image.png\"\n" + " alt =  \"Alt: <!--#echo var='${IMAGE_CAPTION:<!--comment-->\\'Comment\\'}'  -->\"\n\n" + " title=\"Title: <!--#echo var=\"IMAGE_CAPTION\"-->\">two";
+		string gold = "onetwo";
+		assertHTMLStripsTo(test, gold, null);
+
+		test = "one<script><!-- <!--#config comment=\"<!-- \\\"comment\\\"-->\"--> --></script>two";
+		gold = "one\ntwo";
+		assertHTMLStripsTo(test, gold, null);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testScriptQuotes() throws Exception
+	  public virtual void testScriptQuotes()
+	  {
+		string test = "one<script attr= bare><!-- action('<!-- comment -->', \"\\\"-->\\\"\"); --></script>two";
+		string gold = "one\ntwo";
+		assertHTMLStripsTo(test, gold, null);
+
+		test = "hello<script><!-- f('<!--internal--></script>'); --></script>";
+		gold = "hello\n";
+		assertHTMLStripsTo(test, gold, null);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEscapeScript() throws Exception
+	  public virtual void testEscapeScript()
+	  {
+		string test = "one<script no-value-attr>callSomeMethod();</script>two";
+		string gold = "one<script no-value-attr></script>two";
+		ISet<string> escapedTags = new HashSet<string>(Arrays.asList("SCRIPT"));
+		assertHTMLStripsTo(test, gold, escapedTags);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStyle() throws Exception
+	  public virtual void testStyle()
+	  {
+		string test = "one<style type=\"text/css\">\n" + "<!--\n" + "@import url('http://www.lasletrasdecanciones.com/css.css');\n" + "-->\n" + "</style>two";
+		string gold = "one\ntwo";
+		assertHTMLStripsTo(test, gold, null);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEscapeStyle() throws Exception
+	  public virtual void testEscapeStyle()
+	  {
+		string test = "one<style type=\"text/css\"> body,font,a { font-family:arial; } </style>two";
+		string gold = "one<style type=\"text/css\"></style>two";
+		ISet<string> escapedTags = new HashSet<string>(Arrays.asList("STYLE"));
+		assertHTMLStripsTo(test, gold, escapedTags);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBR() throws Exception
+	  public virtual void testBR()
+	  {
+		string[] testGold = new string[] {"one<BR />two<br>three", "one\ntwo\nthree", "one<BR some stuff here too>two</BR>", "one\ntwo\n"};
+		for (int i = 0 ; i < testGold.Length ; i += 2)
+		{
+		  assertHTMLStripsTo(testGold[i], testGold[i + 1], null);
+		}
+	  }
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEscapeBR() throws Exception
+	  public virtual void testEscapeBR()
+	  {
+		string test = "one<BR class='whatever'>two</\nBR\n>";
+		string gold = "one<BR class='whatever'>two</\nBR\n>";
+		ISet<string> escapedTags = new HashSet<string>(Arrays.asList("BR"));
+		assertHTMLStripsTo(test, gold, escapedTags);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testInlineTagsNoSpace() throws Exception
+	  public virtual void testInlineTagsNoSpace()
+	  {
+		string test = "one<sPAn class=\"invisible\">two<sup>2<sup>e</sup></sup>.</SpaN>three";
+		string gold = "onetwo2e.three";
+		assertHTMLStripsTo(test, gold, null);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCDATA() throws Exception
+	  public virtual void testCDATA()
+	  {
+		int maxNumElems = 100;
+		string randomHtmlishString1 = TestUtil.randomHtmlishString(random(), maxNumElems).replaceAll(">", " ").replaceFirst("^--","__"); // Don't create a comment (disallow "<!--") and don't include a closing ">"
+		string closedAngleBangNonCDATA = "<!" + randomHtmlishString1 + "-[CDATA[&]]>";
+
+		string randomHtmlishString2 = TestUtil.randomHtmlishString(random(), maxNumElems).replaceAll(">", " ").replaceFirst("^--","__"); // Don't create a comment (disallow "<!--") and don't include a closing ">"
+		string unclosedAngleBangNonCDATA = "<!" + randomHtmlishString1 + "-[CDATA[";
+
+		string[] testGold = new string[] {"one<![CDATA[<one><two>three<four></four></two></one>]]>two", "one<one><two>three<four></four></two></one>two", "one<![CDATA[two<![CDATA[three]]]]><![CDATA[>four]]>five", "onetwo<![CDATA[three]]>fourfive", "<! [CDATA[&]]>", "", "<! [CDATA[&] ] >", "", "<! [CDATA[&]]", "<! [CDATA[&]]", "<!\u2009[CDATA[&]]>", "", "<!\u2009[CDATA[&]\u2009]\u2009>", "", "<!\u2009[CDATA[&]\u2009]\u2009", "<!\u2009[CDATA[&]\u2009]\u2009", closedAngleBangNonCDATA, "", "<![CDATA[", "", "<![CDATA[<br>", "<br>", "<![CDATA[<br>]]", "<br>]]", "<![CDATA[<br>]]>", "<br>", "<![CDATA[<br>] ] >", "<br>] ] >", "<![CDATA[<br>]\u2009]\u2009>", "<br>]\u2009]\u2009>", "<!\u2009[CDATA[", "<!\u2009[CDATA[", unclosedAngleBangNonCDATA, unclosedAngleBangNonCDATA};
+		for (int i = 0 ; i < testGold.Length ; i += 2)
+		{
+		  assertHTMLStripsTo(testGold[i], testGold[i + 1], null);
+		}
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testUnclosedAngleBang() throws Exception
+	  public virtual void testUnclosedAngleBang()
+	  {
+		assertHTMLStripsTo("<![endif]", "<![endif]", null);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testUppercaseCharacterEntityVariants() throws Exception
+	  public virtual void testUppercaseCharacterEntityVariants()
+	  {
+		string test = " &QUOT;-&COPY;&GT;>&LT;<&REG;&AMP;";
+		string gold = " \"-\u00A9>><<\u00AE&";
+		assertHTMLStripsTo(test, gold, null);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMSWordMalformedProcessingInstruction() throws Exception
+	  public virtual void testMSWordMalformedProcessingInstruction()
+	  {
+		string test = "one<?xml:namespace prefix = o ns = \"urn:schemas-microsoft-com:office:office\" />two";
+		string gold = "onetwo";
+		assertHTMLStripsTo(test, gold, null);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testSupplementaryCharsInTags() throws Exception
+	  public virtual void testSupplementaryCharsInTags()
+	  {
+		string test = "one<𩬅艱鍟䇹愯瀛>two<瀛愯𩬅>three 瀛愯𩬅</瀛愯𩬅>four</𩬅艱鍟䇹愯瀛>five<𠀀𠀀>six<𠀀𠀀/>seven";
+		string gold = "one\ntwo\nthree 瀛愯𩬅\nfour\nfive\nsix\nseven";
+		assertHTMLStripsTo(test, gold, null);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomBrokenHTML() throws Exception
+	  public virtual void testRandomBrokenHTML()
+	  {
+		int maxNumElements = 10000;
+		string text = TestUtil.randomHtmlishString(random(), maxNumElements);
+		checkAnalysisConsistency(random(), newTestAnalyzer(), random().nextBoolean(), text);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomText() throws Exception
+	  public virtual void testRandomText()
+	  {
+		StringBuilder text = new StringBuilder();
+		int minNumWords = 10;
+		int maxNumWords = 10000;
+		int minWordLength = 3;
+		int maxWordLength = 20;
+		int numWords = TestUtil.Next(random(), minNumWords, maxNumWords);
+		switch (TestUtil.Next(random(), 0, 4))
+		{
+		  case 0:
+		  {
+			for (int wordNum = 0 ; wordNum < numWords ; ++wordNum)
+			{
+			  text.Append(TestUtil.randomUnicodeString(random(), maxWordLength));
+			  text.Append(' ');
+			}
+			break;
+		  }
+		  case 1:
+		  {
+			for (int wordNum = 0 ; wordNum < numWords ; ++wordNum)
+			{
+			  text.Append(TestUtil.randomRealisticUnicodeString(random(), minWordLength, maxWordLength));
+			  text.Append(' ');
+			}
+			break;
+		  }
+		  default:
+		  { // ASCII 50% of the time
+			for (int wordNum = 0 ; wordNum < numWords ; ++wordNum)
+			{
+			  text.Append(TestUtil.randomSimpleString(random()));
+			  text.Append(' ');
+			}
+		  }
+	  break;
+		}
+		Reader reader = new HTMLStripCharFilter(new StringReader(text.ToString()));
+		while (reader.read() != -1);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testUTF16Surrogates() throws Exception
+	  public virtual void testUTF16Surrogates()
+	  {
+		Analyzer analyzer = newTestAnalyzer();
+		// Paired surrogates
+		assertAnalyzesTo(analyzer, " one two &#xD86C;&#XdC01;three", new string[] {"one", "two", "\uD86C\uDC01three"});
+		assertAnalyzesTo(analyzer, " &#55404;&#XdC01;", new string[] {"\uD86C\uDC01"});
+		assertAnalyzesTo(analyzer, " &#xD86C;&#56321;", new string[] {"\uD86C\uDC01"});
+		assertAnalyzesTo(analyzer, " &#55404;&#56321;", new string[] {"\uD86C\uDC01"});
+
+		// Improperly paired surrogates
+		assertAnalyzesTo(analyzer, " &#55404;&#57999;", new string[] {"\uFFFD\uE28F"});
+		assertAnalyzesTo(analyzer, " &#xD86C;&#57999;", new string[] {"\uFFFD\uE28F"});
+		assertAnalyzesTo(analyzer, " &#55002;&#XdC01;", new string[] {"\uD6DA\uFFFD"});
+		assertAnalyzesTo(analyzer, " &#55002;&#56321;", new string[] {"\uD6DA\uFFFD"});
+
+		// Unpaired high surrogates
+		assertAnalyzesTo(analyzer, " &#Xd921;", new string[] {"\uFFFD"});
+		assertAnalyzesTo(analyzer, " &#Xd921", new string[] {"\uFFFD"});
+		assertAnalyzesTo(analyzer, " &#Xd921<br>", new string[] {"&#Xd921"});
+		assertAnalyzesTo(analyzer, " &#55528;", new string[] {"\uFFFD"});
+		assertAnalyzesTo(analyzer, " &#55528", new string[] {"\uFFFD"});
+		assertAnalyzesTo(analyzer, " &#55528<br>", new string[] {"&#55528"});
+
+		// Unpaired low surrogates
+		assertAnalyzesTo(analyzer, " &#xdfdb;", new string[] {"\uFFFD"});
+		assertAnalyzesTo(analyzer, " &#xdfdb", new string[] {"\uFFFD"});
+		assertAnalyzesTo(analyzer, " &#xdfdb<br>", new string[] {"&#xdfdb"});
+		assertAnalyzesTo(analyzer, " &#57209;", new string[] {"\uFFFD"});
+		assertAnalyzesTo(analyzer, " &#57209", new string[] {"\uFFFD"});
+		assertAnalyzesTo(analyzer, " &#57209<br>", new string[] {"&#57209"});
+	  }
+
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public static void assertHTMLStripsTo(String input, String gold, java.util.Set<String> escapedTags) throws Exception
+	  public static void assertHTMLStripsTo(string input, string gold, ISet<string> escapedTags)
+	  {
+		assertHTMLStripsTo(new StringReader(input), gold, escapedTags);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public static void assertHTMLStripsTo(java.io.Reader input, String gold, java.util.Set<String> escapedTags) throws Exception
+	  public static void assertHTMLStripsTo(Reader input, string gold, ISet<string> escapedTags)
+	  {
+		HTMLStripCharFilter reader;
+		if (null == escapedTags)
+		{
+		  reader = new HTMLStripCharFilter(input);
+		}
+		else
+		{
+		  reader = new HTMLStripCharFilter(input, escapedTags);
+		}
+		int ch = 0;
+		StringBuilder builder = new StringBuilder();
+		try
+		{
+		  while ((ch = reader.read()) != -1)
+		  {
+			builder.Append((char)ch);
+		  }
+		}
+		catch (Exception e)
+		{
+		  if (gold.Equals(builder.ToString()))
+		  {
+			throw e;
+		  }
+		  throw new Exception("('" + builder.ToString() + "' is not equal to '" + gold + "').  " + e.Message, e);
+		}
+		assertEquals("'" + builder.ToString() + "' is not equal to '" + gold + "'", gold, builder.ToString());
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Charfilter/TestHTMLStripCharFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Charfilter/TestHTMLStripCharFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Charfilter/TestHTMLStripCharFilterFactory.cs
new file mode 100644
index 0000000..08adf1b
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Charfilter/TestHTMLStripCharFilterFactory.cs
@@ -0,0 +1,121 @@
+namespace org.apache.lucene.analysis.charfilter
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure this factory is working
+	/// </summary>
+	public class TestHTMLStripCharFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNothingChanged() throws Exception
+	  public virtual void testNothingChanged()
+	  {
+		//                             11111111112
+		//                   012345678901234567890
+		const string text = "this is only a test.";
+		Reader cs = charFilterFactory("HTMLStrip", "escapedTags", "a, Title").create(new StringReader(text));
+		TokenStream ts = new MockTokenizer(cs, MockTokenizer.WHITESPACE, false);
+		assertTokenStreamContents(ts, new string[] {"this", "is", "only", "a", "test."}, new int[] {0, 5, 8, 13, 15}, new int[] {4, 7, 12, 14, 20});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNoEscapedTags() throws Exception
+	  public virtual void testNoEscapedTags()
+	  {
+		//                             11111111112222222222333333333344
+		//                   012345678901234567890123456789012345678901
+		const string text = "<u>this</u> is <b>only</b> a <I>test</I>.";
+		Reader cs = charFilterFactory("HTMLStrip").create(new StringReader(text));
+		TokenStream ts = new MockTokenizer(cs, MockTokenizer.WHITESPACE, false);
+		assertTokenStreamContents(ts, new string[] {"this", "is", "only", "a", "test."}, new int[] {3, 12, 18, 27, 32}, new int[] {11, 14, 26, 28, 41});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEscapedTags() throws Exception
+	  public virtual void testEscapedTags()
+	  {
+		//                             11111111112222222222333333333344
+		//                   012345678901234567890123456789012345678901
+		const string text = "<u>this</u> is <b>only</b> a <I>test</I>.";
+		Reader cs = charFilterFactory("HTMLStrip", "escapedTags", "U i").create(new StringReader(text));
+		TokenStream ts = new MockTokenizer(cs, MockTokenizer.WHITESPACE, false);
+		assertTokenStreamContents(ts, new string[] {"<u>this</u>", "is", "only", "a", "<I>test</I>."}, new int[] {0, 12, 18, 27, 29}, new int[] {11, 14, 26, 28, 41});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testSeparatorOnlyEscapedTags() throws Exception
+	  public virtual void testSeparatorOnlyEscapedTags()
+	  {
+		//                             11111111112222222222333333333344
+		//                   012345678901234567890123456789012345678901
+		const string text = "<u>this</u> is <b>only</b> a <I>test</I>.";
+		Reader cs = charFilterFactory("HTMLStrip", "escapedTags", ",, , ").create(new StringReader(text));
+		TokenStream ts = new MockTokenizer(cs, MockTokenizer.WHITESPACE, false);
+		assertTokenStreamContents(ts, new string[] {"this", "is", "only", "a", "test."}, new int[] {3, 12, 18, 27, 32}, new int[] {11, 14, 26, 28, 41});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyEscapedTags() throws Exception
+	  public virtual void testEmptyEscapedTags()
+	  {
+		//                             11111111112222222222333333333344
+		//                   012345678901234567890123456789012345678901
+		const string text = "<u>this</u> is <b>only</b> a <I>test</I>.";
+		Reader cs = charFilterFactory("HTMLStrip", "escapedTags", "").create(new StringReader(text));
+		TokenStream ts = new MockTokenizer(cs, MockTokenizer.WHITESPACE, false);
+		assertTokenStreamContents(ts, new string[] {"this", "is", "only", "a", "test."}, new int[] {3, 12, 18, 27, 32}, new int[] {11, 14, 26, 28, 41});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testSingleEscapedTag() throws Exception
+	  public virtual void testSingleEscapedTag()
+	  {
+		//                             11111111112222222222333333333344
+		//                   012345678901234567890123456789012345678901
+		const string text = "<u>this</u> is <b>only</b> a <I>test</I>.";
+		Reader cs = charFilterFactory("HTMLStrip", "escapedTags", ", B\r\n\t").create(new StringReader(text));
+		TokenStream ts = new MockTokenizer(cs, MockTokenizer.WHITESPACE, false);
+		assertTokenStreamContents(ts, new string[] {"this", "is", "<b>only</b>", "a", "test."}, new int[] {3, 12, 15, 27, 32}, new int[] {11, 14, 26, 28, 41});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  charFilterFactory("HTMLStrip", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Charfilter/TestMappingCharFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Charfilter/TestMappingCharFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Charfilter/TestMappingCharFilter.cs
new file mode 100644
index 0000000..8b3d5fa
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Charfilter/TestMappingCharFilter.cs
@@ -0,0 +1,636 @@
+using System;
+using System.Diagnostics;
+using System.Collections.Generic;
+using System.Text;
+
+/*
+ * 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 org.apache.lucene.analysis.charfilter
+{
+
+
+	using TestUtil = org.apache.lucene.util.TestUtil;
+	using UnicodeUtil = org.apache.lucene.util.UnicodeUtil;
+
+	public class TestMappingCharFilter : BaseTokenStreamTestCase
+	{
+
+	  internal NormalizeCharMap normMap;
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Override public void setUp() throws Exception
+	  public override void setUp()
+	  {
+		base.setUp();
+		NormalizeCharMap.Builder builder = new NormalizeCharMap.Builder();
+
+		builder.add("aa", "a");
+		builder.add("bbb", "b");
+		builder.add("cccc", "cc");
+
+		builder.add("h", "i");
+		builder.add("j", "jj");
+		builder.add("k", "kkk");
+		builder.add("ll", "llll");
+
+		builder.add("empty", "");
+
+		// BMP (surrogate pair):
+		builder.add(UnicodeUtil.newString(new int[] {0x1D122}, 0, 1), "fclef");
+
+		builder.add("\uff01", "full-width-exclamation");
+
+		normMap = builder.build();
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testReaderReset() throws Exception
+	  public virtual void testReaderReset()
+	  {
+		CharFilter cs = new MappingCharFilter(normMap, new StringReader("x"));
+		char[] buf = new char[10];
+		int len = cs.read(buf, 0, 10);
+		assertEquals(1, len);
+		assertEquals('x', buf[0]);
+		len = cs.read(buf, 0, 10);
+		assertEquals(-1, len);
+
+		// rewind
+		cs.reset();
+		len = cs.read(buf, 0, 10);
+		assertEquals(1, len);
+		assertEquals('x', buf[0]);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNothingChange() throws Exception
+	  public virtual void testNothingChange()
+	  {
+		CharFilter cs = new MappingCharFilter(normMap, new StringReader("x"));
+		TokenStream ts = new MockTokenizer(cs, MockTokenizer.WHITESPACE, false);
+		assertTokenStreamContents(ts, new string[]{"x"}, new int[]{0}, new int[]{1}, 1);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void test1to1() throws Exception
+	  public virtual void test1to1()
+	  {
+		CharFilter cs = new MappingCharFilter(normMap, new StringReader("h"));
+		TokenStream ts = new MockTokenizer(cs, MockTokenizer.WHITESPACE, false);
+		assertTokenStreamContents(ts, new string[]{"i"}, new int[]{0}, new int[]{1}, 1);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void test1to2() throws Exception
+	  public virtual void test1to2()
+	  {
+		CharFilter cs = new MappingCharFilter(normMap, new StringReader("j"));
+		TokenStream ts = new MockTokenizer(cs, MockTokenizer.WHITESPACE, false);
+		assertTokenStreamContents(ts, new string[]{"jj"}, new int[]{0}, new int[]{1}, 1);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void test1to3() throws Exception
+	  public virtual void test1to3()
+	  {
+		CharFilter cs = new MappingCharFilter(normMap, new StringReader("k"));
+		TokenStream ts = new MockTokenizer(cs, MockTokenizer.WHITESPACE, false);
+		assertTokenStreamContents(ts, new string[]{"kkk"}, new int[]{0}, new int[]{1}, 1);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void test2to4() throws Exception
+	  public virtual void test2to4()
+	  {
+		CharFilter cs = new MappingCharFilter(normMap, new StringReader("ll"));
+		TokenStream ts = new MockTokenizer(cs, MockTokenizer.WHITESPACE, false);
+		assertTokenStreamContents(ts, new string[]{"llll"}, new int[]{0}, new int[]{2}, 2);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void test2to1() throws Exception
+	  public virtual void test2to1()
+	  {
+		CharFilter cs = new MappingCharFilter(normMap, new StringReader("aa"));
+		TokenStream ts = new MockTokenizer(cs, MockTokenizer.WHITESPACE, false);
+		assertTokenStreamContents(ts, new string[]{"a"}, new int[]{0}, new int[]{2}, 2);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void test3to1() throws Exception
+	  public virtual void test3to1()
+	  {
+		CharFilter cs = new MappingCharFilter(normMap, new StringReader("bbb"));
+		TokenStream ts = new MockTokenizer(cs, MockTokenizer.WHITESPACE, false);
+		assertTokenStreamContents(ts, new string[]{"b"}, new int[]{0}, new int[]{3}, 3);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void test4to2() throws Exception
+	  public virtual void test4to2()
+	  {
+		CharFilter cs = new MappingCharFilter(normMap, new StringReader("cccc"));
+		TokenStream ts = new MockTokenizer(cs, MockTokenizer.WHITESPACE, false);
+		assertTokenStreamContents(ts, new string[]{"cc"}, new int[]{0}, new int[]{4}, 4);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void test5to0() throws Exception
+	  public virtual void test5to0()
+	  {
+		CharFilter cs = new MappingCharFilter(normMap, new StringReader("empty"));
+		TokenStream ts = new MockTokenizer(cs, MockTokenizer.WHITESPACE, false);
+		assertTokenStreamContents(ts, new string[0], new int[]{}, new int[]{}, 5);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNonBMPChar() throws Exception
+	  public virtual void testNonBMPChar()
+	  {
+		CharFilter cs = new MappingCharFilter(normMap, new StringReader(UnicodeUtil.newString(new int[] {0x1D122}, 0, 1)));
+		TokenStream ts = new MockTokenizer(cs, MockTokenizer.WHITESPACE, false);
+		assertTokenStreamContents(ts, new string[]{"fclef"}, new int[]{0}, new int[]{2}, 2);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFullWidthChar() throws Exception
+	  public virtual void testFullWidthChar()
+	  {
+		CharFilter cs = new MappingCharFilter(normMap, new StringReader("\uff01"));
+		TokenStream ts = new MockTokenizer(cs, MockTokenizer.WHITESPACE, false);
+		assertTokenStreamContents(ts, new string[]{"full-width-exclamation"}, new int[]{0}, new int[]{1}, 1);
+	  }
+
+	  //
+	  //                1111111111222
+	  //      01234567890123456789012
+	  //(in)  h i j k ll cccc bbb aa
+	  //
+	  //                1111111111222
+	  //      01234567890123456789012
+	  //(out) i i jj kkk llll cc b a
+	  //
+	  //    h, 0, 1 =>    i, 0, 1
+	  //    i, 2, 3 =>    i, 2, 3
+	  //    j, 4, 5 =>   jj, 4, 5
+	  //    k, 6, 7 =>  kkk, 6, 7
+	  //   ll, 8,10 => llll, 8,10
+	  // cccc,11,15 =>   cc,11,15
+	  //  bbb,16,19 =>    b,16,19
+	  //   aa,20,22 =>    a,20,22
+	  //
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTokenStream() throws Exception
+	  public virtual void testTokenStream()
+	  {
+		string testString = "h i j k ll cccc bbb aa";
+		CharFilter cs = new MappingCharFilter(normMap, new StringReader(testString));
+		TokenStream ts = new MockTokenizer(cs, MockTokenizer.WHITESPACE, false);
+		assertTokenStreamContents(ts, new string[]{"i","i","jj","kkk","llll","cc","b","a"}, new int[]{0,2,4,6,8,11,16,20}, new int[]{1,3,5,7,10,15,19,22}, testString.Length);
+	  }
+
+	  //
+	  //
+	  //        0123456789
+	  //(in)    aaaa ll h
+	  //(out-1) aa llll i
+	  //(out-2) a llllllll i
+	  //
+	  // aaaa,0,4 => a,0,4
+	  //   ll,5,7 => llllllll,5,7
+	  //    h,8,9 => i,8,9
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testChained() throws Exception
+	  public virtual void testChained()
+	  {
+		string testString = "aaaa ll h";
+		CharFilter cs = new MappingCharFilter(normMap, new MappingCharFilter(normMap, new StringReader(testString)));
+		TokenStream ts = new MockTokenizer(cs, MockTokenizer.WHITESPACE, false);
+		assertTokenStreamContents(ts, new string[]{"a","llllllll","i"}, new int[]{0,5,8}, new int[]{4,7,9}, testString.Length);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandom() throws Exception
+	  public virtual void testRandom()
+	  {
+		Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper(this);
+
+		int numRounds = RANDOM_MULTIPLIER * 10000;
+		checkRandomData(random(), analyzer, numRounds);
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestMappingCharFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestMappingCharFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(tokenizer, tokenizer);
+		  }
+
+		  protected internal override Reader initReader(string fieldName, Reader reader)
+		  {
+			return new MappingCharFilter(outerInstance.normMap, reader);
+		  }
+	  }
+
+	  //@Ignore("wrong finalOffset: https://issues.apache.org/jira/browse/LUCENE-3971")
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFinalOffsetSpecialCase() throws Exception
+	  public virtual void testFinalOffsetSpecialCase()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final NormalizeCharMap.Builder builder = new NormalizeCharMap.Builder();
+		NormalizeCharMap.Builder builder = new NormalizeCharMap.Builder();
+		builder.add("t", "");
+		// even though this below rule has no effect, the test passes if you remove it!!
+		builder.add("tmakdbl", "c");
+
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final NormalizeCharMap map = builder.build();
+		NormalizeCharMap map = builder.build();
+
+		Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper2(this, map);
+
+		string text = "gzw f quaxot";
+		checkAnalysisConsistency(random(), analyzer, false, text);
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestMappingCharFilter outerInstance;
+
+		  private NormalizeCharMap map;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestMappingCharFilter outerInstance, NormalizeCharMap map)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.map = map;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(tokenizer, tokenizer);
+		  }
+
+		  protected internal override Reader initReader(string fieldName, Reader reader)
+		  {
+			return new MappingCharFilter(map, reader);
+		  }
+	  }
+
+	  //@Ignore("wrong finalOffset: https://issues.apache.org/jira/browse/LUCENE-3971")
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomMaps() throws Exception
+	  public virtual void testRandomMaps()
+	  {
+		int numIterations = atLeast(3);
+		for (int i = 0; i < numIterations; i++)
+		{
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final NormalizeCharMap map = randomMap();
+		  NormalizeCharMap map = randomMap();
+		  Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper3(this, map);
+		  int numRounds = 100;
+		  checkRandomData(random(), analyzer, numRounds);
+		}
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper3 : Analyzer
+	  {
+		  private readonly TestMappingCharFilter outerInstance;
+
+		  private NormalizeCharMap map;
+
+		  public AnalyzerAnonymousInnerClassHelper3(TestMappingCharFilter outerInstance, NormalizeCharMap map)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.map = map;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(tokenizer, tokenizer);
+		  }
+
+		  protected internal override Reader initReader(string fieldName, Reader reader)
+		  {
+			return new MappingCharFilter(map, reader);
+		  }
+	  }
+
+	  private NormalizeCharMap randomMap()
+	  {
+		Random random = random();
+		NormalizeCharMap.Builder builder = new NormalizeCharMap.Builder();
+		// we can't add duplicate keys, or NormalizeCharMap gets angry
+		ISet<string> keys = new HashSet<string>();
+		int num = random.Next(5);
+		//System.out.println("NormalizeCharMap=");
+		for (int i = 0; i < num; i++)
+		{
+		  string key = TestUtil.randomSimpleString(random);
+		  if (!keys.Contains(key) && key.Length != 0)
+		  {
+			string value = TestUtil.randomSimpleString(random);
+			builder.add(key, value);
+			keys.Add(key);
+			//System.out.println("mapping: '" + key + "' => '" + value + "'");
+		  }
+		}
+		return builder.build();
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomMaps2() throws Exception
+	  public virtual void testRandomMaps2()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final java.util.Random random = random();
+		Random random = random();
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int numIterations = atLeast(3);
+		int numIterations = atLeast(3);
+		for (int iter = 0;iter < numIterations;iter++)
+		{
+
+		  if (VERBOSE)
+		  {
+			Console.WriteLine("\nTEST iter=" + iter);
+		  }
+
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final char endLetter = (char) org.apache.lucene.util.TestUtil.nextInt(random, 'b', 'z');
+		  char endLetter = (char) TestUtil.Next(random, 'b', 'z');
+
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final java.util.Map<String,String> map = new java.util.HashMap<>();
+		  IDictionary<string, string> map = new Dictionary<string, string>();
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final NormalizeCharMap.Builder builder = new NormalizeCharMap.Builder();
+		  NormalizeCharMap.Builder builder = new NormalizeCharMap.Builder();
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int numMappings = atLeast(5);
+		  int numMappings = atLeast(5);
+		  if (VERBOSE)
+		  {
+			Console.WriteLine("  mappings:");
+		  }
+		  while (map.Count < numMappings)
+		  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final String key = org.apache.lucene.util.TestUtil.randomSimpleStringRange(random, 'a', endLetter, 7);
+			string key = TestUtil.randomSimpleStringRange(random, 'a', endLetter, 7);
+			if (key.Length != 0 && !map.ContainsKey(key))
+			{
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final String value = org.apache.lucene.util.TestUtil.randomSimpleString(random);
+			  string value = TestUtil.randomSimpleString(random);
+			  map[key] = value;
+			  builder.add(key, value);
+			  if (VERBOSE)
+			  {
+				Console.WriteLine("    " + key + " -> " + value);
+			  }
+			}
+		  }
+
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final NormalizeCharMap charMap = builder.build();
+		  NormalizeCharMap charMap = builder.build();
+
+		  if (VERBOSE)
+		  {
+			Console.WriteLine("  test random documents...");
+		  }
+
+		  for (int iter2 = 0;iter2 < 100;iter2++)
+		  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final String content = org.apache.lucene.util.TestUtil.randomSimpleStringRange(random, 'a', endLetter, atLeast(1000));
+			string content = TestUtil.randomSimpleStringRange(random, 'a', endLetter, atLeast(1000));
+
+			if (VERBOSE)
+			{
+			  Console.WriteLine("  content=" + content);
+			}
+
+			// Do stupid dog-slow mapping:
+
+			// Output string:
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final StringBuilder output = new StringBuilder();
+			StringBuilder output = new StringBuilder();
+
+			// Maps output offset to input offset:
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final java.util.List<Integer> inputOffsets = new java.util.ArrayList<>();
+			IList<int?> inputOffsets = new List<int?>();
+
+			int cumDiff = 0;
+			int charIdx = 0;
+			while (charIdx < content.Length)
+			{
+
+			  int matchLen = -1;
+			  string matchRepl = null;
+
+			  foreach (KeyValuePair<string, string> ent in map.SetOfKeyValuePairs())
+			  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final String match = ent.getKey();
+				string match = ent.Key;
+				if (charIdx + match.Length <= content.Length)
+				{
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int limit = charIdx+match.length();
+				  int limit = charIdx + match.Length;
+				  bool matches = true;
+				  for (int charIdx2 = charIdx;charIdx2 < limit;charIdx2++)
+				  {
+					if (match[charIdx2 - charIdx] != content[charIdx2])
+					{
+					  matches = false;
+					  break;
+					}
+				  }
+
+				  if (matches)
+				  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final String repl = ent.getValue();
+					string repl = ent.Value;
+					if (match.Length > matchLen)
+					{
+					  // Greedy: longer match wins
+					  matchLen = match.Length;
+					  matchRepl = repl;
+					}
+				  }
+				}
+			  }
+
+			  if (matchLen != -1)
+			  {
+				// We found a match here!
+				if (VERBOSE)
+				{
+				  Console.WriteLine("    match=" + content.Substring(charIdx, matchLen) + " @ off=" + charIdx + " repl=" + matchRepl);
+				}
+				output.Append(matchRepl);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int minLen = Math.min(matchLen, matchRepl.length());
+				int minLen = Math.Min(matchLen, matchRepl.Length);
+
+				// Common part, directly maps back to input
+				// offset:
+				for (int outIdx = 0;outIdx < minLen;outIdx++)
+				{
+				  inputOffsets.Add(output.Length - matchRepl.Length + outIdx + cumDiff);
+				}
+
+				cumDiff += matchLen - matchRepl.Length;
+				charIdx += matchLen;
+
+				if (matchRepl.Length < matchLen)
+				{
+				  // Replacement string is shorter than matched
+				  // input: nothing to do
+				}
+				else if (matchRepl.Length > matchLen)
+				{
+				  // Replacement string is longer than matched
+				  // input: for all the "extra" chars we map
+				  // back to a single input offset:
+				  for (int outIdx = matchLen;outIdx < matchRepl.Length;outIdx++)
+				  {
+					inputOffsets.Add(output.Length + cumDiff - 1);
+				  }
+				}
+				else
+				{
+				  // Same length: no change to offset
+				}
+
+				Debug.Assert(inputOffsets.Count == output.Length, "inputOffsets.size()=" + inputOffsets.Count + " vs output.length()=" + output.Length);
+			  }
+			  else
+			  {
+				inputOffsets.Add(output.Length + cumDiff);
+				output.Append(content[charIdx]);
+				charIdx++;
+			  }
+			}
+
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final String expected = output.toString();
+			string expected = output.ToString();
+			if (VERBOSE)
+			{
+			  Console.Write("    expected:");
+			  for (int charIdx2 = 0;charIdx2 < expected.Length;charIdx2++)
+			  {
+				Console.Write(" " + expected[charIdx2] + "/" + inputOffsets[charIdx2]);
+			  }
+			  Console.WriteLine();
+			}
+
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final MappingCharFilter mapFilter = new MappingCharFilter(charMap, new java.io.StringReader(content));
+			MappingCharFilter mapFilter = new MappingCharFilter(charMap, new StringReader(content));
+
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final StringBuilder actualBuilder = new StringBuilder();
+			StringBuilder actualBuilder = new StringBuilder();
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final java.util.List<Integer> actualInputOffsets = new java.util.ArrayList<>();
+			IList<int?> actualInputOffsets = new List<int?>();
+
+			// Now consume the actual mapFilter, somewhat randomly:
+			while (true)
+			{
+			  if (random.nextBoolean())
+			  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int ch = mapFilter.read();
+				int ch = mapFilter.read();
+				if (ch == -1)
+				{
+				  break;
+				}
+				actualBuilder.Append((char) ch);
+			  }
+			  else
+			  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final char[] buffer = new char[org.apache.lucene.util.TestUtil.nextInt(random, 1, 100)];
+				char[] buffer = new char[TestUtil.Next(random, 1, 100)];
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int off = buffer.length == 1 ? 0 : random.nextInt(buffer.length-1);
+				int off = buffer.Length == 1 ? 0 : random.Next(buffer.Length - 1);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int count = mapFilter.read(buffer, off, buffer.length-off);
+				int count = mapFilter.read(buffer, off, buffer.Length - off);
+				if (count == -1)
+				{
+				  break;
+				}
+				else
+				{
+				  actualBuilder.Append(buffer, off, count);
+				}
+			  }
+
+			  if (random.Next(10) == 7)
+			  {
+				// Map offsets
+				while (actualInputOffsets.Count < actualBuilder.Length)
+				{
+				  actualInputOffsets.Add(mapFilter.correctOffset(actualInputOffsets.Count));
+				}
+			  }
+			}
+
+			// Finish mappping offsets
+			while (actualInputOffsets.Count < actualBuilder.Length)
+			{
+			  actualInputOffsets.Add(mapFilter.correctOffset(actualInputOffsets.Count));
+			}
+
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final String actual = actualBuilder.toString();
+			string actual = actualBuilder.ToString();
+
+			// Verify:
+			assertEquals(expected, actual);
+			assertEquals(inputOffsets, actualInputOffsets);
+		  }
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Charfilter/TestMappingCharFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Charfilter/TestMappingCharFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Charfilter/TestMappingCharFilterFactory.cs
new file mode 100644
index 0000000..078707f
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Charfilter/TestMappingCharFilterFactory.cs
@@ -0,0 +1,82 @@
+namespace org.apache.lucene.analysis.charfilter
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	public class TestMappingCharFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testParseString() throws Exception
+	  public virtual void testParseString()
+	  {
+
+		MappingCharFilterFactory f = (MappingCharFilterFactory)charFilterFactory("Mapping");
+
+		try
+		{
+		  f.parseString("\\");
+		  fail("escape character cannot be alone.");
+		}
+		catch (System.ArgumentException)
+		{
+		}
+
+		assertEquals("unexpected escaped characters", "\\\"\n\t\r\b\f", f.parseString("\\\\\\\"\\n\\t\\r\\b\\f"));
+		assertEquals("unexpected escaped characters", "A", f.parseString("\\u0041"));
+		assertEquals("unexpected escaped characters", "AB", f.parseString("\\u0041\\u0042"));
+
+		try
+		{
+		  f.parseString("\\u000");
+		  fail("invalid length check.");
+		}
+		catch (System.ArgumentException)
+		{
+		}
+
+		try
+		{
+		  f.parseString("\\u123x");
+		  fail("invalid hex number check.");
+		}
+		catch (System.FormatException)
+		{
+		}
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  charFilterFactory("Mapping", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cjk/TestCJKAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cjk/TestCJKAnalyzer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cjk/TestCJKAnalyzer.cs
new file mode 100644
index 0000000..0b2a3b1
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cjk/TestCJKAnalyzer.cs
@@ -0,0 +1,289 @@
+using System;
+
+namespace org.apache.lucene.analysis.cjk
+{
+
+	/*
+	 * 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 MappingCharFilter = org.apache.lucene.analysis.charfilter.MappingCharFilter;
+	using NormalizeCharMap = org.apache.lucene.analysis.charfilter.NormalizeCharMap;
+	using KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+	using StopFilter = org.apache.lucene.analysis.core.StopFilter;
+	using StandardTokenizer = org.apache.lucene.analysis.standard.StandardTokenizer;
+	using TypeAttribute = org.apache.lucene.analysis.tokenattributes.TypeAttribute;
+	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+
+	/// <summary>
+	/// Most tests adopted from TestCJKTokenizer
+	/// </summary>
+	public class TestCJKAnalyzer : BaseTokenStreamTestCase
+	{
+	  private Analyzer analyzer = new CJKAnalyzer(TEST_VERSION_CURRENT);
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testJa1() throws java.io.IOException
+	  public virtual void testJa1()
+	  {
+		assertAnalyzesTo(analyzer, "一二三四五六七八九十", new string[] {"一二", "二三", "三四", "四五", "五六", "六七", "七八", "八九", "九十"}, new int[] {0, 1, 2, 3, 4, 5, 6, 7, 8}, new int[] {2, 3, 4, 5, 6, 7, 8, 9, 10}, new string[] {"<DOUBLE>", "<DOUBLE>", "<DOUBLE>", "<DOUBLE>", "<DOUBLE>", "<DOUBLE>", "<DOUBLE>", "<DOUBLE>", "<DOUBLE>"}, new int[] {1, 1, 1, 1, 1, 1, 1, 1, 1});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testJa2() throws java.io.IOException
+	  public virtual void testJa2()
+	  {
+		assertAnalyzesTo(analyzer, "一 二三四 五六七八九 十", new string[] {"一", "二三", "三四", "五六", "六七", "七八", "八九", "十"}, new int[] {0, 2, 3, 6, 7, 8, 9, 12}, new int[] {1, 4, 5, 8, 9, 10, 11, 13}, new string[] {"<SINGLE>", "<DOUBLE>", "<DOUBLE>", "<DOUBLE>", "<DOUBLE>", "<DOUBLE>", "<DOUBLE>", "<SINGLE>"}, new int[] {1, 1, 1, 1, 1, 1, 1, 1});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testC() throws java.io.IOException
+	  public virtual void testC()
+	  {
+		assertAnalyzesTo(analyzer, "abc defgh ijklmn opqrstu vwxy z", new string[] {"abc", "defgh", "ijklmn", "opqrstu", "vwxy", "z"}, new int[] {0, 4, 10, 17, 25, 30}, new int[] {3, 9, 16, 24, 29, 31}, new string[] {"<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>"}, new int[] {1, 1, 1, 1, 1, 1});
+	  }
+
+	  /// <summary>
+	  /// LUCENE-2207: wrong offset calculated by end() 
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFinalOffset() throws java.io.IOException
+	  public virtual void testFinalOffset()
+	  {
+		assertAnalyzesTo(analyzer, "あい", new string[] {"あい"}, new int[] {0}, new int[] {2}, new string[] {"<DOUBLE>"}, new int[] {1});
+
+		assertAnalyzesTo(analyzer, "あい   ", new string[] {"あい"}, new int[] {0}, new int[] {2}, new string[] {"<DOUBLE>"}, new int[] {1});
+
+		assertAnalyzesTo(analyzer, "test", new string[] {"test"}, new int[] {0}, new int[] {4}, new string[] {"<ALPHANUM>"}, new int[] {1});
+
+		assertAnalyzesTo(analyzer, "test   ", new string[] {"test"}, new int[] {0}, new int[] {4}, new string[] {"<ALPHANUM>"}, new int[] {1});
+
+		assertAnalyzesTo(analyzer, "あいtest", new string[] {"あい", "test"}, new int[] {0, 2}, new int[] {2, 6}, new string[] {"<DOUBLE>", "<ALPHANUM>"}, new int[] {1, 1});
+
+		assertAnalyzesTo(analyzer, "testあい    ", new string[] {"test", "あい"}, new int[] {0, 4}, new int[] {4, 6}, new string[] {"<ALPHANUM>", "<DOUBLE>"}, new int[] {1, 1});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMix() throws java.io.IOException
+	  public virtual void testMix()
+	  {
+		assertAnalyzesTo(analyzer, "あいうえおabcかきくけこ", new string[] {"あい", "いう", "うえ", "えお", "abc", "かき", "きく", "くけ", "けこ"}, new int[] {0, 1, 2, 3, 5, 8, 9, 10, 11}, new int[] {2, 3, 4, 5, 8, 10, 11, 12, 13}, new string[] {"<DOUBLE>", "<DOUBLE>", "<DOUBLE>", "<DOUBLE>", "<ALPHANUM>", "<DOUBLE>", "<DOUBLE>", "<DOUBLE>", "<DOUBLE>"}, new int[] {1, 1, 1, 1, 1, 1, 1, 1, 1});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMix2() throws java.io.IOException
+	  public virtual void testMix2()
+	  {
+		assertAnalyzesTo(analyzer, "あいうえおabんcかきくけ こ", new string[] {"あい", "いう", "うえ", "えお", "ab", "ん", "c", "かき", "きく", "くけ", "こ"}, new int[] {0, 1, 2, 3, 5, 7, 8, 9, 10, 11, 14}, new int[] {2, 3, 4, 5, 7, 8, 9, 11, 12, 13, 15}, new string[] {"<DOUBLE>", "<DOUBLE>", "<DOUBLE>", "<DOUBLE>", "<ALPHANUM>", "<SINGLE>", "<ALPHANUM>", "<DOUBLE>", "<DOUBLE>", "<DOUBLE>", "<SINGLE>"}, new int[] {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1});
+	  }
+
+	  /// <summary>
+	  /// Non-english text (outside of CJK) is treated normally, according to unicode rules 
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNonIdeographic() throws java.io.IOException
+	  public virtual void testNonIdeographic()
+	  {
+		assertAnalyzesTo(analyzer, "一 روبرت موير", new string[] {"一", "روبرت", "موير"}, new int[] {0, 2, 8}, new int[] {1, 7, 12}, new string[] {"<SINGLE>", "<ALPHANUM>", "<ALPHANUM>"}, new int[] {1, 1, 1});
+	  }
+
+	  /// <summary>
+	  /// Same as the above, except with a nonspacing mark to show correctness.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNonIdeographicNonLetter() throws java.io.IOException
+	  public virtual void testNonIdeographicNonLetter()
+	  {
+		assertAnalyzesTo(analyzer, "一 رُوبرت موير", new string[] {"一", "رُوبرت", "موير"}, new int[] {0, 2, 9}, new int[] {1, 8, 13}, new string[] {"<SINGLE>", "<ALPHANUM>", "<ALPHANUM>"}, new int[] {1, 1, 1});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testSurrogates() throws java.io.IOException
+	  public virtual void testSurrogates()
+	  {
+		assertAnalyzesTo(analyzer, "𩬅艱鍟䇹愯瀛", new string[] {"𩬅艱", "艱鍟", "鍟䇹", "䇹愯", "愯瀛"}, new int[] {0, 2, 3, 4, 5}, new int[] {3, 4, 5, 6, 7}, new string[] {"<DOUBLE>", "<DOUBLE>", "<DOUBLE>", "<DOUBLE>", "<DOUBLE>"}, new int[] {1, 1, 1, 1, 1});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testReusableTokenStream() throws java.io.IOException
+	  public virtual void testReusableTokenStream()
+	  {
+		assertAnalyzesTo(analyzer, "あいうえおabcかきくけこ", new string[] {"あい", "いう", "うえ", "えお", "abc", "かき", "きく", "くけ", "けこ"}, new int[] {0, 1, 2, 3, 5, 8, 9, 10, 11}, new int[] {2, 3, 4, 5, 8, 10, 11, 12, 13}, new string[] {"<DOUBLE>", "<DOUBLE>", "<DOUBLE>", "<DOUBLE>", "<ALPHANUM>", "<DOUBLE>", "<DOUBLE>", "<DOUBLE>", "<DOUBLE>"}, new int[] {1, 1, 1, 1, 1, 1, 1, 1, 1});
+
+		assertAnalyzesTo(analyzer, "あいうえおabんcかきくけ こ", new string[] {"あい", "いう", "うえ", "えお", "ab", "ん", "c", "かき", "きく", "くけ", "こ"}, new int[] {0, 1, 2, 3, 5, 7, 8, 9, 10, 11, 14}, new int[] {2, 3, 4, 5, 7, 8, 9, 11, 12, 13, 15}, new string[] {"<DOUBLE>", "<DOUBLE>", "<DOUBLE>", "<DOUBLE>", "<ALPHANUM>", "<SINGLE>", "<ALPHANUM>", "<DOUBLE>", "<DOUBLE>", "<DOUBLE>", "<SINGLE>"}, new int[] {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testSingleChar() throws java.io.IOException
+	  public virtual void testSingleChar()
+	  {
+		assertAnalyzesTo(analyzer, "一", new string[] {"一"}, new int[] {0}, new int[] {1}, new string[] {"<SINGLE>"}, new int[] {1});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTokenStream() throws java.io.IOException
+	  public virtual void testTokenStream()
+	  {
+		assertAnalyzesTo(analyzer, "一丁丂", new string[] {"一丁", "丁丂"}, new int[] {0, 1}, new int[] {2, 3}, new string[] {"<DOUBLE>", "<DOUBLE>"}, new int[] {1, 1});
+	  }
+
+	  /// <summary>
+	  /// test that offsets are correct when mappingcharfilter is previously applied </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testChangedOffsets() throws java.io.IOException
+	  public virtual void testChangedOffsets()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.charfilter.NormalizeCharMap.Builder builder = new org.apache.lucene.analysis.charfilter.NormalizeCharMap.Builder();
+		NormalizeCharMap.Builder builder = new NormalizeCharMap.Builder();
+		builder.add("a", "一二");
+		builder.add("b", "二三");
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.charfilter.NormalizeCharMap norm = builder.build();
+		NormalizeCharMap norm = builder.build();
+		Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper(this, norm);
+
+		assertAnalyzesTo(analyzer, "ab", new string[] {"一二", "二二", "二三"}, new int[] {0, 0, 1}, new int[] {1, 1, 2});
+
+		// note: offsets are strange since this is how the charfilter maps them... 
+		// before bigramming, the 4 tokens look like:
+		//   { 0, 0, 1, 1 },
+		//   { 0, 1, 1, 2 }
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestCJKAnalyzer outerInstance;
+
+		  private NormalizeCharMap norm;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestCJKAnalyzer outerInstance, NormalizeCharMap norm)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.norm = norm;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new StandardTokenizer(TEST_VERSION_CURRENT, reader);
+			return new TokenStreamComponents(tokenizer, new CJKBigramFilter(tokenizer));
+		  }
+
+		  protected internal override Reader initReader(string fieldName, Reader reader)
+		  {
+			return new MappingCharFilter(norm, reader);
+		  }
+	  }
+
+	  private class FakeStandardTokenizer : TokenFilter
+	  {
+		internal readonly TypeAttribute typeAtt = addAttribute(typeof(TypeAttribute));
+
+		public FakeStandardTokenizer(TokenStream input) : base(input)
+		{
+		}
+
+//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())
+		  {
+			typeAtt.Type = StandardTokenizer.TOKEN_TYPES[StandardTokenizer.IDEOGRAPHIC];
+			return true;
+		  }
+		  else
+		  {
+			return false;
+		  }
+		}
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testSingleChar2() throws Exception
+	  public virtual void testSingleChar2()
+	  {
+		Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper(this);
+
+		assertAnalyzesTo(analyzer, "一", new string[] {"一"}, new int[] {0}, new int[] {1}, new string[] {"<SINGLE>"}, new int[] {1});
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestCJKAnalyzer outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestCJKAnalyzer outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			TokenFilter filter = new FakeStandardTokenizer(tokenizer);
+			filter = new StopFilter(TEST_VERSION_CURRENT, filter, CharArraySet.EMPTY_SET);
+			filter = new CJKBigramFilter(filter);
+			return new TokenStreamComponents(tokenizer, filter);
+		  }
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), new CJKAnalyzer(TEST_VERSION_CURRENT), 1000 * RANDOM_MULTIPLIER);
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomHugeStrings() throws Exception
+	  public virtual void testRandomHugeStrings()
+	  {
+		Random random = random();
+		checkRandomData(random, new CJKAnalyzer(TEST_VERSION_CURRENT), 100 * RANDOM_MULTIPLIER, 8192);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper2(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestCJKAnalyzer outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestCJKAnalyzer outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new CJKBigramFilter(tokenizer));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file


[19/27] lucenenet git commit: adding converted analysis common tests

Posted by sy...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/WordBreakTestUnicode_6_3_0.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/WordBreakTestUnicode_6_3_0.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/WordBreakTestUnicode_6_3_0.cs
new file mode 100644
index 0000000..90d1796
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/WordBreakTestUnicode_6_3_0.cs
@@ -0,0 +1,4171 @@
+namespace org.apache.lucene.analysis.core
+{
+
+	/// <summary>
+	/// 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>
+
+	using Ignore = org.junit.Ignore;
+
+	/// <summary>
+	/// This class was automatically generated by generateJavaUnicodeWordBreakTest.pl
+	/// from: http://www.unicode.org/Public/6.3.0/ucd/auxiliary/WordBreakTest.txt
+	/// 
+	/// WordBreakTest.txt indicates the points in the provided character sequences
+	/// at which conforming implementations must and must not break words.  This
+	/// class tests for expected token extraction from each of the test sequences
+	/// in WordBreakTest.txt, where the expected tokens are those character
+	/// sequences bounded by word breaks and containing at least one character
+	/// from one of the following character sets:
+	/// 
+	///    \p{Script = Han}                (From http://www.unicode.org/Public/6.3.0/ucd/Scripts.txt)
+	///    \p{Script = Hiragana}
+	///    \p{LineBreak = Complex_Context} (From http://www.unicode.org/Public/6.3.0/ucd/LineBreak.txt)
+	///    \p{WordBreak = ALetter}         (From http://www.unicode.org/Public/6.3.0/ucd/auxiliary/WordBreakProperty.txt)
+	///    \p{WordBreak = Hebrew_Letter}
+	///    \p{WordBreak = Katakana}
+	///    \p{WordBreak = Numeric}         (Excludes full-width Arabic digits)
+	///    [\uFF10-\uFF19]                (Full-width Arabic digits)
+	/// </summary>
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @Ignore public class WordBreakTestUnicode_6_3_0 extends org.apache.lucene.analysis.BaseTokenStreamTestCase
+	public class WordBreakTestUnicode_6_3_0 : BaseTokenStreamTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void test(org.apache.lucene.analysis.Analyzer analyzer) throws Exception
+	  public virtual void test(Analyzer analyzer)
+	  {
+		// ÷ 0001 ÷ 0001 ÷  #  ÷ [0.2] <START OF HEADING> (Other) ÷ [999.0] <START OF HEADING> (Other) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u0001", new string[] { });
+
+		// ÷ 0001 × 0308 ÷ 0001 ÷  #  ÷ [0.2] <START OF HEADING> (Other) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] <START OF HEADING> (Other) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u0308\u0001", new string[] { });
+
+		// ÷ 0001 ÷ 000D ÷  #  ÷ [0.2] <START OF HEADING> (Other) ÷ [3.2] <CARRIAGE RETURN (CR)> (CR) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\r", new string[] { });
+
+		// ÷ 0001 × 0308 ÷ 000D ÷  #  ÷ [0.2] <START OF HEADING> (Other) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [3.2] <CARRIAGE RETURN (CR)> (CR) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u0308\r", new string[] { });
+
+		// ÷ 0001 ÷ 000A ÷  #  ÷ [0.2] <START OF HEADING> (Other) ÷ [3.2] <LINE FEED (LF)> (LF) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\n", new string[] { });
+
+		// ÷ 0001 × 0308 ÷ 000A ÷  #  ÷ [0.2] <START OF HEADING> (Other) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [3.2] <LINE FEED (LF)> (LF) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u0308\n", new string[] { });
+
+		// ÷ 0001 ÷ 000B ÷  #  ÷ [0.2] <START OF HEADING> (Other) ÷ [3.2] <LINE TABULATION> (Newline) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u000B", new string[] { });
+
+		// ÷ 0001 × 0308 ÷ 000B ÷  #  ÷ [0.2] <START OF HEADING> (Other) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [3.2] <LINE TABULATION> (Newline) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u0308\u000B", new string[] { });
+
+		// ÷ 0001 ÷ 3031 ÷  #  ÷ [0.2] <START OF HEADING> (Other) ÷ [999.0] VERTICAL KANA REPEAT MARK (Katakana) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u3031", new string[] {"\u3031"});
+
+		// ÷ 0001 × 0308 ÷ 3031 ÷  #  ÷ [0.2] <START OF HEADING> (Other) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] VERTICAL KANA REPEAT MARK (Katakana) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u0308\u3031", new string[] {"\u3031"});
+
+		// ÷ 0001 ÷ 0041 ÷  #  ÷ [0.2] <START OF HEADING> (Other) ÷ [999.0] LATIN CAPITAL LETTER A (ALetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u0041", new string[] {"\u0041"});
+
+		// ÷ 0001 × 0308 ÷ 0041 ÷  #  ÷ [0.2] <START OF HEADING> (Other) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] LATIN CAPITAL LETTER A (ALetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u0308\u0041", new string[] {"\u0041"});
+
+		// ÷ 0001 ÷ 003A ÷  #  ÷ [0.2] <START OF HEADING> (Other) ÷ [999.0] COLON (MidLetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u003A", new string[] { });
+
+		// ÷ 0001 × 0308 ÷ 003A ÷  #  ÷ [0.2] <START OF HEADING> (Other) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] COLON (MidLetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u0308\u003A", new string[] { });
+
+		// ÷ 0001 ÷ 002C ÷  #  ÷ [0.2] <START OF HEADING> (Other) ÷ [999.0] COMMA (MidNum) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u002C", new string[] { });
+
+		// ÷ 0001 × 0308 ÷ 002C ÷  #  ÷ [0.2] <START OF HEADING> (Other) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] COMMA (MidNum) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u0308\u002C", new string[] { });
+
+		// ÷ 0001 ÷ 002E ÷  #  ÷ [0.2] <START OF HEADING> (Other) ÷ [999.0] FULL STOP (MidNumLet) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u002E", new string[] { });
+
+		// ÷ 0001 × 0308 ÷ 002E ÷  #  ÷ [0.2] <START OF HEADING> (Other) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] FULL STOP (MidNumLet) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u0308\u002E", new string[] { });
+
+		// ÷ 0001 ÷ 0030 ÷  #  ÷ [0.2] <START OF HEADING> (Other) ÷ [999.0] DIGIT ZERO (Numeric) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u0030", new string[] {"\u0030"});
+
+		// ÷ 0001 × 0308 ÷ 0030 ÷  #  ÷ [0.2] <START OF HEADING> (Other) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] DIGIT ZERO (Numeric) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u0308\u0030", new string[] {"\u0030"});
+
+		// ÷ 0001 ÷ 005F ÷  #  ÷ [0.2] <START OF HEADING> (Other) ÷ [999.0] LOW LINE (ExtendNumLet) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u005F", new string[] { });
+
+		// ÷ 0001 × 0308 ÷ 005F ÷  #  ÷ [0.2] <START OF HEADING> (Other) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] LOW LINE (ExtendNumLet) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u0308\u005F", new string[] { });
+
+		// ÷ 0001 ÷ 1F1E6 ÷  #  ÷ [0.2] <START OF HEADING> (Other) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (Regional_Indicator) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\uD83C\uDDE6", new string[] { });
+
+		// ÷ 0001 × 0308 ÷ 1F1E6 ÷  #  ÷ [0.2] <START OF HEADING> (Other) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (Regional_Indicator) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u0308\uD83C\uDDE6", new string[] { });
+
+		// ÷ 0001 ÷ 05D0 ÷  #  ÷ [0.2] <START OF HEADING> (Other) ÷ [999.0] HEBREW LETTER ALEF (Hebrew_Letter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u05D0", new string[] {"\u05D0"});
+
+		// ÷ 0001 × 0308 ÷ 05D0 ÷  #  ÷ [0.2] <START OF HEADING> (Other) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] HEBREW LETTER ALEF (Hebrew_Letter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u0308\u05D0", new string[] {"\u05D0"});
+
+		// ÷ 0001 ÷ 0022 ÷  #  ÷ [0.2] <START OF HEADING> (Other) ÷ [999.0] QUOTATION MARK (Double_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\"", new string[] { });
+
+		// ÷ 0001 × 0308 ÷ 0022 ÷  #  ÷ [0.2] <START OF HEADING> (Other) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] QUOTATION MARK (Double_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u0308\"", new string[] { });
+
+		// ÷ 0001 ÷ 0027 ÷  #  ÷ [0.2] <START OF HEADING> (Other) ÷ [999.0] APOSTROPHE (Single_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u0027", new string[] { });
+
+		// ÷ 0001 × 0308 ÷ 0027 ÷  #  ÷ [0.2] <START OF HEADING> (Other) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] APOSTROPHE (Single_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u0308\u0027", new string[] { });
+
+		// ÷ 0001 × 00AD ÷  #  ÷ [0.2] <START OF HEADING> (Other) × [4.0] SOFT HYPHEN (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u00AD", new string[] { });
+
+		// ÷ 0001 × 0308 × 00AD ÷  #  ÷ [0.2] <START OF HEADING> (Other) × [4.0] COMBINING DIAERESIS (Extend_FE) × [4.0] SOFT HYPHEN (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u0308\u00AD", new string[] { });
+
+		// ÷ 0001 × 0300 ÷  #  ÷ [0.2] <START OF HEADING> (Other) × [4.0] COMBINING GRAVE ACCENT (Extend_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u0300", new string[] { });
+
+		// ÷ 0001 × 0308 × 0300 ÷  #  ÷ [0.2] <START OF HEADING> (Other) × [4.0] COMBINING DIAERESIS (Extend_FE) × [4.0] COMBINING GRAVE ACCENT (Extend_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u0308\u0300", new string[] { });
+
+		// ÷ 0001 ÷ 0061 × 2060 ÷  #  ÷ [0.2] <START OF HEADING> (Other) ÷ [999.0] LATIN SMALL LETTER A (ALetter) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u0061\u2060", new string[] {"\u0061\u2060"});
+
+		// ÷ 0001 × 0308 ÷ 0061 × 2060 ÷  #  ÷ [0.2] <START OF HEADING> (Other) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] LATIN SMALL LETTER A (ALetter) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u0308\u0061\u2060", new string[] {"\u0061\u2060"});
+
+		// ÷ 0001 ÷ 0061 ÷ 003A ÷  #  ÷ [0.2] <START OF HEADING> (Other) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u0061\u003A", new string[] {"\u0061"});
+
+		// ÷ 0001 × 0308 ÷ 0061 ÷ 003A ÷  #  ÷ [0.2] <START OF HEADING> (Other) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u0308\u0061\u003A", new string[] {"\u0061"});
+
+		// ÷ 0001 ÷ 0061 ÷ 0027 ÷  #  ÷ [0.2] <START OF HEADING> (Other) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [999.0] APOSTROPHE (Single_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u0061\u0027", new string[] {"\u0061"});
+
+		// ÷ 0001 × 0308 ÷ 0061 ÷ 0027 ÷  #  ÷ [0.2] <START OF HEADING> (Other) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [999.0] APOSTROPHE (Single_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u0308\u0061\u0027", new string[] {"\u0061"});
+
+		// ÷ 0001 ÷ 0061 ÷ 0027 × 2060 ÷  #  ÷ [0.2] <START OF HEADING> (Other) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [999.0] APOSTROPHE (Single_Quote) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u0061\u0027\u2060", new string[] {"\u0061"});
+
+		// ÷ 0001 × 0308 ÷ 0061 ÷ 0027 × 2060 ÷  #  ÷ [0.2] <START OF HEADING> (Other) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [999.0] APOSTROPHE (Single_Quote) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u0308\u0061\u0027\u2060", new string[] {"\u0061"});
+
+		// ÷ 0001 ÷ 0061 ÷ 002C ÷  #  ÷ [0.2] <START OF HEADING> (Other) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u0061\u002C", new string[] {"\u0061"});
+
+		// ÷ 0001 × 0308 ÷ 0061 ÷ 002C ÷  #  ÷ [0.2] <START OF HEADING> (Other) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u0308\u0061\u002C", new string[] {"\u0061"});
+
+		// ÷ 0001 ÷ 0031 ÷ 003A ÷  #  ÷ [0.2] <START OF HEADING> (Other) ÷ [999.0] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u0031\u003A", new string[] {"\u0031"});
+
+		// ÷ 0001 × 0308 ÷ 0031 ÷ 003A ÷  #  ÷ [0.2] <START OF HEADING> (Other) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u0308\u0031\u003A", new string[] {"\u0031"});
+
+		// ÷ 0001 ÷ 0031 ÷ 0027 ÷  #  ÷ [0.2] <START OF HEADING> (Other) ÷ [999.0] DIGIT ONE (Numeric) ÷ [999.0] APOSTROPHE (Single_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u0031\u0027", new string[] {"\u0031"});
+
+		// ÷ 0001 × 0308 ÷ 0031 ÷ 0027 ÷  #  ÷ [0.2] <START OF HEADING> (Other) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] DIGIT ONE (Numeric) ÷ [999.0] APOSTROPHE (Single_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u0308\u0031\u0027", new string[] {"\u0031"});
+
+		// ÷ 0001 ÷ 0031 ÷ 002C ÷  #  ÷ [0.2] <START OF HEADING> (Other) ÷ [999.0] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u0031\u002C", new string[] {"\u0031"});
+
+		// ÷ 0001 × 0308 ÷ 0031 ÷ 002C ÷  #  ÷ [0.2] <START OF HEADING> (Other) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u0308\u0031\u002C", new string[] {"\u0031"});
+
+		// ÷ 0001 ÷ 0031 ÷ 002E × 2060 ÷  #  ÷ [0.2] <START OF HEADING> (Other) ÷ [999.0] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u0031\u002E\u2060", new string[] {"\u0031"});
+
+		// ÷ 0001 × 0308 ÷ 0031 ÷ 002E × 2060 ÷  #  ÷ [0.2] <START OF HEADING> (Other) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0001\u0308\u0031\u002E\u2060", new string[] {"\u0031"});
+
+		// ÷ 000D ÷ 0001 ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] <START OF HEADING> (Other) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u0001", new string[] { });
+
+		// ÷ 000D ÷ 0308 ÷ 0001 ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] <START OF HEADING> (Other) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u0308\u0001", new string[] { });
+
+		// ÷ 000D ÷ 000D ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] <CARRIAGE RETURN (CR)> (CR) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\r", new string[] { });
+
+		// ÷ 000D ÷ 0308 ÷ 000D ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [3.2] <CARRIAGE RETURN (CR)> (CR) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u0308\r", new string[] { });
+
+		// ÷ 000D × 000A ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) × [3.0] <LINE FEED (LF)> (LF) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\n", new string[] { });
+
+		// ÷ 000D ÷ 0308 ÷ 000A ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [3.2] <LINE FEED (LF)> (LF) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u0308\n", new string[] { });
+
+		// ÷ 000D ÷ 000B ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] <LINE TABULATION> (Newline) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u000B", new string[] { });
+
+		// ÷ 000D ÷ 0308 ÷ 000B ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [3.2] <LINE TABULATION> (Newline) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u0308\u000B", new string[] { });
+
+		// ÷ 000D ÷ 3031 ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] VERTICAL KANA REPEAT MARK (Katakana) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u3031", new string[] {"\u3031"});
+
+		// ÷ 000D ÷ 0308 ÷ 3031 ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] VERTICAL KANA REPEAT MARK (Katakana) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u0308\u3031", new string[] {"\u3031"});
+
+		// ÷ 000D ÷ 0041 ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] LATIN CAPITAL LETTER A (ALetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u0041", new string[] {"\u0041"});
+
+		// ÷ 000D ÷ 0308 ÷ 0041 ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] LATIN CAPITAL LETTER A (ALetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u0308\u0041", new string[] {"\u0041"});
+
+		// ÷ 000D ÷ 003A ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] COLON (MidLetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u003A", new string[] { });
+
+		// ÷ 000D ÷ 0308 ÷ 003A ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] COLON (MidLetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u0308\u003A", new string[] { });
+
+		// ÷ 000D ÷ 002C ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] COMMA (MidNum) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u002C", new string[] { });
+
+		// ÷ 000D ÷ 0308 ÷ 002C ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] COMMA (MidNum) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u0308\u002C", new string[] { });
+
+		// ÷ 000D ÷ 002E ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] FULL STOP (MidNumLet) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u002E", new string[] { });
+
+		// ÷ 000D ÷ 0308 ÷ 002E ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] FULL STOP (MidNumLet) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u0308\u002E", new string[] { });
+
+		// ÷ 000D ÷ 0030 ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] DIGIT ZERO (Numeric) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u0030", new string[] {"\u0030"});
+
+		// ÷ 000D ÷ 0308 ÷ 0030 ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] DIGIT ZERO (Numeric) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u0308\u0030", new string[] {"\u0030"});
+
+		// ÷ 000D ÷ 005F ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] LOW LINE (ExtendNumLet) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u005F", new string[] { });
+
+		// ÷ 000D ÷ 0308 ÷ 005F ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] LOW LINE (ExtendNumLet) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u0308\u005F", new string[] { });
+
+		// ÷ 000D ÷ 1F1E6 ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] REGIONAL INDICATOR SYMBOL LETTER A (Regional_Indicator) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\uD83C\uDDE6", new string[] { });
+
+		// ÷ 000D ÷ 0308 ÷ 1F1E6 ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (Regional_Indicator) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u0308\uD83C\uDDE6", new string[] { });
+
+		// ÷ 000D ÷ 05D0 ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] HEBREW LETTER ALEF (Hebrew_Letter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u05D0", new string[] {"\u05D0"});
+
+		// ÷ 000D ÷ 0308 ÷ 05D0 ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] HEBREW LETTER ALEF (Hebrew_Letter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u0308\u05D0", new string[] {"\u05D0"});
+
+		// ÷ 000D ÷ 0022 ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] QUOTATION MARK (Double_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\"", new string[] { });
+
+		// ÷ 000D ÷ 0308 ÷ 0022 ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] QUOTATION MARK (Double_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u0308\"", new string[] { });
+
+		// ÷ 000D ÷ 0027 ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] APOSTROPHE (Single_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u0027", new string[] { });
+
+		// ÷ 000D ÷ 0308 ÷ 0027 ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] APOSTROPHE (Single_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u0308\u0027", new string[] { });
+
+		// ÷ 000D ÷ 00AD ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] SOFT HYPHEN (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u00AD", new string[] { });
+
+		// ÷ 000D ÷ 0308 × 00AD ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) × [4.0] SOFT HYPHEN (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u0308\u00AD", new string[] { });
+
+		// ÷ 000D ÷ 0300 ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] COMBINING GRAVE ACCENT (Extend_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u0300", new string[] { });
+
+		// ÷ 000D ÷ 0308 × 0300 ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) × [4.0] COMBINING GRAVE ACCENT (Extend_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u0308\u0300", new string[] { });
+
+		// ÷ 000D ÷ 0061 × 2060 ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] LATIN SMALL LETTER A (ALetter) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u0061\u2060", new string[] {"\u0061\u2060"});
+
+		// ÷ 000D ÷ 0308 ÷ 0061 × 2060 ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] LATIN SMALL LETTER A (ALetter) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u0308\u0061\u2060", new string[] {"\u0061\u2060"});
+
+		// ÷ 000D ÷ 0061 ÷ 003A ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u0061\u003A", new string[] {"\u0061"});
+
+		// ÷ 000D ÷ 0308 ÷ 0061 ÷ 003A ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u0308\u0061\u003A", new string[] {"\u0061"});
+
+		// ÷ 000D ÷ 0061 ÷ 0027 ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] LATIN SMALL LETTER A (ALetter) ÷ [999.0] APOSTROPHE (Single_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u0061\u0027", new string[] {"\u0061"});
+
+		// ÷ 000D ÷ 0308 ÷ 0061 ÷ 0027 ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [999.0] APOSTROPHE (Single_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u0308\u0061\u0027", new string[] {"\u0061"});
+
+		// ÷ 000D ÷ 0061 ÷ 0027 × 2060 ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] LATIN SMALL LETTER A (ALetter) ÷ [999.0] APOSTROPHE (Single_Quote) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u0061\u0027\u2060", new string[] {"\u0061"});
+
+		// ÷ 000D ÷ 0308 ÷ 0061 ÷ 0027 × 2060 ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [999.0] APOSTROPHE (Single_Quote) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u0308\u0061\u0027\u2060", new string[] {"\u0061"});
+
+		// ÷ 000D ÷ 0061 ÷ 002C ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u0061\u002C", new string[] {"\u0061"});
+
+		// ÷ 000D ÷ 0308 ÷ 0061 ÷ 002C ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u0308\u0061\u002C", new string[] {"\u0061"});
+
+		// ÷ 000D ÷ 0031 ÷ 003A ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u0031\u003A", new string[] {"\u0031"});
+
+		// ÷ 000D ÷ 0308 ÷ 0031 ÷ 003A ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u0308\u0031\u003A", new string[] {"\u0031"});
+
+		// ÷ 000D ÷ 0031 ÷ 0027 ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] DIGIT ONE (Numeric) ÷ [999.0] APOSTROPHE (Single_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u0031\u0027", new string[] {"\u0031"});
+
+		// ÷ 000D ÷ 0308 ÷ 0031 ÷ 0027 ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] DIGIT ONE (Numeric) ÷ [999.0] APOSTROPHE (Single_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u0308\u0031\u0027", new string[] {"\u0031"});
+
+		// ÷ 000D ÷ 0031 ÷ 002C ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u0031\u002C", new string[] {"\u0031"});
+
+		// ÷ 000D ÷ 0308 ÷ 0031 ÷ 002C ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u0308\u0031\u002C", new string[] {"\u0031"});
+
+		// ÷ 000D ÷ 0031 ÷ 002E × 2060 ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u0031\u002E\u2060", new string[] {"\u0031"});
+
+		// ÷ 000D ÷ 0308 ÷ 0031 ÷ 002E × 2060 ÷  #  ÷ [0.2] <CARRIAGE RETURN (CR)> (CR) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\r\u0308\u0031\u002E\u2060", new string[] {"\u0031"});
+
+		// ÷ 000A ÷ 0001 ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] <START OF HEADING> (Other) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u0001", new string[] { });
+
+		// ÷ 000A ÷ 0308 ÷ 0001 ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] <START OF HEADING> (Other) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u0308\u0001", new string[] { });
+
+		// ÷ 000A ÷ 000D ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] <CARRIAGE RETURN (CR)> (CR) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\r", new string[] { });
+
+		// ÷ 000A ÷ 0308 ÷ 000D ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [3.2] <CARRIAGE RETURN (CR)> (CR) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u0308\r", new string[] { });
+
+		// ÷ 000A ÷ 000A ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] <LINE FEED (LF)> (LF) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\n", new string[] { });
+
+		// ÷ 000A ÷ 0308 ÷ 000A ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [3.2] <LINE FEED (LF)> (LF) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u0308\n", new string[] { });
+
+		// ÷ 000A ÷ 000B ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] <LINE TABULATION> (Newline) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u000B", new string[] { });
+
+		// ÷ 000A ÷ 0308 ÷ 000B ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [3.2] <LINE TABULATION> (Newline) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u0308\u000B", new string[] { });
+
+		// ÷ 000A ÷ 3031 ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] VERTICAL KANA REPEAT MARK (Katakana) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u3031", new string[] {"\u3031"});
+
+		// ÷ 000A ÷ 0308 ÷ 3031 ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] VERTICAL KANA REPEAT MARK (Katakana) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u0308\u3031", new string[] {"\u3031"});
+
+		// ÷ 000A ÷ 0041 ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] LATIN CAPITAL LETTER A (ALetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u0041", new string[] {"\u0041"});
+
+		// ÷ 000A ÷ 0308 ÷ 0041 ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] LATIN CAPITAL LETTER A (ALetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u0308\u0041", new string[] {"\u0041"});
+
+		// ÷ 000A ÷ 003A ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] COLON (MidLetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u003A", new string[] { });
+
+		// ÷ 000A ÷ 0308 ÷ 003A ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] COLON (MidLetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u0308\u003A", new string[] { });
+
+		// ÷ 000A ÷ 002C ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] COMMA (MidNum) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u002C", new string[] { });
+
+		// ÷ 000A ÷ 0308 ÷ 002C ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] COMMA (MidNum) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u0308\u002C", new string[] { });
+
+		// ÷ 000A ÷ 002E ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] FULL STOP (MidNumLet) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u002E", new string[] { });
+
+		// ÷ 000A ÷ 0308 ÷ 002E ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] FULL STOP (MidNumLet) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u0308\u002E", new string[] { });
+
+		// ÷ 000A ÷ 0030 ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] DIGIT ZERO (Numeric) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u0030", new string[] {"\u0030"});
+
+		// ÷ 000A ÷ 0308 ÷ 0030 ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] DIGIT ZERO (Numeric) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u0308\u0030", new string[] {"\u0030"});
+
+		// ÷ 000A ÷ 005F ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] LOW LINE (ExtendNumLet) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u005F", new string[] { });
+
+		// ÷ 000A ÷ 0308 ÷ 005F ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] LOW LINE (ExtendNumLet) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u0308\u005F", new string[] { });
+
+		// ÷ 000A ÷ 1F1E6 ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] REGIONAL INDICATOR SYMBOL LETTER A (Regional_Indicator) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\uD83C\uDDE6", new string[] { });
+
+		// ÷ 000A ÷ 0308 ÷ 1F1E6 ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (Regional_Indicator) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u0308\uD83C\uDDE6", new string[] { });
+
+		// ÷ 000A ÷ 05D0 ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] HEBREW LETTER ALEF (Hebrew_Letter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u05D0", new string[] {"\u05D0"});
+
+		// ÷ 000A ÷ 0308 ÷ 05D0 ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] HEBREW LETTER ALEF (Hebrew_Letter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u0308\u05D0", new string[] {"\u05D0"});
+
+		// ÷ 000A ÷ 0022 ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] QUOTATION MARK (Double_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\"", new string[] { });
+
+		// ÷ 000A ÷ 0308 ÷ 0022 ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] QUOTATION MARK (Double_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u0308\"", new string[] { });
+
+		// ÷ 000A ÷ 0027 ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] APOSTROPHE (Single_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u0027", new string[] { });
+
+		// ÷ 000A ÷ 0308 ÷ 0027 ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] APOSTROPHE (Single_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u0308\u0027", new string[] { });
+
+		// ÷ 000A ÷ 00AD ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] SOFT HYPHEN (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u00AD", new string[] { });
+
+		// ÷ 000A ÷ 0308 × 00AD ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) × [4.0] SOFT HYPHEN (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u0308\u00AD", new string[] { });
+
+		// ÷ 000A ÷ 0300 ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] COMBINING GRAVE ACCENT (Extend_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u0300", new string[] { });
+
+		// ÷ 000A ÷ 0308 × 0300 ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) × [4.0] COMBINING GRAVE ACCENT (Extend_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u0308\u0300", new string[] { });
+
+		// ÷ 000A ÷ 0061 × 2060 ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] LATIN SMALL LETTER A (ALetter) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u0061\u2060", new string[] {"\u0061\u2060"});
+
+		// ÷ 000A ÷ 0308 ÷ 0061 × 2060 ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] LATIN SMALL LETTER A (ALetter) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u0308\u0061\u2060", new string[] {"\u0061\u2060"});
+
+		// ÷ 000A ÷ 0061 ÷ 003A ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u0061\u003A", new string[] {"\u0061"});
+
+		// ÷ 000A ÷ 0308 ÷ 0061 ÷ 003A ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u0308\u0061\u003A", new string[] {"\u0061"});
+
+		// ÷ 000A ÷ 0061 ÷ 0027 ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] LATIN SMALL LETTER A (ALetter) ÷ [999.0] APOSTROPHE (Single_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u0061\u0027", new string[] {"\u0061"});
+
+		// ÷ 000A ÷ 0308 ÷ 0061 ÷ 0027 ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [999.0] APOSTROPHE (Single_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u0308\u0061\u0027", new string[] {"\u0061"});
+
+		// ÷ 000A ÷ 0061 ÷ 0027 × 2060 ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] LATIN SMALL LETTER A (ALetter) ÷ [999.0] APOSTROPHE (Single_Quote) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u0061\u0027\u2060", new string[] {"\u0061"});
+
+		// ÷ 000A ÷ 0308 ÷ 0061 ÷ 0027 × 2060 ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [999.0] APOSTROPHE (Single_Quote) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u0308\u0061\u0027\u2060", new string[] {"\u0061"});
+
+		// ÷ 000A ÷ 0061 ÷ 002C ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u0061\u002C", new string[] {"\u0061"});
+
+		// ÷ 000A ÷ 0308 ÷ 0061 ÷ 002C ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u0308\u0061\u002C", new string[] {"\u0061"});
+
+		// ÷ 000A ÷ 0031 ÷ 003A ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u0031\u003A", new string[] {"\u0031"});
+
+		// ÷ 000A ÷ 0308 ÷ 0031 ÷ 003A ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u0308\u0031\u003A", new string[] {"\u0031"});
+
+		// ÷ 000A ÷ 0031 ÷ 0027 ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] DIGIT ONE (Numeric) ÷ [999.0] APOSTROPHE (Single_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u0031\u0027", new string[] {"\u0031"});
+
+		// ÷ 000A ÷ 0308 ÷ 0031 ÷ 0027 ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] DIGIT ONE (Numeric) ÷ [999.0] APOSTROPHE (Single_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u0308\u0031\u0027", new string[] {"\u0031"});
+
+		// ÷ 000A ÷ 0031 ÷ 002C ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u0031\u002C", new string[] {"\u0031"});
+
+		// ÷ 000A ÷ 0308 ÷ 0031 ÷ 002C ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u0308\u0031\u002C", new string[] {"\u0031"});
+
+		// ÷ 000A ÷ 0031 ÷ 002E × 2060 ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u0031\u002E\u2060", new string[] {"\u0031"});
+
+		// ÷ 000A ÷ 0308 ÷ 0031 ÷ 002E × 2060 ÷  #  ÷ [0.2] <LINE FEED (LF)> (LF) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\n\u0308\u0031\u002E\u2060", new string[] {"\u0031"});
+
+		// ÷ 000B ÷ 0001 ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] <START OF HEADING> (Other) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u0001", new string[] { });
+
+		// ÷ 000B ÷ 0308 ÷ 0001 ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] <START OF HEADING> (Other) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u0308\u0001", new string[] { });
+
+		// ÷ 000B ÷ 000D ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] <CARRIAGE RETURN (CR)> (CR) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\r", new string[] { });
+
+		// ÷ 000B ÷ 0308 ÷ 000D ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [3.2] <CARRIAGE RETURN (CR)> (CR) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u0308\r", new string[] { });
+
+		// ÷ 000B ÷ 000A ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] <LINE FEED (LF)> (LF) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\n", new string[] { });
+
+		// ÷ 000B ÷ 0308 ÷ 000A ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [3.2] <LINE FEED (LF)> (LF) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u0308\n", new string[] { });
+
+		// ÷ 000B ÷ 000B ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] <LINE TABULATION> (Newline) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u000B", new string[] { });
+
+		// ÷ 000B ÷ 0308 ÷ 000B ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [3.2] <LINE TABULATION> (Newline) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u0308\u000B", new string[] { });
+
+		// ÷ 000B ÷ 3031 ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] VERTICAL KANA REPEAT MARK (Katakana) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u3031", new string[] {"\u3031"});
+
+		// ÷ 000B ÷ 0308 ÷ 3031 ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] VERTICAL KANA REPEAT MARK (Katakana) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u0308\u3031", new string[] {"\u3031"});
+
+		// ÷ 000B ÷ 0041 ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] LATIN CAPITAL LETTER A (ALetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u0041", new string[] {"\u0041"});
+
+		// ÷ 000B ÷ 0308 ÷ 0041 ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] LATIN CAPITAL LETTER A (ALetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u0308\u0041", new string[] {"\u0041"});
+
+		// ÷ 000B ÷ 003A ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] COLON (MidLetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u003A", new string[] { });
+
+		// ÷ 000B ÷ 0308 ÷ 003A ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] COLON (MidLetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u0308\u003A", new string[] { });
+
+		// ÷ 000B ÷ 002C ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] COMMA (MidNum) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u002C", new string[] { });
+
+		// ÷ 000B ÷ 0308 ÷ 002C ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] COMMA (MidNum) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u0308\u002C", new string[] { });
+
+		// ÷ 000B ÷ 002E ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] FULL STOP (MidNumLet) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u002E", new string[] { });
+
+		// ÷ 000B ÷ 0308 ÷ 002E ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] FULL STOP (MidNumLet) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u0308\u002E", new string[] { });
+
+		// ÷ 000B ÷ 0030 ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] DIGIT ZERO (Numeric) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u0030", new string[] {"\u0030"});
+
+		// ÷ 000B ÷ 0308 ÷ 0030 ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] DIGIT ZERO (Numeric) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u0308\u0030", new string[] {"\u0030"});
+
+		// ÷ 000B ÷ 005F ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] LOW LINE (ExtendNumLet) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u005F", new string[] { });
+
+		// ÷ 000B ÷ 0308 ÷ 005F ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] LOW LINE (ExtendNumLet) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u0308\u005F", new string[] { });
+
+		// ÷ 000B ÷ 1F1E6 ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] REGIONAL INDICATOR SYMBOL LETTER A (Regional_Indicator) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\uD83C\uDDE6", new string[] { });
+
+		// ÷ 000B ÷ 0308 ÷ 1F1E6 ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (Regional_Indicator) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u0308\uD83C\uDDE6", new string[] { });
+
+		// ÷ 000B ÷ 05D0 ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] HEBREW LETTER ALEF (Hebrew_Letter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u05D0", new string[] {"\u05D0"});
+
+		// ÷ 000B ÷ 0308 ÷ 05D0 ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] HEBREW LETTER ALEF (Hebrew_Letter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u0308\u05D0", new string[] {"\u05D0"});
+
+		// ÷ 000B ÷ 0022 ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] QUOTATION MARK (Double_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\"", new string[] { });
+
+		// ÷ 000B ÷ 0308 ÷ 0022 ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] QUOTATION MARK (Double_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u0308\"", new string[] { });
+
+		// ÷ 000B ÷ 0027 ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] APOSTROPHE (Single_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u0027", new string[] { });
+
+		// ÷ 000B ÷ 0308 ÷ 0027 ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] APOSTROPHE (Single_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u0308\u0027", new string[] { });
+
+		// ÷ 000B ÷ 00AD ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] SOFT HYPHEN (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u00AD", new string[] { });
+
+		// ÷ 000B ÷ 0308 × 00AD ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) × [4.0] SOFT HYPHEN (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u0308\u00AD", new string[] { });
+
+		// ÷ 000B ÷ 0300 ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] COMBINING GRAVE ACCENT (Extend_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u0300", new string[] { });
+
+		// ÷ 000B ÷ 0308 × 0300 ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) × [4.0] COMBINING GRAVE ACCENT (Extend_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u0308\u0300", new string[] { });
+
+		// ÷ 000B ÷ 0061 × 2060 ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] LATIN SMALL LETTER A (ALetter) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u0061\u2060", new string[] {"\u0061\u2060"});
+
+		// ÷ 000B ÷ 0308 ÷ 0061 × 2060 ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] LATIN SMALL LETTER A (ALetter) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u0308\u0061\u2060", new string[] {"\u0061\u2060"});
+
+		// ÷ 000B ÷ 0061 ÷ 003A ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u0061\u003A", new string[] {"\u0061"});
+
+		// ÷ 000B ÷ 0308 ÷ 0061 ÷ 003A ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u0308\u0061\u003A", new string[] {"\u0061"});
+
+		// ÷ 000B ÷ 0061 ÷ 0027 ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] LATIN SMALL LETTER A (ALetter) ÷ [999.0] APOSTROPHE (Single_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u0061\u0027", new string[] {"\u0061"});
+
+		// ÷ 000B ÷ 0308 ÷ 0061 ÷ 0027 ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [999.0] APOSTROPHE (Single_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u0308\u0061\u0027", new string[] {"\u0061"});
+
+		// ÷ 000B ÷ 0061 ÷ 0027 × 2060 ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] LATIN SMALL LETTER A (ALetter) ÷ [999.0] APOSTROPHE (Single_Quote) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u0061\u0027\u2060", new string[] {"\u0061"});
+
+		// ÷ 000B ÷ 0308 ÷ 0061 ÷ 0027 × 2060 ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [999.0] APOSTROPHE (Single_Quote) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u0308\u0061\u0027\u2060", new string[] {"\u0061"});
+
+		// ÷ 000B ÷ 0061 ÷ 002C ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u0061\u002C", new string[] {"\u0061"});
+
+		// ÷ 000B ÷ 0308 ÷ 0061 ÷ 002C ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u0308\u0061\u002C", new string[] {"\u0061"});
+
+		// ÷ 000B ÷ 0031 ÷ 003A ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u0031\u003A", new string[] {"\u0031"});
+
+		// ÷ 000B ÷ 0308 ÷ 0031 ÷ 003A ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u0308\u0031\u003A", new string[] {"\u0031"});
+
+		// ÷ 000B ÷ 0031 ÷ 0027 ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] DIGIT ONE (Numeric) ÷ [999.0] APOSTROPHE (Single_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u0031\u0027", new string[] {"\u0031"});
+
+		// ÷ 000B ÷ 0308 ÷ 0031 ÷ 0027 ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] DIGIT ONE (Numeric) ÷ [999.0] APOSTROPHE (Single_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u0308\u0031\u0027", new string[] {"\u0031"});
+
+		// ÷ 000B ÷ 0031 ÷ 002C ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u0031\u002C", new string[] {"\u0031"});
+
+		// ÷ 000B ÷ 0308 ÷ 0031 ÷ 002C ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u0308\u0031\u002C", new string[] {"\u0031"});
+
+		// ÷ 000B ÷ 0031 ÷ 002E × 2060 ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u0031\u002E\u2060", new string[] {"\u0031"});
+
+		// ÷ 000B ÷ 0308 ÷ 0031 ÷ 002E × 2060 ÷  #  ÷ [0.2] <LINE TABULATION> (Newline) ÷ [3.1] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u000B\u0308\u0031\u002E\u2060", new string[] {"\u0031"});
+
+		// ÷ 3031 ÷ 0001 ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) ÷ [999.0] <START OF HEADING> (Other) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u0001", new string[] {"\u3031"});
+
+		// ÷ 3031 × 0308 ÷ 0001 ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] <START OF HEADING> (Other) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u0308\u0001", new string[] {"\u3031\u0308"});
+
+		// ÷ 3031 ÷ 000D ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) ÷ [3.2] <CARRIAGE RETURN (CR)> (CR) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\r", new string[] {"\u3031"});
+
+		// ÷ 3031 × 0308 ÷ 000D ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [3.2] <CARRIAGE RETURN (CR)> (CR) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u0308\r", new string[] {"\u3031\u0308"});
+
+		// ÷ 3031 ÷ 000A ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) ÷ [3.2] <LINE FEED (LF)> (LF) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\n", new string[] {"\u3031"});
+
+		// ÷ 3031 × 0308 ÷ 000A ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [3.2] <LINE FEED (LF)> (LF) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u0308\n", new string[] {"\u3031\u0308"});
+
+		// ÷ 3031 ÷ 000B ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) ÷ [3.2] <LINE TABULATION> (Newline) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u000B", new string[] {"\u3031"});
+
+		// ÷ 3031 × 0308 ÷ 000B ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [3.2] <LINE TABULATION> (Newline) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u0308\u000B", new string[] {"\u3031\u0308"});
+
+		// ÷ 3031 × 3031 ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) × [13.0] VERTICAL KANA REPEAT MARK (Katakana) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u3031", new string[] {"\u3031\u3031"});
+
+		// ÷ 3031 × 0308 × 3031 ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) × [4.0] COMBINING DIAERESIS (Extend_FE) × [13.0] VERTICAL KANA REPEAT MARK (Katakana) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u0308\u3031", new string[] {"\u3031\u0308\u3031"});
+
+		// ÷ 3031 ÷ 0041 ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) ÷ [999.0] LATIN CAPITAL LETTER A (ALetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u0041", new string[] {"\u3031", "\u0041"});
+
+		// ÷ 3031 × 0308 ÷ 0041 ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] LATIN CAPITAL LETTER A (ALetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u0308\u0041", new string[] {"\u3031\u0308", "\u0041"});
+
+		// ÷ 3031 ÷ 003A ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) ÷ [999.0] COLON (MidLetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u003A", new string[] {"\u3031"});
+
+		// ÷ 3031 × 0308 ÷ 003A ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] COLON (MidLetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u0308\u003A", new string[] {"\u3031\u0308"});
+
+		// ÷ 3031 ÷ 002C ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) ÷ [999.0] COMMA (MidNum) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u002C", new string[] {"\u3031"});
+
+		// ÷ 3031 × 0308 ÷ 002C ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] COMMA (MidNum) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u0308\u002C", new string[] {"\u3031\u0308"});
+
+		// ÷ 3031 ÷ 002E ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) ÷ [999.0] FULL STOP (MidNumLet) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u002E", new string[] {"\u3031"});
+
+		// ÷ 3031 × 0308 ÷ 002E ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] FULL STOP (MidNumLet) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u0308\u002E", new string[] {"\u3031\u0308"});
+
+		// ÷ 3031 ÷ 0030 ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) ÷ [999.0] DIGIT ZERO (Numeric) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u0030", new string[] {"\u3031", "\u0030"});
+
+		// ÷ 3031 × 0308 ÷ 0030 ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] DIGIT ZERO (Numeric) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u0308\u0030", new string[] {"\u3031\u0308", "\u0030"});
+
+		// ÷ 3031 × 005F ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) × [13.1] LOW LINE (ExtendNumLet) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u005F", new string[] {"\u3031\u005F"});
+
+		// ÷ 3031 × 0308 × 005F ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) × [4.0] COMBINING DIAERESIS (Extend_FE) × [13.1] LOW LINE (ExtendNumLet) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u0308\u005F", new string[] {"\u3031\u0308\u005F"});
+
+		// ÷ 3031 ÷ 1F1E6 ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (Regional_Indicator) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\uD83C\uDDE6", new string[] {"\u3031"});
+
+		// ÷ 3031 × 0308 ÷ 1F1E6 ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (Regional_Indicator) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u0308\uD83C\uDDE6", new string[] {"\u3031\u0308"});
+
+		// ÷ 3031 ÷ 05D0 ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) ÷ [999.0] HEBREW LETTER ALEF (Hebrew_Letter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u05D0", new string[] {"\u3031", "\u05D0"});
+
+		// ÷ 3031 × 0308 ÷ 05D0 ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] HEBREW LETTER ALEF (Hebrew_Letter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u0308\u05D0", new string[] {"\u3031\u0308", "\u05D0"});
+
+		// ÷ 3031 ÷ 0022 ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) ÷ [999.0] QUOTATION MARK (Double_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\"", new string[] {"\u3031"});
+
+		// ÷ 3031 × 0308 ÷ 0022 ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] QUOTATION MARK (Double_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u0308\"", new string[] {"\u3031\u0308"});
+
+		// ÷ 3031 ÷ 0027 ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) ÷ [999.0] APOSTROPHE (Single_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u0027", new string[] {"\u3031"});
+
+		// ÷ 3031 × 0308 ÷ 0027 ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] APOSTROPHE (Single_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u0308\u0027", new string[] {"\u3031\u0308"});
+
+		// ÷ 3031 × 00AD ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) × [4.0] SOFT HYPHEN (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u00AD", new string[] {"\u3031\u00AD"});
+
+		// ÷ 3031 × 0308 × 00AD ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) × [4.0] COMBINING DIAERESIS (Extend_FE) × [4.0] SOFT HYPHEN (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u0308\u00AD", new string[] {"\u3031\u0308\u00AD"});
+
+		// ÷ 3031 × 0300 ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) × [4.0] COMBINING GRAVE ACCENT (Extend_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u0300", new string[] {"\u3031\u0300"});
+
+		// ÷ 3031 × 0308 × 0300 ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) × [4.0] COMBINING DIAERESIS (Extend_FE) × [4.0] COMBINING GRAVE ACCENT (Extend_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u0308\u0300", new string[] {"\u3031\u0308\u0300"});
+
+		// ÷ 3031 ÷ 0061 × 2060 ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) ÷ [999.0] LATIN SMALL LETTER A (ALetter) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u0061\u2060", new string[] {"\u3031", "\u0061\u2060"});
+
+		// ÷ 3031 × 0308 ÷ 0061 × 2060 ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] LATIN SMALL LETTER A (ALetter) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u0308\u0061\u2060", new string[] {"\u3031\u0308", "\u0061\u2060"});
+
+		// ÷ 3031 ÷ 0061 ÷ 003A ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u0061\u003A", new string[] {"\u3031", "\u0061"});
+
+		// ÷ 3031 × 0308 ÷ 0061 ÷ 003A ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u0308\u0061\u003A", new string[] {"\u3031\u0308", "\u0061"});
+
+		// ÷ 3031 ÷ 0061 ÷ 0027 ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [999.0] APOSTROPHE (Single_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u0061\u0027", new string[] {"\u3031", "\u0061"});
+
+		// ÷ 3031 × 0308 ÷ 0061 ÷ 0027 ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [999.0] APOSTROPHE (Single_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u0308\u0061\u0027", new string[] {"\u3031\u0308", "\u0061"});
+
+		// ÷ 3031 ÷ 0061 ÷ 0027 × 2060 ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [999.0] APOSTROPHE (Single_Quote) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u0061\u0027\u2060", new string[] {"\u3031", "\u0061"});
+
+		// ÷ 3031 × 0308 ÷ 0061 ÷ 0027 × 2060 ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [999.0] APOSTROPHE (Single_Quote) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u0308\u0061\u0027\u2060", new string[] {"\u3031\u0308", "\u0061"});
+
+		// ÷ 3031 ÷ 0061 ÷ 002C ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u0061\u002C", new string[] {"\u3031", "\u0061"});
+
+		// ÷ 3031 × 0308 ÷ 0061 ÷ 002C ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u0308\u0061\u002C", new string[] {"\u3031\u0308", "\u0061"});
+
+		// ÷ 3031 ÷ 0031 ÷ 003A ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) ÷ [999.0] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u0031\u003A", new string[] {"\u3031", "\u0031"});
+
+		// ÷ 3031 × 0308 ÷ 0031 ÷ 003A ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u0308\u0031\u003A", new string[] {"\u3031\u0308", "\u0031"});
+
+		// ÷ 3031 ÷ 0031 ÷ 0027 ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) ÷ [999.0] DIGIT ONE (Numeric) ÷ [999.0] APOSTROPHE (Single_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u0031\u0027", new string[] {"\u3031", "\u0031"});
+
+		// ÷ 3031 × 0308 ÷ 0031 ÷ 0027 ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] DIGIT ONE (Numeric) ÷ [999.0] APOSTROPHE (Single_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u0308\u0031\u0027", new string[] {"\u3031\u0308", "\u0031"});
+
+		// ÷ 3031 ÷ 0031 ÷ 002C ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) ÷ [999.0] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u0031\u002C", new string[] {"\u3031", "\u0031"});
+
+		// ÷ 3031 × 0308 ÷ 0031 ÷ 002C ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u0308\u0031\u002C", new string[] {"\u3031\u0308", "\u0031"});
+
+		// ÷ 3031 ÷ 0031 ÷ 002E × 2060 ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) ÷ [999.0] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u0031\u002E\u2060", new string[] {"\u3031", "\u0031"});
+
+		// ÷ 3031 × 0308 ÷ 0031 ÷ 002E × 2060 ÷  #  ÷ [0.2] VERTICAL KANA REPEAT MARK (Katakana) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u3031\u0308\u0031\u002E\u2060", new string[] {"\u3031\u0308", "\u0031"});
+
+		// ÷ 0041 ÷ 0001 ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) ÷ [999.0] <START OF HEADING> (Other) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u0001", new string[] {"\u0041"});
+
+		// ÷ 0041 × 0308 ÷ 0001 ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] <START OF HEADING> (Other) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u0308\u0001", new string[] {"\u0041\u0308"});
+
+		// ÷ 0041 ÷ 000D ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) ÷ [3.2] <CARRIAGE RETURN (CR)> (CR) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\r", new string[] {"\u0041"});
+
+		// ÷ 0041 × 0308 ÷ 000D ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [3.2] <CARRIAGE RETURN (CR)> (CR) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u0308\r", new string[] {"\u0041\u0308"});
+
+		// ÷ 0041 ÷ 000A ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) ÷ [3.2] <LINE FEED (LF)> (LF) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\n", new string[] {"\u0041"});
+
+		// ÷ 0041 × 0308 ÷ 000A ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [3.2] <LINE FEED (LF)> (LF) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u0308\n", new string[] {"\u0041\u0308"});
+
+		// ÷ 0041 ÷ 000B ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) ÷ [3.2] <LINE TABULATION> (Newline) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u000B", new string[] {"\u0041"});
+
+		// ÷ 0041 × 0308 ÷ 000B ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [3.2] <LINE TABULATION> (Newline) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u0308\u000B", new string[] {"\u0041\u0308"});
+
+		// ÷ 0041 ÷ 3031 ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) ÷ [999.0] VERTICAL KANA REPEAT MARK (Katakana) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u3031", new string[] {"\u0041", "\u3031"});
+
+		// ÷ 0041 × 0308 ÷ 3031 ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] VERTICAL KANA REPEAT MARK (Katakana) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u0308\u3031", new string[] {"\u0041\u0308", "\u3031"});
+
+		// ÷ 0041 × 0041 ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) × [5.0] LATIN CAPITAL LETTER A (ALetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u0041", new string[] {"\u0041\u0041"});
+
+		// ÷ 0041 × 0308 × 0041 ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) × [4.0] COMBINING DIAERESIS (Extend_FE) × [5.0] LATIN CAPITAL LETTER A (ALetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u0308\u0041", new string[] {"\u0041\u0308\u0041"});
+
+		// ÷ 0041 ÷ 003A ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u003A", new string[] {"\u0041"});
+
+		// ÷ 0041 × 0308 ÷ 003A ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] COLON (MidLetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u0308\u003A", new string[] {"\u0041\u0308"});
+
+		// ÷ 0041 ÷ 002C ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u002C", new string[] {"\u0041"});
+
+		// ÷ 0041 × 0308 ÷ 002C ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] COMMA (MidNum) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u0308\u002C", new string[] {"\u0041\u0308"});
+
+		// ÷ 0041 ÷ 002E ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u002E", new string[] {"\u0041"});
+
+		// ÷ 0041 × 0308 ÷ 002E ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] FULL STOP (MidNumLet) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u0308\u002E", new string[] {"\u0041\u0308"});
+
+		// ÷ 0041 × 0030 ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) × [9.0] DIGIT ZERO (Numeric) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u0030", new string[] {"\u0041\u0030"});
+
+		// ÷ 0041 × 0308 × 0030 ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) × [4.0] COMBINING DIAERESIS (Extend_FE) × [9.0] DIGIT ZERO (Numeric) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u0308\u0030", new string[] {"\u0041\u0308\u0030"});
+
+		// ÷ 0041 × 005F ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) × [13.1] LOW LINE (ExtendNumLet) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u005F", new string[] {"\u0041\u005F"});
+
+		// ÷ 0041 × 0308 × 005F ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) × [4.0] COMBINING DIAERESIS (Extend_FE) × [13.1] LOW LINE (ExtendNumLet) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u0308\u005F", new string[] {"\u0041\u0308\u005F"});
+
+		// ÷ 0041 ÷ 1F1E6 ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (Regional_Indicator) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\uD83C\uDDE6", new string[] {"\u0041"});
+
+		// ÷ 0041 × 0308 ÷ 1F1E6 ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (Regional_Indicator) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u0308\uD83C\uDDE6", new string[] {"\u0041\u0308"});
+
+		// ÷ 0041 × 05D0 ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) × [5.0] HEBREW LETTER ALEF (Hebrew_Letter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u05D0", new string[] {"\u0041\u05D0"});
+
+		// ÷ 0041 × 0308 × 05D0 ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) × [4.0] COMBINING DIAERESIS (Extend_FE) × [5.0] HEBREW LETTER ALEF (Hebrew_Letter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u0308\u05D0", new string[] {"\u0041\u0308\u05D0"});
+
+		// ÷ 0041 ÷ 0022 ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) ÷ [999.0] QUOTATION MARK (Double_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\"", new string[] {"\u0041"});
+
+		// ÷ 0041 × 0308 ÷ 0022 ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] QUOTATION MARK (Double_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u0308\"", new string[] {"\u0041\u0308"});
+
+		// ÷ 0041 ÷ 0027 ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) ÷ [999.0] APOSTROPHE (Single_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u0027", new string[] {"\u0041"});
+
+		// ÷ 0041 × 0308 ÷ 0027 ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] APOSTROPHE (Single_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u0308\u0027", new string[] {"\u0041\u0308"});
+
+		// ÷ 0041 × 00AD ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) × [4.0] SOFT HYPHEN (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u00AD", new string[] {"\u0041\u00AD"});
+
+		// ÷ 0041 × 0308 × 00AD ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) × [4.0] COMBINING DIAERESIS (Extend_FE) × [4.0] SOFT HYPHEN (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u0308\u00AD", new string[] {"\u0041\u0308\u00AD"});
+
+		// ÷ 0041 × 0300 ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) × [4.0] COMBINING GRAVE ACCENT (Extend_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u0300", new string[] {"\u0041\u0300"});
+
+		// ÷ 0041 × 0308 × 0300 ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) × [4.0] COMBINING DIAERESIS (Extend_FE) × [4.0] COMBINING GRAVE ACCENT (Extend_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u0308\u0300", new string[] {"\u0041\u0308\u0300"});
+
+		// ÷ 0041 × 0061 × 2060 ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) × [5.0] LATIN SMALL LETTER A (ALetter) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u0061\u2060", new string[] {"\u0041\u0061\u2060"});
+
+		// ÷ 0041 × 0308 × 0061 × 2060 ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) × [4.0] COMBINING DIAERESIS (Extend_FE) × [5.0] LATIN SMALL LETTER A (ALetter) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u0308\u0061\u2060", new string[] {"\u0041\u0308\u0061\u2060"});
+
+		// ÷ 0041 × 0061 ÷ 003A ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) × [5.0] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u0061\u003A", new string[] {"\u0041\u0061"});
+
+		// ÷ 0041 × 0308 × 0061 ÷ 003A ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) × [4.0] COMBINING DIAERESIS (Extend_FE) × [5.0] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u0308\u0061\u003A", new string[] {"\u0041\u0308\u0061"});
+
+		// ÷ 0041 × 0061 ÷ 0027 ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) × [5.0] LATIN SMALL LETTER A (ALetter) ÷ [999.0] APOSTROPHE (Single_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u0061\u0027", new string[] {"\u0041\u0061"});
+
+		// ÷ 0041 × 0308 × 0061 ÷ 0027 ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) × [4.0] COMBINING DIAERESIS (Extend_FE) × [5.0] LATIN SMALL LETTER A (ALetter) ÷ [999.0] APOSTROPHE (Single_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u0308\u0061\u0027", new string[] {"\u0041\u0308\u0061"});
+
+		// ÷ 0041 × 0061 ÷ 0027 × 2060 ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) × [5.0] LATIN SMALL LETTER A (ALetter) ÷ [999.0] APOSTROPHE (Single_Quote) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u0061\u0027\u2060", new string[] {"\u0041\u0061"});
+
+		// ÷ 0041 × 0308 × 0061 ÷ 0027 × 2060 ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) × [4.0] COMBINING DIAERESIS (Extend_FE) × [5.0] LATIN SMALL LETTER A (ALetter) ÷ [999.0] APOSTROPHE (Single_Quote) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u0308\u0061\u0027\u2060", new string[] {"\u0041\u0308\u0061"});
+
+		// ÷ 0041 × 0061 ÷ 002C ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) × [5.0] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u0061\u002C", new string[] {"\u0041\u0061"});
+
+		// ÷ 0041 × 0308 × 0061 ÷ 002C ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) × [4.0] COMBINING DIAERESIS (Extend_FE) × [5.0] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u0308\u0061\u002C", new string[] {"\u0041\u0308\u0061"});
+
+		// ÷ 0041 × 0031 ÷ 003A ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) × [9.0] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u0031\u003A", new string[] {"\u0041\u0031"});
+
+		// ÷ 0041 × 0308 × 0031 ÷ 003A ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) × [4.0] COMBINING DIAERESIS (Extend_FE) × [9.0] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u0308\u0031\u003A", new string[] {"\u0041\u0308\u0031"});
+
+		// ÷ 0041 × 0031 ÷ 0027 ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) × [9.0] DIGIT ONE (Numeric) ÷ [999.0] APOSTROPHE (Single_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u0031\u0027", new string[] {"\u0041\u0031"});
+
+		// ÷ 0041 × 0308 × 0031 ÷ 0027 ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) × [4.0] COMBINING DIAERESIS (Extend_FE) × [9.0] DIGIT ONE (Numeric) ÷ [999.0] APOSTROPHE (Single_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u0308\u0031\u0027", new string[] {"\u0041\u0308\u0031"});
+
+		// ÷ 0041 × 0031 ÷ 002C ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) × [9.0] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u0031\u002C", new string[] {"\u0041\u0031"});
+
+		// ÷ 0041 × 0308 × 0031 ÷ 002C ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) × [4.0] COMBINING DIAERESIS (Extend_FE) × [9.0] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u0308\u0031\u002C", new string[] {"\u0041\u0308\u0031"});
+
+		// ÷ 0041 × 0031 ÷ 002E × 2060 ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) × [9.0] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u0031\u002E\u2060", new string[] {"\u0041\u0031"});
+
+		// ÷ 0041 × 0308 × 0031 ÷ 002E × 2060 ÷  #  ÷ [0.2] LATIN CAPITAL LETTER A (ALetter) × [4.0] COMBINING DIAERESIS (Extend_FE) × [9.0] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u0041\u0308\u0031\u002E\u2060", new string[] {"\u0041\u0308\u0031"});
+
+		// ÷ 003A ÷ 0001 ÷  #  ÷ [0.2] COLON (MidLetter) ÷ [999.0] <START OF HEADING> (Other) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u0001", new string[] { });
+
+		// ÷ 003A × 0308 ÷ 0001 ÷  #  ÷ [0.2] COLON (MidLetter) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] <START OF HEADING> (Other) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u0308\u0001", new string[] { });
+
+		// ÷ 003A ÷ 000D ÷  #  ÷ [0.2] COLON (MidLetter) ÷ [3.2] <CARRIAGE RETURN (CR)> (CR) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\r", new string[] { });
+
+		// ÷ 003A × 0308 ÷ 000D ÷  #  ÷ [0.2] COLON (MidLetter) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [3.2] <CARRIAGE RETURN (CR)> (CR) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u0308\r", new string[] { });
+
+		// ÷ 003A ÷ 000A ÷  #  ÷ [0.2] COLON (MidLetter) ÷ [3.2] <LINE FEED (LF)> (LF) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\n", new string[] { });
+
+		// ÷ 003A × 0308 ÷ 000A ÷  #  ÷ [0.2] COLON (MidLetter) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [3.2] <LINE FEED (LF)> (LF) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u0308\n", new string[] { });
+
+		// ÷ 003A ÷ 000B ÷  #  ÷ [0.2] COLON (MidLetter) ÷ [3.2] <LINE TABULATION> (Newline) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u000B", new string[] { });
+
+		// ÷ 003A × 0308 ÷ 000B ÷  #  ÷ [0.2] COLON (MidLetter) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [3.2] <LINE TABULATION> (Newline) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u0308\u000B", new string[] { });
+
+		// ÷ 003A ÷ 3031 ÷  #  ÷ [0.2] COLON (MidLetter) ÷ [999.0] VERTICAL KANA REPEAT MARK (Katakana) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u3031", new string[] {"\u3031"});
+
+		// ÷ 003A × 0308 ÷ 3031 ÷  #  ÷ [0.2] COLON (MidLetter) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] VERTICAL KANA REPEAT MARK (Katakana) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u0308\u3031", new string[] {"\u3031"});
+
+		// ÷ 003A ÷ 0041 ÷  #  ÷ [0.2] COLON (MidLetter) ÷ [999.0] LATIN CAPITAL LETTER A (ALetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u0041", new string[] {"\u0041"});
+
+		// ÷ 003A × 0308 ÷ 0041 ÷  #  ÷ [0.2] COLON (MidLetter) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] LATIN CAPITAL LETTER A (ALetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u0308\u0041", new string[] {"\u0041"});
+
+		// ÷ 003A ÷ 003A ÷  #  ÷ [0.2] COLON (MidLetter) ÷ [999.0] COLON (MidLetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u003A", new string[] { });
+
+		// ÷ 003A × 0308 ÷ 003A ÷  #  ÷ [0.2] COLON (MidLetter) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] COLON (MidLetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u0308\u003A", new string[] { });
+
+		// ÷ 003A ÷ 002C ÷  #  ÷ [0.2] COLON (MidLetter) ÷ [999.0] COMMA (MidNum) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u002C", new string[] { });
+
+		// ÷ 003A × 0308 ÷ 002C ÷  #  ÷ [0.2] COLON (MidLetter) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] COMMA (MidNum) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u0308\u002C", new string[] { });
+
+		// ÷ 003A ÷ 002E ÷  #  ÷ [0.2] COLON (MidLetter) ÷ [999.0] FULL STOP (MidNumLet) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u002E", new string[] { });
+
+		// ÷ 003A × 0308 ÷ 002E ÷  #  ÷ [0.2] COLON (MidLetter) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] FULL STOP (MidNumLet) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u0308\u002E", new string[] { });
+
+		// ÷ 003A ÷ 0030 ÷  #  ÷ [0.2] COLON (MidLetter) ÷ [999.0] DIGIT ZERO (Numeric) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u0030", new string[] {"\u0030"});
+
+		// ÷ 003A × 0308 ÷ 0030 ÷  #  ÷ [0.2] COLON (MidLetter) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] DIGIT ZERO (Numeric) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u0308\u0030", new string[] {"\u0030"});
+
+		// ÷ 003A ÷ 005F ÷  #  ÷ [0.2] COLON (MidLetter) ÷ [999.0] LOW LINE (ExtendNumLet) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u005F", new string[] { });
+
+		// ÷ 003A × 0308 ÷ 005F ÷  #  ÷ [0.2] COLON (MidLetter) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] LOW LINE (ExtendNumLet) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u0308\u005F", new string[] { });
+
+		// ÷ 003A ÷ 1F1E6 ÷  #  ÷ [0.2] COLON (MidLetter) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (Regional_Indicator) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\uD83C\uDDE6", new string[] { });
+
+		// ÷ 003A × 0308 ÷ 1F1E6 ÷  #  ÷ [0.2] COLON (MidLetter) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (Regional_Indicator) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u0308\uD83C\uDDE6", new string[] { });
+
+		// ÷ 003A ÷ 05D0 ÷  #  ÷ [0.2] COLON (MidLetter) ÷ [999.0] HEBREW LETTER ALEF (Hebrew_Letter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u05D0", new string[] {"\u05D0"});
+
+		// ÷ 003A × 0308 ÷ 05D0 ÷  #  ÷ [0.2] COLON (MidLetter) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] HEBREW LETTER ALEF (Hebrew_Letter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u0308\u05D0", new string[] {"\u05D0"});
+
+		// ÷ 003A ÷ 0022 ÷  #  ÷ [0.2] COLON (MidLetter) ÷ [999.0] QUOTATION MARK (Double_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\"", new string[] { });
+
+		// ÷ 003A × 0308 ÷ 0022 ÷  #  ÷ [0.2] COLON (MidLetter) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] QUOTATION MARK (Double_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u0308\"", new string[] { });
+
+		// ÷ 003A ÷ 0027 ÷  #  ÷ [0.2] COLON (MidLetter) ÷ [999.0] APOSTROPHE (Single_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u0027", new string[] { });
+
+		// ÷ 003A × 0308 ÷ 0027 ÷  #  ÷ [0.2] COLON (MidLetter) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] APOSTROPHE (Single_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u0308\u0027", new string[] { });
+
+		// ÷ 003A × 00AD ÷  #  ÷ [0.2] COLON (MidLetter) × [4.0] SOFT HYPHEN (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u00AD", new string[] { });
+
+		// ÷ 003A × 0308 × 00AD ÷  #  ÷ [0.2] COLON (MidLetter) × [4.0] COMBINING DIAERESIS (Extend_FE) × [4.0] SOFT HYPHEN (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u0308\u00AD", new string[] { });
+
+		// ÷ 003A × 0300 ÷  #  ÷ [0.2] COLON (MidLetter) × [4.0] COMBINING GRAVE ACCENT (Extend_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u0300", new string[] { });
+
+		// ÷ 003A × 0308 × 0300 ÷  #  ÷ [0.2] COLON (MidLetter) × [4.0] COMBINING DIAERESIS (Extend_FE) × [4.0] COMBINING GRAVE ACCENT (Extend_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u0308\u0300", new string[] { });
+
+		// ÷ 003A ÷ 0061 × 2060 ÷  #  ÷ [0.2] COLON (MidLetter) ÷ [999.0] LATIN SMALL LETTER A (ALetter) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u0061\u2060", new string[] {"\u0061\u2060"});
+
+		// ÷ 003A × 0308 ÷ 0061 × 2060 ÷  #  ÷ [0.2] COLON (MidLetter) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] LATIN SMALL LETTER A (ALetter) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u0308\u0061\u2060", new string[] {"\u0061\u2060"});
+
+		// ÷ 003A ÷ 0061 ÷ 003A ÷  #  ÷ [0.2] COLON (MidLetter) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u0061\u003A", new string[] {"\u0061"});
+
+		// ÷ 003A × 0308 ÷ 0061 ÷ 003A ÷  #  ÷ [0.2] COLON (MidLetter) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COLON (MidLetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u0308\u0061\u003A", new string[] {"\u0061"});
+
+		// ÷ 003A ÷ 0061 ÷ 0027 ÷  #  ÷ [0.2] COLON (MidLetter) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [999.0] APOSTROPHE (Single_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u0061\u0027", new string[] {"\u0061"});
+
+		// ÷ 003A × 0308 ÷ 0061 ÷ 0027 ÷  #  ÷ [0.2] COLON (MidLetter) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [999.0] APOSTROPHE (Single_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u0308\u0061\u0027", new string[] {"\u0061"});
+
+		// ÷ 003A ÷ 0061 ÷ 0027 × 2060 ÷  #  ÷ [0.2] COLON (MidLetter) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [999.0] APOSTROPHE (Single_Quote) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u0061\u0027\u2060", new string[] {"\u0061"});
+
+		// ÷ 003A × 0308 ÷ 0061 ÷ 0027 × 2060 ÷  #  ÷ [0.2] COLON (MidLetter) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [999.0] APOSTROPHE (Single_Quote) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u0308\u0061\u0027\u2060", new string[] {"\u0061"});
+
+		// ÷ 003A ÷ 0061 ÷ 002C ÷  #  ÷ [0.2] COLON (MidLetter) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u0061\u002C", new string[] {"\u0061"});
+
+		// ÷ 003A × 0308 ÷ 0061 ÷ 002C ÷  #  ÷ [0.2] COLON (MidLetter) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] LATIN SMALL LETTER A (ALetter) ÷ [999.0] COMMA (MidNum) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u0308\u0061\u002C", new string[] {"\u0061"});
+
+		// ÷ 003A ÷ 0031 ÷ 003A ÷  #  ÷ [0.2] COLON (MidLetter) ÷ [999.0] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u0031\u003A", new string[] {"\u0031"});
+
+		// ÷ 003A × 0308 ÷ 0031 ÷ 003A ÷  #  ÷ [0.2] COLON (MidLetter) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] DIGIT ONE (Numeric) ÷ [999.0] COLON (MidLetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u0308\u0031\u003A", new string[] {"\u0031"});
+
+		// ÷ 003A ÷ 0031 ÷ 0027 ÷  #  ÷ [0.2] COLON (MidLetter) ÷ [999.0] DIGIT ONE (Numeric) ÷ [999.0] APOSTROPHE (Single_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u0031\u0027", new string[] {"\u0031"});
+
+		// ÷ 003A × 0308 ÷ 0031 ÷ 0027 ÷  #  ÷ [0.2] COLON (MidLetter) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] DIGIT ONE (Numeric) ÷ [999.0] APOSTROPHE (Single_Quote) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u0308\u0031\u0027", new string[] {"\u0031"});
+
+		// ÷ 003A ÷ 0031 ÷ 002C ÷  #  ÷ [0.2] COLON (MidLetter) ÷ [999.0] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u0031\u002C", new string[] {"\u0031"});
+
+		// ÷ 003A × 0308 ÷ 0031 ÷ 002C ÷  #  ÷ [0.2] COLON (MidLetter) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] DIGIT ONE (Numeric) ÷ [999.0] COMMA (MidNum) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u0308\u0031\u002C", new string[] {"\u0031"});
+
+		// ÷ 003A ÷ 0031 ÷ 002E × 2060 ÷  #  ÷ [0.2] COLON (MidLetter) ÷ [999.0] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u0031\u002E\u2060", new string[] {"\u0031"});
+
+		// ÷ 003A × 0308 ÷ 0031 ÷ 002E × 2060 ÷  #  ÷ [0.2] COLON (MidLetter) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] DIGIT ONE (Numeric) ÷ [999.0] FULL STOP (MidNumLet) × [4.0] WORD JOINER (Format_FE) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u003A\u0308\u0031\u002E\u2060", new string[] {"\u0031"});
+
+		// ÷ 002C ÷ 0001 ÷  #  ÷ [0.2] COMMA (MidNum) ÷ [999.0] <START OF HEADING> (Other) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u002C\u0001", new string[] { });
+
+		// ÷ 002C × 0308 ÷ 0001 ÷  #  ÷ [0.2] COMMA (MidNum) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] <START OF HEADING> (Other) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u002C\u0308\u0001", new string[] { });
+
+		// ÷ 002C ÷ 000D ÷  #  ÷ [0.2] COMMA (MidNum) ÷ [3.2] <CARRIAGE RETURN (CR)> (CR) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u002C\r", new string[] { });
+
+		// ÷ 002C × 0308 ÷ 000D ÷  #  ÷ [0.2] COMMA (MidNum) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [3.2] <CARRIAGE RETURN (CR)> (CR) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u002C\u0308\r", new string[] { });
+
+		// ÷ 002C ÷ 000A ÷  #  ÷ [0.2] COMMA (MidNum) ÷ [3.2] <LINE FEED (LF)> (LF) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u002C\n", new string[] { });
+
+		// ÷ 002C × 0308 ÷ 000A ÷  #  ÷ [0.2] COMMA (MidNum) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [3.2] <LINE FEED (LF)> (LF) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u002C\u0308\n", new string[] { });
+
+		// ÷ 002C ÷ 000B ÷  #  ÷ [0.2] COMMA (MidNum) ÷ [3.2] <LINE TABULATION> (Newline) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u002C\u000B", new string[] { });
+
+		// ÷ 002C × 0308 ÷ 000B ÷  #  ÷ [0.2] COMMA (MidNum) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [3.2] <LINE TABULATION> (Newline) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u002C\u0308\u000B", new string[] { });
+
+		// ÷ 002C ÷ 3031 ÷  #  ÷ [0.2] COMMA (MidNum) ÷ [999.0] VERTICAL KANA REPEAT MARK (Katakana) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u002C\u3031", new string[] {"\u3031"});
+
+		// ÷ 002C × 0308 ÷ 3031 ÷  #  ÷ [0.2] COMMA (MidNum) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] VERTICAL KANA REPEAT MARK (Katakana) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u002C\u0308\u3031", new string[] {"\u3031"});
+
+		// ÷ 002C ÷ 0041 ÷  #  ÷ [0.2] COMMA (MidNum) ÷ [999.0] LATIN CAPITAL LETTER A (ALetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u002C\u0041", new string[] {"\u0041"});
+
+		// ÷ 002C × 0308 ÷ 0041 ÷  #  ÷ [0.2] COMMA (MidNum) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] LATIN CAPITAL LETTER A (ALetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u002C\u0308\u0041", new string[] {"\u0041"});
+
+		// ÷ 002C ÷ 003A ÷  #  ÷ [0.2] COMMA (MidNum) ÷ [999.0] COLON (MidLetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u002C\u003A", new string[] { });
+
+		// ÷ 002C × 0308 ÷ 003A ÷  #  ÷ [0.2] COMMA (MidNum) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] COLON (MidLetter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u002C\u0308\u003A", new string[] { });
+
+		// ÷ 002C ÷ 002C ÷  #  ÷ [0.2] COMMA (MidNum) ÷ [999.0] COMMA (MidNum) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u002C\u002C", new string[] { });
+
+		// ÷ 002C × 0308 ÷ 002C ÷  #  ÷ [0.2] COMMA (MidNum) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] COMMA (MidNum) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u002C\u0308\u002C", new string[] { });
+
+		// ÷ 002C ÷ 002E ÷  #  ÷ [0.2] COMMA (MidNum) ÷ [999.0] FULL STOP (MidNumLet) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u002C\u002E", new string[] { });
+
+		// ÷ 002C × 0308 ÷ 002E ÷  #  ÷ [0.2] COMMA (MidNum) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] FULL STOP (MidNumLet) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u002C\u0308\u002E", new string[] { });
+
+		// ÷ 002C ÷ 0030 ÷  #  ÷ [0.2] COMMA (MidNum) ÷ [999.0] DIGIT ZERO (Numeric) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u002C\u0030", new string[] {"\u0030"});
+
+		// ÷ 002C × 0308 ÷ 0030 ÷  #  ÷ [0.2] COMMA (MidNum) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] DIGIT ZERO (Numeric) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u002C\u0308\u0030", new string[] {"\u0030"});
+
+		// ÷ 002C ÷ 005F ÷  #  ÷ [0.2] COMMA (MidNum) ÷ [999.0] LOW LINE (ExtendNumLet) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u002C\u005F", new string[] { });
+
+		// ÷ 002C × 0308 ÷ 005F ÷  #  ÷ [0.2] COMMA (MidNum) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] LOW LINE (ExtendNumLet) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u002C\u0308\u005F", new string[] { });
+
+		// ÷ 002C ÷ 1F1E6 ÷  #  ÷ [0.2] COMMA (MidNum) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (Regional_Indicator) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u002C\uD83C\uDDE6", new string[] { });
+
+		// ÷ 002C × 0308 ÷ 1F1E6 ÷  #  ÷ [0.2] COMMA (MidNum) × [4.0] COMBINING DIAERESIS (Extend_FE) ÷ [999.0] REGIONAL INDICATOR SYMBOL LETTER A (Regional_Indicator) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u002C\u0308\uD83C\uDDE6", new string[] { });
+
+		// ÷ 002C ÷ 05D0 ÷  #  ÷ [0.2] COMMA (MidNum) ÷ [999.0] HEBREW LETTER ALEF (Hebrew_Letter) ÷ [0.3]
+		assertAnalyzesTo(analyzer, "\u002C\u

<TRUNCATED>

[03/27] lucenenet git commit: adding converted analysis common tests

Posted by sy...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Th/TestThaiAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Th/TestThaiAnalyzer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Th/TestThaiAnalyzer.cs
new file mode 100644
index 0000000..fa3e078
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Th/TestThaiAnalyzer.cs
@@ -0,0 +1,183 @@
+using System;
+
+namespace org.apache.lucene.analysis.th
+{
+
+	/*
+	 * 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 KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+	using StopAnalyzer = org.apache.lucene.analysis.core.StopAnalyzer;
+	using FlagsAttribute = org.apache.lucene.analysis.tokenattributes.FlagsAttribute;
+	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+	using Version = org.apache.lucene.util.Version;
+
+	/// <summary>
+	/// Test case for ThaiAnalyzer, modified from TestFrenchAnalyzer
+	/// 
+	/// </summary>
+
+	public class TestThaiAnalyzer : BaseTokenStreamTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Override public void setUp() throws Exception
+	  public override void setUp()
+	  {
+		base.setUp();
+		assumeTrue("JRE does not support Thai dictionary-based BreakIterator", ThaiTokenizer.DBBI_AVAILABLE);
+	  }
+	  /*
+	   * testcase for offsets
+	   */
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testOffsets() throws Exception
+	  public virtual void testOffsets()
+	  {
+		assertAnalyzesTo(new ThaiAnalyzer(TEST_VERSION_CURRENT, CharArraySet.EMPTY_SET), "การที่ได้ต้องแสดงว่างานดี", new string[] {"การ", "ที่", "ได้", "ต้อง", "แสดง", "ว่า", "งาน", "ดี"}, new int[] {0, 3, 6, 9, 13, 17, 20, 23}, new int[] {3, 6, 9, 13, 17, 20, 23, 25});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStopWords() throws Exception
+	  public virtual void testStopWords()
+	  {
+		assertAnalyzesTo(new ThaiAnalyzer(TEST_VERSION_CURRENT), "การที่ได้ต้องแสดงว่างานดี", new string[] {"แสดง", "งาน", "ดี"}, new int[] {13, 20, 23}, new int[] {17, 23, 25}, new int[] {5, 2, 1});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBackwardsStopWords() throws Exception
+	  public virtual void testBackwardsStopWords()
+	  {
+		 assertAnalyzesTo(new ThaiAnalyzer(Version.LUCENE_35), "การที่ได้ต้องแสดงว่างานดี", new string[] {"การ", "ที่", "ได้", "ต้อง", "แสดง", "ว่า", "งาน", "ดี"}, new int[] {0, 3, 6, 9, 13, 17, 20, 23}, new int[] {3, 6, 9, 13, 17, 20, 23, 25});
+	  }
+
+	  /// <summary>
+	  /// Thai numeric tokens were typed as <ALPHANUM> instead of <NUM>. </summary>
+	  /// @deprecated (3.1) testing backwards behavior 
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Deprecated("(3.1) testing backwards behavior") public void testBuggyTokenType30() throws Exception
+	  [Obsolete("(3.1) testing backwards behavior")]
+	  public virtual void testBuggyTokenType30()
+	  {
+		assertAnalyzesTo(new ThaiAnalyzer(Version.LUCENE_30), "การที่ได้ต้องแสดงว่างานดี ๑๒๓", new string[] {"การ", "ที่", "ได้", "ต้อง", "แสดง", "ว่า", "งาน", "ดี", "๑๒๓"}, new string[] {"<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>"});
+	  }
+
+	  /// @deprecated (3.1) testing backwards behavior 
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Deprecated("(3.1) testing backwards behavior") public void testAnalyzer30() throws Exception
+	  [Obsolete("(3.1) testing backwards behavior")]
+	  public virtual void testAnalyzer30()
+	  {
+			ThaiAnalyzer analyzer = new ThaiAnalyzer(Version.LUCENE_30);
+
+		assertAnalyzesTo(analyzer, "", new string[] {});
+
+		assertAnalyzesTo(analyzer, "การที่ได้ต้องแสดงว่างานดี", new string[] {"การ", "ที่", "ได้", "ต้อง", "แสดง", "ว่า", "งาน", "ดี"});
+
+		assertAnalyzesTo(analyzer, "บริษัทชื่อ XY&Z - คุยกับ xyz@demo.com", new string[] {"บริษัท", "ชื่อ", "xy&z", "คุย", "กับ", "xyz@demo.com"});
+
+		// English stop words
+		assertAnalyzesTo(analyzer, "ประโยคว่า The quick brown fox jumped over the lazy dogs", new string[] {"ประโยค", "ว่า", "quick", "brown", "fox", "jumped", "over", "lazy", "dogs"});
+	  }
+
+	  /*
+	   * Test that position increments are adjusted correctly for stopwords.
+	   */
+	  // note this test uses stopfilter's stopset
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testPositionIncrements() throws Exception
+	  public virtual void testPositionIncrements()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final ThaiAnalyzer analyzer = new ThaiAnalyzer(TEST_VERSION_CURRENT, org.apache.lucene.analysis.core.StopAnalyzer.ENGLISH_STOP_WORDS_SET);
+		ThaiAnalyzer analyzer = new ThaiAnalyzer(TEST_VERSION_CURRENT, StopAnalyzer.ENGLISH_STOP_WORDS_SET);
+		assertAnalyzesTo(analyzer, "การที่ได้ต้อง the แสดงว่างานดี", new string[] {"การ", "ที่", "ได้", "ต้อง", "แสดง", "ว่า", "งาน", "ดี"}, new int[] {0, 3, 6, 9, 18, 22, 25, 28}, new int[] {3, 6, 9, 13, 22, 25, 28, 30}, new int[] {1, 1, 1, 1, 2, 1, 1, 1});
+
+		// case that a stopword is adjacent to thai text, with no whitespace
+		assertAnalyzesTo(analyzer, "การที่ได้ต้องthe แสดงว่างานดี", new string[] {"การ", "ที่", "ได้", "ต้อง", "แสดง", "ว่า", "งาน", "ดี"}, new int[] {0, 3, 6, 9, 17, 21, 24, 27}, new int[] {3, 6, 9, 13, 21, 24, 27, 29}, new int[] {1, 1, 1, 1, 2, 1, 1, 1});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testReusableTokenStream() throws Exception
+	  public virtual void testReusableTokenStream()
+	  {
+		ThaiAnalyzer analyzer = new ThaiAnalyzer(TEST_VERSION_CURRENT, CharArraySet.EMPTY_SET);
+		assertAnalyzesTo(analyzer, "", new string[] {});
+
+		  assertAnalyzesTo(analyzer, "การที่ได้ต้องแสดงว่างานดี", new string[] {"การ", "ที่", "ได้", "ต้อง", "แสดง", "ว่า", "งาน", "ดี"});
+
+		  assertAnalyzesTo(analyzer, "บริษัทชื่อ XY&Z - คุยกับ xyz@demo.com", new string[] {"บริษัท", "ชื่อ", "xy", "z", "คุย", "กับ", "xyz", "demo.com"});
+	  }
+
+	  /// @deprecated (3.1) for version back compat 
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Deprecated("(3.1) for version back compat") public void testReusableTokenStream30() throws Exception
+	  [Obsolete("(3.1) for version back compat")]
+	  public virtual void testReusableTokenStream30()
+	  {
+		  ThaiAnalyzer analyzer = new ThaiAnalyzer(Version.LUCENE_30);
+		  assertAnalyzesTo(analyzer, "", new string[] {});
+
+		  assertAnalyzesTo(analyzer, "การที่ได้ต้องแสดงว่างานดี", new string[] {"การ", "ที่", "ได้", "ต้อง", "แสดง", "ว่า", "งาน", "ดี"});
+
+		  assertAnalyzesTo(analyzer, "บริษัทชื่อ XY&Z - คุยกับ xyz@demo.com", new string[] {"บริษัท", "ชื่อ", "xy&z", "คุย", "กับ", "xyz@demo.com"});
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), new ThaiAnalyzer(TEST_VERSION_CURRENT), 1000 * RANDOM_MULTIPLIER);
+	  }
+
+	  /// <summary>
+	  /// blast some random large strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomHugeStrings() throws Exception
+	  public virtual void testRandomHugeStrings()
+	  {
+		Random random = random();
+		checkRandomData(random, new ThaiAnalyzer(TEST_VERSION_CURRENT), 100 * RANDOM_MULTIPLIER, 8192);
+	  }
+
+	  // LUCENE-3044
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testAttributeReuse() throws Exception
+	  public virtual void testAttributeReuse()
+	  {
+		ThaiAnalyzer analyzer = new ThaiAnalyzer(Version.LUCENE_30);
+		// just consume
+		TokenStream ts = analyzer.tokenStream("dummy", "ภาษาไทย");
+		assertTokenStreamContents(ts, new string[] {"ภาษา", "ไทย"});
+		// this consumer adds flagsAtt, which this analyzer does not use. 
+		ts = analyzer.tokenStream("dummy", "ภาษาไทย");
+		ts.addAttribute(typeof(FlagsAttribute));
+		assertTokenStreamContents(ts, new string[] {"ภาษา", "ไทย"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTwoSentences() throws Exception
+	  public virtual void testTwoSentences()
+	  {
+		assertAnalyzesTo(new ThaiAnalyzer(TEST_VERSION_CURRENT, CharArraySet.EMPTY_SET), "This is a test. การที่ได้ต้องแสดงว่างานดี", new string[] {"this", "is", "a", "test", "การ", "ที่", "ได้", "ต้อง", "แสดง", "ว่า", "งาน", "ดี"}, new int[] {0, 5, 8, 10, 16, 19, 22, 25, 29, 33, 36, 39}, new int[] {4, 7, 9, 14, 19, 22, 25, 29, 33, 36, 39, 41});
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Th/TestThaiTokenizerFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Th/TestThaiTokenizerFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Th/TestThaiTokenizerFactory.cs
new file mode 100644
index 0000000..2712a4e
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Th/TestThaiTokenizerFactory.cs
@@ -0,0 +1,59 @@
+namespace org.apache.lucene.analysis.th
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the Thai word filter factory is working.
+	/// </summary>
+	public class TestThaiTokenizerFactory : BaseTokenStreamFactoryTestCase
+	{
+	  /// <summary>
+	  /// Ensure the filter actually decomposes text.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testWordBreak() throws Exception
+	  public virtual void testWordBreak()
+	  {
+		assumeTrue("JRE does not support Thai dictionary-based BreakIterator", ThaiTokenizer.DBBI_AVAILABLE);
+		Tokenizer tokenizer = tokenizerFactory("Thai").create(new StringReader("การที่ได้ต้องแสดงว่างานดี"));
+		assertTokenStreamContents(tokenizer, new string[] {"การ", "ที่", "ได้", "ต้อง", "แสดง", "ว่า", "งาน", "ดี"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		assumeTrue("JRE does not support Thai dictionary-based BreakIterator", ThaiTokenizer.DBBI_AVAILABLE);
+		try
+		{
+		  tokenizerFactory("Thai", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Th/TestThaiWordFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Th/TestThaiWordFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Th/TestThaiWordFilterFactory.cs
new file mode 100644
index 0000000..4abfc55
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Th/TestThaiWordFilterFactory.cs
@@ -0,0 +1,65 @@
+using System;
+
+namespace org.apache.lucene.analysis.th
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the Thai word filter factory is working.
+	/// </summary>
+	[Obsolete]
+	public class TestThaiWordFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+	  /// <summary>
+	  /// Ensure the filter actually decomposes text.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testWordBreak() throws Exception
+	  public virtual void testWordBreak()
+	  {
+		assumeTrue("JRE does not support Thai dictionary-based BreakIterator", ThaiWordFilter.DBBI_AVAILABLE);
+		Reader reader = new StringReader("การที่ได้ต้องแสดงว่างานดี");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("ThaiWord").create(stream);
+		assertTokenStreamContents(stream, new string[] {"การ", "ที่", "ได้", "ต้อง", "แสดง", "ว่า", "งาน", "ดี"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		assumeTrue("JRE does not support Thai dictionary-based BreakIterator", ThaiWordFilter.DBBI_AVAILABLE);
+		try
+		{
+		  tokenFilterFactory("ThaiWord", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Tr/TestApostropheFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Tr/TestApostropheFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Tr/TestApostropheFilter.cs
new file mode 100644
index 0000000..02c94a8
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Tr/TestApostropheFilter.cs
@@ -0,0 +1,37 @@
+namespace org.apache.lucene.analysis.tr
+{
+
+	/*
+	 * 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.
+	 */
+
+
+
+	public class TestApostropheFilter : BaseTokenStreamTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testApostropheFilter() throws Exception
+	  public virtual void testApostropheFilter()
+	  {
+		TokenStream stream = new MockTokenizer(new StringReader("Türkiye'de 2003'te Van Gölü'nü gördüm"), MockTokenizer.WHITESPACE, false);
+		stream = new TurkishLowerCaseFilter(stream);
+		stream = new ApostropheFilter(stream);
+		assertTokenStreamContents(stream, new string[]{"türkiye", "2003", "van", "gölü", "gördüm"});
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Tr/TestApostropheFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Tr/TestApostropheFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Tr/TestApostropheFilterFactory.cs
new file mode 100644
index 0000000..ebf2117
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Tr/TestApostropheFilterFactory.cs
@@ -0,0 +1,62 @@
+namespace org.apache.lucene.analysis.tr
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+
+	/// <summary>
+	/// Simple tests to ensure the apostrophe filter factory is working.
+	/// </summary>
+	public class TestApostropheFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+	  /// <summary>
+	  /// Ensure the filter actually removes characters after an apostrophe.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testApostrophes() throws Exception
+	  public virtual void testApostrophes()
+	  {
+		Reader reader = new StringReader("Türkiye'de 2003'te Van Gölü'nü gördüm");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("Apostrophe").create(stream);
+		assertTokenStreamContents(stream, new string[]{"Türkiye", "2003", "Van", "Gölü", "gördüm"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("Apostrophe", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameter(s):"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Tr/TestTurkishAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Tr/TestTurkishAnalyzer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Tr/TestTurkishAnalyzer.cs
new file mode 100644
index 0000000..103da78
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Tr/TestTurkishAnalyzer.cs
@@ -0,0 +1,73 @@
+namespace org.apache.lucene.analysis.tr
+{
+
+	/*
+	 * 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 CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+
+	public class TestTurkishAnalyzer : BaseTokenStreamTestCase
+	{
+	  /// <summary>
+	  /// This test fails with NPE when the 
+	  /// stopwords file is missing in classpath 
+	  /// </summary>
+	  public virtual void testResourcesAvailable()
+	  {
+		new TurkishAnalyzer(TEST_VERSION_CURRENT);
+	  }
+
+	  /// <summary>
+	  /// test stopwords and stemming </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBasics() throws java.io.IOException
+	  public virtual void testBasics()
+	  {
+		Analyzer a = new TurkishAnalyzer(TEST_VERSION_CURRENT);
+		// stemming
+		checkOneTerm(a, "ağacı", "ağaç");
+		checkOneTerm(a, "ağaç", "ağaç");
+		// stopword
+		assertAnalyzesTo(a, "dolayı", new string[] {});
+		// apostrophes
+		checkOneTerm(a, "Kıbrıs'ta", "kıbrıs");
+		assertAnalyzesTo(a, "Van Gölü'ne", new string[]{"van", "göl"});
+	  }
+
+	  /// <summary>
+	  /// test use of exclusion set </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testExclude() throws java.io.IOException
+	  public virtual void testExclude()
+	  {
+		CharArraySet exclusionSet = new CharArraySet(TEST_VERSION_CURRENT, asSet("ağacı"), false);
+		Analyzer a = new TurkishAnalyzer(TEST_VERSION_CURRENT, TurkishAnalyzer.DefaultStopSet, exclusionSet);
+		checkOneTerm(a, "ağacı", "ağacı");
+		checkOneTerm(a, "ağaç", "ağaç");
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), new TurkishAnalyzer(TEST_VERSION_CURRENT), 1000 * RANDOM_MULTIPLIER);
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Tr/TestTurkishLowerCaseFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Tr/TestTurkishLowerCaseFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Tr/TestTurkishLowerCaseFilter.cs
new file mode 100644
index 0000000..8d3b5cb
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Tr/TestTurkishLowerCaseFilter.cs
@@ -0,0 +1,102 @@
+namespace org.apache.lucene.analysis.tr
+{
+
+	/*
+	 * 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 KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+
+	/// <summary>
+	/// Test the Turkish lowercase filter.
+	/// </summary>
+	public class TestTurkishLowerCaseFilter : BaseTokenStreamTestCase
+	{
+
+	  /// <summary>
+	  /// Test composed forms
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTurkishLowerCaseFilter() throws Exception
+	  public virtual void testTurkishLowerCaseFilter()
+	  {
+		TokenStream stream = new MockTokenizer(new StringReader("\u0130STANBUL \u0130ZM\u0130R ISPARTA"), MockTokenizer.WHITESPACE, false);
+		TurkishLowerCaseFilter filter = new TurkishLowerCaseFilter(stream);
+		assertTokenStreamContents(filter, new string[] {"istanbul", "izmir", "\u0131sparta"});
+	  }
+
+	  /// <summary>
+	  /// Test decomposed forms
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testDecomposed() throws Exception
+	  public virtual void testDecomposed()
+	  {
+		TokenStream stream = new MockTokenizer(new StringReader("\u0049\u0307STANBUL \u0049\u0307ZM\u0049\u0307R ISPARTA"), MockTokenizer.WHITESPACE, false);
+		TurkishLowerCaseFilter filter = new TurkishLowerCaseFilter(stream);
+		assertTokenStreamContents(filter, new string[] {"istanbul", "izmir", "\u0131sparta"});
+	  }
+
+	  /// <summary>
+	  /// Test decomposed forms with additional accents
+	  /// In this example, U+0049 + U+0316 + U+0307 is canonically equivalent
+	  /// to U+0130 + U+0316, and is lowercased the same way.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testDecomposed2() throws Exception
+	  public virtual void testDecomposed2()
+	  {
+		TokenStream stream = new MockTokenizer(new StringReader("\u0049\u0316\u0307STANBUL \u0049\u0307ZM\u0049\u0307R I\u0316SPARTA"), MockTokenizer.WHITESPACE, false);
+		TurkishLowerCaseFilter filter = new TurkishLowerCaseFilter(stream);
+		assertTokenStreamContents(filter, new string[] {"i\u0316stanbul", "izmir", "\u0131\u0316sparta"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testDecomposed3() throws Exception
+	  public virtual void testDecomposed3()
+	  {
+		TokenStream stream = new MockTokenizer(new StringReader("\u0049\u0307"), MockTokenizer.WHITESPACE, false);
+		TurkishLowerCaseFilter filter = new TurkishLowerCaseFilter(stream);
+		assertTokenStreamContents(filter, new string[] {"i"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestTurkishLowerCaseFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestTurkishLowerCaseFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new TurkishLowerCaseFilter(tokenizer));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Tr/TestTurkishLowerCaseFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Tr/TestTurkishLowerCaseFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Tr/TestTurkishLowerCaseFilterFactory.cs
new file mode 100644
index 0000000..1aed94d
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Tr/TestTurkishLowerCaseFilterFactory.cs
@@ -0,0 +1,60 @@
+namespace org.apache.lucene.analysis.tr
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the Turkish lowercase filter factory is working.
+	/// </summary>
+	public class TestTurkishLowerCaseFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+	  /// <summary>
+	  /// Ensure the filter actually lowercases text.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCasing() throws Exception
+	  public virtual void testCasing()
+	  {
+		Reader reader = new StringReader("AĞACI");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("TurkishLowerCase").create(stream);
+		assertTokenStreamContents(stream, new string[] {"ağacı"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("TurkishLowerCase", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/BaseTokenStreamFactoryTestCase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/BaseTokenStreamFactoryTestCase.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/BaseTokenStreamFactoryTestCase.cs
new file mode 100644
index 0000000..483eef2
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/BaseTokenStreamFactoryTestCase.cs
@@ -0,0 +1,186 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+namespace org.apache.lucene.analysis.util
+{
+
+	/*
+	 * Licensed to the Apache Software Foundation (ASF) under one or more
+	 * contributor license agreements.  See the NOTICE file distributed with
+	 * this work for additional information regarding copyright ownership.
+	 * The ASF licenses this file to You under the Apache License, Version 2.0
+	 * (the "License"); you may not use this file except in compliance with
+	 * the License.  You may obtain a copy of the License at
+	 *
+	 *     http://www.apache.org/licenses/LICENSE-2.0
+	 *
+	 * Unless required by applicable law or agreed to in writing, software
+	 * distributed under the License is distributed on an "AS IS" BASIS,
+	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+	 * See the License for the specific language governing permissions and
+	 * limitations under the License.
+	 */
+
+
+	using Version = org.apache.lucene.util.Version;
+
+	/// <summary>
+	/// Base class for testing tokenstream factories. 
+	/// <para>
+	/// Example usage:
+	/// <code><pre>
+	///   Reader reader = new StringReader("Some Text to Analyze");
+	///   reader = charFilterFactory("htmlstrip").create(reader);
+	///   TokenStream stream = tokenizerFactory("standard").create(reader);
+	///   stream = tokenFilterFactory("lowercase").create(stream);
+	///   stream = tokenFilterFactory("asciifolding").create(stream);
+	///   assertTokenStreamContents(stream, new String[] { "some", "text", "to", "analyze" });
+	/// </pre></code>
+	/// </para>
+	/// </summary>
+	// TODO: this has to be here, since the abstract factories are not in lucene-core,
+	// so test-framework doesnt know about them...
+	// this also means we currently cannot use this in other analysis modules :(
+	// TODO: maybe after we improve the abstract factory/SPI apis, they can sit in core and resolve this.
+	public abstract class BaseTokenStreamFactoryTestCase : BaseTokenStreamTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: private AbstractAnalysisFactory analysisFactory(Class<? extends AbstractAnalysisFactory> clazz, org.apache.lucene.util.Version matchVersion, ResourceLoader loader, String... keysAndValues) throws Exception
+	  private AbstractAnalysisFactory analysisFactory<T1>(Type<T1> clazz, Version matchVersion, ResourceLoader loader, params string[] keysAndValues) where T1 : AbstractAnalysisFactory
+	  {
+		if (keysAndValues.Length % 2 == 1)
+		{
+		  throw new System.ArgumentException("invalid keysAndValues map");
+		}
+		IDictionary<string, string> args = new Dictionary<string, string>();
+		for (int i = 0; i < keysAndValues.Length; i += 2)
+		{
+		  string previous = args[keysAndValues[i]] = keysAndValues[i + 1];
+		  assertNull("duplicate values for key: " + keysAndValues[i], previous);
+		}
+		if (matchVersion != null)
+		{
+		  string previous = args["luceneMatchVersion"] = matchVersion.ToString();
+		  assertNull("duplicate values for key: luceneMatchVersion", previous);
+		}
+		AbstractAnalysisFactory factory = null;
+		try
+		{
+		  factory = clazz.GetConstructor(typeof(IDictionary)).newInstance(args);
+		}
+		catch (InvocationTargetException e)
+		{
+		  // to simplify tests that check for illegal parameters
+		  if (e.InnerException is System.ArgumentException)
+		  {
+			throw (System.ArgumentException) e.InnerException;
+		  }
+		  else
+		  {
+			throw e;
+		  }
+		}
+		if (factory is ResourceLoaderAware)
+		{
+		  ((ResourceLoaderAware) factory).inform(loader);
+		}
+		return factory;
+	  }
+
+	  /// <summary>
+	  /// Returns a fully initialized TokenizerFactory with the specified name and key-value arguments.
+	  /// <seealso cref="ClasspathResourceLoader"/> is used for loading resources, so any required ones should
+	  /// be on the test classpath.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: protected TokenizerFactory tokenizerFactory(String name, String... keysAndValues) throws Exception
+	  protected internal virtual TokenizerFactory tokenizerFactory(string name, params string[] keysAndValues)
+	  {
+		return tokenizerFactory(name, TEST_VERSION_CURRENT, keysAndValues);
+	  }
+
+	  /// <summary>
+	  /// Returns a fully initialized TokenizerFactory with the specified name and key-value arguments.
+	  /// <seealso cref="ClasspathResourceLoader"/> is used for loading resources, so any required ones should
+	  /// be on the test classpath.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: protected TokenizerFactory tokenizerFactory(String name, org.apache.lucene.util.Version version, String... keysAndValues) throws Exception
+	  protected internal virtual TokenizerFactory tokenizerFactory(string name, Version version, params string[] keysAndValues)
+	  {
+		return tokenizerFactory(name, version, new ClasspathResourceLoader(this.GetType()), keysAndValues);
+	  }
+
+	  /// <summary>
+	  /// Returns a fully initialized TokenizerFactory with the specified name, version, resource loader, 
+	  /// and key-value arguments.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: protected TokenizerFactory tokenizerFactory(String name, org.apache.lucene.util.Version matchVersion, ResourceLoader loader, String... keysAndValues) throws Exception
+	  protected internal virtual TokenizerFactory tokenizerFactory(string name, Version matchVersion, ResourceLoader loader, params string[] keysAndValues)
+	  {
+		return (TokenizerFactory) analysisFactory(TokenizerFactory.lookupClass(name), matchVersion, loader, keysAndValues);
+	  }
+
+	  /// <summary>
+	  /// Returns a fully initialized TokenFilterFactory with the specified name and key-value arguments.
+	  /// <seealso cref="ClasspathResourceLoader"/> is used for loading resources, so any required ones should
+	  /// be on the test classpath.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: protected TokenFilterFactory tokenFilterFactory(String name, org.apache.lucene.util.Version version, String... keysAndValues) throws Exception
+	  protected internal virtual TokenFilterFactory tokenFilterFactory(string name, Version version, params string[] keysAndValues)
+	  {
+		return tokenFilterFactory(name, version, new ClasspathResourceLoader(this.GetType()), keysAndValues);
+	  }
+
+	  /// <summary>
+	  /// Returns a fully initialized TokenFilterFactory with the specified name and key-value arguments.
+	  /// <seealso cref="ClasspathResourceLoader"/> is used for loading resources, so any required ones should
+	  /// be on the test classpath.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: protected TokenFilterFactory tokenFilterFactory(String name, String... keysAndValues) throws Exception
+	  protected internal virtual TokenFilterFactory tokenFilterFactory(string name, params string[] keysAndValues)
+	  {
+		return tokenFilterFactory(name, TEST_VERSION_CURRENT, keysAndValues);
+	  }
+
+	  /// <summary>
+	  /// Returns a fully initialized TokenFilterFactory with the specified name, version, resource loader, 
+	  /// and key-value arguments.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: protected TokenFilterFactory tokenFilterFactory(String name, org.apache.lucene.util.Version matchVersion, ResourceLoader loader, String... keysAndValues) throws Exception
+	  protected internal virtual TokenFilterFactory tokenFilterFactory(string name, Version matchVersion, ResourceLoader loader, params string[] keysAndValues)
+	  {
+		return (TokenFilterFactory) analysisFactory(TokenFilterFactory.lookupClass(name), matchVersion, loader, keysAndValues);
+	  }
+
+	  /// <summary>
+	  /// Returns a fully initialized CharFilterFactory with the specified name and key-value arguments.
+	  /// <seealso cref="ClasspathResourceLoader"/> is used for loading resources, so any required ones should
+	  /// be on the test classpath.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: protected CharFilterFactory charFilterFactory(String name, String... keysAndValues) throws Exception
+	  protected internal virtual CharFilterFactory charFilterFactory(string name, params string[] keysAndValues)
+	  {
+		return charFilterFactory(name, TEST_VERSION_CURRENT, new ClasspathResourceLoader(this.GetType()), keysAndValues);
+	  }
+
+	  /// <summary>
+	  /// Returns a fully initialized CharFilterFactory with the specified name, version, resource loader, 
+	  /// and key-value arguments.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: protected CharFilterFactory charFilterFactory(String name, org.apache.lucene.util.Version matchVersion, ResourceLoader loader, String... keysAndValues) throws Exception
+	  protected internal virtual CharFilterFactory charFilterFactory(string name, Version matchVersion, ResourceLoader loader, params string[] keysAndValues)
+	  {
+		return (CharFilterFactory) analysisFactory(CharFilterFactory.lookupClass(name), matchVersion, loader, keysAndValues);
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/StringMockResourceLoader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/StringMockResourceLoader.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/StringMockResourceLoader.cs
new file mode 100644
index 0000000..7373c42
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/StringMockResourceLoader.cs
@@ -0,0 +1,74 @@
+using System;
+
+namespace org.apache.lucene.analysis.util
+{
+
+	/*
+	 * Licensed to the Apache Software Foundation (ASF) under one or more
+	 * contributor license agreements.  See the NOTICE file distributed with
+	 * this work for additional information regarding copyright ownership.
+	 * The ASF licenses this file to You under the Apache License, Version 2.0
+	 * (the "License"); you may not use this file except in compliance with
+	 * the License.  You may obtain a copy of the License at
+	 *
+	 *     http://www.apache.org/licenses/LICENSE-2.0
+	 *
+	 * Unless required by applicable law or agreed to in writing, software
+	 * distributed under the License is distributed on an "AS IS" BASIS,
+	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+	 * See the License for the specific language governing permissions and
+	 * limitations under the License.
+	 */
+
+
+	/// <summary>
+	/// Fake resource loader for tests: works if you want to fake reading a single file </summary>
+	public class StringMockResourceLoader : ResourceLoader
+	{
+	  internal string text;
+
+	  public StringMockResourceLoader(string text)
+	  {
+		this.text = text;
+	  }
+
+//JAVA TO C# CONVERTER TODO TASK: Java wildcard generics are not converted to .NET:
+//ORIGINAL LINE: @Override public <T> Class<? extends T> findClass(String cname, Class<T> expectedType)
+//JAVA TO C# CONVERTER TODO TASK: Java wildcard generics are not converted to .NET:
+//ORIGINAL LINE: @Override public <T> Class<? extends T> findClass(String cname, Class<T> expectedType)
+	  public override Type<?> findClass<T>(string cname, Type<T> expectedType) where ? : T
+	  {
+		try
+		{
+		  return Type.GetType(cname).asSubclass(expectedType);
+		}
+		catch (Exception e)
+		{
+		  throw new Exception("Cannot load class: " + cname, e);
+		}
+	  }
+
+	  public override T newInstance<T>(string cname, Type<T> expectedType)
+	  {
+//JAVA TO C# CONVERTER TODO TASK: Java wildcard generics are not converted to .NET:
+//ORIGINAL LINE: Class<? extends T> clazz = findClass(cname, expectedType);
+		Type<?> clazz = findClass(cname, expectedType);
+		try
+		{
+		  return clazz.newInstance();
+		}
+		catch (Exception e)
+		{
+		  throw new Exception("Cannot create instance: " + cname, e);
+		}
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Override public java.io.InputStream openResource(String resource) throws java.io.IOException
+	  public override System.IO.Stream openResource(string resource)
+	  {
+		return new ByteArrayInputStream(text.GetBytes(StandardCharsets.UTF_8));
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestAnalysisSPILoader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestAnalysisSPILoader.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestAnalysisSPILoader.cs
new file mode 100644
index 0000000..edfad89
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestAnalysisSPILoader.cs
@@ -0,0 +1,256 @@
+using System.Collections.Generic;
+
+namespace org.apache.lucene.analysis.util
+{
+
+	/*
+	 * Licensed to the Apache Software Foundation (ASF) under one or more
+	 * contributor license agreements.  See the NOTICE file distributed with
+	 * this work for additional information regarding copyright ownership.
+	 * The ASF licenses this file to You under the Apache License, Version 2.0
+	 * (the "License"); you may not use this file except in compliance with
+	 * the License.  You may obtain a copy of the License at
+	 *
+	 *     http://www.apache.org/licenses/LICENSE-2.0
+	 *
+	 * Unless required by applicable law or agreed to in writing, software
+	 * distributed under the License is distributed on an "AS IS" BASIS,
+	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+	 * See the License for the specific language governing permissions and
+	 * limitations under the License.
+	 */
+
+
+	using HTMLStripCharFilterFactory = org.apache.lucene.analysis.charfilter.HTMLStripCharFilterFactory;
+	using LowerCaseFilterFactory = org.apache.lucene.analysis.core.LowerCaseFilterFactory;
+	using WhitespaceTokenizerFactory = org.apache.lucene.analysis.core.WhitespaceTokenizerFactory;
+	using RemoveDuplicatesTokenFilterFactory = org.apache.lucene.analysis.miscellaneous.RemoveDuplicatesTokenFilterFactory;
+	using LuceneTestCase = org.apache.lucene.util.LuceneTestCase;
+
+	public class TestAnalysisSPILoader : LuceneTestCase
+	{
+
+	  private IDictionary<string, string> versionArgOnly()
+	  {
+		return new HashMapAnonymousInnerClassHelper(this);
+	  }
+
+	  private class HashMapAnonymousInnerClassHelper : Dictionary<string, string>
+	  {
+		  private readonly TestAnalysisSPILoader outerInstance;
+
+		  public HashMapAnonymousInnerClassHelper(TestAnalysisSPILoader outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+
+			  this.put("luceneMatchVersion", TEST_VERSION_CURRENT.ToString());
+		  }
+
+	  }
+
+	  public virtual void testLookupTokenizer()
+	  {
+		assertSame(typeof(WhitespaceTokenizerFactory), TokenizerFactory.forName("Whitespace", versionArgOnly()).GetType());
+		assertSame(typeof(WhitespaceTokenizerFactory), TokenizerFactory.forName("WHITESPACE", versionArgOnly()).GetType());
+		assertSame(typeof(WhitespaceTokenizerFactory), TokenizerFactory.forName("whitespace", versionArgOnly()).GetType());
+	  }
+
+	  public virtual void testBogusLookupTokenizer()
+	  {
+		try
+		{
+		  TokenizerFactory.forName("sdfsdfsdfdsfsdfsdf", new Dictionary<string, string>());
+		  fail();
+		}
+		catch (System.ArgumentException)
+		{
+		  //
+		}
+
+		try
+		{
+		  TokenizerFactory.forName("!(**#$U*#$*", new Dictionary<string, string>());
+		  fail();
+		}
+		catch (System.ArgumentException)
+		{
+		  //
+		}
+	  }
+
+	  public virtual void testLookupTokenizerClass()
+	  {
+		assertSame(typeof(WhitespaceTokenizerFactory), TokenizerFactory.lookupClass("Whitespace"));
+		assertSame(typeof(WhitespaceTokenizerFactory), TokenizerFactory.lookupClass("WHITESPACE"));
+		assertSame(typeof(WhitespaceTokenizerFactory), TokenizerFactory.lookupClass("whitespace"));
+	  }
+
+	  public virtual void testBogusLookupTokenizerClass()
+	  {
+		try
+		{
+		  TokenizerFactory.lookupClass("sdfsdfsdfdsfsdfsdf");
+		  fail();
+		}
+		catch (System.ArgumentException)
+		{
+		  //
+		}
+
+		try
+		{
+		  TokenizerFactory.lookupClass("!(**#$U*#$*");
+		  fail();
+		}
+		catch (System.ArgumentException)
+		{
+		  //
+		}
+	  }
+
+	  public virtual void testAvailableTokenizers()
+	  {
+		assertTrue(TokenizerFactory.availableTokenizers().contains("whitespace"));
+	  }
+
+	  public virtual void testLookupTokenFilter()
+	  {
+		assertSame(typeof(LowerCaseFilterFactory), TokenFilterFactory.forName("Lowercase", versionArgOnly()).GetType());
+		assertSame(typeof(LowerCaseFilterFactory), TokenFilterFactory.forName("LOWERCASE", versionArgOnly()).GetType());
+		assertSame(typeof(LowerCaseFilterFactory), TokenFilterFactory.forName("lowercase", versionArgOnly()).GetType());
+
+		assertSame(typeof(RemoveDuplicatesTokenFilterFactory), TokenFilterFactory.forName("RemoveDuplicates", versionArgOnly()).GetType());
+		assertSame(typeof(RemoveDuplicatesTokenFilterFactory), TokenFilterFactory.forName("REMOVEDUPLICATES", versionArgOnly()).GetType());
+		assertSame(typeof(RemoveDuplicatesTokenFilterFactory), TokenFilterFactory.forName("removeduplicates", versionArgOnly()).GetType());
+	  }
+
+	  public virtual void testBogusLookupTokenFilter()
+	  {
+		try
+		{
+		  TokenFilterFactory.forName("sdfsdfsdfdsfsdfsdf", new Dictionary<string, string>());
+		  fail();
+		}
+		catch (System.ArgumentException)
+		{
+		  //
+		}
+
+		try
+		{
+		  TokenFilterFactory.forName("!(**#$U*#$*", new Dictionary<string, string>());
+		  fail();
+		}
+		catch (System.ArgumentException)
+		{
+		  //
+		}
+	  }
+
+	  public virtual void testLookupTokenFilterClass()
+	  {
+		assertSame(typeof(LowerCaseFilterFactory), TokenFilterFactory.lookupClass("Lowercase"));
+		assertSame(typeof(LowerCaseFilterFactory), TokenFilterFactory.lookupClass("LOWERCASE"));
+		assertSame(typeof(LowerCaseFilterFactory), TokenFilterFactory.lookupClass("lowercase"));
+
+		assertSame(typeof(RemoveDuplicatesTokenFilterFactory), TokenFilterFactory.lookupClass("RemoveDuplicates"));
+		assertSame(typeof(RemoveDuplicatesTokenFilterFactory), TokenFilterFactory.lookupClass("REMOVEDUPLICATES"));
+		assertSame(typeof(RemoveDuplicatesTokenFilterFactory), TokenFilterFactory.lookupClass("removeduplicates"));
+	  }
+
+	  public virtual void testBogusLookupTokenFilterClass()
+	  {
+		try
+		{
+		  TokenFilterFactory.lookupClass("sdfsdfsdfdsfsdfsdf");
+		  fail();
+		}
+		catch (System.ArgumentException)
+		{
+		  //
+		}
+
+		try
+		{
+		  TokenFilterFactory.lookupClass("!(**#$U*#$*");
+		  fail();
+		}
+		catch (System.ArgumentException)
+		{
+		  //
+		}
+	  }
+
+	  public virtual void testAvailableTokenFilters()
+	  {
+		assertTrue(TokenFilterFactory.availableTokenFilters().contains("lowercase"));
+		assertTrue(TokenFilterFactory.availableTokenFilters().contains("removeduplicates"));
+	  }
+
+	  public virtual void testLookupCharFilter()
+	  {
+		assertSame(typeof(HTMLStripCharFilterFactory), CharFilterFactory.forName("HTMLStrip", versionArgOnly()).GetType());
+		assertSame(typeof(HTMLStripCharFilterFactory), CharFilterFactory.forName("HTMLSTRIP", versionArgOnly()).GetType());
+		assertSame(typeof(HTMLStripCharFilterFactory), CharFilterFactory.forName("htmlstrip", versionArgOnly()).GetType());
+	  }
+
+	  public virtual void testBogusLookupCharFilter()
+	  {
+		try
+		{
+		  CharFilterFactory.forName("sdfsdfsdfdsfsdfsdf", new Dictionary<string, string>());
+		  fail();
+		}
+		catch (System.ArgumentException)
+		{
+		  //
+		}
+
+		try
+		{
+		  CharFilterFactory.forName("!(**#$U*#$*", new Dictionary<string, string>());
+		  fail();
+		}
+		catch (System.ArgumentException)
+		{
+		  //
+		}
+	  }
+
+	  public virtual void testLookupCharFilterClass()
+	  {
+		assertSame(typeof(HTMLStripCharFilterFactory), CharFilterFactory.lookupClass("HTMLStrip"));
+		assertSame(typeof(HTMLStripCharFilterFactory), CharFilterFactory.lookupClass("HTMLSTRIP"));
+		assertSame(typeof(HTMLStripCharFilterFactory), CharFilterFactory.lookupClass("htmlstrip"));
+	  }
+
+	  public virtual void testBogusLookupCharFilterClass()
+	  {
+		try
+		{
+		  CharFilterFactory.lookupClass("sdfsdfsdfdsfsdfsdf");
+		  fail();
+		}
+		catch (System.ArgumentException)
+		{
+		  //
+		}
+
+		try
+		{
+		  CharFilterFactory.lookupClass("!(**#$U*#$*");
+		  fail();
+		}
+		catch (System.ArgumentException)
+		{
+		  //
+		}
+	  }
+
+	  public virtual void testAvailableCharFilters()
+	  {
+		assertTrue(CharFilterFactory.availableCharFilters().contains("htmlstrip"));
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestCharArrayIterator.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestCharArrayIterator.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestCharArrayIterator.cs
new file mode 100644
index 0000000..e0f13e1
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestCharArrayIterator.cs
@@ -0,0 +1,181 @@
+using System;
+
+namespace org.apache.lucene.analysis.util
+{
+
+	/*
+	 * Licensed to the Apache Software Foundation (ASF) under one or more
+	 * contributor license agreements.  See the NOTICE file distributed with
+	 * this work for additional information regarding copyright ownership.
+	 * The ASF licenses this file to You under the Apache License, Version 2.0
+	 * (the "License"); you may not use this file except in compliance with
+	 * the License.  You may obtain a copy of the License at
+	 *
+	 *     http://www.apache.org/licenses/LICENSE-2.0
+	 *
+	 * Unless required by applicable law or agreed to in writing, software
+	 * distributed under the License is distributed on an "AS IS" BASIS,
+	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+	 * See the License for the specific language governing permissions and
+	 * limitations under the License.
+	 */
+
+
+	using LuceneTestCase = org.apache.lucene.util.LuceneTestCase;
+	using TestUtil = org.apache.lucene.util.TestUtil;
+
+	public class TestCharArrayIterator : LuceneTestCase
+	{
+
+	  public virtual void testWordInstance()
+	  {
+		doTests(CharArrayIterator.newWordInstance());
+	  }
+
+	  public virtual void testConsumeWordInstance()
+	  {
+		// we use the default locale, as its randomized by LuceneTestCase
+		BreakIterator bi = BreakIterator.getWordInstance(Locale.Default);
+		CharArrayIterator ci = CharArrayIterator.newWordInstance();
+		for (int i = 0; i < 10000; i++)
+		{
+		  char[] text = TestUtil.randomUnicodeString(random()).toCharArray();
+		  ci.setText(text, 0, text.Length);
+		  consume(bi, ci);
+		}
+	  }
+
+	  /* run this to test if your JRE is buggy
+	  public void testWordInstanceJREBUG() {
+	    // we use the default locale, as its randomized by LuceneTestCase
+	    BreakIterator bi = BreakIterator.getWordInstance(Locale.getDefault());
+	    Segment ci = new Segment();
+	    for (int i = 0; i < 10000; i++) {
+	      char text[] = TestUtil.randomUnicodeString(random).toCharArray();
+	      ci.array = text;
+	      ci.offset = 0;
+	      ci.count = text.length;
+	      consume(bi, ci);
+	    }
+	  }
+	  */
+
+	  public virtual void testSentenceInstance()
+	  {
+		doTests(CharArrayIterator.newSentenceInstance());
+	  }
+
+	  public virtual void testConsumeSentenceInstance()
+	  {
+		// we use the default locale, as its randomized by LuceneTestCase
+		BreakIterator bi = BreakIterator.getSentenceInstance(Locale.Default);
+		CharArrayIterator ci = CharArrayIterator.newSentenceInstance();
+		for (int i = 0; i < 10000; i++)
+		{
+		  char[] text = TestUtil.randomUnicodeString(random()).toCharArray();
+		  ci.setText(text, 0, text.Length);
+		  consume(bi, ci);
+		}
+	  }
+
+	  /* run this to test if your JRE is buggy
+	  public void testSentenceInstanceJREBUG() {
+	    // we use the default locale, as its randomized by LuceneTestCase
+	    BreakIterator bi = BreakIterator.getSentenceInstance(Locale.getDefault());
+	    Segment ci = new Segment();
+	    for (int i = 0; i < 10000; i++) {
+	      char text[] = TestUtil.randomUnicodeString(random).toCharArray();
+	      ci.array = text;
+	      ci.offset = 0;
+	      ci.count = text.length;
+	      consume(bi, ci);
+	    }
+	  }
+	  */
+
+	  private void doTests(CharArrayIterator ci)
+	  {
+		// basics
+		ci.setText("testing".ToCharArray(), 0, "testing".Length);
+		assertEquals(0, ci.BeginIndex);
+		assertEquals(7, ci.EndIndex);
+		assertEquals(0, ci.Index);
+		assertEquals('t', ci.current());
+		assertEquals('e', ci.next());
+		assertEquals('g', ci.last());
+		assertEquals('n', ci.previous());
+		assertEquals('t', ci.first());
+		assertEquals(CharacterIterator.DONE, ci.previous());
+
+		// first()
+		ci.setText("testing".ToCharArray(), 0, "testing".Length);
+		ci.next();
+		// Sets the position to getBeginIndex() and returns the character at that position. 
+		assertEquals('t', ci.first());
+		assertEquals(ci.BeginIndex, ci.Index);
+		// or DONE if the text is empty
+		ci.setText(new char[] {}, 0, 0);
+		assertEquals(CharacterIterator.DONE, ci.first());
+
+		// last()
+		ci.setText("testing".ToCharArray(), 0, "testing".Length);
+		// Sets the position to getEndIndex()-1 (getEndIndex() if the text is empty) 
+		// and returns the character at that position. 
+		assertEquals('g', ci.last());
+		assertEquals(ci.Index, ci.EndIndex - 1);
+		// or DONE if the text is empty
+		ci.setText(new char[] {}, 0, 0);
+		assertEquals(CharacterIterator.DONE, ci.last());
+		assertEquals(ci.EndIndex, ci.Index);
+
+		// current()
+		// Gets the character at the current position (as returned by getIndex()). 
+		ci.setText("testing".ToCharArray(), 0, "testing".Length);
+		assertEquals('t', ci.current());
+		ci.last();
+		ci.next();
+		// or DONE if the current position is off the end of the text.
+		assertEquals(CharacterIterator.DONE, ci.current());
+
+		// next()
+		ci.setText("te".ToCharArray(), 0, 2);
+		// Increments the iterator's index by one and returns the character at the new index.
+		assertEquals('e', ci.next());
+		assertEquals(1, ci.Index);
+		// or DONE if the new position is off the end of the text range.
+		assertEquals(CharacterIterator.DONE, ci.next());
+		assertEquals(ci.EndIndex, ci.Index);
+
+		// setIndex()
+		ci.setText("test".ToCharArray(), 0, "test".Length);
+		try
+		{
+		  ci.Index = 5;
+		  fail();
+		}
+		catch (Exception e)
+		{
+		  assertTrue(e is System.ArgumentException);
+		}
+
+		// clone()
+		char[] text = "testing".ToCharArray();
+		ci.setText(text, 0, text.Length);
+		ci.next();
+		CharArrayIterator ci2 = ci.clone();
+		assertEquals(ci.Index, ci2.Index);
+		assertEquals(ci.next(), ci2.next());
+		assertEquals(ci.last(), ci2.last());
+	  }
+
+	  private void consume(BreakIterator bi, CharacterIterator ci)
+	  {
+		bi.Text = ci;
+		while (bi.next() != BreakIterator.DONE)
+		{
+		  ;
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestCharArrayMap.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestCharArrayMap.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestCharArrayMap.cs
new file mode 100644
index 0000000..9202318
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestCharArrayMap.cs
@@ -0,0 +1,288 @@
+using System.Collections.Generic;
+using System.Text;
+
+/*
+ * 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 org.apache.lucene.analysis.util
+{
+
+	using LuceneTestCase = org.apache.lucene.util.LuceneTestCase;
+
+	public class TestCharArrayMap : LuceneTestCase
+	{
+	  public virtual void doRandom(int iter, bool ignoreCase)
+	  {
+		CharArrayMap<int?> map = new CharArrayMap<int?>(TEST_VERSION_CURRENT, 1, ignoreCase);
+		Dictionary<string, int?> hmap = new Dictionary<string, int?>();
+
+		char[] key;
+		for (int i = 0; i < iter; i++)
+		{
+		  int len = random().Next(5);
+		  key = new char[len];
+		  for (int j = 0; j < key.Length; j++)
+		  {
+			key[j] = (char)random().Next(127);
+		  }
+		  string keyStr = new string(key);
+		  string hmapKey = ignoreCase ? keyStr.ToLower(Locale.ROOT) : keyStr;
+
+		  int val = random().Next();
+
+		  object o1 = map.put(key, val);
+		  object o2 = hmap[hmapKey].Value = val;
+		  assertEquals(o1,o2);
+
+		  // add it again with the string method
+		  assertEquals(val, map.put(keyStr,val).intValue());
+
+		  assertEquals(val, map.get(key,0,key.Length).intValue());
+		  assertEquals(val, map.get(key).intValue());
+		  assertEquals(val, map.get(keyStr).intValue());
+
+		  assertEquals(hmap.Count, map.size());
+		}
+	  }
+
+	  public virtual void testCharArrayMap()
+	  {
+		int num = 5 * RANDOM_MULTIPLIER;
+		for (int i = 0; i < num; i++)
+		{ // pump this up for more random testing
+		  doRandom(1000,false);
+		  doRandom(1000,true);
+		}
+	  }
+
+	  public virtual void testMethods()
+	  {
+		CharArrayMap<int?> cm = new CharArrayMap<int?>(TEST_VERSION_CURRENT, 2, false);
+		Dictionary<string, int?> hm = new Dictionary<string, int?>();
+		hm["foo"] = 1;
+		hm["bar"] = 2;
+		cm.putAll(hm);
+		assertEquals(hm.Count, cm.size());
+		hm["baz"] = 3;
+		cm.putAll(hm);
+		assertEquals(hm.Count, cm.size());
+
+		CharArraySet cs = cm.Keys;
+		int n = 0;
+		foreach (object o in cs)
+		{
+		  assertTrue(cm.containsKey(o));
+		  char[] co = (char[]) o;
+		  assertTrue(cm.containsKey(co, 0, co.Length));
+		  n++;
+		}
+		assertEquals(hm.Count, n);
+		assertEquals(hm.Count, cs.size());
+		assertEquals(cm.size(), cs.size());
+		cs.clear();
+		assertEquals(0, cs.size());
+		assertEquals(0, cm.size());
+		try
+		{
+		  cs.add("test");
+		  fail("keySet() allows adding new keys");
+		}
+		catch (System.NotSupportedException)
+		{
+		  // pass
+		}
+		cm.putAll(hm);
+		assertEquals(hm.Count, cs.size());
+		assertEquals(cm.size(), cs.size());
+
+		IEnumerator<KeyValuePair<object, int?>> iter1 = cm.entrySet().GetEnumerator();
+		n = 0;
+		while (iter1.MoveNext())
+		{
+		  KeyValuePair<object, int?> entry = iter1.Current;
+		  object key = entry.Key;
+		  int? val = entry.Value;
+		  assertEquals(cm.get(key), val);
+		  entry.Value = val * 100;
+		  assertEquals(val * 100, (int)cm.get(key));
+		  n++;
+		}
+		assertEquals(hm.Count, n);
+		cm.clear();
+		cm.putAll(hm);
+		assertEquals(cm.size(), n);
+
+		CharArrayMap<int?>.EntryIterator iter2 = cm.entrySet().GetEnumerator();
+		n = 0;
+		while (iter2.hasNext())
+		{
+		  char[] keyc = iter2.nextKey();
+		  int? val = iter2.currentValue();
+		  assertEquals(hm[new string(keyc)], val);
+		  iter2.Value = val * 100;
+		  assertEquals(val * 100, (int)cm.get(keyc));
+		  n++;
+		}
+		assertEquals(hm.Count, n);
+
+		cm.entrySet().clear();
+		assertEquals(0, cm.size());
+		assertEquals(0, cm.entrySet().size());
+		assertTrue(cm.Empty);
+	  }
+
+	  public virtual void testModifyOnUnmodifiable()
+	  {
+		CharArrayMap<int?> map = new CharArrayMap<int?>(TEST_VERSION_CURRENT, 2, false);
+		map.put("foo",1);
+		map.put("bar",2);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int size = map.size();
+		int size = map.size();
+		assertEquals(2, size);
+		assertTrue(map.containsKey("foo"));
+		assertEquals(1, map.get("foo").intValue());
+		assertTrue(map.containsKey("bar"));
+		assertEquals(2, map.get("bar").intValue());
+
+		map = CharArrayMap.unmodifiableMap(map);
+		assertEquals("Map size changed due to unmodifiableMap call", size, map.size());
+		string NOT_IN_MAP = "SirGallahad";
+		assertFalse("Test String already exists in map", map.containsKey(NOT_IN_MAP));
+		assertNull("Test String already exists in map", map.get(NOT_IN_MAP));
+
+		try
+		{
+		  map.put(NOT_IN_MAP.ToCharArray(), 3);
+		  fail("Modified unmodifiable map");
+		}
+		catch (System.NotSupportedException)
+		{
+		  // expected
+		  assertFalse("Test String has been added to unmodifiable map", map.containsKey(NOT_IN_MAP));
+		  assertNull("Test String has been added to unmodifiable map", map.get(NOT_IN_MAP));
+		  assertEquals("Size of unmodifiable map has changed", size, map.size());
+		}
+
+		try
+		{
+		  map.put(NOT_IN_MAP, 3);
+		  fail("Modified unmodifiable map");
+		}
+		catch (System.NotSupportedException)
+		{
+		  // expected
+		  assertFalse("Test String has been added to unmodifiable map", map.containsKey(NOT_IN_MAP));
+		  assertNull("Test String has been added to unmodifiable map", map.get(NOT_IN_MAP));
+		  assertEquals("Size of unmodifiable map has changed", size, map.size());
+		}
+
+		try
+		{
+		  map.put(new StringBuilder(NOT_IN_MAP), 3);
+		  fail("Modified unmodifiable map");
+		}
+		catch (System.NotSupportedException)
+		{
+		  // expected
+		  assertFalse("Test String has been added to unmodifiable map", map.containsKey(NOT_IN_MAP));
+		  assertNull("Test String has been added to unmodifiable map", map.get(NOT_IN_MAP));
+		  assertEquals("Size of unmodifiable map has changed", size, map.size());
+		}
+
+		try
+		{
+		  map.clear();
+		  fail("Modified unmodifiable map");
+		}
+		catch (System.NotSupportedException)
+		{
+		  // expected
+		  assertEquals("Size of unmodifiable map has changed", size, map.size());
+		}
+
+		try
+		{
+		  map.entrySet().clear();
+		  fail("Modified unmodifiable map");
+		}
+		catch (System.NotSupportedException)
+		{
+		  // expected
+		  assertEquals("Size of unmodifiable map has changed", size, map.size());
+		}
+
+		try
+		{
+		  map.Keys.Clear();
+		  fail("Modified unmodifiable map");
+		}
+		catch (System.NotSupportedException)
+		{
+		  // expected
+		  assertEquals("Size of unmodifiable map has changed", size, map.size());
+		}
+
+		try
+		{
+		  map.put((object) NOT_IN_MAP, 3);
+		  fail("Modified unmodifiable map");
+		}
+		catch (System.NotSupportedException)
+		{
+		  // expected
+		  assertFalse("Test String has been added to unmodifiable map", map.containsKey(NOT_IN_MAP));
+		  assertNull("Test String has been added to unmodifiable map", map.get(NOT_IN_MAP));
+		  assertEquals("Size of unmodifiable map has changed", size, map.size());
+		}
+
+		try
+		{
+		  map.putAll(Collections.singletonMap(NOT_IN_MAP, 3));
+		  fail("Modified unmodifiable map");
+		}
+		catch (System.NotSupportedException)
+		{
+		  // expected
+		  assertFalse("Test String has been added to unmodifiable map", map.containsKey(NOT_IN_MAP));
+		  assertNull("Test String has been added to unmodifiable map", map.get(NOT_IN_MAP));
+		  assertEquals("Size of unmodifiable map has changed", size, map.size());
+		}
+
+		assertTrue(map.containsKey("foo"));
+		assertEquals(1, map.get("foo").intValue());
+		assertTrue(map.containsKey("bar"));
+		assertEquals(2, map.get("bar").intValue());
+	  }
+
+	  public virtual void testToString()
+	  {
+		CharArrayMap<int?> cm = new CharArrayMap<int?>(TEST_VERSION_CURRENT, Collections.singletonMap("test",1), false);
+		assertEquals("[test]",cm.Keys.ToString());
+		assertEquals("[1]",cm.values().ToString());
+		assertEquals("[test=1]",cm.entrySet().ToString());
+		assertEquals("{test=1}",cm.ToString());
+		cm.put("test2", 2);
+		assertTrue(cm.Keys.ToString().Contains(", "));
+		assertTrue(cm.values().ToString().Contains(", "));
+		assertTrue(cm.entrySet().ToString().Contains(", "));
+		assertTrue(cm.ToString().Contains(", "));
+	  }
+	}
+
+
+}
\ No newline at end of file


[18/27] lucenenet git commit: adding converted analysis common tests

Posted by sy...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cz/TestCzechAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cz/TestCzechAnalyzer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cz/TestCzechAnalyzer.cs
new file mode 100644
index 0000000..d71ee2a
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cz/TestCzechAnalyzer.cs
@@ -0,0 +1,91 @@
+using System;
+
+namespace org.apache.lucene.analysis.cz
+{
+
+	/*
+	 * 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 CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+	using Version = org.apache.lucene.util.Version;
+
+	/// <summary>
+	/// Test the CzechAnalyzer
+	/// 
+	/// Before Lucene 3.1, CzechAnalyzer was a StandardAnalyzer with a custom 
+	/// stopword list. As of 3.1 it also includes a stemmer.
+	/// 
+	/// </summary>
+	public class TestCzechAnalyzer : BaseTokenStreamTestCase
+	{
+	  /// @deprecated (3.1) Remove this test when support for 3.0 indexes is no longer needed. 
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Deprecated("(3.1) Remove this test when support for 3.0 indexes is no longer needed.") public void testStopWordLegacy() throws Exception
+	  [Obsolete("(3.1) Remove this test when support for 3.0 indexes is no longer needed.")]
+	  public virtual void testStopWordLegacy()
+	  {
+		assertAnalyzesTo(new CzechAnalyzer(Version.LUCENE_30), "Pokud mluvime o volnem", new string[] {"mluvime", "volnem"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStopWord() throws Exception
+	  public virtual void testStopWord()
+	  {
+		assertAnalyzesTo(new CzechAnalyzer(TEST_VERSION_CURRENT), "Pokud mluvime o volnem", new string[] {"mluvim", "voln"});
+	  }
+
+	  /// @deprecated (3.1) Remove this test when support for 3.0 indexes is no longer needed. 
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Deprecated("(3.1) Remove this test when support for 3.0 indexes is no longer needed.") public void testReusableTokenStreamLegacy() throws Exception
+	  [Obsolete("(3.1) Remove this test when support for 3.0 indexes is no longer needed.")]
+	  public virtual void testReusableTokenStreamLegacy()
+	  {
+		Analyzer analyzer = new CzechAnalyzer(Version.LUCENE_30);
+		assertAnalyzesTo(analyzer, "Pokud mluvime o volnem", new string[] {"mluvime", "volnem"});
+		assertAnalyzesTo(analyzer, "Česká Republika", new string[] {"česká", "republika"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testReusableTokenStream() throws Exception
+	  public virtual void testReusableTokenStream()
+	  {
+		Analyzer analyzer = new CzechAnalyzer(TEST_VERSION_CURRENT);
+		assertAnalyzesTo(analyzer, "Pokud mluvime o volnem", new string[] {"mluvim", "voln"});
+		assertAnalyzesTo(analyzer, "Česká Republika", new string[] {"česk", "republik"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testWithStemExclusionSet() throws java.io.IOException
+	  public virtual void testWithStemExclusionSet()
+	  {
+		CharArraySet set = new CharArraySet(TEST_VERSION_CURRENT, 1, true);
+		set.add("hole");
+		CzechAnalyzer cz = new CzechAnalyzer(TEST_VERSION_CURRENT, CharArraySet.EMPTY_SET, set);
+		assertAnalyzesTo(cz, "hole desek", new string[] {"hole", "desk"});
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), new CzechAnalyzer(TEST_VERSION_CURRENT), 1000 * RANDOM_MULTIPLIER);
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cz/TestCzechStemFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cz/TestCzechStemFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cz/TestCzechStemFilterFactory.cs
new file mode 100644
index 0000000..53e309c
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cz/TestCzechStemFilterFactory.cs
@@ -0,0 +1,60 @@
+namespace org.apache.lucene.analysis.cz
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the Czech stem filter factory is working.
+	/// </summary>
+	public class TestCzechStemFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+	  /// <summary>
+	  /// Ensure the filter actually stems text.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStemming() throws Exception
+	  public virtual void testStemming()
+	  {
+		Reader reader = new StringReader("angličtí");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("CzechStem").create(stream);
+		assertTokenStreamContents(stream, new string[] {"anglick"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("CzechStem", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cz/TestCzechStemmer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cz/TestCzechStemmer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cz/TestCzechStemmer.cs
new file mode 100644
index 0000000..c8badda
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cz/TestCzechStemmer.cs
@@ -0,0 +1,333 @@
+namespace org.apache.lucene.analysis.cz
+{
+
+	/*
+	 * 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 KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+	using SetKeywordMarkerFilter = org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter;
+	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+
+	/// <summary>
+	/// Test the Czech Stemmer.
+	/// 
+	/// Note: its algorithmic, so some stems are nonsense
+	/// 
+	/// </summary>
+	public class TestCzechStemmer : BaseTokenStreamTestCase
+	{
+
+	  /// <summary>
+	  /// Test showing how masculine noun forms conflate
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMasculineNouns() throws java.io.IOException
+	  public virtual void testMasculineNouns()
+	  {
+		CzechAnalyzer cz = new CzechAnalyzer(TEST_VERSION_CURRENT);
+
+		/* animate ending with a hard consonant */
+		assertAnalyzesTo(cz, "pán", new string[] {"pán"});
+		assertAnalyzesTo(cz, "páni", new string[] {"pán"});
+		assertAnalyzesTo(cz, "pánové", new string[] {"pán"});
+		assertAnalyzesTo(cz, "pána", new string[] {"pán"});
+		assertAnalyzesTo(cz, "pánů", new string[] {"pán"});
+		assertAnalyzesTo(cz, "pánovi", new string[] {"pán"});
+		assertAnalyzesTo(cz, "pánům", new string[] {"pán"});
+		assertAnalyzesTo(cz, "pány", new string[] {"pán"});
+		assertAnalyzesTo(cz, "páne", new string[] {"pán"});
+		assertAnalyzesTo(cz, "pánech", new string[] {"pán"});
+		assertAnalyzesTo(cz, "pánem", new string[] {"pán"});
+
+		/* inanimate ending with hard consonant */
+		assertAnalyzesTo(cz, "hrad", new string[] {"hrad"});
+		assertAnalyzesTo(cz, "hradu", new string[] {"hrad"});
+		assertAnalyzesTo(cz, "hrade", new string[] {"hrad"});
+		assertAnalyzesTo(cz, "hradem", new string[] {"hrad"});
+		assertAnalyzesTo(cz, "hrady", new string[] {"hrad"});
+		assertAnalyzesTo(cz, "hradech", new string[] {"hrad"});
+		assertAnalyzesTo(cz, "hradům", new string[] {"hrad"});
+		assertAnalyzesTo(cz, "hradů", new string[] {"hrad"});
+
+		/* animate ending with a soft consonant */
+		assertAnalyzesTo(cz, "muž", new string[] {"muh"});
+		assertAnalyzesTo(cz, "muži", new string[] {"muh"});
+		assertAnalyzesTo(cz, "muže", new string[] {"muh"});
+		assertAnalyzesTo(cz, "mužů", new string[] {"muh"});
+		assertAnalyzesTo(cz, "mužům", new string[] {"muh"});
+		assertAnalyzesTo(cz, "mužích", new string[] {"muh"});
+		assertAnalyzesTo(cz, "mužem", new string[] {"muh"});
+
+		/* inanimate ending with a soft consonant */
+		assertAnalyzesTo(cz, "stroj", new string[] {"stroj"});
+		assertAnalyzesTo(cz, "stroje", new string[] {"stroj"});
+		assertAnalyzesTo(cz, "strojů", new string[] {"stroj"});
+		assertAnalyzesTo(cz, "stroji", new string[] {"stroj"});
+		assertAnalyzesTo(cz, "strojům", new string[] {"stroj"});
+		assertAnalyzesTo(cz, "strojích", new string[] {"stroj"});
+		assertAnalyzesTo(cz, "strojem", new string[] {"stroj"});
+
+		/* ending with a */
+		assertAnalyzesTo(cz, "předseda", new string[] {"předsd"});
+		assertAnalyzesTo(cz, "předsedové", new string[] {"předsd"});
+		assertAnalyzesTo(cz, "předsedy", new string[] {"předsd"});
+		assertAnalyzesTo(cz, "předsedů", new string[] {"předsd"});
+		assertAnalyzesTo(cz, "předsedovi", new string[] {"předsd"});
+		assertAnalyzesTo(cz, "předsedům", new string[] {"předsd"});
+		assertAnalyzesTo(cz, "předsedu", new string[] {"předsd"});
+		assertAnalyzesTo(cz, "předsedo", new string[] {"předsd"});
+		assertAnalyzesTo(cz, "předsedech", new string[] {"předsd"});
+		assertAnalyzesTo(cz, "předsedou", new string[] {"předsd"});
+
+		/* ending with e */
+		assertAnalyzesTo(cz, "soudce", new string[] {"soudk"});
+		assertAnalyzesTo(cz, "soudci", new string[] {"soudk"});
+		assertAnalyzesTo(cz, "soudců", new string[] {"soudk"});
+		assertAnalyzesTo(cz, "soudcům", new string[] {"soudk"});
+		assertAnalyzesTo(cz, "soudcích", new string[] {"soudk"});
+		assertAnalyzesTo(cz, "soudcem", new string[] {"soudk"});
+	  }
+
+	  /// <summary>
+	  /// Test showing how feminine noun forms conflate
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFeminineNouns() throws java.io.IOException
+	  public virtual void testFeminineNouns()
+	  {
+		CzechAnalyzer cz = new CzechAnalyzer(TEST_VERSION_CURRENT);
+
+		/* ending with hard consonant */
+		assertAnalyzesTo(cz, "kost", new string[] {"kost"});
+		assertAnalyzesTo(cz, "kosti", new string[] {"kost"});
+		assertAnalyzesTo(cz, "kostí", new string[] {"kost"});
+		assertAnalyzesTo(cz, "kostem", new string[] {"kost"});
+		assertAnalyzesTo(cz, "kostech", new string[] {"kost"});
+		assertAnalyzesTo(cz, "kostmi", new string[] {"kost"});
+
+		/* ending with a soft consonant */
+		// note: in this example sing nom. and sing acc. don't conflate w/ the rest
+		assertAnalyzesTo(cz, "píseň", new string[] {"písň"});
+		assertAnalyzesTo(cz, "písně", new string[] {"písn"});
+		assertAnalyzesTo(cz, "písni", new string[] {"písn"});
+		assertAnalyzesTo(cz, "písněmi", new string[] {"písn"});
+		assertAnalyzesTo(cz, "písních", new string[] {"písn"});
+		assertAnalyzesTo(cz, "písním", new string[] {"písn"});
+
+		/* ending with e */
+		assertAnalyzesTo(cz, "růže", new string[] {"růh"});
+		assertAnalyzesTo(cz, "růží", new string[] {"růh"});
+		assertAnalyzesTo(cz, "růžím", new string[] {"růh"});
+		assertAnalyzesTo(cz, "růžích", new string[] {"růh"});
+		assertAnalyzesTo(cz, "růžemi", new string[] {"růh"});
+		assertAnalyzesTo(cz, "růži", new string[] {"růh"});
+
+		/* ending with a */
+		assertAnalyzesTo(cz, "žena", new string[] {"žn"});
+		assertAnalyzesTo(cz, "ženy", new string[] {"žn"});
+		assertAnalyzesTo(cz, "žen", new string[] {"žn"});
+		assertAnalyzesTo(cz, "ženě", new string[] {"žn"});
+		assertAnalyzesTo(cz, "ženám", new string[] {"žn"});
+		assertAnalyzesTo(cz, "ženu", new string[] {"žn"});
+		assertAnalyzesTo(cz, "ženo", new string[] {"žn"});
+		assertAnalyzesTo(cz, "ženách", new string[] {"žn"});
+		assertAnalyzesTo(cz, "ženou", new string[] {"žn"});
+		assertAnalyzesTo(cz, "ženami", new string[] {"žn"});
+	  }
+
+	  /// <summary>
+	  /// Test showing how neuter noun forms conflate
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNeuterNouns() throws java.io.IOException
+	  public virtual void testNeuterNouns()
+	  {
+		CzechAnalyzer cz = new CzechAnalyzer(TEST_VERSION_CURRENT);
+
+		/* ending with o */
+		assertAnalyzesTo(cz, "město", new string[] {"měst"});
+		assertAnalyzesTo(cz, "města", new string[] {"měst"});
+		assertAnalyzesTo(cz, "měst", new string[] {"měst"});
+		assertAnalyzesTo(cz, "městu", new string[] {"měst"});
+		assertAnalyzesTo(cz, "městům", new string[] {"měst"});
+		assertAnalyzesTo(cz, "městě", new string[] {"měst"});
+		assertAnalyzesTo(cz, "městech", new string[] {"měst"});
+		assertAnalyzesTo(cz, "městem", new string[] {"měst"});
+		assertAnalyzesTo(cz, "městy", new string[] {"měst"});
+
+		/* ending with e */
+		assertAnalyzesTo(cz, "moře", new string[] {"moř"});
+		assertAnalyzesTo(cz, "moří", new string[] {"moř"});
+		assertAnalyzesTo(cz, "mořím", new string[] {"moř"});
+		assertAnalyzesTo(cz, "moři", new string[] {"moř"});
+		assertAnalyzesTo(cz, "mořích", new string[] {"moř"});
+		assertAnalyzesTo(cz, "mořem", new string[] {"moř"});
+
+		/* ending with ě */
+		assertAnalyzesTo(cz, "kuře", new string[] {"kuř"});
+		assertAnalyzesTo(cz, "kuřata", new string[] {"kuř"});
+		assertAnalyzesTo(cz, "kuřete", new string[] {"kuř"});
+		assertAnalyzesTo(cz, "kuřat", new string[] {"kuř"});
+		assertAnalyzesTo(cz, "kuřeti", new string[] {"kuř"});
+		assertAnalyzesTo(cz, "kuřatům", new string[] {"kuř"});
+		assertAnalyzesTo(cz, "kuřatech", new string[] {"kuř"});
+		assertAnalyzesTo(cz, "kuřetem", new string[] {"kuř"});
+		assertAnalyzesTo(cz, "kuřaty", new string[] {"kuř"});
+
+		/* ending with í */
+		assertAnalyzesTo(cz, "stavení", new string[] {"stavn"});
+		assertAnalyzesTo(cz, "stavením", new string[] {"stavn"});
+		assertAnalyzesTo(cz, "staveních", new string[] {"stavn"});
+		assertAnalyzesTo(cz, "staveními", new string[] {"stavn"});
+	  }
+
+	  /// <summary>
+	  /// Test showing how adjectival forms conflate
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testAdjectives() throws java.io.IOException
+	  public virtual void testAdjectives()
+	  {
+		CzechAnalyzer cz = new CzechAnalyzer(TEST_VERSION_CURRENT);
+
+		/* ending with ý/á/é */
+		assertAnalyzesTo(cz, "mladý", new string[] {"mlad"});
+		assertAnalyzesTo(cz, "mladí", new string[] {"mlad"});
+		assertAnalyzesTo(cz, "mladého", new string[] {"mlad"});
+		assertAnalyzesTo(cz, "mladých", new string[] {"mlad"});
+		assertAnalyzesTo(cz, "mladému", new string[] {"mlad"});
+		assertAnalyzesTo(cz, "mladým", new string[] {"mlad"});
+		assertAnalyzesTo(cz, "mladé", new string[] {"mlad"});
+		assertAnalyzesTo(cz, "mladém", new string[] {"mlad"});
+		assertAnalyzesTo(cz, "mladými", new string[] {"mlad"});
+		assertAnalyzesTo(cz, "mladá", new string[] {"mlad"});
+		assertAnalyzesTo(cz, "mladou", new string[] {"mlad"});
+
+		/* ending with í */
+		assertAnalyzesTo(cz, "jarní", new string[] {"jarn"});
+		assertAnalyzesTo(cz, "jarního", new string[] {"jarn"});
+		assertAnalyzesTo(cz, "jarních", new string[] {"jarn"});
+		assertAnalyzesTo(cz, "jarnímu", new string[] {"jarn"});
+		assertAnalyzesTo(cz, "jarním", new string[] {"jarn"});
+		assertAnalyzesTo(cz, "jarními", new string[] {"jarn"});
+	  }
+
+	  /// <summary>
+	  /// Test some possessive suffixes
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testPossessive() throws java.io.IOException
+	  public virtual void testPossessive()
+	  {
+		CzechAnalyzer cz = new CzechAnalyzer(TEST_VERSION_CURRENT);
+		assertAnalyzesTo(cz, "Karlův", new string[] {"karl"});
+		assertAnalyzesTo(cz, "jazykový", new string[] {"jazyk"});
+	  }
+
+	  /// <summary>
+	  /// Test some exceptional rules, implemented as rewrites.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testExceptions() throws java.io.IOException
+	  public virtual void testExceptions()
+	  {
+		CzechAnalyzer cz = new CzechAnalyzer(TEST_VERSION_CURRENT);
+
+		/* rewrite of št -> sk */
+		assertAnalyzesTo(cz, "český", new string[] {"česk"});
+		assertAnalyzesTo(cz, "čeští", new string[] {"česk"});
+
+		/* rewrite of čt -> ck */
+		assertAnalyzesTo(cz, "anglický", new string[] {"anglick"});
+		assertAnalyzesTo(cz, "angličtí", new string[] {"anglick"});
+
+		/* rewrite of z -> h */
+		assertAnalyzesTo(cz, "kniha", new string[] {"knih"});
+		assertAnalyzesTo(cz, "knize", new string[] {"knih"});
+
+		/* rewrite of ž -> h */
+		assertAnalyzesTo(cz, "mazat", new string[] {"mah"});
+		assertAnalyzesTo(cz, "mažu", new string[] {"mah"});
+
+		/* rewrite of c -> k */
+		assertAnalyzesTo(cz, "kluk", new string[] {"kluk"});
+		assertAnalyzesTo(cz, "kluci", new string[] {"kluk"});
+		assertAnalyzesTo(cz, "klucích", new string[] {"kluk"});
+
+		/* rewrite of č -> k */
+		assertAnalyzesTo(cz, "hezký", new string[] {"hezk"});
+		assertAnalyzesTo(cz, "hezčí", new string[] {"hezk"});
+
+		/* rewrite of *ů* -> *o* */
+		assertAnalyzesTo(cz, "hůl", new string[] {"hol"});
+		assertAnalyzesTo(cz, "hole", new string[] {"hol"});
+
+		/* rewrite of e* -> * */
+		assertAnalyzesTo(cz, "deska", new string[] {"desk"});
+		assertAnalyzesTo(cz, "desek", new string[] {"desk"});
+	  }
+
+	  /// <summary>
+	  /// Test that very short words are not stemmed.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testDontStem() throws java.io.IOException
+	  public virtual void testDontStem()
+	  {
+		CzechAnalyzer cz = new CzechAnalyzer(TEST_VERSION_CURRENT);
+		assertAnalyzesTo(cz, "e", new string[] {"e"});
+		assertAnalyzesTo(cz, "zi", new string[] {"zi"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testWithKeywordAttribute() throws java.io.IOException
+	  public virtual void testWithKeywordAttribute()
+	  {
+		CharArraySet set = new CharArraySet(TEST_VERSION_CURRENT, 1, true);
+		set.add("hole");
+		CzechStemFilter filter = new CzechStemFilter(new SetKeywordMarkerFilter(new MockTokenizer(new StringReader("hole desek"), MockTokenizer.WHITESPACE, false), set));
+		assertTokenStreamContents(filter, new string[] {"hole", "desk"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestCzechStemmer outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestCzechStemmer outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new CzechStemFilter(tokenizer));
+		  }
+	  }
+
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Da/TestDanishAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Da/TestDanishAnalyzer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Da/TestDanishAnalyzer.cs
new file mode 100644
index 0000000..00509ee
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Da/TestDanishAnalyzer.cs
@@ -0,0 +1,70 @@
+namespace org.apache.lucene.analysis.da
+{
+
+	/*
+	 * 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 CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+
+	public class TestDanishAnalyzer : BaseTokenStreamTestCase
+	{
+	  /// <summary>
+	  /// This test fails with NPE when the 
+	  /// stopwords file is missing in classpath 
+	  /// </summary>
+	  public virtual void testResourcesAvailable()
+	  {
+		new DanishAnalyzer(TEST_VERSION_CURRENT);
+	  }
+
+	  /// <summary>
+	  /// test stopwords and stemming </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBasics() throws java.io.IOException
+	  public virtual void testBasics()
+	  {
+		Analyzer a = new DanishAnalyzer(TEST_VERSION_CURRENT);
+		// stemming
+		checkOneTerm(a, "undersøg", "undersøg");
+		checkOneTerm(a, "undersøgelse", "undersøg");
+		// stopword
+		assertAnalyzesTo(a, "på", new string[] {});
+	  }
+
+	  /// <summary>
+	  /// test use of exclusion set </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testExclude() throws java.io.IOException
+	  public virtual void testExclude()
+	  {
+		CharArraySet exclusionSet = new CharArraySet(TEST_VERSION_CURRENT, asSet("undersøgelse"), false);
+		Analyzer a = new DanishAnalyzer(TEST_VERSION_CURRENT, DanishAnalyzer.DefaultStopSet, exclusionSet);
+		checkOneTerm(a, "undersøgelse", "undersøgelse");
+		checkOneTerm(a, "undersøg", "undersøg");
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), new DanishAnalyzer(TEST_VERSION_CURRENT), 1000 * RANDOM_MULTIPLIER);
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/De/TestGermanAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/De/TestGermanAnalyzer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/De/TestGermanAnalyzer.cs
new file mode 100644
index 0000000..a5e12f2
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/De/TestGermanAnalyzer.cs
@@ -0,0 +1,85 @@
+namespace org.apache.lucene.analysis.de
+{
+
+	/*
+	 * 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 LowerCaseTokenizer = org.apache.lucene.analysis.core.LowerCaseTokenizer;
+	using SetKeywordMarkerFilter = org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter;
+	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+	using Version = org.apache.lucene.util.Version;
+
+	public class TestGermanAnalyzer : BaseTokenStreamTestCase
+	{
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testReusableTokenStream() throws Exception
+	  public virtual void testReusableTokenStream()
+	  {
+		Analyzer a = new GermanAnalyzer(TEST_VERSION_CURRENT);
+		checkOneTerm(a, "Tisch", "tisch");
+		checkOneTerm(a, "Tische", "tisch");
+		checkOneTerm(a, "Tischen", "tisch");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testWithKeywordAttribute() throws java.io.IOException
+	  public virtual void testWithKeywordAttribute()
+	  {
+		CharArraySet set = new CharArraySet(TEST_VERSION_CURRENT, 1, true);
+		set.add("fischen");
+		GermanStemFilter filter = new GermanStemFilter(new SetKeywordMarkerFilter(new LowerCaseTokenizer(TEST_VERSION_CURRENT, new StringReader("Fischen Trinken")), set));
+		assertTokenStreamContents(filter, new string[] {"fischen", "trink"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStemExclusionTable() throws Exception
+	  public virtual void testStemExclusionTable()
+	  {
+		GermanAnalyzer a = new GermanAnalyzer(TEST_VERSION_CURRENT, CharArraySet.EMPTY_SET, new CharArraySet(TEST_VERSION_CURRENT, asSet("tischen"), false));
+		checkOneTerm(a, "tischen", "tischen");
+	  }
+
+	  /// <summary>
+	  /// test some features of the new snowball filter
+	  /// these only pass with LUCENE_CURRENT, not if you use o.a.l.a.de.GermanStemmer
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testGermanSpecials() throws Exception
+	  public virtual void testGermanSpecials()
+	  {
+		GermanAnalyzer a = new GermanAnalyzer(TEST_VERSION_CURRENT);
+		// a/o/u + e is equivalent to the umlaut form
+		checkOneTerm(a, "Schaltflächen", "schaltflach");
+		checkOneTerm(a, "Schaltflaechen", "schaltflach");
+		// here they are with the old stemmer
+		a = new GermanAnalyzer(Version.LUCENE_30);
+		checkOneTerm(a, "Schaltflächen", "schaltflach");
+		checkOneTerm(a, "Schaltflaechen", "schaltflaech");
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), new GermanAnalyzer(TEST_VERSION_CURRENT), 1000 * RANDOM_MULTIPLIER);
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/De/TestGermanLightStemFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/De/TestGermanLightStemFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/De/TestGermanLightStemFilter.cs
new file mode 100644
index 0000000..08614c6
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/De/TestGermanLightStemFilter.cs
@@ -0,0 +1,123 @@
+namespace org.apache.lucene.analysis.de
+{
+
+	/*
+	 * 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 KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+	using SetKeywordMarkerFilter = org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter;
+	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+
+//JAVA TO C# CONVERTER TODO TASK: This Java 'import static' statement cannot be converted to C#:
+//	import static org.apache.lucene.analysis.VocabularyAssert.*;
+
+	/// <summary>
+	/// Simple tests for <seealso cref="GermanLightStemFilter"/>
+	/// </summary>
+	public class TestGermanLightStemFilter : BaseTokenStreamTestCase
+	{
+	  private Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper();
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  public AnalyzerAnonymousInnerClassHelper()
+		  {
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer source = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(source, new GermanLightStemFilter(source));
+		  }
+	  }
+
+	  /// <summary>
+	  /// Test against a vocabulary from the reference impl </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testVocabulary() throws java.io.IOException
+	  public virtual void testVocabulary()
+	  {
+		assertVocabulary(analyzer, getDataFile("delighttestdata.zip"), "delight.txt");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testKeyword() throws java.io.IOException
+	  public virtual void testKeyword()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.util.CharArraySet exclusionSet = new org.apache.lucene.analysis.util.CharArraySet(TEST_VERSION_CURRENT, asSet("sängerinnen"), false);
+		CharArraySet exclusionSet = new CharArraySet(TEST_VERSION_CURRENT, asSet("sängerinnen"), false);
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper2(this, exclusionSet);
+		checkOneTerm(a, "sängerinnen", "sängerinnen");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestGermanLightStemFilter outerInstance;
+
+		  private CharArraySet exclusionSet;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestGermanLightStemFilter outerInstance, CharArraySet exclusionSet)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.exclusionSet = exclusionSet;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer source = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			TokenStream sink = new SetKeywordMarkerFilter(source, exclusionSet);
+			return new TokenStreamComponents(source, new GermanLightStemFilter(sink));
+		  }
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), analyzer, 1000 * RANDOM_MULTIPLIER);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper3(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper3 : Analyzer
+	  {
+		  private readonly TestGermanLightStemFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper3(TestGermanLightStemFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new GermanLightStemFilter(tokenizer));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/De/TestGermanLightStemFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/De/TestGermanLightStemFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/De/TestGermanLightStemFilterFactory.cs
new file mode 100644
index 0000000..d0c9dea
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/De/TestGermanLightStemFilterFactory.cs
@@ -0,0 +1,57 @@
+namespace org.apache.lucene.analysis.de
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the German light stem factory is working.
+	/// </summary>
+	public class TestGermanLightStemFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStemming() throws Exception
+	  public virtual void testStemming()
+	  {
+		Reader reader = new StringReader("häuser");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("GermanLightStem").create(stream);
+		assertTokenStreamContents(stream, new string[] {"haus"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("GermanLightStem", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/De/TestGermanMinimalStemFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/De/TestGermanMinimalStemFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/De/TestGermanMinimalStemFilter.cs
new file mode 100644
index 0000000..2bb224f
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/De/TestGermanMinimalStemFilter.cs
@@ -0,0 +1,139 @@
+namespace org.apache.lucene.analysis.de
+{
+
+	/*
+	 * 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 KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+	using SetKeywordMarkerFilter = org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter;
+	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+
+//JAVA TO C# CONVERTER TODO TASK: This Java 'import static' statement cannot be converted to C#:
+//	import static org.apache.lucene.analysis.VocabularyAssert.*;
+
+	/// <summary>
+	/// Simple tests for <seealso cref="GermanMinimalStemFilter"/>
+	/// </summary>
+	public class TestGermanMinimalStemFilter : BaseTokenStreamTestCase
+	{
+	  private Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper();
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  public AnalyzerAnonymousInnerClassHelper()
+		  {
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer source = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(source, new GermanMinimalStemFilter(source));
+		  }
+	  }
+
+	  /// <summary>
+	  /// Test some examples from the paper </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testExamples() throws java.io.IOException
+	  public virtual void testExamples()
+	  {
+		checkOneTerm(analyzer, "sängerinnen", "sangerin");
+		checkOneTerm(analyzer, "frauen", "frau");
+		checkOneTerm(analyzer, "kenntnisse", "kenntnis");
+		checkOneTerm(analyzer, "staates", "staat");
+		checkOneTerm(analyzer, "bilder", "bild");
+		checkOneTerm(analyzer, "boote", "boot");
+		checkOneTerm(analyzer, "götter", "gott");
+		checkOneTerm(analyzer, "äpfel", "apfel");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testKeyword() throws java.io.IOException
+	  public virtual void testKeyword()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.util.CharArraySet exclusionSet = new org.apache.lucene.analysis.util.CharArraySet(TEST_VERSION_CURRENT, asSet("sängerinnen"), false);
+		CharArraySet exclusionSet = new CharArraySet(TEST_VERSION_CURRENT, asSet("sängerinnen"), false);
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper2(this, exclusionSet);
+		checkOneTerm(a, "sängerinnen", "sängerinnen");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestGermanMinimalStemFilter outerInstance;
+
+		  private CharArraySet exclusionSet;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestGermanMinimalStemFilter outerInstance, CharArraySet exclusionSet)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.exclusionSet = exclusionSet;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer source = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			TokenStream sink = new SetKeywordMarkerFilter(source, exclusionSet);
+			return new TokenStreamComponents(source, new GermanMinimalStemFilter(sink));
+		  }
+	  }
+
+	  /// <summary>
+	  /// Test against a vocabulary from the reference impl </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testVocabulary() throws java.io.IOException
+	  public virtual void testVocabulary()
+	  {
+		assertVocabulary(analyzer, getDataFile("deminimaltestdata.zip"), "deminimal.txt");
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), analyzer, 1000 * RANDOM_MULTIPLIER);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper3(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper3 : Analyzer
+	  {
+		  private readonly TestGermanMinimalStemFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper3(TestGermanMinimalStemFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new GermanMinimalStemFilter(tokenizer));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/De/TestGermanMinimalStemFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/De/TestGermanMinimalStemFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/De/TestGermanMinimalStemFilterFactory.cs
new file mode 100644
index 0000000..6abbb9e
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/De/TestGermanMinimalStemFilterFactory.cs
@@ -0,0 +1,57 @@
+namespace org.apache.lucene.analysis.de
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the German minimal stem factory is working.
+	/// </summary>
+	public class TestGermanMinimalStemFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStemming() throws Exception
+	  public virtual void testStemming()
+	  {
+		Reader reader = new StringReader("bilder");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("GermanMinimalStem").create(stream);
+		assertTokenStreamContents(stream, new string[] {"bild"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("GermanMinimalStem", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/De/TestGermanNormalizationFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/De/TestGermanNormalizationFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/De/TestGermanNormalizationFilter.cs
new file mode 100644
index 0000000..5bb92b5
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/De/TestGermanNormalizationFilter.cs
@@ -0,0 +1,114 @@
+namespace org.apache.lucene.analysis.de
+{
+
+	/*
+	 * 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 KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+
+	/// <summary>
+	/// Tests <seealso cref="GermanNormalizationFilter"/>
+	/// </summary>
+	public class TestGermanNormalizationFilter : BaseTokenStreamTestCase
+	{
+	  private Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper();
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  public AnalyzerAnonymousInnerClassHelper()
+		  {
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string field, Reader reader)
+		  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.Tokenizer tokenizer = new org.apache.lucene.analysis.MockTokenizer(reader, org.apache.lucene.analysis.MockTokenizer.WHITESPACE, false);
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.TokenStream stream = new GermanNormalizationFilter(tokenizer);
+			TokenStream stream = new GermanNormalizationFilter(tokenizer);
+			return new TokenStreamComponents(tokenizer, stream);
+		  }
+	  }
+
+	  /// <summary>
+	  /// Tests that a/o/u + e is equivalent to the umlaut form
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBasicExamples() throws java.io.IOException
+	  public virtual void testBasicExamples()
+	  {
+		checkOneTerm(analyzer, "Schaltflächen", "Schaltflachen");
+		checkOneTerm(analyzer, "Schaltflaechen", "Schaltflachen");
+	  }
+
+	  /// <summary>
+	  /// Tests the specific heuristic that ue is not folded after a vowel or q.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testUHeuristic() throws java.io.IOException
+	  public virtual void testUHeuristic()
+	  {
+		checkOneTerm(analyzer, "dauer", "dauer");
+	  }
+
+	  /// <summary>
+	  /// Tests german specific folding of sharp-s
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testSpecialFolding() throws java.io.IOException
+	  public virtual void testSpecialFolding()
+	  {
+		checkOneTerm(analyzer, "weißbier", "weissbier");
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), analyzer, 1000 * RANDOM_MULTIPLIER);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper2(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestGermanNormalizationFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestGermanNormalizationFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new GermanNormalizationFilter(tokenizer));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/De/TestGermanNormalizationFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/De/TestGermanNormalizationFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/De/TestGermanNormalizationFilterFactory.cs
new file mode 100644
index 0000000..e3da605
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/De/TestGermanNormalizationFilterFactory.cs
@@ -0,0 +1,57 @@
+namespace org.apache.lucene.analysis.de
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the German normalization factory is working.
+	/// </summary>
+	public class TestGermanNormalizationFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStemming() throws Exception
+	  public virtual void testStemming()
+	  {
+		Reader reader = new StringReader("weißbier");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("GermanNormalization").create(stream);
+		assertTokenStreamContents(stream, new string[] {"weissbier"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("GermanNormalization", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/De/TestGermanStemFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/De/TestGermanStemFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/De/TestGermanStemFilter.cs
new file mode 100644
index 0000000..c31b02d
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/De/TestGermanStemFilter.cs
@@ -0,0 +1,136 @@
+namespace org.apache.lucene.analysis.de
+{
+
+	/*
+	 * 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 KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+	using LowerCaseFilter = org.apache.lucene.analysis.core.LowerCaseFilter;
+	using SetKeywordMarkerFilter = org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter;
+	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+
+//JAVA TO C# CONVERTER TODO TASK: This Java 'import static' statement cannot be converted to C#:
+//	import static org.apache.lucene.analysis.VocabularyAssert.*;
+
+	/// <summary>
+	/// Test the German stemmer. The stemming algorithm is known to work less 
+	/// than perfect, as it doesn't use any word lists with exceptions. We 
+	/// also check some of the cases where the algorithm is wrong.
+	/// 
+	/// </summary>
+	public class TestGermanStemFilter : BaseTokenStreamTestCase
+	{
+	  internal Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper();
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  public AnalyzerAnonymousInnerClassHelper()
+		  {
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer t = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(t, new GermanStemFilter(new LowerCaseFilter(TEST_VERSION_CURRENT, t)));
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStemming() throws Exception
+	  public virtual void testStemming()
+	  {
+		System.IO.Stream vocOut = this.GetType().getResourceAsStream("data.txt");
+		assertVocabulary(analyzer, vocOut);
+		vocOut.Close();
+	  }
+
+	  // LUCENE-3043: we use keywordtokenizer in this test,
+	  // so ensure the stemmer does not crash on zero-length strings.
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmpty() throws Exception
+	  public virtual void testEmpty()
+	  {
+		assertAnalyzesTo(analyzer, "", new string[] {""});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testKeyword() throws java.io.IOException
+	  public virtual void testKeyword()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.util.CharArraySet exclusionSet = new org.apache.lucene.analysis.util.CharArraySet(TEST_VERSION_CURRENT, asSet("sängerinnen"), false);
+		CharArraySet exclusionSet = new CharArraySet(TEST_VERSION_CURRENT, asSet("sängerinnen"), false);
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper2(this, exclusionSet);
+		checkOneTerm(a, "sängerinnen", "sängerinnen");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestGermanStemFilter outerInstance;
+
+		  private CharArraySet exclusionSet;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestGermanStemFilter outerInstance, CharArraySet exclusionSet)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.exclusionSet = exclusionSet;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer source = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			TokenStream sink = new SetKeywordMarkerFilter(source, exclusionSet);
+			return new TokenStreamComponents(source, new GermanStemFilter(sink));
+		  }
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), analyzer, 1000 * RANDOM_MULTIPLIER);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper3(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper3 : Analyzer
+	  {
+		  private readonly TestGermanStemFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper3(TestGermanStemFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new GermanStemFilter(tokenizer));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/De/TestGermanStemFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/De/TestGermanStemFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/De/TestGermanStemFilterFactory.cs
new file mode 100644
index 0000000..f4b9e73
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/De/TestGermanStemFilterFactory.cs
@@ -0,0 +1,60 @@
+namespace org.apache.lucene.analysis.de
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the German stem filter factory is working.
+	/// </summary>
+	public class TestGermanStemFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+	  /// <summary>
+	  /// Ensure the filter actually stems text.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStemming() throws Exception
+	  public virtual void testStemming()
+	  {
+		Reader reader = new StringReader("Tischen");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("GermanStem").create(stream);
+		assertTokenStreamContents(stream, new string[] {"tisch"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("GermanStem", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/El/GreekAnalyzerTest.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/El/GreekAnalyzerTest.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/El/GreekAnalyzerTest.cs
new file mode 100644
index 0000000..f18f101
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/El/GreekAnalyzerTest.cs
@@ -0,0 +1,98 @@
+using System;
+
+namespace org.apache.lucene.analysis.el
+{
+
+	/// <summary>
+	/// Copyright 2005 The Apache Software Foundation
+	/// 
+	/// Licensed 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>
+
+	using Version = org.apache.lucene.util.Version;
+
+	/// <summary>
+	/// A unit test class for verifying the correct operation of the GreekAnalyzer.
+	/// 
+	/// </summary>
+	public class GreekAnalyzerTest : BaseTokenStreamTestCase
+	{
+
+	  /// <summary>
+	  /// Test the analysis of various greek strings.
+	  /// </summary>
+	  /// <exception cref="Exception"> in case an error occurs </exception>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testAnalyzer() throws Exception
+	  public virtual void testAnalyzer()
+	  {
+		Analyzer a = new GreekAnalyzer(TEST_VERSION_CURRENT);
+		// Verify the correct analysis of capitals and small accented letters, and
+		// stemming
+		assertAnalyzesTo(a, "Μία εξαιρετικά καλή και πλούσια σειρά χαρακτήρων της Ελληνικής γλώσσας", new string[] {"μια", "εξαιρετ", "καλ", "πλουσ", "σειρ", "χαρακτηρ", "ελληνικ", "γλωσσ"});
+		// Verify the correct analysis of small letters with diaeresis and the elimination
+		// of punctuation marks
+		assertAnalyzesTo(a, "Προϊόντα (και)     [πολλαπλές] - ΑΝΑΓΚΕΣ", new string[] {"προιοντ", "πολλαπλ", "αναγκ"});
+		// Verify the correct analysis of capital accented letters and capital letters with diaeresis,
+		// as well as the elimination of stop words
+		assertAnalyzesTo(a, "ΠΡΟΫΠΟΘΕΣΕΙΣ  Άψογος, ο μεστός και οι άλλοι", new string[] {"προυποθεσ", "αψογ", "μεστ", "αλλ"});
+	  }
+
+	  /// <summary>
+	  /// Test the analysis of various greek strings.
+	  /// </summary>
+	  /// <exception cref="Exception"> in case an error occurs </exception>
+	  /// @deprecated (3.1) Remove this test when support for 3.0 is no longer needed 
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Deprecated("(3.1) Remove this test when support for 3.0 is no longer needed") public void testAnalyzerBWCompat() throws Exception
+	  [Obsolete("(3.1) Remove this test when support for 3.0 is no longer needed")]
+	  public virtual void testAnalyzerBWCompat()
+	  {
+		Analyzer a = new GreekAnalyzer(Version.LUCENE_30);
+		// Verify the correct analysis of capitals and small accented letters
+		assertAnalyzesTo(a, "Μία εξαιρετικά καλή και πλούσια σειρά χαρακτήρων της Ελληνικής γλώσσας", new string[] {"μια", "εξαιρετικα", "καλη", "πλουσια", "σειρα", "χαρακτηρων", "ελληνικησ", "γλωσσασ"});
+		// Verify the correct analysis of small letters with diaeresis and the elimination
+		// of punctuation marks
+		assertAnalyzesTo(a, "Προϊόντα (και)     [πολλαπλές] - ΑΝΑΓΚΕΣ", new string[] {"προιοντα", "πολλαπλεσ", "αναγκεσ"});
+		// Verify the correct analysis of capital accented letters and capital letters with diaeresis,
+		// as well as the elimination of stop words
+		assertAnalyzesTo(a, "ΠΡΟΫΠΟΘΕΣΕΙΣ  Άψογος, ο μεστός και οι άλλοι", new string[] {"προυποθεσεισ", "αψογοσ", "μεστοσ", "αλλοι"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testReusableTokenStream() throws Exception
+	  public virtual void testReusableTokenStream()
+	  {
+		Analyzer a = new GreekAnalyzer(TEST_VERSION_CURRENT);
+		// Verify the correct analysis of capitals and small accented letters, and
+		// stemming
+		assertAnalyzesTo(a, "Μία εξαιρετικά καλή και πλούσια σειρά χαρακτήρων της Ελληνικής γλώσσας", new string[] {"μια", "εξαιρετ", "καλ", "πλουσ", "σειρ", "χαρακτηρ", "ελληνικ", "γλωσσ"});
+		// Verify the correct analysis of small letters with diaeresis and the elimination
+		// of punctuation marks
+		assertAnalyzesTo(a, "Προϊόντα (και)     [πολλαπλές] - ΑΝΑΓΚΕΣ", new string[] {"προιοντ", "πολλαπλ", "αναγκ"});
+		// Verify the correct analysis of capital accented letters and capital letters with diaeresis,
+		// as well as the elimination of stop words
+		assertAnalyzesTo(a, "ΠΡΟΫΠΟΘΕΣΕΙΣ  Άψογος, ο μεστός και οι άλλοι", new string[] {"προυποθεσ", "αψογ", "μεστ", "αλλ"});
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), new GreekAnalyzer(TEST_VERSION_CURRENT), 1000 * RANDOM_MULTIPLIER);
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/El/TestGreekLowerCaseFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/El/TestGreekLowerCaseFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/El/TestGreekLowerCaseFilterFactory.cs
new file mode 100644
index 0000000..2922563
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/El/TestGreekLowerCaseFilterFactory.cs
@@ -0,0 +1,60 @@
+namespace org.apache.lucene.analysis.el
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the Greek lowercase filter factory is working.
+	/// </summary>
+	public class TestGreekLowerCaseFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+	  /// <summary>
+	  /// Ensure the filter actually lowercases (and a bit more) greek text.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNormalization() throws Exception
+	  public virtual void testNormalization()
+	  {
+		Reader reader = new StringReader("Μάϊος ΜΆΪΟΣ");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("GreekLowerCase").create(stream);
+		assertTokenStreamContents(stream, new string[] {"μαιοσ", "μαιοσ"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("GreekLowerCase", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/El/TestGreekStemFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/El/TestGreekStemFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/El/TestGreekStemFilterFactory.cs
new file mode 100644
index 0000000..e26eca3
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/El/TestGreekStemFilterFactory.cs
@@ -0,0 +1,58 @@
+namespace org.apache.lucene.analysis.el
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the Greek stem filter factory is working.
+	/// </summary>
+	public class TestGreekStemFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStemming() throws Exception
+	  public virtual void testStemming()
+	  {
+		Reader reader = new StringReader("άνθρωπος");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("GreekLowerCase").create(stream);
+		stream = tokenFilterFactory("GreekStem").create(stream);
+		assertTokenStreamContents(stream, new string[] {"ανθρωπ"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("GreekStem", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file


[26/27] lucenenet git commit: adding converted analysis common tests

Posted by sy...@apache.org.
adding converted analysis common tests


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

Branch: refs/heads/master
Commit: c64856a7ba290b2cbd2129c1c33bb9cd39d6a938
Parents: 812e1c5
Author: Laimonas Simutis <la...@gmail.com>
Authored: Sun Dec 6 08:31:22 2015 -0500
Committer: Laimonas Simutis <la...@gmail.com>
Committed: Sun Dec 6 08:31:22 2015 -0500

----------------------------------------------------------------------
 .../Analysis/Ar/TestArabicAnalyzer.cs           |  122 +
 .../Analysis/Ar/TestArabicFilters.cs            |  131 +
 .../Analysis/Ar/TestArabicLetterTokenizer.cs    |   52 +
 .../Ar/TestArabicNormalizationFilter.cs         |  164 +
 .../Analysis/Ar/TestArabicStemFilter.cs         |  227 +
 .../Analysis/Bg/TestBulgarianAnalyzer.cs        |  100 +
 .../Bg/TestBulgarianStemFilterFactory.cs        |   60 +
 .../Analysis/Bg/TestBulgarianStemmer.cs         |  266 ++
 .../Br/TestBrazilianStemFilterFactory.cs        |   60 +
 .../Analysis/Br/TestBrazilianStemmer.cs         |  212 +
 .../Analysis/Ca/TestCatalanAnalyzer.cs          |   80 +
 .../Charfilter/HTMLStripCharFilterTest.cs       |  570 +++
 .../TestHTMLStripCharFilterFactory.cs           |  121 +
 .../Charfilter/TestMappingCharFilter.cs         |  636 +++
 .../Charfilter/TestMappingCharFilterFactory.cs  |   82 +
 .../Analysis/Cjk/TestCJKAnalyzer.cs             |  289 ++
 .../Analysis/Cjk/TestCJKBigramFilter.cs         |  171 +
 .../Analysis/Cjk/TestCJKBigramFilterFactory.cs  |   77 +
 .../Analysis/Cjk/TestCJKTokenizer.cs            |  240 +
 .../Analysis/Cjk/TestCJKTokenizerFactory.cs     |   62 +
 .../Analysis/Cjk/TestCJKWidthFilter.cs          |  100 +
 .../Analysis/Cjk/TestCJKWidthFilterFactory.cs   |   57 +
 .../Analysis/Ckb/TestSoraniAnalyzer.cs          |   82 +
 .../Ckb/TestSoraniNormalizationFilter.cs        |  122 +
 .../Ckb/TestSoraniNormalizationFilterFactory.cs |   58 +
 .../Analysis/Ckb/TestSoraniStemFilter.cs        |  144 +
 .../Analysis/Ckb/TestSoraniStemFilterFactory.cs |   58 +
 .../Analysis/Cn/TestChineseFilterFactory.cs     |   60 +
 .../Analysis/Cn/TestChineseTokenizer.cs         |  151 +
 .../Analysis/Cn/TestChineseTokenizerFactory.cs  |   59 +
 .../Commongrams/CommonGramsFilterTest.cs        |  346 ++
 .../Commongrams/TestCommonGramsFilterFactory.cs |  101 +
 .../TestCommonGramsQueryFilterFactory.cs        |  101 +
 .../Compound/TestCompoundWordTokenFilter.cs     |  412 ++
 ...tDictionaryCompoundWordTokenFilterFactory.cs |   60 +
 ...HyphenationCompoundWordTokenFilterFactory.cs |   77 +
 .../Core/TestAllAnalyzersHaveFactories.cs       |  193 +
 .../Analysis/Core/TestAnalyzers.cs              |  314 ++
 .../Analysis/Core/TestBugInSomething.cs         |  383 ++
 .../Analysis/Core/TestClassicAnalyzer.cs        |  395 ++
 .../Analysis/Core/TestDuelingAnalyzers.cs       |  302 ++
 .../Analysis/Core/TestFactories.cs              |  263 ++
 .../Analysis/Core/TestKeywordAnalyzer.cs        |  143 +
 .../Analysis/Core/TestRandomChains.cs           | 1587 +++++++
 .../Analysis/Core/TestStandardAnalyzer.cs       |  453 ++
 .../Analysis/Core/TestStopAnalyzer.cs           |  134 +
 .../Analysis/Core/TestStopFilter.cs             |  243 +
 .../Analysis/Core/TestStopFilterFactory.cs      |  116 +
 .../Analysis/Core/TestTypeTokenFilter.cs        |  121 +
 .../Analysis/Core/TestTypeTokenFilterFactory.cs |  102 +
 .../Analysis/Core/TestUAX29URLEmailAnalyzer.cs  |  361 ++
 .../Analysis/Core/TestUAX29URLEmailTokenizer.cs |  737 ++++
 .../Analysis/Core/WordBreakTestUnicode_6_3_0.cs | 4171 ++++++++++++++++++
 .../Analysis/Cz/TestCzechAnalyzer.cs            |   91 +
 .../Analysis/Cz/TestCzechStemFilterFactory.cs   |   60 +
 .../Analysis/Cz/TestCzechStemmer.cs             |  333 ++
 .../Analysis/Da/TestDanishAnalyzer.cs           |   70 +
 .../Analysis/De/TestGermanAnalyzer.cs           |   85 +
 .../Analysis/De/TestGermanLightStemFilter.cs    |  123 +
 .../De/TestGermanLightStemFilterFactory.cs      |   57 +
 .../Analysis/De/TestGermanMinimalStemFilter.cs  |  139 +
 .../De/TestGermanMinimalStemFilterFactory.cs    |   57 +
 .../De/TestGermanNormalizationFilter.cs         |  114 +
 .../De/TestGermanNormalizationFilterFactory.cs  |   57 +
 .../Analysis/De/TestGermanStemFilter.cs         |  136 +
 .../Analysis/De/TestGermanStemFilterFactory.cs  |   60 +
 .../Analysis/El/GreekAnalyzerTest.cs            |   98 +
 .../El/TestGreekLowerCaseFilterFactory.cs       |   60 +
 .../Analysis/El/TestGreekStemFilterFactory.cs   |   58 +
 .../Analysis/El/TestGreekStemmer.cs             |  571 +++
 .../Analysis/En/TestEnglishAnalyzer.cs          |   74 +
 .../Analysis/En/TestEnglishMinimalStemFilter.cs |   95 +
 .../En/TestEnglishMinimalStemFilterFactory.cs   |   57 +
 .../Analysis/En/TestKStemFilterFactory.cs       |   57 +
 .../Analysis/En/TestKStemmer.cs                 |  124 +
 .../Analysis/En/TestPorterStemFilter.cs         |  105 +
 .../Analysis/En/TestPorterStemFilterFactory.cs  |   60 +
 .../Analysis/Es/TestSpanishAnalyzer.cs          |   70 +
 .../Analysis/Es/TestSpanishLightStemFilter.cs   |   90 +
 .../Es/TestSpanishLightStemFilterFactory.cs     |   57 +
 .../Analysis/Eu/TestBasqueAnalyzer.cs           |   70 +
 .../Analysis/Fa/TestPersianAnalyzer.cs          |  252 ++
 .../Analysis/Fa/TestPersianCharFilter.cs        |   60 +
 .../Fa/TestPersianNormalizationFilter.cs        |  110 +
 .../Fa/TestPersianNormalizationFilterFactory.cs |   60 +
 .../Analysis/Fi/TestFinnishAnalyzer.cs          |   70 +
 .../Analysis/Fi/TestFinnishLightStemFilter.cs   |  123 +
 .../Fi/TestFinnishLightStemFilterFactory.cs     |   57 +
 .../Analysis/Fr/TestFrenchAnalyzer.cs           |  202 +
 .../Analysis/Fr/TestFrenchLightStemFilter.cs    |  257 ++
 .../Fr/TestFrenchLightStemFilterFactory.cs      |   57 +
 .../Analysis/Fr/TestFrenchMinimalStemFilter.cs  |  141 +
 .../Fr/TestFrenchMinimalStemFilterFactory.cs    |   57 +
 .../Analysis/Ga/TestIrishAnalyzer.cs            |   90 +
 .../Analysis/Ga/TestIrishLowerCaseFilter.cs     |   67 +
 .../Ga/TestIrishLowerCaseFilterFactory.cs       |   57 +
 .../Analysis/Gl/TestGalicianAnalyzer.cs         |   70 +
 .../Gl/TestGalicianMinimalStemFilter.cs         |  129 +
 .../Gl/TestGalicianMinimalStemFilterFactory.cs  |   57 +
 .../Analysis/Gl/TestGalicianStemFilter.cs       |   85 +
 .../Gl/TestGalicianStemFilterFactory.cs         |   57 +
 .../Analysis/Hi/TestHindiAnalyzer.cs            |   66 +
 .../Analysis/Hi/TestHindiFilters.cs             |  109 +
 .../Analysis/Hi/TestHindiNormalizer.cs          |   98 +
 .../Analysis/Hi/TestHindiStemmer.cs             |  126 +
 .../Analysis/Hu/TestHungarianAnalyzer.cs        |   70 +
 .../Analysis/Hu/TestHungarianLightStemFilter.cs |  114 +
 .../Hu/TestHungarianLightStemFilterFactory.cs   |   57 +
 .../Analysis/Hunspell/StemmerTestBase.cs        |   95 +
 .../Analysis/Hunspell/TestAllDictionaries.cs    |   99 +
 .../Analysis/Hunspell/TestAllDictionaries2.cs   |   99 +
 .../Analysis/Hunspell/TestCaseInsensitive.cs    |   90 +
 .../Analysis/Hunspell/TestCircumfix.cs          |   46 +
 .../Analysis/Hunspell/TestComplexPrefix.cs      |   47 +
 .../Analysis/Hunspell/TestCondition.cs          |   50 +
 .../Analysis/Hunspell/TestConv.cs               |   44 +
 .../Analysis/Hunspell/TestDependencies.cs       |   47 +
 .../Analysis/Hunspell/TestDictionary.cs         |  293 ++
 .../Analysis/Hunspell/TestEscaped.cs            |   44 +
 .../Analysis/Hunspell/TestFlagLong.cs           |   41 +
 .../Analysis/Hunspell/TestFlagNum.cs            |   41 +
 .../Analysis/Hunspell/TestHomonyms.cs           |   40 +
 .../Analysis/Hunspell/TestHunspellStemFilter.cs |  178 +
 .../Hunspell/TestHunspellStemFilterFactory.cs   |   57 +
 .../Analysis/Hunspell/TestIgnore.cs             |   44 +
 .../Analysis/Hunspell/TestMorph.cs              |   42 +
 .../Analysis/Hunspell/TestOptionalCondition.cs  |   50 +
 .../Analysis/Hunspell/TestStemmer.cs            |   88 +
 .../Analysis/Hunspell/TestTwoFold.cs            |   45 +
 .../Analysis/Hunspell/TestTwoSuffixes.cs        |   44 +
 .../Analysis/Hy/TestArmenianAnalyzer.cs         |   70 +
 .../Analysis/Id/TestIndonesianAnalyzer.cs       |   70 +
 .../Id/TestIndonesianStemFilterFactory.cs       |   73 +
 .../Analysis/Id/TestIndonesianStemmer.cs        |  187 +
 .../Analysis/In/TestIndicNormalizer.cs          |   80 +
 .../Analysis/It/TestItalianAnalyzer.cs          |   94 +
 .../Analysis/It/TestItalianLightStemFilter.cs   |   90 +
 .../It/TestItalianLightStemFilterFactory.cs     |   57 +
 .../Analysis/Lv/TestLatvianAnalyzer.cs          |   70 +
 .../Analysis/Lv/TestLatvianStemFilterFactory.cs |   57 +
 .../Analysis/Lv/TestLatvianStemmer.cs           |  328 ++
 .../Miscellaneous/PatternAnalyzerTest.cs        |  214 +
 .../Miscellaneous/TestASCIIFoldingFilter.cs     |  284 ++
 .../Miscellaneous/TestCapitalizationFilter.cs   |  177 +
 .../TestCapitalizationFilterFactory.cs          |  308 ++
 .../Miscellaneous/TestCodepointCountFilter.cs   |   99 +
 .../TestCodepointCountFilterFactory.cs          |   73 +
 .../Miscellaneous/TestEmptyTokenStream.cs       |   82 +
 .../Miscellaneous/TestHyphenatedWordsFilter.cs  |  117 +
 .../Miscellaneous/TestKeepFilterFactory.cs      |   63 +
 .../Miscellaneous/TestKeepWordFilter.cs         |  102 +
 .../Miscellaneous/TestKeywordMarkerFilter.cs    |  110 +
 .../TestKeywordMarkerFilterFactory.cs           |  115 +
 .../Miscellaneous/TestKeywordRepeatFilter.cs    |   48 +
 .../Analysis/Miscellaneous/TestLengthFilter.cs  |   86 +
 .../Miscellaneous/TestLengthFilterFactory.cs    |   85 +
 .../TestLimitTokenCountAnalyzer.cs              |  103 +
 .../Miscellaneous/TestLimitTokenCountFilter.cs  |   48 +
 .../TestLimitTokenCountFilterFactory.cs         |   79 +
 .../TestLimitTokenPositionFilter.cs             |  104 +
 .../TestLimitTokenPositionFilterFactory.cs      |  105 +
 .../TestLucene47WordDelimiterFilter.cs          |  446 ++
 .../TestPerFieldAnalyzerWrapper.cs              |  110 +
 .../TestPrefixAndSuffixAwareTokenFilter.cs      |   42 +
 .../Miscellaneous/TestPrefixAwareTokenFilter.cs |   50 +
 .../TestRemoveDuplicatesTokenFilter.cs          |  231 +
 .../TestRemoveDuplicatesTokenFilterFactory.cs   |   70 +
 .../TestScandinavianFoldingFilter.cs            |  155 +
 .../TestScandinavianFoldingFilterFactory.cs     |   53 +
 .../TestScandinavianNormalizationFilter.cs      |  154 +
 ...estScandinavianNormalizationFilterFactory.cs |   53 +
 .../Miscellaneous/TestSingleTokenTokenFilter.cs |   52 +
 .../Miscellaneous/TestStemmerOverrideFilter.cs  |  157 +
 .../TestStemmerOverrideFilterFactory.cs         |   73 +
 .../Analysis/Miscellaneous/TestTrimFilter.cs    |  180 +
 .../Miscellaneous/TestTrimFilterFactory.cs      |   57 +
 .../Miscellaneous/TestTruncateTokenFilter.cs    |   47 +
 .../TestTruncateTokenFilterFactory.cs           |   81 +
 .../Miscellaneous/TestWordDelimiterFilter.cs    |  568 +++
 .../Analysis/Ngram/EdgeNGramTokenFilterTest.cs  |  407 ++
 .../Analysis/Ngram/EdgeNGramTokenizerTest.cs    |  329 ++
 .../Analysis/Ngram/NGramTokenFilterTest.cs      |  288 ++
 .../Analysis/Ngram/NGramTokenizerTest.cs        |  386 ++
 .../Analysis/Ngram/TestNGramFilters.cs          |  203 +
 .../Analysis/Nl/TestDutchStemmer.cs             |  255 ++
 .../Analysis/No/TestNorwegianAnalyzer.cs        |   70 +
 .../Analysis/No/TestNorwegianLightStemFilter.cs |  157 +
 .../No/TestNorwegianLightStemFilterFactory.cs   |   81 +
 .../No/TestNorwegianMinimalStemFilter.cs        |  156 +
 .../No/TestNorwegianMinimalStemFilterFactory.cs |   81 +
 .../Analysis/Path/TestPathHierarchyTokenizer.cs |  223 +
 .../Path/TestReversePathHierarchyTokenizer.cs   |  191 +
 .../TestPatternCaptureGroupTokenFilter.cs       |  231 +
 .../Pattern/TestPatternReplaceCharFilter.cs     |  313 ++
 .../TestPatternReplaceCharFilterFactory.cs      |   86 +
 .../Pattern/TestPatternReplaceFilter.cs         |  145 +
 .../Pattern/TestPatternReplaceFilterFactory.cs  |   59 +
 .../Analysis/Pattern/TestPatternTokenizer.cs    |  170 +
 .../Pattern/TestPatternTokenizerFactory.cs      |   58 +
 .../Payloads/DelimitedPayloadTokenFilterTest.cs |  173 +
 .../Payloads/NumericPayloadTokenFilterTest.cs   |   93 +
 .../TestDelimitedPayloadTokenFilterFactory.cs   |   90 +
 .../TokenOffsetPayloadTokenFilterTest.cs        |   56 +
 .../Payloads/TypeAsPayloadTokenFilterTest.cs    |   81 +
 .../Analysis/Position/PositionFilterTest.cs     |  112 +
 .../Analysis/Pt/TestPortugueseAnalyzer.cs       |   70 +
 .../Pt/TestPortugueseLightStemFilter.cs         |  167 +
 .../Pt/TestPortugueseLightStemFilterFactory.cs  |   57 +
 .../Pt/TestPortugueseMinimalStemFilter.cs       |  138 +
 .../TestPortugueseMinimalStemFilterFactory.cs   |   57 +
 .../Analysis/Pt/TestPortugueseStemFilter.cs     |  137 +
 .../Pt/TestPortugueseStemFilterFactory.cs       |   57 +
 .../Query/QueryAutoStopWordAnalyzerTest.cs      |  165 +
 .../Analysis/Reverse/TestReverseStringFilter.cs |  169 +
 .../Reverse/TestReverseStringFilterFactory.cs   |   60 +
 .../Analysis/Ro/TestRomanianAnalyzer.cs         |   70 +
 .../Analysis/Ru/TestRussianAnalyzer.cs          |   85 +
 .../Analysis/Ru/TestRussianFilters.cs           |   59 +
 .../Analysis/Ru/TestRussianLetterTokenizer.cs   |   52 +
 .../Analysis/Ru/TestRussianLightStemFilter.cs   |  123 +
 .../Ru/TestRussianLightStemFilterFactory.cs     |   57 +
 .../Shingle/ShingleAnalyzerWrapperTest.cs       |  276 ++
 .../Analysis/Shingle/ShingleFilterTest.cs       |  716 +++
 .../Shingle/TestShingleFilterFactory.cs         |  224 +
 .../Sinks/DateRecognizerSinkTokenizerTest.cs    |   52 +
 .../Analysis/Sinks/TestTeeSinkTokenFilter.cs    |  357 ++
 .../Sinks/TokenRangeSinkTokenizerTest.cs        |   62 +
 .../Sinks/TokenTypeSinkTokenizerTest.cs         |   95 +
 .../Analysis/Snowball/TestSnowball.cs           |  232 +
 .../Snowball/TestSnowballPorterFilterFactory.cs |   82 +
 .../Analysis/Snowball/TestSnowballVocab.cs      |  106 +
 .../Analysis/Standard/TestStandardFactories.cs  |  249 ++
 .../TestUAX29URLEmailTokenizerFactory.cs        |  169 +
 .../Analysis/Sv/TestSwedishAnalyzer.cs          |   70 +
 .../Analysis/Sv/TestSwedishLightStemFilter.cs   |  123 +
 .../Sv/TestSwedishLightStemFilterFactory.cs     |   57 +
 .../Analysis/Synonym/TestMultiWordSynonyms.cs   |   62 +
 .../Analysis/Synonym/TestSlowSynonymFilter.cs   |  387 ++
 .../Analysis/Synonym/TestSolrSynonymParser.cs   |  177 +
 .../Synonym/TestSynonymFilterFactory.cs         |  216 +
 .../Analysis/Synonym/TestSynonymMap.cs          |  363 ++
 .../Analysis/Synonym/TestSynonymMapFilter.cs    | 1350 ++++++
 .../Synonym/TestWordnetSynonymParser.cs         |   70 +
 .../Analysis/Th/TestThaiAnalyzer.cs             |  183 +
 .../Analysis/Th/TestThaiTokenizerFactory.cs     |   59 +
 .../Analysis/Th/TestThaiWordFilterFactory.cs    |   65 +
 .../Analysis/Tr/TestApostropheFilter.cs         |   37 +
 .../Analysis/Tr/TestApostropheFilterFactory.cs  |   62 +
 .../Analysis/Tr/TestTurkishAnalyzer.cs          |   73 +
 .../Analysis/Tr/TestTurkishLowerCaseFilter.cs   |  102 +
 .../Tr/TestTurkishLowerCaseFilterFactory.cs     |   60 +
 .../Util/BaseTokenStreamFactoryTestCase.cs      |  186 +
 .../Analysis/Util/StringMockResourceLoader.cs   |   74 +
 .../Analysis/Util/TestAnalysisSPILoader.cs      |  256 ++
 .../Analysis/Util/TestCharArrayIterator.cs      |  181 +
 .../Analysis/Util/TestCharArrayMap.cs           |  288 ++
 .../Analysis/Util/TestCharArraySet.cs           |  593 +++
 .../Analysis/Util/TestCharTokenizers.cs         |  268 ++
 .../Analysis/Util/TestCharacterUtils.cs         |  290 ++
 .../Analysis/Util/TestElision.cs                |   89 +
 .../Analysis/Util/TestElisionFilterFactory.cs   |   85 +
 .../Util/TestFilesystemResourceLoader.cs        |  121 +
 .../Analysis/Util/TestRollingCharBuffer.cs      |  136 +
 .../Util/TestSegmentingTokenizerBase.cs         |  251 ++
 .../Analysis/Util/TestWordlistLoader.cs         |   79 +
 .../Wikipedia/TestWikipediaTokenizerFactory.cs  |   56 +
 .../Wikipedia/WikipediaTokenizerTest.cs         |  180 +
 .../Collation/TestCollationKeyAnalyzer.cs       |  126 +
 .../Collation/TestCollationKeyFilter.cs         |  125 +
 .../Collation/TestCollationKeyFilterFactory.cs  |  152 +
 .../DateTimeHelperClass.cs                      |   15 +
 .../HashMapHelperClass.cs                       |   26 +
 .../StringHelperClass.cs                        |   90 +
 273 files changed, 45055 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ar/TestArabicAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ar/TestArabicAnalyzer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ar/TestArabicAnalyzer.cs
new file mode 100644
index 0000000..6f9118b
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ar/TestArabicAnalyzer.cs
@@ -0,0 +1,122 @@
+namespace org.apache.lucene.analysis.ar
+{
+
+	/*
+	 * 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 CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+
+	/// <summary>
+	/// Test the Arabic Analyzer
+	/// 
+	/// </summary>
+	public class TestArabicAnalyzer : BaseTokenStreamTestCase
+	{
+
+	  /// <summary>
+	  /// This test fails with NPE when the 
+	  /// stopwords file is missing in classpath 
+	  /// </summary>
+	  public virtual void testResourcesAvailable()
+	  {
+		new ArabicAnalyzer(TEST_VERSION_CURRENT);
+	  }
+
+	  /// <summary>
+	  /// Some simple tests showing some features of the analyzer, how some regular forms will conflate
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBasicFeatures() throws Exception
+	  public virtual void testBasicFeatures()
+	  {
+		ArabicAnalyzer a = new ArabicAnalyzer(TEST_VERSION_CURRENT);
+		assertAnalyzesTo(a, "كبير", new string[] {"كبير"});
+		assertAnalyzesTo(a, "كبيرة", new string[] {"كبير"}); // feminine marker
+
+		assertAnalyzesTo(a, "مشروب", new string[] {"مشروب"});
+		assertAnalyzesTo(a, "مشروبات", new string[] {"مشروب"}); // plural -at
+
+		assertAnalyzesTo(a, "أمريكيين", new string[] {"امريك"}); // plural -in
+		assertAnalyzesTo(a, "امريكي", new string[] {"امريك"}); // singular with bare alif
+
+		assertAnalyzesTo(a, "كتاب", new string[] {"كتاب"});
+		assertAnalyzesTo(a, "الكتاب", new string[] {"كتاب"}); // definite article
+
+		assertAnalyzesTo(a, "ما ملكت أيمانكم", new string[] {"ملكت", "ايمانكم"});
+		assertAnalyzesTo(a, "الذين ملكت أيمانكم", new string[] {"ملكت", "ايمانكم"}); // stopwords
+	  }
+
+	  /// <summary>
+	  /// Simple tests to show things are getting reset correctly, etc.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testReusableTokenStream() throws Exception
+	  public virtual void testReusableTokenStream()
+	  {
+		ArabicAnalyzer a = new ArabicAnalyzer(TEST_VERSION_CURRENT);
+		assertAnalyzesTo(a, "كبير", new string[] {"كبير"});
+		assertAnalyzesTo(a, "كبيرة", new string[] {"كبير"}); // feminine marker
+	  }
+
+	  /// <summary>
+	  /// Non-arabic text gets treated in a similar way as SimpleAnalyzer.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEnglishInput() throws Exception
+	  public virtual void testEnglishInput()
+	  {
+		assertAnalyzesTo(new ArabicAnalyzer(TEST_VERSION_CURRENT), "English text.", new string[] {"english", "text"});
+	  }
+
+	  /// <summary>
+	  /// Test that custom stopwords work, and are not case-sensitive.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCustomStopwords() throws Exception
+	  public virtual void testCustomStopwords()
+	  {
+		CharArraySet set = new CharArraySet(TEST_VERSION_CURRENT, asSet("the", "and", "a"), false);
+		ArabicAnalyzer a = new ArabicAnalyzer(TEST_VERSION_CURRENT, set);
+		assertAnalyzesTo(a, "The quick brown fox.", new string[] {"quick", "brown", "fox"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testWithStemExclusionSet() throws java.io.IOException
+	  public virtual void testWithStemExclusionSet()
+	  {
+		CharArraySet set = new CharArraySet(TEST_VERSION_CURRENT, asSet("ساهدهات"), false);
+		ArabicAnalyzer a = new ArabicAnalyzer(TEST_VERSION_CURRENT, CharArraySet.EMPTY_SET, set);
+		assertAnalyzesTo(a, "كبيرة the quick ساهدهات", new string[] {"كبير","the", "quick", "ساهدهات"});
+		assertAnalyzesTo(a, "كبيرة the quick ساهدهات", new string[] {"كبير","the", "quick", "ساهدهات"});
+
+
+		a = new ArabicAnalyzer(TEST_VERSION_CURRENT, CharArraySet.EMPTY_SET, CharArraySet.EMPTY_SET);
+		assertAnalyzesTo(a, "كبيرة the quick ساهدهات", new string[] {"كبير","the", "quick", "ساهد"});
+		assertAnalyzesTo(a, "كبيرة the quick ساهدهات", new string[] {"كبير","the", "quick", "ساهد"});
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), new ArabicAnalyzer(TEST_VERSION_CURRENT), 1000 * RANDOM_MULTIPLIER);
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ar/TestArabicFilters.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ar/TestArabicFilters.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ar/TestArabicFilters.cs
new file mode 100644
index 0000000..622e2b9
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ar/TestArabicFilters.cs
@@ -0,0 +1,131 @@
+using System;
+
+namespace org.apache.lucene.analysis.ar
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the Arabic filter Factories are working.
+	/// </summary>
+	public class TestArabicFilters : BaseTokenStreamFactoryTestCase
+	{
+	  /// <summary>
+	  /// Test ArabicLetterTokenizerFactory </summary>
+	  /// @deprecated (3.1) Remove in Lucene 5.0 
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Deprecated("(3.1) Remove in Lucene 5.0") public void testTokenizer() throws Exception
+	  [Obsolete("(3.1) Remove in Lucene 5.0")]
+	  public virtual void testTokenizer()
+	  {
+		Reader reader = new StringReader("الذين مَلكت أيمانكم");
+		TokenStream stream = tokenizerFactory("ArabicLetter").create(reader);
+		assertTokenStreamContents(stream, new string[] {"الذين", "مَلكت", "أيمانكم"});
+	  }
+
+	  /// <summary>
+	  /// Test ArabicNormalizationFilterFactory
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNormalizer() throws Exception
+	  public virtual void testNormalizer()
+	  {
+		Reader reader = new StringReader("الذين مَلكت أيمانكم");
+		Tokenizer tokenizer = tokenizerFactory("Standard").create(reader);
+		TokenStream stream = tokenFilterFactory("ArabicNormalization").create(tokenizer);
+		assertTokenStreamContents(stream, new string[] {"الذين", "ملكت", "ايمانكم"});
+	  }
+
+	  /// <summary>
+	  /// Test ArabicStemFilterFactory
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStemmer() throws Exception
+	  public virtual void testStemmer()
+	  {
+		Reader reader = new StringReader("الذين مَلكت أيمانكم");
+		Tokenizer tokenizer = tokenizerFactory("Standard").create(reader);
+		TokenStream stream = tokenFilterFactory("ArabicNormalization").create(tokenizer);
+		stream = tokenFilterFactory("ArabicStem").create(stream);
+		assertTokenStreamContents(stream, new string[] {"ذين", "ملكت", "ايمانكم"});
+	  }
+
+	  /// <summary>
+	  /// Test PersianCharFilterFactory
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testPersianCharFilter() throws Exception
+	  public virtual void testPersianCharFilter()
+	  {
+		Reader reader = charFilterFactory("Persian").create(new StringReader("می‌خورد"));
+		Tokenizer tokenizer = tokenizerFactory("Standard").create(reader);
+		assertTokenStreamContents(tokenizer, new string[] {"می", "خورد"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("ArabicNormalization", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+
+		try
+		{
+		  tokenFilterFactory("Arabicstem", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+
+		try
+		{
+		  charFilterFactory("Persian", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+
+		try
+		{
+		  tokenizerFactory("ArabicLetter", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ar/TestArabicLetterTokenizer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ar/TestArabicLetterTokenizer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ar/TestArabicLetterTokenizer.cs
new file mode 100644
index 0000000..88fba37
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ar/TestArabicLetterTokenizer.cs
@@ -0,0 +1,52 @@
+using System;
+
+namespace org.apache.lucene.analysis.ar
+{
+
+	/*
+	 * 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 Version = org.apache.lucene.util.Version;
+
+	/// <summary>
+	/// Testcase for <seealso cref="TestArabicLetterTokenizer"/> </summary>
+	/// @deprecated (3.1) Remove in Lucene 5.0 
+	[Obsolete("(3.1) Remove in Lucene 5.0")]
+	public class TestArabicLetterTokenizer : BaseTokenStreamTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testArabicLetterTokenizer() throws java.io.IOException
+	  public virtual void testArabicLetterTokenizer()
+	  {
+		StringReader reader = new StringReader("1234567890 Tokenizer \ud801\udc1c\u0300test");
+		ArabicLetterTokenizer tokenizer = new ArabicLetterTokenizer(Version.LUCENE_31, reader);
+		assertTokenStreamContents(tokenizer, new string[] {"Tokenizer", "\ud801\udc1c\u0300test"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testArabicLetterTokenizerBWCompat() throws java.io.IOException
+	  public virtual void testArabicLetterTokenizerBWCompat()
+	  {
+		StringReader reader = new StringReader("1234567890 Tokenizer \ud801\udc1c\u0300test");
+		ArabicLetterTokenizer tokenizer = new ArabicLetterTokenizer(Version.LUCENE_30, reader);
+		assertTokenStreamContents(tokenizer, new string[] {"Tokenizer", "\u0300test"});
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ar/TestArabicNormalizationFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ar/TestArabicNormalizationFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ar/TestArabicNormalizationFilter.cs
new file mode 100644
index 0000000..99d1989
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ar/TestArabicNormalizationFilter.cs
@@ -0,0 +1,164 @@
+namespace org.apache.lucene.analysis.ar
+{
+
+	/*
+	 * 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 KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+
+	/// <summary>
+	/// Test the Arabic Normalization Filter
+	/// </summary>
+	public class TestArabicNormalizationFilter : BaseTokenStreamTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testAlifMadda() throws java.io.IOException
+	  public virtual void testAlifMadda()
+	  {
+		check("آجن", "اجن");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testAlifHamzaAbove() throws java.io.IOException
+	  public virtual void testAlifHamzaAbove()
+	  {
+		check("أحمد", "احمد");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testAlifHamzaBelow() throws java.io.IOException
+	  public virtual void testAlifHamzaBelow()
+	  {
+		check("إعاذ", "اعاذ");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testAlifMaksura() throws java.io.IOException
+	  public virtual void testAlifMaksura()
+	  {
+		check("بنى", "بني");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTehMarbuta() throws java.io.IOException
+	  public virtual void testTehMarbuta()
+	  {
+		check("فاطمة", "فاطمه");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTatweel() throws java.io.IOException
+	  public virtual void testTatweel()
+	  {
+		check("روبرـــــت", "روبرت");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFatha() throws java.io.IOException
+	  public virtual void testFatha()
+	  {
+		check("مَبنا", "مبنا");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testKasra() throws java.io.IOException
+	  public virtual void testKasra()
+	  {
+		check("علِي", "علي");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testDamma() throws java.io.IOException
+	  public virtual void testDamma()
+	  {
+		check("بُوات", "بوات");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFathatan() throws java.io.IOException
+	  public virtual void testFathatan()
+	  {
+		check("ولداً", "ولدا");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testKasratan() throws java.io.IOException
+	  public virtual void testKasratan()
+	  {
+		check("ولدٍ", "ولد");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testDammatan() throws java.io.IOException
+	  public virtual void testDammatan()
+	  {
+		check("ولدٌ", "ولد");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testSukun() throws java.io.IOException
+	  public virtual void testSukun()
+	  {
+		check("نلْسون", "نلسون");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testShaddah() throws java.io.IOException
+	  public virtual void testShaddah()
+	  {
+		check("هتميّ", "هتمي");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: private void check(final String input, final String expected) throws java.io.IOException
+//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
+	  private void check(string input, string expected)
+	  {
+		ArabicLetterTokenizer tokenStream = new ArabicLetterTokenizer(TEST_VERSION_CURRENT, new StringReader(input));
+		ArabicNormalizationFilter filter = new ArabicNormalizationFilter(tokenStream);
+		assertTokenStreamContents(filter, new string[]{expected});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestArabicNormalizationFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestArabicNormalizationFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new ArabicNormalizationFilter(tokenizer));
+		  }
+	  }
+
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ar/TestArabicStemFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ar/TestArabicStemFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ar/TestArabicStemFilter.cs
new file mode 100644
index 0000000..73e24ad
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ar/TestArabicStemFilter.cs
@@ -0,0 +1,227 @@
+namespace org.apache.lucene.analysis.ar
+{
+
+	/*
+	 * 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 KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+	using SetKeywordMarkerFilter = org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter;
+	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+
+	/// <summary>
+	/// Test the Arabic Normalization Filter
+	/// 
+	/// </summary>
+	public class TestArabicStemFilter : BaseTokenStreamTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testAlPrefix() throws java.io.IOException
+	  public virtual void testAlPrefix()
+	  {
+		check("الحسن", "حسن");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testWalPrefix() throws java.io.IOException
+	  public virtual void testWalPrefix()
+	  {
+		check("والحسن", "حسن");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBalPrefix() throws java.io.IOException
+	  public virtual void testBalPrefix()
+	  {
+		check("بالحسن", "حسن");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testKalPrefix() throws java.io.IOException
+	  public virtual void testKalPrefix()
+	  {
+		check("كالحسن", "حسن");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFalPrefix() throws java.io.IOException
+	  public virtual void testFalPrefix()
+	  {
+		check("فالحسن", "حسن");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testLlPrefix() throws java.io.IOException
+	  public virtual void testLlPrefix()
+	  {
+		check("للاخر", "اخر");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testWaPrefix() throws java.io.IOException
+	  public virtual void testWaPrefix()
+	  {
+		check("وحسن", "حسن");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testAhSuffix() throws java.io.IOException
+	  public virtual void testAhSuffix()
+	  {
+		check("زوجها", "زوج");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testAnSuffix() throws java.io.IOException
+	  public virtual void testAnSuffix()
+	  {
+		check("ساهدان", "ساهد");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testAtSuffix() throws java.io.IOException
+	  public virtual void testAtSuffix()
+	  {
+		check("ساهدات", "ساهد");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testWnSuffix() throws java.io.IOException
+	  public virtual void testWnSuffix()
+	  {
+		check("ساهدون", "ساهد");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testYnSuffix() throws java.io.IOException
+	  public virtual void testYnSuffix()
+	  {
+		check("ساهدين", "ساهد");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testYhSuffix() throws java.io.IOException
+	  public virtual void testYhSuffix()
+	  {
+		check("ساهديه", "ساهد");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testYpSuffix() throws java.io.IOException
+	  public virtual void testYpSuffix()
+	  {
+		check("ساهدية", "ساهد");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testHSuffix() throws java.io.IOException
+	  public virtual void testHSuffix()
+	  {
+		check("ساهده", "ساهد");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testPSuffix() throws java.io.IOException
+	  public virtual void testPSuffix()
+	  {
+		check("ساهدة", "ساهد");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testYSuffix() throws java.io.IOException
+	  public virtual void testYSuffix()
+	  {
+		check("ساهدي", "ساهد");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testComboPrefSuf() throws java.io.IOException
+	  public virtual void testComboPrefSuf()
+	  {
+		check("وساهدون", "ساهد");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testComboSuf() throws java.io.IOException
+	  public virtual void testComboSuf()
+	  {
+		check("ساهدهات", "ساهد");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testShouldntStem() throws java.io.IOException
+	  public virtual void testShouldntStem()
+	  {
+		check("الو", "الو");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNonArabic() throws java.io.IOException
+	  public virtual void testNonArabic()
+	  {
+		check("English", "English");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testWithKeywordAttribute() throws java.io.IOException
+	  public virtual void testWithKeywordAttribute()
+	  {
+		CharArraySet set = new CharArraySet(TEST_VERSION_CURRENT, 1, true);
+		set.add("ساهدهات");
+		ArabicLetterTokenizer tokenStream = new ArabicLetterTokenizer(TEST_VERSION_CURRENT, new StringReader("ساهدهات"));
+
+		ArabicStemFilter filter = new ArabicStemFilter(new SetKeywordMarkerFilter(tokenStream, set));
+		assertTokenStreamContents(filter, new string[]{"ساهدهات"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: private void check(final String input, final String expected) throws java.io.IOException
+//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
+	  private void check(string input, string expected)
+	  {
+		ArabicLetterTokenizer tokenStream = new ArabicLetterTokenizer(TEST_VERSION_CURRENT, new StringReader(input));
+		ArabicStemFilter filter = new ArabicStemFilter(tokenStream);
+		assertTokenStreamContents(filter, new string[]{expected});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestArabicStemFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestArabicStemFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new ArabicStemFilter(tokenizer));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Bg/TestBulgarianAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Bg/TestBulgarianAnalyzer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Bg/TestBulgarianAnalyzer.cs
new file mode 100644
index 0000000..464a655
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Bg/TestBulgarianAnalyzer.cs
@@ -0,0 +1,100 @@
+namespace org.apache.lucene.analysis.bg
+{
+
+	/*
+	 * 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 CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+	using Version = org.apache.lucene.util.Version;
+
+	/// <summary>
+	/// Test the Bulgarian analyzer
+	/// </summary>
+	public class TestBulgarianAnalyzer : BaseTokenStreamTestCase
+	{
+
+	  /// <summary>
+	  /// This test fails with NPE when the stopwords file is missing in classpath
+	  /// </summary>
+	  public virtual void testResourcesAvailable()
+	  {
+		new BulgarianAnalyzer(TEST_VERSION_CURRENT);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStopwords() throws java.io.IOException
+	  public virtual void testStopwords()
+	  {
+		Analyzer a = new BulgarianAnalyzer(TEST_VERSION_CURRENT);
+		assertAnalyzesTo(a, "Как се казваш?", new string[] {"казваш"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCustomStopwords() throws java.io.IOException
+	  public virtual void testCustomStopwords()
+	  {
+		Analyzer a = new BulgarianAnalyzer(TEST_VERSION_CURRENT, CharArraySet.EMPTY_SET);
+		assertAnalyzesTo(a, "Как се казваш?", new string[] {"как", "се", "казваш"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testReusableTokenStream() throws java.io.IOException
+	  public virtual void testReusableTokenStream()
+	  {
+		Analyzer a = new BulgarianAnalyzer(TEST_VERSION_CURRENT);
+		assertAnalyzesTo(a, "документи", new string[] {"документ"});
+		assertAnalyzesTo(a, "документ", new string[] {"документ"});
+	  }
+
+	  /// <summary>
+	  /// Test some examples from the paper
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBasicExamples() throws java.io.IOException
+	  public virtual void testBasicExamples()
+	  {
+		Analyzer a = new BulgarianAnalyzer(TEST_VERSION_CURRENT);
+		assertAnalyzesTo(a, "енергийни кризи", new string[] {"енергийн", "криз"});
+		assertAnalyzesTo(a, "Атомната енергия", new string[] {"атомн", "енерг"});
+
+		assertAnalyzesTo(a, "компютри", new string[] {"компютр"});
+		assertAnalyzesTo(a, "компютър", new string[] {"компютр"});
+
+		assertAnalyzesTo(a, "градове", new string[] {"град"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testWithStemExclusionSet() throws java.io.IOException
+	  public virtual void testWithStemExclusionSet()
+	  {
+		CharArraySet set = new CharArraySet(TEST_VERSION_CURRENT, 1, true);
+		set.add("строеве");
+		Analyzer a = new BulgarianAnalyzer(TEST_VERSION_CURRENT, CharArraySet.EMPTY_SET, set);
+		assertAnalyzesTo(a, "строевете строеве", new string[] {"строй", "строеве"});
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), new BulgarianAnalyzer(TEST_VERSION_CURRENT), 1000 * RANDOM_MULTIPLIER);
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Bg/TestBulgarianStemFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Bg/TestBulgarianStemFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Bg/TestBulgarianStemFilterFactory.cs
new file mode 100644
index 0000000..38c26b3
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Bg/TestBulgarianStemFilterFactory.cs
@@ -0,0 +1,60 @@
+namespace org.apache.lucene.analysis.bg
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the Bulgarian stem filter factory is working.
+	/// </summary>
+	public class TestBulgarianStemFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+	  /// <summary>
+	  /// Ensure the filter actually stems text.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStemming() throws Exception
+	  public virtual void testStemming()
+	  {
+		Reader reader = new StringReader("компютри");
+		Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		TokenStream stream = tokenFilterFactory("BulgarianStem").create(tokenizer);
+		assertTokenStreamContents(stream, new string[] {"компютр"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("BulgarianStem", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Bg/TestBulgarianStemmer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Bg/TestBulgarianStemmer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Bg/TestBulgarianStemmer.cs
new file mode 100644
index 0000000..0609bb2
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Bg/TestBulgarianStemmer.cs
@@ -0,0 +1,266 @@
+namespace org.apache.lucene.analysis.bg
+{
+
+	/*
+	 * 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 KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+	using SetKeywordMarkerFilter = org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter;
+	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+	using Version = org.apache.lucene.util.Version;
+
+	/// <summary>
+	/// Test the Bulgarian Stemmer
+	/// </summary>
+	public class TestBulgarianStemmer : BaseTokenStreamTestCase
+	{
+	  /// <summary>
+	  /// Test showing how masculine noun forms conflate. An example noun for each
+	  /// common (and some rare) plural pattern is listed.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMasculineNouns() throws java.io.IOException
+	  public virtual void testMasculineNouns()
+	  {
+		BulgarianAnalyzer a = new BulgarianAnalyzer(TEST_VERSION_CURRENT);
+
+		// -и pattern
+		assertAnalyzesTo(a, "град", new string[] {"град"});
+		assertAnalyzesTo(a, "града", new string[] {"град"});
+		assertAnalyzesTo(a, "градът", new string[] {"град"});
+		assertAnalyzesTo(a, "градове", new string[] {"град"});
+		assertAnalyzesTo(a, "градовете", new string[] {"град"});
+
+		// -ове pattern
+		assertAnalyzesTo(a, "народ", new string[] {"народ"});
+		assertAnalyzesTo(a, "народа", new string[] {"народ"});
+		assertAnalyzesTo(a, "народът", new string[] {"народ"});
+		assertAnalyzesTo(a, "народи", new string[] {"народ"});
+		assertAnalyzesTo(a, "народите", new string[] {"народ"});
+		assertAnalyzesTo(a, "народе", new string[] {"народ"});
+
+		// -ища pattern
+		assertAnalyzesTo(a, "път", new string[] {"път"});
+		assertAnalyzesTo(a, "пътя", new string[] {"път"});
+		assertAnalyzesTo(a, "пътят", new string[] {"път"});
+		assertAnalyzesTo(a, "пътища", new string[] {"път"});
+		assertAnalyzesTo(a, "пътищата", new string[] {"път"});
+
+		// -чета pattern
+		assertAnalyzesTo(a, "градец", new string[] {"градец"});
+		assertAnalyzesTo(a, "градеца", new string[] {"градец"});
+		assertAnalyzesTo(a, "градецът", new string[] {"градец"});
+		/* note the below forms conflate with each other, but not the rest */
+		assertAnalyzesTo(a, "градовце", new string[] {"градовц"});
+		assertAnalyzesTo(a, "градовцете", new string[] {"градовц"});
+
+		// -овци pattern
+		assertAnalyzesTo(a, "дядо", new string[] {"дяд"});
+		assertAnalyzesTo(a, "дядото", new string[] {"дяд"});
+		assertAnalyzesTo(a, "дядовци", new string[] {"дяд"});
+		assertAnalyzesTo(a, "дядовците", new string[] {"дяд"});
+
+		// -е pattern
+		assertAnalyzesTo(a, "мъж", new string[] {"мъж"});
+		assertAnalyzesTo(a, "мъжа", new string[] {"мъж"});
+		assertAnalyzesTo(a, "мъже", new string[] {"мъж"});
+		assertAnalyzesTo(a, "мъжете", new string[] {"мъж"});
+		assertAnalyzesTo(a, "мъжо", new string[] {"мъж"});
+		/* word is too short, will not remove -ът */
+		assertAnalyzesTo(a, "мъжът", new string[] {"мъжът"});
+
+		// -а pattern
+		assertAnalyzesTo(a, "крак", new string[] {"крак"});
+		assertAnalyzesTo(a, "крака", new string[] {"крак"});
+		assertAnalyzesTo(a, "кракът", new string[] {"крак"});
+		assertAnalyzesTo(a, "краката", new string[] {"крак"});
+
+		// брат
+		assertAnalyzesTo(a, "брат", new string[] {"брат"});
+		assertAnalyzesTo(a, "брата", new string[] {"брат"});
+		assertAnalyzesTo(a, "братът", new string[] {"брат"});
+		assertAnalyzesTo(a, "братя", new string[] {"брат"});
+		assertAnalyzesTo(a, "братята", new string[] {"брат"});
+		assertAnalyzesTo(a, "брате", new string[] {"брат"});
+	  }
+
+	  /// <summary>
+	  /// Test showing how feminine noun forms conflate
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFeminineNouns() throws java.io.IOException
+	  public virtual void testFeminineNouns()
+	  {
+		BulgarianAnalyzer a = new BulgarianAnalyzer(TEST_VERSION_CURRENT);
+
+		assertAnalyzesTo(a, "вест", new string[] {"вест"});
+		assertAnalyzesTo(a, "вестта", new string[] {"вест"});
+		assertAnalyzesTo(a, "вести", new string[] {"вест"});
+		assertAnalyzesTo(a, "вестите", new string[] {"вест"});
+	  }
+
+	  /// <summary>
+	  /// Test showing how neuter noun forms conflate an example noun for each common
+	  /// plural pattern is listed
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNeuterNouns() throws java.io.IOException
+	  public virtual void testNeuterNouns()
+	  {
+		BulgarianAnalyzer a = new BulgarianAnalyzer(TEST_VERSION_CURRENT);
+
+		// -а pattern
+		assertAnalyzesTo(a, "дърво", new string[] {"дърв"});
+		assertAnalyzesTo(a, "дървото", new string[] {"дърв"});
+		assertAnalyzesTo(a, "дърва", new string[] {"дърв"});
+		assertAnalyzesTo(a, "дървета", new string[] {"дърв"});
+		assertAnalyzesTo(a, "дървата", new string[] {"дърв"});
+		assertAnalyzesTo(a, "дърветата", new string[] {"дърв"});
+
+		// -та pattern
+		assertAnalyzesTo(a, "море", new string[] {"мор"});
+		assertAnalyzesTo(a, "морето", new string[] {"мор"});
+		assertAnalyzesTo(a, "морета", new string[] {"мор"});
+		assertAnalyzesTo(a, "моретата", new string[] {"мор"});
+
+		// -я pattern
+		assertAnalyzesTo(a, "изключение", new string[] {"изключени"});
+		assertAnalyzesTo(a, "изключението", new string[] {"изключени"});
+		assertAnalyzesTo(a, "изключенията", new string[] {"изключени"});
+		/* note the below form in this example does not conflate with the rest */
+		assertAnalyzesTo(a, "изключения", new string[] {"изключн"});
+	  }
+
+	  /// <summary>
+	  /// Test showing how adjectival forms conflate
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testAdjectives() throws java.io.IOException
+	  public virtual void testAdjectives()
+	  {
+		BulgarianAnalyzer a = new BulgarianAnalyzer(TEST_VERSION_CURRENT);
+		assertAnalyzesTo(a, "красив", new string[] {"красив"});
+		assertAnalyzesTo(a, "красивия", new string[] {"красив"});
+		assertAnalyzesTo(a, "красивият", new string[] {"красив"});
+		assertAnalyzesTo(a, "красива", new string[] {"красив"});
+		assertAnalyzesTo(a, "красивата", new string[] {"красив"});
+		assertAnalyzesTo(a, "красиво", new string[] {"красив"});
+		assertAnalyzesTo(a, "красивото", new string[] {"красив"});
+		assertAnalyzesTo(a, "красиви", new string[] {"красив"});
+		assertAnalyzesTo(a, "красивите", new string[] {"красив"});
+	  }
+
+	  /// <summary>
+	  /// Test some exceptional rules, implemented as rewrites.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testExceptions() throws java.io.IOException
+	  public virtual void testExceptions()
+	  {
+		BulgarianAnalyzer a = new BulgarianAnalyzer(TEST_VERSION_CURRENT);
+
+		// ци -> к
+		assertAnalyzesTo(a, "собственик", new string[] {"собственик"});
+		assertAnalyzesTo(a, "собственика", new string[] {"собственик"});
+		assertAnalyzesTo(a, "собственикът", new string[] {"собственик"});
+		assertAnalyzesTo(a, "собственици", new string[] {"собственик"});
+		assertAnalyzesTo(a, "собствениците", new string[] {"собственик"});
+
+		// зи -> г
+		assertAnalyzesTo(a, "подлог", new string[] {"подлог"});
+		assertAnalyzesTo(a, "подлога", new string[] {"подлог"});
+		assertAnalyzesTo(a, "подлогът", new string[] {"подлог"});
+		assertAnalyzesTo(a, "подлози", new string[] {"подлог"});
+		assertAnalyzesTo(a, "подлозите", new string[] {"подлог"});
+
+		// си -> х
+		assertAnalyzesTo(a, "кожух", new string[] {"кожух"});
+		assertAnalyzesTo(a, "кожуха", new string[] {"кожух"});
+		assertAnalyzesTo(a, "кожухът", new string[] {"кожух"});
+		assertAnalyzesTo(a, "кожуси", new string[] {"кожух"});
+		assertAnalyzesTo(a, "кожусите", new string[] {"кожух"});
+
+		// ъ deletion
+		assertAnalyzesTo(a, "център", new string[] {"центр"});
+		assertAnalyzesTo(a, "центъра", new string[] {"центр"});
+		assertAnalyzesTo(a, "центърът", new string[] {"центр"});
+		assertAnalyzesTo(a, "центрове", new string[] {"центр"});
+		assertAnalyzesTo(a, "центровете", new string[] {"центр"});
+
+		// е*и -> я*
+		assertAnalyzesTo(a, "промяна", new string[] {"промян"});
+		assertAnalyzesTo(a, "промяната", new string[] {"промян"});
+		assertAnalyzesTo(a, "промени", new string[] {"промян"});
+		assertAnalyzesTo(a, "промените", new string[] {"промян"});
+
+		// ен -> н
+		assertAnalyzesTo(a, "песен", new string[] {"песн"});
+		assertAnalyzesTo(a, "песента", new string[] {"песн"});
+		assertAnalyzesTo(a, "песни", new string[] {"песн"});
+		assertAnalyzesTo(a, "песните", new string[] {"песн"});
+
+		// -еве -> й
+		// note: this is the only word i think this rule works for.
+		// most -еве pluralized nouns are monosyllabic,
+		// and the stemmer requires length > 6...
+		assertAnalyzesTo(a, "строй", new string[] {"строй"});
+		assertAnalyzesTo(a, "строеве", new string[] {"строй"});
+		assertAnalyzesTo(a, "строевете", new string[] {"строй"});
+		/* note the below forms conflate with each other, but not the rest */
+		assertAnalyzesTo(a, "строя", new string[] {"стр"});
+		assertAnalyzesTo(a, "строят", new string[] {"стр"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testWithKeywordAttribute() throws java.io.IOException
+	  public virtual void testWithKeywordAttribute()
+	  {
+		CharArraySet set = new CharArraySet(TEST_VERSION_CURRENT, 1, true);
+		set.add("строеве");
+		MockTokenizer tokenStream = new MockTokenizer(new StringReader("строевете строеве"), MockTokenizer.WHITESPACE, false);
+
+		BulgarianStemFilter filter = new BulgarianStemFilter(new SetKeywordMarkerFilter(tokenStream, set));
+		assertTokenStreamContents(filter, new string[] {"строй", "строеве"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestBulgarianStemmer outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestBulgarianStemmer outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new BulgarianStemFilter(tokenizer));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Br/TestBrazilianStemFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Br/TestBrazilianStemFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Br/TestBrazilianStemFilterFactory.cs
new file mode 100644
index 0000000..63a2d75
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Br/TestBrazilianStemFilterFactory.cs
@@ -0,0 +1,60 @@
+namespace org.apache.lucene.analysis.br
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the Brazilian stem filter factory is working.
+	/// </summary>
+	public class TestBrazilianStemFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+	  /// <summary>
+	  /// Ensure the filter actually stems and normalizes text.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStemming() throws Exception
+	  public virtual void testStemming()
+	  {
+		Reader reader = new StringReader("Brasília");
+		Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		TokenStream stream = tokenFilterFactory("BrazilianStem").create(tokenizer);
+		assertTokenStreamContents(stream, new string[] {"brasil"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("BrazilianStem", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Br/TestBrazilianStemmer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Br/TestBrazilianStemmer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Br/TestBrazilianStemmer.cs
new file mode 100644
index 0000000..1cd6d59
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Br/TestBrazilianStemmer.cs
@@ -0,0 +1,212 @@
+namespace org.apache.lucene.analysis.br
+{
+
+	/*
+	 * 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 KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+	using LowerCaseTokenizer = org.apache.lucene.analysis.core.LowerCaseTokenizer;
+	using SetKeywordMarkerFilter = org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter;
+	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+
+	/// <summary>
+	/// Test the Brazilian Stem Filter, which only modifies the term text.
+	/// 
+	/// It is very similar to the snowball portuguese algorithm but not exactly the same.
+	/// 
+	/// </summary>
+	public class TestBrazilianStemmer : BaseTokenStreamTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testWithSnowballExamples() throws Exception
+	  public virtual void testWithSnowballExamples()
+	  {
+	   check("boa", "boa");
+	   check("boainain", "boainain");
+	   check("boas", "boas");
+	   check("bôas", "boas"); // removes diacritic: different from snowball portugese
+	   check("boassu", "boassu");
+	   check("boataria", "boat");
+	   check("boate", "boat");
+	   check("boates", "boat");
+	   check("boatos", "boat");
+	   check("bob", "bob");
+	   check("boba", "bob");
+	   check("bobagem", "bobag");
+	   check("bobagens", "bobagens");
+	   check("bobalhões", "bobalho"); // removes diacritic: different from snowball portugese
+	   check("bobear", "bob");
+	   check("bobeira", "bobeir");
+	   check("bobinho", "bobinh");
+	   check("bobinhos", "bobinh");
+	   check("bobo", "bob");
+	   check("bobs", "bobs");
+	   check("boca", "boc");
+	   check("bocadas", "boc");
+	   check("bocadinho", "bocadinh");
+	   check("bocado", "boc");
+	   check("bocaiúva", "bocaiuv"); // removes diacritic: different from snowball portuguese
+	   check("boçal", "bocal"); // removes diacritic: different from snowball portuguese
+	   check("bocarra", "bocarr");
+	   check("bocas", "boc");
+	   check("bode", "bod");
+	   check("bodoque", "bodoqu");
+	   check("body", "body");
+	   check("boeing", "boeing");
+	   check("boem", "boem");
+	   check("boemia", "boem");
+	   check("boêmio", "boemi"); // removes diacritic: different from snowball portuguese
+	   check("bogotá", "bogot");
+	   check("boi", "boi");
+	   check("bóia", "boi"); // removes diacritic: different from snowball portuguese
+	   check("boiando", "boi");
+	   check("quiabo", "quiab");
+	   check("quicaram", "quic");
+	   check("quickly", "quickly");
+	   check("quieto", "quiet");
+	   check("quietos", "quiet");
+	   check("quilate", "quilat");
+	   check("quilates", "quilat");
+	   check("quilinhos", "quilinh");
+	   check("quilo", "quil");
+	   check("quilombo", "quilomb");
+	   check("quilométricas", "quilometr"); // removes diacritic: different from snowball portuguese
+	   check("quilométricos", "quilometr"); // removes diacritic: different from snowball portuguese
+	   check("quilômetro", "quilometr"); // removes diacritic: different from snowball portoguese
+	   check("quilômetros", "quilometr"); // removes diacritic: different from snowball portoguese
+	   check("quilos", "quil");
+	   check("quimica", "quimic");
+	   check("quilos", "quil");
+	   check("quimica", "quimic");
+	   check("quimicas", "quimic");
+	   check("quimico", "quimic");
+	   check("quimicos", "quimic");
+	   check("quimioterapia", "quimioterap");
+	   check("quimioterápicos", "quimioterap"); // removes diacritic: different from snowball portoguese
+	   check("quimono", "quimon");
+	   check("quincas", "quinc");
+	   check("quinhão", "quinha"); // removes diacritic: different from snowball portoguese
+	   check("quinhentos", "quinhent");
+	   check("quinn", "quinn");
+	   check("quino", "quin");
+	   check("quinta", "quint");
+	   check("quintal", "quintal");
+	   check("quintana", "quintan");
+	   check("quintanilha", "quintanilh");
+	   check("quintão", "quinta"); // removes diacritic: different from snowball portoguese
+	   check("quintessência", "quintessente"); // versus snowball portuguese 'quintessent'
+	   check("quintino", "quintin");
+	   check("quinto", "quint");
+	   check("quintos", "quint");
+	   check("quintuplicou", "quintuplic");
+	   check("quinze", "quinz");
+	   check("quinzena", "quinzen");
+	   check("quiosque", "quiosqu");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNormalization() throws Exception
+	  public virtual void testNormalization()
+	  {
+		check("Brasil", "brasil"); // lowercase by default
+		check("Brasília", "brasil"); // remove diacritics
+		check("quimio5terápicos", "quimio5terapicos"); // contains non-letter, diacritic will still be removed
+		check("áá", "áá"); // token is too short: diacritics are not removed
+		check("ááá", "aaa"); // normally, diacritics are removed
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testReusableTokenStream() throws Exception
+	  public virtual void testReusableTokenStream()
+	  {
+		Analyzer a = new BrazilianAnalyzer(TEST_VERSION_CURRENT);
+		checkReuse(a, "boa", "boa");
+		checkReuse(a, "boainain", "boainain");
+		checkReuse(a, "boas", "boas");
+		checkReuse(a, "bôas", "boas"); // removes diacritic: different from snowball portugese
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStemExclusionTable() throws Exception
+	  public virtual void testStemExclusionTable()
+	  {
+		BrazilianAnalyzer a = new BrazilianAnalyzer(TEST_VERSION_CURRENT, CharArraySet.EMPTY_SET, new CharArraySet(TEST_VERSION_CURRENT, asSet("quintessência"), false));
+		checkReuse(a, "quintessência", "quintessência"); // excluded words will be completely unchanged.
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testWithKeywordAttribute() throws java.io.IOException
+	  public virtual void testWithKeywordAttribute()
+	  {
+		CharArraySet set = new CharArraySet(TEST_VERSION_CURRENT, 1, true);
+		set.add("Brasília");
+		BrazilianStemFilter filter = new BrazilianStemFilter(new SetKeywordMarkerFilter(new LowerCaseTokenizer(TEST_VERSION_CURRENT, new StringReader("Brasília Brasilia")), set));
+		assertTokenStreamContents(filter, new string[] {"brasília", "brasil"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: private void check(final String input, final String expected) throws Exception
+//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
+	  private void check(string input, string expected)
+	  {
+		checkOneTerm(new BrazilianAnalyzer(TEST_VERSION_CURRENT), input, expected);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: private void checkReuse(org.apache.lucene.analysis.Analyzer a, String input, String expected) throws Exception
+	  private void checkReuse(Analyzer a, string input, string expected)
+	  {
+		checkOneTerm(a, input, expected);
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), new BrazilianAnalyzer(TEST_VERSION_CURRENT), 1000 * RANDOM_MULTIPLIER);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestBrazilianStemmer outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestBrazilianStemmer outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new BrazilianStemFilter(tokenizer));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ca/TestCatalanAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ca/TestCatalanAnalyzer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ca/TestCatalanAnalyzer.cs
new file mode 100644
index 0000000..5ed025b
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ca/TestCatalanAnalyzer.cs
@@ -0,0 +1,80 @@
+namespace org.apache.lucene.analysis.ca
+{
+
+	/*
+	 * 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 CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+
+	public class TestCatalanAnalyzer : BaseTokenStreamTestCase
+	{
+	  /// <summary>
+	  /// This test fails with NPE when the 
+	  /// stopwords file is missing in classpath 
+	  /// </summary>
+	  public virtual void testResourcesAvailable()
+	  {
+		new CatalanAnalyzer(TEST_VERSION_CURRENT);
+	  }
+
+	  /// <summary>
+	  /// test stopwords and stemming </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBasics() throws java.io.IOException
+	  public virtual void testBasics()
+	  {
+		Analyzer a = new CatalanAnalyzer(TEST_VERSION_CURRENT);
+		// stemming
+		checkOneTerm(a, "llengües", "llengu");
+		checkOneTerm(a, "llengua", "llengu");
+		// stopword
+		assertAnalyzesTo(a, "un", new string[] { });
+	  }
+
+	  /// <summary>
+	  /// test use of elisionfilter </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testContractions() throws java.io.IOException
+	  public virtual void testContractions()
+	  {
+		Analyzer a = new CatalanAnalyzer(TEST_VERSION_CURRENT);
+		assertAnalyzesTo(a, "Diccionari de l'Institut d'Estudis Catalans", new string[] {"diccion", "inst", "estud", "catalan"});
+	  }
+
+	  /// <summary>
+	  /// test use of exclusion set </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testExclude() throws java.io.IOException
+	  public virtual void testExclude()
+	  {
+		CharArraySet exclusionSet = new CharArraySet(TEST_VERSION_CURRENT, asSet("llengües"), false);
+		Analyzer a = new CatalanAnalyzer(TEST_VERSION_CURRENT, CatalanAnalyzer.DefaultStopSet, exclusionSet);
+		checkOneTerm(a, "llengües", "llengües");
+		checkOneTerm(a, "llengua", "llengu");
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), new CatalanAnalyzer(TEST_VERSION_CURRENT), 1000 * RANDOM_MULTIPLIER);
+	  }
+	}
+
+}
\ No newline at end of file


[04/27] lucenenet git commit: adding converted analysis common tests

Posted by sy...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestSynonymFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestSynonymFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestSynonymFilterFactory.cs
new file mode 100644
index 0000000..698f713
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestSynonymFilterFactory.cs
@@ -0,0 +1,216 @@
+using System;
+
+namespace org.apache.lucene.analysis.synonym
+{
+
+	/*
+	 * Licensed to the Apache Software Foundation (ASF) under one or more
+	 * contributor license agreements.  See the NOTICE file distributed with
+	 * this work for additional information regarding copyright ownership.
+	 * The ASF licenses this file to You under the Apache License, Version 2.0
+	 * (the "License"); you may not use this file except in compliance with
+	 * the License.  You may obtain a copy of the License at
+	 *
+	 *     http://www.apache.org/licenses/LICENSE-2.0
+	 *
+	 * Unless required by applicable law or agreed to in writing, software
+	 * distributed under the License is distributed on an "AS IS" BASIS,
+	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+	 * See the License for the specific language governing permissions and
+	 * limitations under the License.
+	 */
+
+
+	using PatternTokenizerFactory = org.apache.lucene.analysis.pattern.PatternTokenizerFactory;
+	using TokenFilterFactory = org.apache.lucene.analysis.util.TokenFilterFactory;
+	using BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+	using ClasspathResourceLoader = org.apache.lucene.analysis.util.ClasspathResourceLoader;
+	using StringMockResourceLoader = org.apache.lucene.analysis.util.StringMockResourceLoader;
+	using Version = org.apache.lucene.util.Version;
+
+	public class TestSynonymFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+
+	  /// <summary>
+	  /// checks for synonyms of "GB" in synonyms.txt </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: private void checkSolrSynonyms(org.apache.lucene.analysis.util.TokenFilterFactory factory) throws Exception
+	  private void checkSolrSynonyms(TokenFilterFactory factory)
+	  {
+		Reader reader = new StringReader("GB");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = factory.create(stream);
+		assertTrue(stream is SynonymFilter);
+		assertTokenStreamContents(stream, new string[] {"GB", "gib", "gigabyte", "gigabytes"}, new int[] {1, 0, 0, 0});
+	  }
+
+	  /// <summary>
+	  /// checks for synonyms of "second" in synonyms-wordnet.txt </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: private void checkWordnetSynonyms(org.apache.lucene.analysis.util.TokenFilterFactory factory) throws Exception
+	  private void checkWordnetSynonyms(TokenFilterFactory factory)
+	  {
+		Reader reader = new StringReader("second");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = factory.create(stream);
+		assertTrue(stream is SynonymFilter);
+		assertTokenStreamContents(stream, new string[] {"second", "2nd", "two"}, new int[] {1, 0, 0});
+	  }
+
+	  /// <summary>
+	  /// test that we can parse and use the solr syn file </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testSynonyms() throws Exception
+	  public virtual void testSynonyms()
+	  {
+		checkSolrSynonyms(tokenFilterFactory("Synonym", "synonyms", "synonyms.txt"));
+	  }
+
+	  /// <summary>
+	  /// test that we can parse and use the solr syn file, with the old impl </summary>
+	  /// @deprecated Remove this test in Lucene 5.0  
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Deprecated("Remove this test in Lucene 5.0") public void testSynonymsOld() throws Exception
+	  [Obsolete("Remove this test in Lucene 5.0")]
+	  public virtual void testSynonymsOld()
+	  {
+		Reader reader = new StringReader("GB");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("Synonym", Version.LUCENE_33, new ClasspathResourceLoader(this.GetType()), "synonyms", "synonyms.txt").create(stream);
+		assertTrue(stream is SlowSynonymFilter);
+		assertTokenStreamContents(stream, new string[] {"GB", "gib", "gigabyte", "gigabytes"}, new int[] {1, 0, 0, 0});
+	  }
+
+	  /// <summary>
+	  /// test multiword offsets with the old impl </summary>
+	  /// @deprecated Remove this test in Lucene 5.0  
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Deprecated("Remove this test in Lucene 5.0") public void testMultiwordOffsetsOld() throws Exception
+	  [Obsolete("Remove this test in Lucene 5.0")]
+	  public virtual void testMultiwordOffsetsOld()
+	  {
+		Reader reader = new StringReader("national hockey league");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("Synonym", Version.LUCENE_33, new StringMockResourceLoader("national hockey league, nhl"), "synonyms", "synonyms.txt").create(stream);
+		// WTF?
+		assertTokenStreamContents(stream, new string[] {"national", "nhl", "hockey", "league"}, new int[] {0, 0, 0, 0}, new int[] {22, 22, 22, 22}, new int[] {1, 0, 1, 1});
+	  }
+
+	  /// <summary>
+	  /// if the synonyms are completely empty, test that we still analyze correctly </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptySynonyms() throws Exception
+	  public virtual void testEmptySynonyms()
+	  {
+		Reader reader = new StringReader("GB");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("Synonym", TEST_VERSION_CURRENT, new StringMockResourceLoader(""), "synonyms", "synonyms.txt").create(stream); // empty file!
+		assertTokenStreamContents(stream, new string[] {"GB"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFormat() throws Exception
+	  public virtual void testFormat()
+	  {
+		checkSolrSynonyms(tokenFilterFactory("Synonym", "synonyms", "synonyms.txt", "format", "solr"));
+		checkWordnetSynonyms(tokenFilterFactory("Synonym", "synonyms", "synonyms-wordnet.txt", "format", "wordnet"));
+		// explicit class should work the same as the "solr" alias
+//JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method:
+		checkSolrSynonyms(tokenFilterFactory("Synonym", "synonyms", "synonyms.txt", "format", typeof(SolrSynonymParser).FullName));
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("Synonym", "synonyms", "synonyms.txt", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+
+	  internal const string TOK_SYN_ARG_VAL = "argument";
+	  internal const string TOK_FOO_ARG_VAL = "foofoofoo";
+
+	  /// <summary>
+	  /// Test that we can parse TokenierFactory's arguments </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTokenizerFactoryArguments() throws Exception
+	  public virtual void testTokenizerFactoryArguments()
+	  {
+		// diff versions produce diff delegator behavior,
+		// all should be (mostly) equivilent for our test purposes.
+		doTestTokenizerFactoryArguments(Version.LUCENE_33, typeof(SlowSynonymFilterFactory));
+		doTestTokenizerFactoryArguments(Version.LUCENE_34, typeof(FSTSynonymFilterFactory));
+		doTestTokenizerFactoryArguments(Version.LUCENE_35, typeof(FSTSynonymFilterFactory));
+
+		doTestTokenizerFactoryArguments(Version.LUCENE_CURRENT, typeof(FSTSynonymFilterFactory));
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: protected void doTestTokenizerFactoryArguments(final org.apache.lucene.util.Version ver, final Class delegatorClass) throws Exception
+//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
+	  protected internal virtual void doTestTokenizerFactoryArguments(Version ver, Type delegatorClass)
+	  {
+
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final String clazz = org.apache.lucene.analysis.pattern.PatternTokenizerFactory.class.getName();
+//JAVA TO C# CONVERTER WARNING: The .NET Type.FullName property will not always yield results identical to the Java Class.getName method:
+		string clazz = typeof(PatternTokenizerFactory).FullName;
+		TokenFilterFactory factory = null;
+
+		// simple arg form
+		factory = tokenFilterFactory("Synonym", ver, "synonyms", "synonyms.txt", "tokenizerFactory", clazz, "pattern", "(.*)", "group", "0");
+		assertDelegator(factory, delegatorClass);
+
+		// prefix
+		factory = tokenFilterFactory("Synonym", ver, "synonyms", "synonyms.txt", "tokenizerFactory", clazz, "tokenizerFactory.pattern", "(.*)", "tokenizerFactory.group", "0");
+		assertDelegator(factory, delegatorClass);
+
+		// sanity check that sub-PatternTokenizerFactory fails w/o pattern
+		try
+		{
+		  factory = tokenFilterFactory("Synonym", ver, "synonyms", "synonyms.txt", "tokenizerFactory", clazz);
+		  fail("tokenizerFactory should have complained about missing pattern arg");
+		}
+		catch (Exception)
+		{
+		  // :NOOP:
+		}
+
+		// sanity check that sub-PatternTokenizerFactory fails on unexpected
+		try
+		{
+		  factory = tokenFilterFactory("Synonym", ver, "synonyms", "synonyms.txt", "tokenizerFactory", clazz, "tokenizerFactory.pattern", "(.*)", "tokenizerFactory.bogusbogusbogus", "bogus", "tokenizerFactory.group", "0");
+		  fail("tokenizerFactory should have complained about missing pattern arg");
+		}
+		catch (Exception)
+		{
+		  // :NOOP:
+		}
+	  }
+
+//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
+//ORIGINAL LINE: private static void assertDelegator(final org.apache.lucene.analysis.util.TokenFilterFactory factory, final Class delegatorClass)
+	  private static void assertDelegator(TokenFilterFactory factory, Type delegatorClass)
+	  {
+		assertNotNull(factory);
+		assertTrue("factory not expected class: " + factory.GetType(), factory is SynonymFilterFactory);
+		SynonymFilterFactory synFac = (SynonymFilterFactory) factory;
+		object delegator = synFac.Delegator;
+		assertNotNull(delegator);
+		assertTrue("delegator not expected class: " + delegator.GetType(), delegatorClass.IsInstanceOfType(delegator));
+
+	  }
+	}
+
+
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestSynonymMap.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestSynonymMap.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestSynonymMap.cs
new file mode 100644
index 0000000..c154734
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestSynonymMap.cs
@@ -0,0 +1,363 @@
+using System;
+using System.Collections.Generic;
+
+namespace org.apache.lucene.analysis.synonym
+{
+
+	/*
+	 * Licensed to the Apache Software Foundation (ASF) under one or more
+	 * contributor license agreements.  See the NOTICE file distributed with
+	 * this work for additional information regarding copyright ownership.
+	 * The ASF licenses this file to You under the Apache License, Version 2.0
+	 * (the "License"); you may not use this file except in compliance with
+	 * the License.  You may obtain a copy of the License at
+	 *
+	 *     http://www.apache.org/licenses/LICENSE-2.0
+	 *
+	 * Unless required by applicable law or agreed to in writing, software
+	 * distributed under the License is distributed on an "AS IS" BASIS,
+	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+	 * See the License for the specific language governing permissions and
+	 * limitations under the License.
+	 */
+
+
+	using NGramTokenizerFactory = org.apache.lucene.analysis.ngram.NGramTokenizerFactory;
+	using AbstractAnalysisFactory = org.apache.lucene.analysis.util.AbstractAnalysisFactory;
+	using TokenizerFactory = org.apache.lucene.analysis.util.TokenizerFactory;
+	using LuceneTestCase = org.apache.lucene.util.LuceneTestCase;
+	using ResourceLoader = org.apache.lucene.analysis.util.ResourceLoader;
+
+	/// @deprecated Remove this test in Lucene 5.0 
+	[Obsolete("Remove this test in Lucene 5.0")]
+	public class TestSynonymMap : LuceneTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testInvalidMappingRules() throws Exception
+	  public virtual void testInvalidMappingRules()
+	  {
+		SlowSynonymMap synMap = new SlowSynonymMap(true);
+		IList<string> rules = new List<string>(1);
+		rules.Add("a=>b=>c");
+		try
+		{
+			SlowSynonymFilterFactory.parseRules(rules, synMap, "=>", ",", true, null);
+			fail("IllegalArgumentException must be thrown.");
+		}
+		catch (System.ArgumentException)
+		{
+		}
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testReadMappingRules() throws Exception
+	  public virtual void testReadMappingRules()
+	  {
+		SlowSynonymMap synMap;
+
+		// (a)->[b]
+		IList<string> rules = new List<string>();
+		rules.Add("a=>b");
+		synMap = new SlowSynonymMap(true);
+		SlowSynonymFilterFactory.parseRules(rules, synMap, "=>", ",", true, null);
+		assertEquals(1, synMap.submap.size());
+		assertTokIncludes(synMap, "a", "b");
+
+		// (a)->[c]
+		// (b)->[c]
+		rules.Clear();
+		rules.Add("a,b=>c");
+		synMap = new SlowSynonymMap(true);
+		SlowSynonymFilterFactory.parseRules(rules, synMap, "=>", ",", true, null);
+		assertEquals(2, synMap.submap.size());
+		assertTokIncludes(synMap, "a", "c");
+		assertTokIncludes(synMap, "b", "c");
+
+		// (a)->[b][c]
+		rules.Clear();
+		rules.Add("a=>b,c");
+		synMap = new SlowSynonymMap(true);
+		SlowSynonymFilterFactory.parseRules(rules, synMap, "=>", ",", true, null);
+		assertEquals(1, synMap.submap.size());
+		assertTokIncludes(synMap, "a", "b");
+		assertTokIncludes(synMap, "a", "c");
+
+		// (a)->(b)->[a2]
+		//      [a1]
+		rules.Clear();
+		rules.Add("a=>a1");
+		rules.Add("a b=>a2");
+		synMap = new SlowSynonymMap(true);
+		SlowSynonymFilterFactory.parseRules(rules, synMap, "=>", ",", true, null);
+		assertEquals(1, synMap.submap.size());
+		assertTokIncludes(synMap, "a", "a1");
+		assertEquals(1, getSubSynonymMap(synMap, "a").submap.size());
+		assertTokIncludes(getSubSynonymMap(synMap, "a"), "b", "a2");
+
+		// (a)->(b)->[a2]
+		//      (c)->[a3]
+		//      [a1]
+		rules.Clear();
+		rules.Add("a=>a1");
+		rules.Add("a b=>a2");
+		rules.Add("a c=>a3");
+		synMap = new SlowSynonymMap(true);
+		SlowSynonymFilterFactory.parseRules(rules, synMap, "=>", ",", true, null);
+		assertEquals(1, synMap.submap.size());
+		assertTokIncludes(synMap, "a", "a1");
+		assertEquals(2, getSubSynonymMap(synMap, "a").submap.size());
+		assertTokIncludes(getSubSynonymMap(synMap, "a"), "b", "a2");
+		assertTokIncludes(getSubSynonymMap(synMap, "a"), "c", "a3");
+
+		// (a)->(b)->[a2]
+		//      [a1]
+		// (b)->(c)->[b2]
+		//      [b1]
+		rules.Clear();
+		rules.Add("a=>a1");
+		rules.Add("a b=>a2");
+		rules.Add("b=>b1");
+		rules.Add("b c=>b2");
+		synMap = new SlowSynonymMap(true);
+		SlowSynonymFilterFactory.parseRules(rules, synMap, "=>", ",", true, null);
+		assertEquals(2, synMap.submap.size());
+		assertTokIncludes(synMap, "a", "a1");
+		assertEquals(1, getSubSynonymMap(synMap, "a").submap.size());
+		assertTokIncludes(getSubSynonymMap(synMap, "a"), "b", "a2");
+		assertTokIncludes(synMap, "b", "b1");
+		assertEquals(1, getSubSynonymMap(synMap, "b").submap.size());
+		assertTokIncludes(getSubSynonymMap(synMap, "b"), "c", "b2");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRead1waySynonymRules() throws Exception
+	  public virtual void testRead1waySynonymRules()
+	  {
+		SlowSynonymMap synMap;
+
+		// (a)->[a]
+		// (b)->[a]
+		IList<string> rules = new List<string>();
+		rules.Add("a,b");
+		synMap = new SlowSynonymMap(true);
+		SlowSynonymFilterFactory.parseRules(rules, synMap, "=>", ",", false, null);
+		assertEquals(2, synMap.submap.size());
+		assertTokIncludes(synMap, "a", "a");
+		assertTokIncludes(synMap, "b", "a");
+
+		// (a)->[a]
+		// (b)->[a]
+		// (c)->[a]
+		rules.Clear();
+		rules.Add("a,b,c");
+		synMap = new SlowSynonymMap(true);
+		SlowSynonymFilterFactory.parseRules(rules, synMap, "=>", ",", false, null);
+		assertEquals(3, synMap.submap.size());
+		assertTokIncludes(synMap, "a", "a");
+		assertTokIncludes(synMap, "b", "a");
+		assertTokIncludes(synMap, "c", "a");
+
+		// (a)->[a]
+		// (b1)->(b2)->[a]
+		rules.Clear();
+		rules.Add("a,b1 b2");
+		synMap = new SlowSynonymMap(true);
+		SlowSynonymFilterFactory.parseRules(rules, synMap, "=>", ",", false, null);
+		assertEquals(2, synMap.submap.size());
+		assertTokIncludes(synMap, "a", "a");
+		assertEquals(1, getSubSynonymMap(synMap, "b1").submap.size());
+		assertTokIncludes(getSubSynonymMap(synMap, "b1"), "b2", "a");
+
+		// (a1)->(a2)->[a1][a2]
+		// (b)->[a1][a2]
+		rules.Clear();
+		rules.Add("a1 a2,b");
+		synMap = new SlowSynonymMap(true);
+		SlowSynonymFilterFactory.parseRules(rules, synMap, "=>", ",", false, null);
+		assertEquals(2, synMap.submap.size());
+		assertEquals(1, getSubSynonymMap(synMap, "a1").submap.size());
+		assertTokIncludes(getSubSynonymMap(synMap, "a1"), "a2", "a1");
+		assertTokIncludes(getSubSynonymMap(synMap, "a1"), "a2", "a2");
+		assertTokIncludes(synMap, "b", "a1");
+		assertTokIncludes(synMap, "b", "a2");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRead2waySynonymRules() throws Exception
+	  public virtual void testRead2waySynonymRules()
+	  {
+		SlowSynonymMap synMap;
+
+		// (a)->[a][b]
+		// (b)->[a][b]
+		IList<string> rules = new List<string>();
+		rules.Add("a,b");
+		synMap = new SlowSynonymMap(true);
+		SlowSynonymFilterFactory.parseRules(rules, synMap, "=>", ",", true, null);
+		assertEquals(2, synMap.submap.size());
+		assertTokIncludes(synMap, "a", "a");
+		assertTokIncludes(synMap, "a", "b");
+		assertTokIncludes(synMap, "b", "a");
+		assertTokIncludes(synMap, "b", "b");
+
+		// (a)->[a][b][c]
+		// (b)->[a][b][c]
+		// (c)->[a][b][c]
+		rules.Clear();
+		rules.Add("a,b,c");
+		synMap = new SlowSynonymMap(true);
+		SlowSynonymFilterFactory.parseRules(rules, synMap, "=>", ",", true, null);
+		assertEquals(3, synMap.submap.size());
+		assertTokIncludes(synMap, "a", "a");
+		assertTokIncludes(synMap, "a", "b");
+		assertTokIncludes(synMap, "a", "c");
+		assertTokIncludes(synMap, "b", "a");
+		assertTokIncludes(synMap, "b", "b");
+		assertTokIncludes(synMap, "b", "c");
+		assertTokIncludes(synMap, "c", "a");
+		assertTokIncludes(synMap, "c", "b");
+		assertTokIncludes(synMap, "c", "c");
+
+		// (a)->[a]
+		//      [b1][b2]
+		// (b1)->(b2)->[a]
+		//             [b1][b2]
+		rules.Clear();
+		rules.Add("a,b1 b2");
+		synMap = new SlowSynonymMap(true);
+		SlowSynonymFilterFactory.parseRules(rules, synMap, "=>", ",", true, null);
+		assertEquals(2, synMap.submap.size());
+		assertTokIncludes(synMap, "a", "a");
+		assertTokIncludes(synMap, "a", "b1");
+		assertTokIncludes(synMap, "a", "b2");
+		assertEquals(1, getSubSynonymMap(synMap, "b1").submap.size());
+		assertTokIncludes(getSubSynonymMap(synMap, "b1"), "b2", "a");
+		assertTokIncludes(getSubSynonymMap(synMap, "b1"), "b2", "b1");
+		assertTokIncludes(getSubSynonymMap(synMap, "b1"), "b2", "b2");
+
+		// (a1)->(a2)->[a1][a2]
+		//             [b]
+		// (b)->[a1][a2]
+		//      [b]
+		rules.Clear();
+		rules.Add("a1 a2,b");
+		synMap = new SlowSynonymMap(true);
+		SlowSynonymFilterFactory.parseRules(rules, synMap, "=>", ",", true, null);
+		assertEquals(2, synMap.submap.size());
+		assertEquals(1, getSubSynonymMap(synMap, "a1").submap.size());
+		assertTokIncludes(getSubSynonymMap(synMap, "a1"), "a2", "a1");
+		assertTokIncludes(getSubSynonymMap(synMap, "a1"), "a2", "a2");
+		assertTokIncludes(getSubSynonymMap(synMap, "a1"), "a2", "b");
+		assertTokIncludes(synMap, "b", "a1");
+		assertTokIncludes(synMap, "b", "a2");
+		assertTokIncludes(synMap, "b", "b");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBigramTokenizer() throws Exception
+	  public virtual void testBigramTokenizer()
+	  {
+		SlowSynonymMap synMap;
+
+		// prepare bi-gram tokenizer factory
+		IDictionary<string, string> args = new Dictionary<string, string>();
+		args[AbstractAnalysisFactory.LUCENE_MATCH_VERSION_PARAM] = "4.4";
+		args["minGramSize"] = "2";
+		args["maxGramSize"] = "2";
+		TokenizerFactory tf = new NGramTokenizerFactory(args);
+
+		// (ab)->(bc)->(cd)->[ef][fg][gh]
+		IList<string> rules = new List<string>();
+		rules.Add("abcd=>efgh");
+		synMap = new SlowSynonymMap(true);
+		SlowSynonymFilterFactory.parseRules(rules, synMap, "=>", ",", true, tf);
+		assertEquals(1, synMap.submap.size());
+		assertEquals(1, getSubSynonymMap(synMap, "ab").submap.size());
+		assertEquals(1, getSubSynonymMap(getSubSynonymMap(synMap, "ab"), "bc").submap.size());
+		assertTokIncludes(getSubSynonymMap(getSubSynonymMap(synMap, "ab"), "bc"), "cd", "ef");
+		assertTokIncludes(getSubSynonymMap(getSubSynonymMap(synMap, "ab"), "bc"), "cd", "fg");
+		assertTokIncludes(getSubSynonymMap(getSubSynonymMap(synMap, "ab"), "bc"), "cd", "gh");
+	  }
+
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testLoadRules() throws Exception
+	  public virtual void testLoadRules()
+	  {
+		IDictionary<string, string> args = new Dictionary<string, string>();
+		args["synonyms"] = "something.txt";
+		SlowSynonymFilterFactory ff = new SlowSynonymFilterFactory(args);
+		ff.inform(new ResourceLoaderAnonymousInnerClassHelper(this));
+
+		SlowSynonymMap synMap = ff.SynonymMap;
+		assertEquals(2, synMap.submap.size());
+		assertTokIncludes(synMap, "a", "a");
+		assertTokIncludes(synMap, "a", "b");
+		assertTokIncludes(synMap, "b", "a");
+		assertTokIncludes(synMap, "b", "b");
+	  }
+
+	  private class ResourceLoaderAnonymousInnerClassHelper : ResourceLoader
+	  {
+		  private readonly TestSynonymMap outerInstance;
+
+		  public ResourceLoaderAnonymousInnerClassHelper(TestSynonymMap outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+
+		  public override T newInstance<T>(string cname, Type<T> expectedType)
+		  {
+			throw new Exception("stub");
+		  }
+
+//JAVA TO C# CONVERTER TODO TASK: Java wildcard generics are not converted to .NET:
+//ORIGINAL LINE: @Override public <T> Class<? extends T> findClass(String cname, Class<T> expectedType)
+//JAVA TO C# CONVERTER TODO TASK: Java wildcard generics are not converted to .NET:
+//ORIGINAL LINE: @Override public <T> Class<? extends T> findClass(String cname, Class<T> expectedType)
+		  public override Type<?> findClass<T>(string cname, Type<T> expectedType) where ? : T
+		  {
+			throw new Exception("stub");
+		  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Override public java.io.InputStream openResource(String resource) throws java.io.IOException
+		  public override System.IO.Stream openResource(string resource)
+		  {
+			if (!"something.txt".Equals(resource))
+			{
+			  throw new Exception("should not get a differnt resource");
+			}
+			else
+			{
+			  return new ByteArrayInputStream("a,b".GetBytes("UTF-8"));
+			}
+		  }
+	  }
+
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: private void assertTokIncludes(SlowSynonymMap map, String src, String exp) throws Exception
+	  private void assertTokIncludes(SlowSynonymMap map, string src, string exp)
+	  {
+		Token[] tokens = map.submap.get(src).synonyms;
+		bool inc = false;
+		foreach (Token token in tokens)
+		{
+		  if (exp.Equals(new string(token.buffer(), 0, token.length())))
+		  {
+			inc = true;
+		  }
+		}
+		assertTrue(inc);
+	  }
+
+	  private SlowSynonymMap getSubSynonymMap(SlowSynonymMap map, string src)
+	  {
+		return map.submap.get(src);
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestSynonymMapFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestSynonymMapFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestSynonymMapFilter.cs
new file mode 100644
index 0000000..37da9ea
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestSynonymMapFilter.cs
@@ -0,0 +1,1350 @@
+using System;
+using System.Diagnostics;
+using System.Collections.Generic;
+using System.Text;
+
+/*
+ * 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 org.apache.lucene.analysis.synonym
+{
+
+
+	using KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+	using org.apache.lucene.analysis.tokenattributes;
+	using CharsRef = org.apache.lucene.util.CharsRef;
+	using TestUtil = org.apache.lucene.util.TestUtil;
+
+	public class TestSynonymMapFilter : BaseTokenStreamTestCase
+	{
+
+	  private SynonymMap.Builder b;
+	  private Tokenizer tokensIn;
+	  private SynonymFilter tokensOut;
+	  private CharTermAttribute termAtt;
+	  private PositionIncrementAttribute posIncrAtt;
+	  private PositionLengthAttribute posLenAtt;
+	  private OffsetAttribute offsetAtt;
+
+	  private void add(string input, string output, bool keepOrig)
+	  {
+		if (VERBOSE)
+		{
+		  Console.WriteLine("  add input=" + input + " output=" + output + " keepOrig=" + keepOrig);
+		}
+		CharsRef inputCharsRef = new CharsRef();
+		SynonymMap.Builder.join(input.Split(" +", true), inputCharsRef);
+
+		CharsRef outputCharsRef = new CharsRef();
+		SynonymMap.Builder.join(output.Split(" +", true), outputCharsRef);
+
+		b.add(inputCharsRef, outputCharsRef, keepOrig);
+	  }
+
+	  private void assertEquals(CharTermAttribute term, string expected)
+	  {
+		assertEquals(expected.Length, term.length());
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final char[] buffer = term.buffer();
+		char[] buffer = term.buffer();
+		for (int chIDX = 0;chIDX < expected.Length;chIDX++)
+		{
+		  assertEquals(expected[chIDX], buffer[chIDX]);
+		}
+	  }
+
+	  // For the output string: separate positions with a space,
+	  // and separate multiple tokens at each position with a
+	  // /.  If a token should have end offset != the input
+	  // token's end offset then add :X to it:
+
+	  // TODO: we should probably refactor this guy to use/take analyzer,
+	  // the tests are a little messy
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: private void verify(String input, String output) throws Exception
+	  private void verify(string input, string output)
+	  {
+		if (VERBOSE)
+		{
+		  Console.WriteLine("TEST: verify input=" + input + " expectedOutput=" + output);
+		}
+
+		tokensIn.Reader = new StringReader(input);
+		tokensOut.reset();
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final String[] expected = output.split(" ");
+		string[] expected = output.Split(" ", true);
+		int expectedUpto = 0;
+		while (tokensOut.incrementToken())
+		{
+
+		  if (VERBOSE)
+		  {
+			Console.WriteLine("  incr token=" + termAtt.ToString() + " posIncr=" + posIncrAtt.PositionIncrement + " startOff=" + offsetAtt.startOffset() + " endOff=" + offsetAtt.endOffset());
+		  }
+
+		  assertTrue(expectedUpto < expected.Length);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int startOffset = offsetAtt.startOffset();
+		  int startOffset = offsetAtt.startOffset();
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int endOffset = offsetAtt.endOffset();
+		  int endOffset = offsetAtt.endOffset();
+
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final String[] expectedAtPos = expected[expectedUpto++].split("/");
+		  string[] expectedAtPos = expected[expectedUpto++].Split("/", true);
+		  for (int atPos = 0;atPos < expectedAtPos.Length;atPos++)
+		  {
+			if (atPos > 0)
+			{
+			  assertTrue(tokensOut.incrementToken());
+			  if (VERBOSE)
+			  {
+				Console.WriteLine("  incr token=" + termAtt.ToString() + " posIncr=" + posIncrAtt.PositionIncrement + " startOff=" + offsetAtt.startOffset() + " endOff=" + offsetAtt.endOffset());
+			  }
+			}
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int colonIndex = expectedAtPos[atPos].indexOf(':');
+			int colonIndex = expectedAtPos[atPos].IndexOf(':');
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int underbarIndex = expectedAtPos[atPos].indexOf('_');
+			int underbarIndex = expectedAtPos[atPos].IndexOf('_');
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final String expectedToken;
+			string expectedToken;
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int expectedEndOffset;
+			int expectedEndOffset;
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int expectedPosLen;
+			int expectedPosLen;
+			if (colonIndex != -1)
+			{
+			  expectedToken = expectedAtPos[atPos].Substring(0, colonIndex);
+			  if (underbarIndex != -1)
+			  {
+				expectedEndOffset = int.Parse(expectedAtPos[atPos].Substring(1 + colonIndex, underbarIndex - (1 + colonIndex)));
+				expectedPosLen = int.Parse(expectedAtPos[atPos].Substring(1 + underbarIndex));
+			  }
+			  else
+			  {
+				expectedEndOffset = int.Parse(expectedAtPos[atPos].Substring(1 + colonIndex));
+				expectedPosLen = 1;
+			  }
+			}
+			else
+			{
+			  expectedToken = expectedAtPos[atPos];
+			  expectedEndOffset = endOffset;
+			  expectedPosLen = 1;
+			}
+			assertEquals(expectedToken, termAtt.ToString());
+			assertEquals(atPos == 0 ? 1 : 0, posIncrAtt.PositionIncrement);
+			// start/end offset of all tokens at same pos should
+			// be the same:
+			assertEquals(startOffset, offsetAtt.startOffset());
+			assertEquals(expectedEndOffset, offsetAtt.endOffset());
+			assertEquals(expectedPosLen, posLenAtt.PositionLength);
+		  }
+		}
+		tokensOut.end();
+		tokensOut.close();
+		if (VERBOSE)
+		{
+		  Console.WriteLine("  incr: END");
+		}
+		assertEquals(expectedUpto, expected.Length);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testDontKeepOrig() throws Exception
+	  public virtual void testDontKeepOrig()
+	  {
+		b = new SynonymMap.Builder(true);
+		add("a b", "foo", false);
+
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final SynonymMap map = b.build();
+		SynonymMap map = b.build();
+
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.Analyzer analyzer = new org.apache.lucene.analysis.Analyzer()
+		Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper(this, map);
+
+		assertAnalyzesTo(analyzer, "a b c", new string[] {"foo", "c"}, new int[] {0, 4}, new int[] {3, 5}, null, new int[] {1, 1}, new int[] {1, 1}, true);
+		checkAnalysisConsistency(random(), analyzer, false, "a b c");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestSynonymMapFilter outerInstance;
+
+		  private SynonymMap map;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestSynonymMapFilter outerInstance, SynonymMap map)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.map = map;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.SIMPLE, true);
+			return new TokenStreamComponents(tokenizer, new SynonymFilter(tokenizer, map, false));
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testDoKeepOrig() throws Exception
+	  public virtual void testDoKeepOrig()
+	  {
+		b = new SynonymMap.Builder(true);
+		add("a b", "foo", true);
+
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final SynonymMap map = b.build();
+		SynonymMap map = b.build();
+
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.Analyzer analyzer = new org.apache.lucene.analysis.Analyzer()
+		Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper2(this, map);
+
+		assertAnalyzesTo(analyzer, "a b c", new string[] {"a", "foo", "b", "c"}, new int[] {0, 0, 2, 4}, new int[] {1, 3, 3, 5}, null, new int[] {1, 0, 1, 1}, new int[] {1, 2, 1, 1}, true);
+		checkAnalysisConsistency(random(), analyzer, false, "a b c");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestSynonymMapFilter outerInstance;
+
+		  private SynonymMap map;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestSynonymMapFilter outerInstance, SynonymMap map)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.map = map;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.SIMPLE, true);
+			return new TokenStreamComponents(tokenizer, new SynonymFilter(tokenizer, map, false));
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBasic() throws Exception
+	  public virtual void testBasic()
+	  {
+		b = new SynonymMap.Builder(true);
+		add("a", "foo", true);
+		add("a b", "bar fee", true);
+		add("b c", "dog collar", true);
+		add("c d", "dog harness holder extras", true);
+		add("m c e", "dog barks loudly", false);
+		add("i j k", "feep", true);
+
+		add("e f", "foo bar", false);
+		add("e f", "baz bee", false);
+
+		add("z", "boo", false);
+		add("y", "bee", true);
+
+		tokensIn = new MockTokenizer(new StringReader("a"), MockTokenizer.WHITESPACE, true);
+		tokensIn.reset();
+		assertTrue(tokensIn.incrementToken());
+		assertFalse(tokensIn.incrementToken());
+		tokensIn.end();
+		tokensIn.close();
+
+		tokensOut = new SynonymFilter(tokensIn, b.build(), true);
+		termAtt = tokensOut.addAttribute(typeof(CharTermAttribute));
+		posIncrAtt = tokensOut.addAttribute(typeof(PositionIncrementAttribute));
+		posLenAtt = tokensOut.addAttribute(typeof(PositionLengthAttribute));
+		offsetAtt = tokensOut.addAttribute(typeof(OffsetAttribute));
+
+		verify("a b c", "a/bar b/fee c");
+
+		// syn output extends beyond input tokens
+		verify("x a b c d", "x a/bar b/fee c/dog d/harness holder extras");
+
+		verify("a b a", "a/bar b/fee a/foo");
+
+		// outputs that add to one another:
+		verify("c d c d", "c/dog d/harness c/holder/dog d/extras/harness holder extras");
+
+		// two outputs for same input
+		verify("e f", "foo/baz bar/bee");
+
+		// verify multi-word / single-output offsets:
+		verify("g i j k g", "g i/feep:7_3 j k g");
+
+		// mixed keepOrig true/false:
+		verify("a m c e x", "a/foo dog barks loudly x");
+		verify("c d m c e x", "c/dog d/harness holder/dog extras/barks loudly x");
+		assertTrue(tokensOut.CaptureCount > 0);
+
+		// no captureStates when no syns matched
+		verify("p q r s t", "p q r s t");
+		assertEquals(0, tokensOut.CaptureCount);
+
+		// no captureStates when only single-input syns, w/ no
+		// lookahead needed, matched
+		verify("p q z y t", "p q boo y/bee t");
+		assertEquals(0, tokensOut.CaptureCount);
+	  }
+
+	  private string getRandomString(char start, int alphabetSize, int length)
+	  {
+		Debug.Assert(alphabetSize <= 26);
+		char[] s = new char[2 * length];
+		for (int charIDX = 0;charIDX < length;charIDX++)
+		{
+		  s[2 * charIDX] = (char)(start + random().Next(alphabetSize));
+		  s[2 * charIDX + 1] = ' ';
+		}
+		return new string(s);
+	  }
+
+	  private class OneSyn
+	  {
+		internal string @in;
+		internal IList<string> @out;
+		internal bool keepOrig;
+	  }
+
+	  public virtual string slowSynMatcher(string doc, IList<OneSyn> syns, int maxOutputLength)
+	  {
+		assertTrue(doc.Length % 2 == 0);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int numInputs = doc.length()/2;
+		int numInputs = doc.Length / 2;
+		bool[] keepOrigs = new bool[numInputs];
+		bool[] hasMatch = new bool[numInputs];
+		Arrays.fill(keepOrigs, false);
+		string[] outputs = new string[numInputs + maxOutputLength];
+		OneSyn[] matches = new OneSyn[numInputs];
+		foreach (OneSyn syn in syns)
+		{
+		  int idx = -1;
+		  while (true)
+		  {
+			idx = doc.IndexOf(syn.@in, 1 + idx, StringComparison.Ordinal);
+			if (idx == -1)
+			{
+			  break;
+			}
+			assertTrue(idx % 2 == 0);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int matchIDX = idx/2;
+			int matchIDX = idx / 2;
+			assertTrue(syn.@in.Length % 2 == 1);
+			if (matches[matchIDX] == null)
+			{
+			  matches[matchIDX] = syn;
+			}
+			else if (syn.@in.Length > matches[matchIDX].@in.Length)
+			{
+			  // Greedy conflict resolution: longer match wins:
+			  matches[matchIDX] = syn;
+			}
+			else
+			{
+			  assertTrue(syn.@in.Length < matches[matchIDX].@in.Length);
+			}
+		  }
+		}
+
+		// Greedy conflict resolution: if syn matches a range of inputs,
+		// it prevents other syns from matching that range
+		for (int inputIDX = 0;inputIDX < numInputs;inputIDX++)
+		{
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final OneSyn match = matches[inputIDX];
+		  OneSyn match = matches[inputIDX];
+		  if (match != null)
+		  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int synInLength = (1+match.in.length())/2;
+			int synInLength = (1 + match.@in.Length) / 2;
+			for (int nextInputIDX = inputIDX + 1;nextInputIDX < numInputs && nextInputIDX < (inputIDX + synInLength);nextInputIDX++)
+			{
+			  matches[nextInputIDX] = null;
+			}
+		  }
+		}
+
+		// Fill overlapping outputs:
+		for (int inputIDX = 0;inputIDX < numInputs;inputIDX++)
+		{
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final OneSyn syn = matches[inputIDX];
+		  OneSyn syn = matches[inputIDX];
+		  if (syn == null)
+		  {
+			continue;
+		  }
+		  for (int idx = 0;idx < (1 + syn.@in.Length) / 2;idx++)
+		  {
+			hasMatch[inputIDX + idx] = true;
+			keepOrigs[inputIDX + idx] |= syn.keepOrig;
+		  }
+		  foreach (string synOut in syn.@out)
+		  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final String[] synOutputs = synOut.split(" ");
+			string[] synOutputs = synOut.Split(" ", true);
+			assertEquals(synOutputs.Length, (1 + synOut.Length) / 2);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int matchEnd = inputIDX + synOutputs.length;
+			int matchEnd = inputIDX + synOutputs.Length;
+			int synUpto = 0;
+			for (int matchIDX = inputIDX;matchIDX < matchEnd;matchIDX++)
+			{
+			  if (outputs[matchIDX] == null)
+			  {
+				outputs[matchIDX] = synOutputs[synUpto++];
+			  }
+			  else
+			  {
+				outputs[matchIDX] = outputs[matchIDX] + "/" + synOutputs[synUpto++];
+			  }
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int endOffset;
+			  int endOffset;
+			  if (matchIDX < numInputs)
+			  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int posLen;
+				int posLen;
+				if (synOutputs.Length == 1)
+				{
+				  // Add full endOffset
+				  endOffset = (inputIDX * 2) + syn.@in.Length;
+				  posLen = syn.keepOrig ? (1 + syn.@in.Length) / 2 : 1;
+				}
+				else
+				{
+				  // Add endOffset matching input token's
+				  endOffset = (matchIDX * 2) + 1;
+				  posLen = 1;
+				}
+				outputs[matchIDX] = outputs[matchIDX] + ":" + endOffset + "_" + posLen;
+			  }
+			}
+		  }
+		}
+
+		StringBuilder sb = new StringBuilder();
+		string[] inputTokens = doc.Split(" ", true);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int limit = inputTokens.length + maxOutputLength;
+		int limit = inputTokens.Length + maxOutputLength;
+		for (int inputIDX = 0;inputIDX < limit;inputIDX++)
+		{
+		  bool posHasOutput = false;
+		  if (inputIDX >= numInputs && outputs[inputIDX] == null)
+		  {
+			break;
+		  }
+		  if (inputIDX < numInputs && (!hasMatch[inputIDX] || keepOrigs[inputIDX]))
+		  {
+			assertTrue(inputTokens[inputIDX].Length != 0);
+			sb.Append(inputTokens[inputIDX]);
+			posHasOutput = true;
+		  }
+
+		  if (outputs[inputIDX] != null)
+		  {
+			if (posHasOutput)
+			{
+			  sb.Append('/');
+			}
+			sb.Append(outputs[inputIDX]);
+		  }
+		  else if (!posHasOutput)
+		  {
+			continue;
+		  }
+		  if (inputIDX < limit - 1)
+		  {
+			sb.Append(' ');
+		  }
+		}
+
+		return sb.ToString();
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandom() throws Exception
+	  public virtual void testRandom()
+	  {
+
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int alphabetSize = org.apache.lucene.util.TestUtil.nextInt(random(), 2, 7);
+		int alphabetSize = TestUtil.Next(random(), 2, 7);
+
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int docLen = atLeast(3000);
+		int docLen = atLeast(3000);
+		//final int docLen = 50;
+
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final String document = getRandomString('a', alphabetSize, docLen);
+		string document = getRandomString('a', alphabetSize, docLen);
+
+		if (VERBOSE)
+		{
+		  Console.WriteLine("TEST: doc=" + document);
+		}
+
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int numSyn = atLeast(5);
+		int numSyn = atLeast(5);
+		//final int numSyn = 2;
+
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final java.util.Map<String,OneSyn> synMap = new java.util.HashMap<>();
+		IDictionary<string, OneSyn> synMap = new Dictionary<string, OneSyn>();
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final java.util.List<OneSyn> syns = new java.util.ArrayList<>();
+		IList<OneSyn> syns = new List<OneSyn>();
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final boolean dedup = random().nextBoolean();
+		bool dedup = random().nextBoolean();
+		if (VERBOSE)
+		{
+		  Console.WriteLine("  dedup=" + dedup);
+		}
+		b = new SynonymMap.Builder(dedup);
+		for (int synIDX = 0;synIDX < numSyn;synIDX++)
+		{
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final String synIn = getRandomString('a', alphabetSize, org.apache.lucene.util.TestUtil.nextInt(random(), 1, 5)).trim();
+		  string synIn = getRandomString('a', alphabetSize, TestUtil.Next(random(), 1, 5)).Trim();
+		  OneSyn s = synMap[synIn];
+		  if (s == null)
+		  {
+			s = new OneSyn();
+			s.@in = synIn;
+			syns.Add(s);
+			s.@out = new List<>();
+			synMap[synIn] = s;
+			s.keepOrig = random().nextBoolean();
+		  }
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final String synOut = getRandomString('0', 10, org.apache.lucene.util.TestUtil.nextInt(random(), 1, 5)).trim();
+		  string synOut = getRandomString('0', 10, TestUtil.Next(random(), 1, 5)).Trim();
+		  s.@out.Add(synOut);
+		  add(synIn, synOut, s.keepOrig);
+		  if (VERBOSE)
+		  {
+			Console.WriteLine("  syns[" + synIDX + "] = " + s.@in + " -> " + s.@out + " keepOrig=" + s.keepOrig);
+		  }
+		}
+
+		tokensIn = new MockTokenizer(new StringReader("a"), MockTokenizer.WHITESPACE, true);
+		tokensIn.reset();
+		assertTrue(tokensIn.incrementToken());
+		assertFalse(tokensIn.incrementToken());
+		tokensIn.end();
+		tokensIn.close();
+
+		tokensOut = new SynonymFilter(tokensIn, b.build(), true);
+		termAtt = tokensOut.addAttribute(typeof(CharTermAttribute));
+		posIncrAtt = tokensOut.addAttribute(typeof(PositionIncrementAttribute));
+		posLenAtt = tokensOut.addAttribute(typeof(PositionLengthAttribute));
+		offsetAtt = tokensOut.addAttribute(typeof(OffsetAttribute));
+
+		if (dedup)
+		{
+		  pruneDups(syns);
+		}
+
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final String expected = slowSynMatcher(document, syns, 5);
+		string expected = slowSynMatcher(document, syns, 5);
+
+		if (VERBOSE)
+		{
+		  Console.WriteLine("TEST: expected=" + expected);
+		}
+
+		verify(document, expected);
+	  }
+
+	  private void pruneDups(IList<OneSyn> syns)
+	  {
+		ISet<string> seen = new HashSet<string>();
+		foreach (OneSyn syn in syns)
+		{
+		  int idx = 0;
+		  while (idx < syn.@out.Count)
+		  {
+			string @out = syn.@out[idx];
+			if (!seen.Contains(@out))
+			{
+			  seen.Add(@out);
+			  idx++;
+			}
+			else
+			{
+			  syn.@out.RemoveAt(idx);
+			}
+		  }
+		  seen.Clear();
+		}
+	  }
+
+	  private string randomNonEmptyString()
+	  {
+		while (true)
+		{
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final String s = org.apache.lucene.util.TestUtil.randomUnicodeString(random()).trim();
+		  string s = TestUtil.randomUnicodeString(random()).trim();
+		  if (s.Length != 0 && s.IndexOf('\u0000') == -1)
+		  {
+			return s;
+		  }
+		}
+	  }
+
+	  /// <summary>
+	  /// simple random test, doesn't verify correctness.
+	  ///  does verify it doesnt throw exceptions, or that the stream doesn't misbehave
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandom2() throws Exception
+	  public virtual void testRandom2()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int numIters = atLeast(3);
+		int numIters = atLeast(3);
+		for (int i = 0; i < numIters; i++)
+		{
+		  b = new SynonymMap.Builder(random().nextBoolean());
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int numEntries = atLeast(10);
+		  int numEntries = atLeast(10);
+		  for (int j = 0; j < numEntries; j++)
+		  {
+			add(randomNonEmptyString(), randomNonEmptyString(), random().nextBoolean());
+		  }
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final SynonymMap map = b.build();
+		  SynonymMap map = b.build();
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final boolean ignoreCase = random().nextBoolean();
+		  bool ignoreCase = random().nextBoolean();
+
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.Analyzer analyzer = new org.apache.lucene.analysis.Analyzer()
+		  Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper(this, map, ignoreCase);
+
+		  checkRandomData(random(), analyzer, 100);
+		}
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestSynonymMapFilter outerInstance;
+
+		  private SynonymMap map;
+		  private bool ignoreCase;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestSynonymMapFilter outerInstance, SynonymMap map, bool ignoreCase)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.map = map;
+			  this.ignoreCase = ignoreCase;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.SIMPLE, true);
+			return new TokenStreamComponents(tokenizer, new SynonymFilter(tokenizer, map, ignoreCase));
+		  }
+	  }
+
+	  // NOTE: this is an invalid test... SynFilter today can't
+	  // properly consume a graph... we can re-enable this once
+	  // we fix that...
+	  /*
+	  // Adds MockGraphTokenFilter before SynFilter:
+	  public void testRandom2GraphBefore() throws Exception {
+	    final int numIters = atLeast(10);
+	    Random random = random();
+	    for (int i = 0; i < numIters; i++) {
+	      b = new SynonymMap.Builder(random.nextBoolean());
+	      final int numEntries = atLeast(10);
+	      for (int j = 0; j < numEntries; j++) {
+	        add(randomNonEmptyString(), randomNonEmptyString(), random.nextBoolean());
+	      }
+	      final SynonymMap map = b.build();
+	      final boolean ignoreCase = random.nextBoolean();
+	      
+	      final Analyzer analyzer = new Analyzer() {
+	        @Override
+	        protected TokenStreamComponents createComponents(String fieldName, Reader reader) {
+	          Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.SIMPLE, true);
+	          TokenStream graph = new MockGraphTokenFilter(random(), tokenizer);
+	          return new TokenStreamComponents(tokenizer, new SynonymFilter(graph, map, ignoreCase));
+	        }
+	      };
+	
+	      checkRandomData(random, analyzer, 1000*RANDOM_MULTIPLIER);
+	    }
+	  }
+	  */
+
+	  // Adds MockGraphTokenFilter after SynFilter:
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandom2GraphAfter() throws Exception
+	  public virtual void testRandom2GraphAfter()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int numIters = atLeast(3);
+		int numIters = atLeast(3);
+		Random random = random();
+		for (int i = 0; i < numIters; i++)
+		{
+		  b = new SynonymMap.Builder(random.nextBoolean());
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int numEntries = atLeast(10);
+		  int numEntries = atLeast(10);
+		  for (int j = 0; j < numEntries; j++)
+		  {
+			add(randomNonEmptyString(), randomNonEmptyString(), random.nextBoolean());
+		  }
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final SynonymMap map = b.build();
+		  SynonymMap map = b.build();
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final boolean ignoreCase = random.nextBoolean();
+		  bool ignoreCase = random.nextBoolean();
+
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.Analyzer analyzer = new org.apache.lucene.analysis.Analyzer()
+		  Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper2(this, map, ignoreCase);
+
+		  checkRandomData(random, analyzer, 100);
+		}
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestSynonymMapFilter outerInstance;
+
+		  private SynonymMap map;
+		  private bool ignoreCase;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestSynonymMapFilter outerInstance, SynonymMap map, bool ignoreCase)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.map = map;
+			  this.ignoreCase = ignoreCase;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.SIMPLE, true);
+			TokenStream syns = new SynonymFilter(tokenizer, map, ignoreCase);
+			TokenStream graph = new MockGraphTokenFilter(random(), syns);
+			return new TokenStreamComponents(tokenizer, graph);
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Random random = random();
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int numIters = atLeast(10);
+		int numIters = atLeast(10);
+		for (int i = 0; i < numIters; i++)
+		{
+		  b = new SynonymMap.Builder(random.nextBoolean());
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int numEntries = atLeast(10);
+		  int numEntries = atLeast(10);
+		  for (int j = 0; j < numEntries; j++)
+		  {
+			add(randomNonEmptyString(), randomNonEmptyString(), random.nextBoolean());
+		  }
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final SynonymMap map = b.build();
+		  SynonymMap map = b.build();
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final boolean ignoreCase = random.nextBoolean();
+		  bool ignoreCase = random.nextBoolean();
+
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.Analyzer analyzer = new org.apache.lucene.analysis.Analyzer()
+		  Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper3(this, map, ignoreCase);
+
+		  checkAnalysisConsistency(random, analyzer, random.nextBoolean(), "");
+		}
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper3 : Analyzer
+	  {
+		  private readonly TestSynonymMapFilter outerInstance;
+
+		  private SynonymMap map;
+		  private bool ignoreCase;
+
+		  public AnalyzerAnonymousInnerClassHelper3(TestSynonymMapFilter outerInstance, SynonymMap map, bool ignoreCase)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.map = map;
+			  this.ignoreCase = ignoreCase;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new SynonymFilter(tokenizer, map, ignoreCase));
+		  }
+	  }
+
+	  /// <summary>
+	  /// simple random test like testRandom2, but for larger docs
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomHuge() throws Exception
+	  public virtual void testRandomHuge()
+	  {
+		Random random = random();
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int numIters = atLeast(3);
+		int numIters = atLeast(3);
+		for (int i = 0; i < numIters; i++)
+		{
+		  b = new SynonymMap.Builder(random.nextBoolean());
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int numEntries = atLeast(10);
+		  int numEntries = atLeast(10);
+		  if (VERBOSE)
+		  {
+			Console.WriteLine("TEST: iter=" + i + " numEntries=" + numEntries);
+		  }
+		  for (int j = 0; j < numEntries; j++)
+		  {
+			add(randomNonEmptyString(), randomNonEmptyString(), random.nextBoolean());
+		  }
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final SynonymMap map = b.build();
+		  SynonymMap map = b.build();
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final boolean ignoreCase = random.nextBoolean();
+		  bool ignoreCase = random.nextBoolean();
+
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.Analyzer analyzer = new org.apache.lucene.analysis.Analyzer()
+		  Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper4(this, map, ignoreCase);
+
+		  checkRandomData(random, analyzer, 100, 1024);
+		}
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper4 : Analyzer
+	  {
+		  private readonly TestSynonymMapFilter outerInstance;
+
+		  private SynonymMap map;
+		  private bool ignoreCase;
+
+		  public AnalyzerAnonymousInnerClassHelper4(TestSynonymMapFilter outerInstance, SynonymMap map, bool ignoreCase)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.map = map;
+			  this.ignoreCase = ignoreCase;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.SIMPLE, true);
+			return new TokenStreamComponents(tokenizer, new SynonymFilter(tokenizer, map, ignoreCase));
+		  }
+	  }
+
+	  // LUCENE-3375
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testVanishingTerms() throws Exception
+	  public virtual void testVanishingTerms()
+	  {
+		string testFile = "aaa => aaaa1 aaaa2 aaaa3\n" + "bbb => bbbb1 bbbb2\n";
+
+		SolrSynonymParser parser = new SolrSynonymParser(true, true, new MockAnalyzer(random()));
+		parser.parse(new StringReader(testFile));
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final SynonymMap map = parser.build();
+		SynonymMap map = parser.build();
+
+		Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper5(this, map);
+
+		// where did my pot go?!
+		assertAnalyzesTo(analyzer, "xyzzy bbb pot of gold", new string[] {"xyzzy", "bbbb1", "pot", "bbbb2", "of", "gold"});
+
+		// this one nukes 'pot' and 'of'
+		// xyzzy aaa pot of gold -> xyzzy aaaa1 aaaa2 aaaa3 gold
+		assertAnalyzesTo(analyzer, "xyzzy aaa pot of gold", new string[] {"xyzzy", "aaaa1", "pot", "aaaa2", "of", "aaaa3", "gold"});
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper5 : Analyzer
+	  {
+		  private readonly TestSynonymMapFilter outerInstance;
+
+		  private SynonymMap map;
+
+		  public AnalyzerAnonymousInnerClassHelper5(TestSynonymMapFilter outerInstance, SynonymMap map)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.map = map;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, true);
+			return new TokenStreamComponents(tokenizer, new SynonymFilter(tokenizer, map, true));
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBasic2() throws Exception
+	  public virtual void testBasic2()
+	  {
+		b = new SynonymMap.Builder(true);
+		const bool keepOrig = false;
+		add("aaa", "aaaa1 aaaa2 aaaa3", keepOrig);
+		add("bbb", "bbbb1 bbbb2", keepOrig);
+		tokensIn = new MockTokenizer(new StringReader("a"), MockTokenizer.WHITESPACE, true);
+		tokensIn.reset();
+		assertTrue(tokensIn.incrementToken());
+		assertFalse(tokensIn.incrementToken());
+		tokensIn.end();
+		tokensIn.close();
+
+		tokensOut = new SynonymFilter(tokensIn, b.build(), true);
+		termAtt = tokensOut.addAttribute(typeof(CharTermAttribute));
+		posIncrAtt = tokensOut.addAttribute(typeof(PositionIncrementAttribute));
+		posLenAtt = tokensOut.addAttribute(typeof(PositionLengthAttribute));
+		offsetAtt = tokensOut.addAttribute(typeof(OffsetAttribute));
+
+		if (keepOrig)
+		{
+		  verify("xyzzy bbb pot of gold", "xyzzy bbb/bbbb1 pot/bbbb2 of gold");
+		  verify("xyzzy aaa pot of gold", "xyzzy aaa/aaaa1 pot/aaaa2 of/aaaa3 gold");
+		}
+		else
+		{
+		  verify("xyzzy bbb pot of gold", "xyzzy bbbb1 pot/bbbb2 of gold");
+		  verify("xyzzy aaa pot of gold", "xyzzy aaaa1 pot/aaaa2 of/aaaa3 gold");
+		}
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMatching() throws Exception
+	  public virtual void testMatching()
+	  {
+		b = new SynonymMap.Builder(true);
+		const bool keepOrig = false;
+		add("a b", "ab", keepOrig);
+		add("a c", "ac", keepOrig);
+		add("a", "aa", keepOrig);
+		add("b", "bb", keepOrig);
+		add("z x c v", "zxcv", keepOrig);
+		add("x c", "xc", keepOrig);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final SynonymMap map = b.build();
+		SynonymMap map = b.build();
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper6(this, map);
+
+		checkOneTerm(a, "$", "$");
+		checkOneTerm(a, "a", "aa");
+		checkOneTerm(a, "b", "bb");
+
+		assertAnalyzesTo(a, "a $", new string[] {"aa", "$"}, new int[] {1, 1});
+
+		assertAnalyzesTo(a, "$ a", new string[] {"$", "aa"}, new int[] {1, 1});
+
+		assertAnalyzesTo(a, "a a", new string[] {"aa", "aa"}, new int[] {1, 1});
+
+		assertAnalyzesTo(a, "z x c v", new string[] {"zxcv"}, new int[] {1});
+
+		assertAnalyzesTo(a, "z x c $", new string[] {"z", "xc", "$"}, new int[] {1, 1, 1});
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper6 : Analyzer
+	  {
+		  private readonly TestSynonymMapFilter outerInstance;
+
+		  private SynonymMap map;
+
+		  public AnalyzerAnonymousInnerClassHelper6(TestSynonymMapFilter outerInstance, SynonymMap map)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.map = map;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(tokenizer, new SynonymFilter(tokenizer, map, true));
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRepeatsOff() throws Exception
+	  public virtual void testRepeatsOff()
+	  {
+		b = new SynonymMap.Builder(true);
+		const bool keepOrig = false;
+		add("a b", "ab", keepOrig);
+		add("a b", "ab", keepOrig);
+		add("a b", "ab", keepOrig);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final SynonymMap map = b.build();
+		SynonymMap map = b.build();
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper7(this, map);
+
+		assertAnalyzesTo(a, "a b", new string[] {"ab"}, new int[] {1});
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper7 : Analyzer
+	  {
+		  private readonly TestSynonymMapFilter outerInstance;
+
+		  private SynonymMap map;
+
+		  public AnalyzerAnonymousInnerClassHelper7(TestSynonymMapFilter outerInstance, SynonymMap map)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.map = map;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(tokenizer, new SynonymFilter(tokenizer, map, true));
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRepeatsOn() throws Exception
+	  public virtual void testRepeatsOn()
+	  {
+		b = new SynonymMap.Builder(false);
+		const bool keepOrig = false;
+		add("a b", "ab", keepOrig);
+		add("a b", "ab", keepOrig);
+		add("a b", "ab", keepOrig);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final SynonymMap map = b.build();
+		SynonymMap map = b.build();
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper8(this, map);
+
+		assertAnalyzesTo(a, "a b", new string[] {"ab", "ab", "ab"}, new int[] {1, 0, 0});
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper8 : Analyzer
+	  {
+		  private readonly TestSynonymMapFilter outerInstance;
+
+		  private SynonymMap map;
+
+		  public AnalyzerAnonymousInnerClassHelper8(TestSynonymMapFilter outerInstance, SynonymMap map)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.map = map;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(tokenizer, new SynonymFilter(tokenizer, map, true));
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRecursion() throws Exception
+	  public virtual void testRecursion()
+	  {
+		b = new SynonymMap.Builder(true);
+		const bool keepOrig = false;
+		add("zoo", "zoo", keepOrig);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final SynonymMap map = b.build();
+		SynonymMap map = b.build();
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper9(this, map);
+
+		assertAnalyzesTo(a, "zoo zoo $ zoo", new string[] {"zoo", "zoo", "$", "zoo"}, new int[] {1, 1, 1, 1});
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper9 : Analyzer
+	  {
+		  private readonly TestSynonymMapFilter outerInstance;
+
+		  private SynonymMap map;
+
+		  public AnalyzerAnonymousInnerClassHelper9(TestSynonymMapFilter outerInstance, SynonymMap map)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.map = map;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(tokenizer, new SynonymFilter(tokenizer, map, true));
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRecursion2() throws Exception
+	  public virtual void testRecursion2()
+	  {
+		b = new SynonymMap.Builder(true);
+		const bool keepOrig = false;
+		add("zoo", "zoo", keepOrig);
+		add("zoo", "zoo zoo", keepOrig);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final SynonymMap map = b.build();
+		SynonymMap map = b.build();
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper10(this, map);
+
+		// verify("zoo zoo $ zoo", "zoo/zoo zoo/zoo/zoo $/zoo zoo/zoo zoo");
+		assertAnalyzesTo(a, "zoo zoo $ zoo", new string[] {"zoo", "zoo", "zoo", "zoo", "zoo", "$", "zoo", "zoo", "zoo", "zoo"}, new int[] {1, 0, 1, 0, 0, 1, 0, 1, 0, 1});
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper10 : Analyzer
+	  {
+		  private readonly TestSynonymMapFilter outerInstance;
+
+		  private SynonymMap map;
+
+		  public AnalyzerAnonymousInnerClassHelper10(TestSynonymMapFilter outerInstance, SynonymMap map)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.map = map;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(tokenizer, new SynonymFilter(tokenizer, map, true));
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testOutputHangsOffEnd() throws Exception
+	  public virtual void testOutputHangsOffEnd()
+	  {
+		b = new SynonymMap.Builder(true);
+		const bool keepOrig = false;
+		// b hangs off the end (no input token under it):
+		add("a", "a b", keepOrig);
+		tokensIn = new MockTokenizer(new StringReader("a"), MockTokenizer.WHITESPACE, true);
+		tokensIn.reset();
+		assertTrue(tokensIn.incrementToken());
+		assertFalse(tokensIn.incrementToken());
+		tokensIn.end();
+		tokensIn.close();
+
+		tokensOut = new SynonymFilter(tokensIn, b.build(), true);
+		termAtt = tokensOut.addAttribute(typeof(CharTermAttribute));
+		posIncrAtt = tokensOut.addAttribute(typeof(PositionIncrementAttribute));
+		offsetAtt = tokensOut.addAttribute(typeof(OffsetAttribute));
+		posLenAtt = tokensOut.addAttribute(typeof(PositionLengthAttribute));
+
+		// Make sure endOffset inherits from previous input token:
+		verify("a", "a b:1");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testIncludeOrig() throws Exception
+	  public virtual void testIncludeOrig()
+	  {
+		b = new SynonymMap.Builder(true);
+		const bool keepOrig = true;
+		add("a b", "ab", keepOrig);
+		add("a c", "ac", keepOrig);
+		add("a", "aa", keepOrig);
+		add("b", "bb", keepOrig);
+		add("z x c v", "zxcv", keepOrig);
+		add("x c", "xc", keepOrig);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final SynonymMap map = b.build();
+		SynonymMap map = b.build();
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper11(this, map);
+
+		assertAnalyzesTo(a, "$", new string[] {"$"}, new int[] {1});
+		assertAnalyzesTo(a, "a", new string[] {"a", "aa"}, new int[] {1, 0});
+		assertAnalyzesTo(a, "a", new string[] {"a", "aa"}, new int[] {1, 0});
+		assertAnalyzesTo(a, "$ a", new string[] {"$", "a", "aa"}, new int[] {1, 1, 0});
+		assertAnalyzesTo(a, "a $", new string[] {"a", "aa", "$"}, new int[] {1, 0, 1});
+		assertAnalyzesTo(a, "$ a !", new string[] {"$", "a", "aa", "!"}, new int[] {1, 1, 0, 1});
+		assertAnalyzesTo(a, "a a", new string[] {"a", "aa", "a", "aa"}, new int[] {1, 0, 1, 0});
+		assertAnalyzesTo(a, "b", new string[] {"b", "bb"}, new int[] {1, 0});
+		assertAnalyzesTo(a, "z x c v", new string[] {"z", "zxcv", "x", "c", "v"}, new int[] {1, 0, 1, 1, 1});
+		assertAnalyzesTo(a, "z x c $", new string[] {"z", "x", "xc", "c", "$"}, new int[] {1, 1, 0, 1, 1});
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper11 : Analyzer
+	  {
+		  private readonly TestSynonymMapFilter outerInstance;
+
+		  private SynonymMap map;
+
+		  public AnalyzerAnonymousInnerClassHelper11(TestSynonymMapFilter outerInstance, SynonymMap map)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.map = map;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(tokenizer, new SynonymFilter(tokenizer, map, true));
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRecursion3() throws Exception
+	  public virtual void testRecursion3()
+	  {
+		b = new SynonymMap.Builder(true);
+		const bool keepOrig = true;
+		add("zoo zoo", "zoo", keepOrig);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final SynonymMap map = b.build();
+		SynonymMap map = b.build();
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper12(this, map);
+
+		assertAnalyzesTo(a, "zoo zoo $ zoo", new string[] {"zoo", "zoo", "zoo", "$", "zoo"}, new int[] {1, 0, 1, 1, 1});
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper12 : Analyzer
+	  {
+		  private readonly TestSynonymMapFilter outerInstance;
+
+		  private SynonymMap map;
+
+		  public AnalyzerAnonymousInnerClassHelper12(TestSynonymMapFilter outerInstance, SynonymMap map)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.map = map;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(tokenizer, new SynonymFilter(tokenizer, map, true));
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRecursion4() throws Exception
+	  public virtual void testRecursion4()
+	  {
+		b = new SynonymMap.Builder(true);
+		const bool keepOrig = true;
+		add("zoo zoo", "zoo", keepOrig);
+		add("zoo", "zoo zoo", keepOrig);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final SynonymMap map = b.build();
+		SynonymMap map = b.build();
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper13(this, map);
+
+		assertAnalyzesTo(a, "zoo zoo $ zoo", new string[] {"zoo", "zoo", "zoo", "$", "zoo", "zoo", "zoo"}, new int[] {1, 0, 1, 1, 1, 0, 1});
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper13 : Analyzer
+	  {
+		  private readonly TestSynonymMapFilter outerInstance;
+
+		  private SynonymMap map;
+
+		  public AnalyzerAnonymousInnerClassHelper13(TestSynonymMapFilter outerInstance, SynonymMap map)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.map = map;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(tokenizer, new SynonymFilter(tokenizer, map, true));
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMultiwordOffsets() throws Exception
+	  public virtual void testMultiwordOffsets()
+	  {
+		b = new SynonymMap.Builder(true);
+		const bool keepOrig = true;
+		add("national hockey league", "nhl", keepOrig);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final SynonymMap map = b.build();
+		SynonymMap map = b.build();
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper14(this, map);
+
+		assertAnalyzesTo(a, "national hockey league", new string[] {"national", "nhl", "hockey", "league"}, new int[] {0, 0, 9, 16}, new int[] {8, 22, 15, 22}, new int[] {1, 0, 1, 1});
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper14 : Analyzer
+	  {
+		  private readonly TestSynonymMapFilter outerInstance;
+
+		  private SynonymMap map;
+
+		  public AnalyzerAnonymousInnerClassHelper14(TestSynonymMapFilter outerInstance, SynonymMap map)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.map = map;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(tokenizer, new SynonymFilter(tokenizer, map, true));
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmpty() throws Exception
+	  public virtual void testEmpty()
+	  {
+		Tokenizer tokenizer = new MockTokenizer(new StringReader("aa bb"));
+		try
+		{
+		  new SynonymFilter(tokenizer, (new SynonymMap.Builder(true)).build(), true);
+		  fail("did not hit expected exception");
+		}
+		catch (System.ArgumentException iae)
+		{
+		  // expected
+		  assertEquals("fst must be non-null", iae.Message);
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestWordnetSynonymParser.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestWordnetSynonymParser.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestWordnetSynonymParser.cs
new file mode 100644
index 0000000..c68f97d
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestWordnetSynonymParser.cs
@@ -0,0 +1,70 @@
+/*
+ * 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 org.apache.lucene.analysis.synonym
+{
+
+
+
+	public class TestWordnetSynonymParser : BaseTokenStreamTestCase
+	{
+
+	  internal string synonymsFile = "s(100000001,1,'woods',n,1,0).\n" + "s(100000001,2,'wood',n,1,0).\n" + "s(100000001,3,'forest',n,1,0).\n" + "s(100000002,1,'wolfish',n,1,0).\n" + "s(100000002,2,'ravenous',n,1,0).\n" + "s(100000003,1,'king',n,1,1).\n" + "s(100000003,2,'baron',n,1,1).\n" + "s(100000004,1,'king''s evil',n,1,1).\n" + "s(100000004,2,'king''s meany',n,1,1).\n";
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testSynonyms() throws Exception
+	  public virtual void testSynonyms()
+	  {
+		WordnetSynonymParser parser = new WordnetSynonymParser(true, true, new MockAnalyzer(random()));
+		parser.parse(new StringReader(synonymsFile));
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final SynonymMap map = parser.build();
+		SynonymMap map = parser.build();
+
+		Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper(this, map);
+
+		/* all expansions */
+		assertAnalyzesTo(analyzer, "Lost in the woods", new string[] {"Lost", "in", "the", "woods", "wood", "forest"}, new int[] {0, 5, 8, 12, 12, 12}, new int[] {4, 7, 11, 17, 17, 17}, new int[] {1, 1, 1, 1, 0, 0});
+
+		/* single quote */
+		assertAnalyzesTo(analyzer, "king", new string[] {"king", "baron"});
+
+		/* multi words */
+		assertAnalyzesTo(analyzer, "king's evil", new string[] {"king's", "king's", "evil", "meany"});
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestWordnetSynonymParser outerInstance;
+
+		  private SynonymMap map;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestWordnetSynonymParser outerInstance, SynonymMap map)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.map = map;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(tokenizer, new SynonymFilter(tokenizer, map, false));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file


[17/27] lucenenet git commit: adding converted analysis common tests

Posted by sy...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/El/TestGreekStemmer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/El/TestGreekStemmer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/El/TestGreekStemmer.cs
new file mode 100644
index 0000000..a022749
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/El/TestGreekStemmer.cs
@@ -0,0 +1,571 @@
+namespace org.apache.lucene.analysis.el
+{
+
+	/*
+	 * 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 KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+
+	public class TestGreekStemmer : BaseTokenStreamTestCase
+	{
+	  internal Analyzer a = new GreekAnalyzer(TEST_VERSION_CURRENT);
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMasculineNouns() throws Exception
+	  public virtual void testMasculineNouns()
+	  {
+		// -ος
+		checkOneTerm(a, "άνθρωπος", "ανθρωπ");
+		checkOneTerm(a, "ανθρώπου", "ανθρωπ");
+		checkOneTerm(a, "άνθρωπο", "ανθρωπ");
+		checkOneTerm(a, "άνθρωπε", "ανθρωπ");
+		checkOneTerm(a, "άνθρωποι", "ανθρωπ");
+		checkOneTerm(a, "ανθρώπων", "ανθρωπ");
+		checkOneTerm(a, "ανθρώπους", "ανθρωπ");
+		checkOneTerm(a, "άνθρωποι", "ανθρωπ");
+
+		// -ης
+		checkOneTerm(a, "πελάτης", "πελατ");
+		checkOneTerm(a, "πελάτη", "πελατ");
+		checkOneTerm(a, "πελάτες", "πελατ");
+		checkOneTerm(a, "πελατών", "πελατ");
+
+		// -ας/-ες
+		checkOneTerm(a, "ελέφαντας", "ελεφαντ");
+		checkOneTerm(a, "ελέφαντα", "ελεφαντ");
+		checkOneTerm(a, "ελέφαντες", "ελεφαντ");
+		checkOneTerm(a, "ελεφάντων", "ελεφαντ");
+
+		// -ας/-αδες
+		checkOneTerm(a, "μπαμπάς", "μπαμπ");
+		checkOneTerm(a, "μπαμπά", "μπαμπ");
+		checkOneTerm(a, "μπαμπάδες", "μπαμπ");
+		checkOneTerm(a, "μπαμπάδων", "μπαμπ");
+
+		// -ης/-ηδες
+		checkOneTerm(a, "μπακάλης", "μπακαλ");
+		checkOneTerm(a, "μπακάλη", "μπακαλ");
+		checkOneTerm(a, "μπακάληδες", "μπακαλ");
+		checkOneTerm(a, "μπακάληδων", "μπακαλ");
+
+		// -ες
+		checkOneTerm(a, "καφές", "καφ");
+		checkOneTerm(a, "καφέ", "καφ");
+		checkOneTerm(a, "καφέδες", "καφ");
+		checkOneTerm(a, "καφέδων", "καφ");
+
+		// -έας/είς
+		checkOneTerm(a, "γραμματέας", "γραμματε");
+		checkOneTerm(a, "γραμματέα", "γραμματε");
+		// plural forms conflate w/ each other, not w/ the sing forms
+		checkOneTerm(a, "γραμματείς", "γραμματ");
+		checkOneTerm(a, "γραμματέων", "γραμματ");
+
+		// -ους/οι
+		checkOneTerm(a, "απόπλους", "αποπλ");
+		checkOneTerm(a, "απόπλου", "αποπλ");
+		checkOneTerm(a, "απόπλοι", "αποπλ");
+		checkOneTerm(a, "απόπλων", "αποπλ");
+
+		// -ους/-ουδες
+		checkOneTerm(a, "παππούς", "παππ");
+		checkOneTerm(a, "παππού", "παππ");
+		checkOneTerm(a, "παππούδες", "παππ");
+		checkOneTerm(a, "παππούδων", "παππ");
+
+		// -ης/-εις
+		checkOneTerm(a, "λάτρης", "λατρ");
+		checkOneTerm(a, "λάτρη", "λατρ");
+		checkOneTerm(a, "λάτρεις", "λατρ");
+		checkOneTerm(a, "λάτρεων", "λατρ");
+
+		// -υς
+		checkOneTerm(a, "πέλεκυς", "πελεκ");
+		checkOneTerm(a, "πέλεκυ", "πελεκ");
+		checkOneTerm(a, "πελέκεις", "πελεκ");
+		checkOneTerm(a, "πελέκεων", "πελεκ");
+
+		// -ωρ
+		// note: nom./voc. doesn't conflate w/ the rest
+		checkOneTerm(a, "μέντωρ", "μεντωρ");
+		checkOneTerm(a, "μέντορος", "μεντορ");
+		checkOneTerm(a, "μέντορα", "μεντορ");
+		checkOneTerm(a, "μέντορες", "μεντορ");
+		checkOneTerm(a, "μεντόρων", "μεντορ");
+
+		// -ων
+		checkOneTerm(a, "αγώνας", "αγων");
+		checkOneTerm(a, "αγώνος", "αγων");
+		checkOneTerm(a, "αγώνα", "αγων");
+		checkOneTerm(a, "αγώνα", "αγων");
+		checkOneTerm(a, "αγώνες", "αγων");
+		checkOneTerm(a, "αγώνων", "αγων");
+
+		// -ας/-ηδες
+		checkOneTerm(a, "αέρας", "αερ");
+		checkOneTerm(a, "αέρα", "αερ");
+		checkOneTerm(a, "αέρηδες", "αερ");
+		checkOneTerm(a, "αέρηδων", "αερ");
+
+		// -ης/-ητες
+		checkOneTerm(a, "γόης", "γο");
+		checkOneTerm(a, "γόη", "γοη"); // too short
+		// the two plural forms conflate
+		checkOneTerm(a, "γόητες", "γοητ");
+		checkOneTerm(a, "γοήτων", "γοητ");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFeminineNouns() throws Exception
+	  public virtual void testFeminineNouns()
+	  {
+		// -α/-ες,-ών
+		checkOneTerm(a, "φορά", "φορ");
+		checkOneTerm(a, "φοράς", "φορ");
+		checkOneTerm(a, "φορές", "φορ");
+		checkOneTerm(a, "φορών", "φορ");
+
+		// -α/-ες,-ων
+		checkOneTerm(a, "αγελάδα", "αγελαδ");
+		checkOneTerm(a, "αγελάδας", "αγελαδ");
+		checkOneTerm(a, "αγελάδες", "αγελαδ");
+		checkOneTerm(a, "αγελάδων", "αγελαδ");
+
+		// -η/-ες
+		checkOneTerm(a, "ζάχαρη", "ζαχαρ");
+		checkOneTerm(a, "ζάχαρης", "ζαχαρ");
+		checkOneTerm(a, "ζάχαρες", "ζαχαρ");
+		checkOneTerm(a, "ζαχάρεων", "ζαχαρ");
+
+		// -η/-εις
+		checkOneTerm(a, "τηλεόραση", "τηλεορασ");
+		checkOneTerm(a, "τηλεόρασης", "τηλεορασ");
+		checkOneTerm(a, "τηλεοράσεις", "τηλεορασ");
+		checkOneTerm(a, "τηλεοράσεων", "τηλεορασ");
+
+		// -α/-αδες
+		checkOneTerm(a, "μαμά", "μαμ");
+		checkOneTerm(a, "μαμάς", "μαμ");
+		checkOneTerm(a, "μαμάδες", "μαμ");
+		checkOneTerm(a, "μαμάδων", "μαμ");
+
+		// -ος
+		checkOneTerm(a, "λεωφόρος", "λεωφορ");
+		checkOneTerm(a, "λεωφόρου", "λεωφορ");
+		checkOneTerm(a, "λεωφόρο", "λεωφορ");
+		checkOneTerm(a, "λεωφόρε", "λεωφορ");
+		checkOneTerm(a, "λεωφόροι", "λεωφορ");
+		checkOneTerm(a, "λεωφόρων", "λεωφορ");
+		checkOneTerm(a, "λεωφόρους", "λεωφορ");
+
+		// -ου
+		checkOneTerm(a, "αλεπού", "αλεπ");
+		checkOneTerm(a, "αλεπούς", "αλεπ");
+		checkOneTerm(a, "αλεπούδες", "αλεπ");
+		checkOneTerm(a, "αλεπούδων", "αλεπ");
+
+		// -έας/είς
+		// note: not all forms conflate
+		checkOneTerm(a, "γραμματέας", "γραμματε");
+		checkOneTerm(a, "γραμματέως", "γραμματ");
+		checkOneTerm(a, "γραμματέα", "γραμματε");
+		checkOneTerm(a, "γραμματείς", "γραμματ");
+		checkOneTerm(a, "γραμματέων", "γραμματ");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNeuterNouns() throws Exception
+	  public virtual void testNeuterNouns()
+	  {
+		// ending with -ο
+		// note: nom doesnt conflate
+		checkOneTerm(a, "βιβλίο", "βιβλι");
+		checkOneTerm(a, "βιβλίου", "βιβλ");
+		checkOneTerm(a, "βιβλία", "βιβλ");
+		checkOneTerm(a, "βιβλίων", "βιβλ");
+
+		// ending with -ι
+		checkOneTerm(a, "πουλί", "πουλ");
+		checkOneTerm(a, "πουλιού", "πουλ");
+		checkOneTerm(a, "πουλιά", "πουλ");
+		checkOneTerm(a, "πουλιών", "πουλ");
+
+		// ending with -α
+		// note: nom. doesnt conflate
+		checkOneTerm(a, "πρόβλημα", "προβλημ");
+		checkOneTerm(a, "προβλήματος", "προβλημα");
+		checkOneTerm(a, "προβλήματα", "προβλημα");
+		checkOneTerm(a, "προβλημάτων", "προβλημα");
+
+		// ending with -ος/-ους
+		checkOneTerm(a, "πέλαγος", "πελαγ");
+		checkOneTerm(a, "πελάγους", "πελαγ");
+		checkOneTerm(a, "πελάγη", "πελαγ");
+		checkOneTerm(a, "πελάγων", "πελαγ");
+
+		// ending with -ός/-ότος
+		checkOneTerm(a, "γεγονός", "γεγον");
+		checkOneTerm(a, "γεγονότος", "γεγον");
+		checkOneTerm(a, "γεγονότα", "γεγον");
+		checkOneTerm(a, "γεγονότων", "γεγον");
+
+		// ending with -υ/-ιου
+		checkOneTerm(a, "βράδυ", "βραδ");
+		checkOneTerm(a, "βράδι", "βραδ");
+		checkOneTerm(a, "βραδιού", "βραδ");
+		checkOneTerm(a, "βράδια", "βραδ");
+		checkOneTerm(a, "βραδιών", "βραδ");
+
+		// ending with -υ/-ατος
+		// note: nom. doesnt conflate
+		checkOneTerm(a, "δόρυ", "δορ");
+		checkOneTerm(a, "δόρατος", "δορατ");
+		checkOneTerm(a, "δόρατα", "δορατ");
+		checkOneTerm(a, "δοράτων", "δορατ");
+
+		// ending with -ας
+		checkOneTerm(a, "κρέας", "κρε");
+		checkOneTerm(a, "κρέατος", "κρε");
+		checkOneTerm(a, "κρέατα", "κρε");
+		checkOneTerm(a, "κρεάτων", "κρε");
+
+		// ending with -ως
+		checkOneTerm(a, "λυκόφως", "λυκοφω");
+		checkOneTerm(a, "λυκόφωτος", "λυκοφω");
+		checkOneTerm(a, "λυκόφωτα", "λυκοφω");
+		checkOneTerm(a, "λυκοφώτων", "λυκοφω");
+
+		// ending with -ον/-ου
+		// note: nom. doesnt conflate
+		checkOneTerm(a, "μέσον", "μεσον");
+		checkOneTerm(a, "μέσου", "μεσ");
+		checkOneTerm(a, "μέσα", "μεσ");
+		checkOneTerm(a, "μέσων", "μεσ");
+
+		// ending in -ον/-οντος
+		// note: nom. doesnt conflate
+		checkOneTerm(a, "ενδιαφέρον", "ενδιαφερον");
+		checkOneTerm(a, "ενδιαφέροντος", "ενδιαφεροντ");
+		checkOneTerm(a, "ενδιαφέροντα", "ενδιαφεροντ");
+		checkOneTerm(a, "ενδιαφερόντων", "ενδιαφεροντ");
+
+		// ending with -εν/-εντος
+		checkOneTerm(a, "ανακοινωθέν", "ανακοινωθεν");
+		checkOneTerm(a, "ανακοινωθέντος", "ανακοινωθεντ");
+		checkOneTerm(a, "ανακοινωθέντα", "ανακοινωθεντ");
+		checkOneTerm(a, "ανακοινωθέντων", "ανακοινωθεντ");
+
+		// ending with -αν/-αντος
+		checkOneTerm(a, "σύμπαν", "συμπ");
+		checkOneTerm(a, "σύμπαντος", "συμπαντ");
+		checkOneTerm(a, "σύμπαντα", "συμπαντ");
+		checkOneTerm(a, "συμπάντων", "συμπαντ");
+
+		// ending with  -α/-ακτος
+		checkOneTerm(a, "γάλα", "γαλ");
+		checkOneTerm(a, "γάλακτος", "γαλακτ");
+		checkOneTerm(a, "γάλατα", "γαλατ");
+		checkOneTerm(a, "γαλάκτων", "γαλακτ");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testAdjectives() throws Exception
+	  public virtual void testAdjectives()
+	  {
+		// ending with -ής, -ές/-είς, -ή
+		checkOneTerm(a, "συνεχής", "συνεχ");
+		checkOneTerm(a, "συνεχούς", "συνεχ");
+		checkOneTerm(a, "συνεχή", "συνεχ");
+		checkOneTerm(a, "συνεχών", "συνεχ");
+		checkOneTerm(a, "συνεχείς", "συνεχ");
+		checkOneTerm(a, "συνεχές", "συνεχ");
+
+		// ending with -ης, -ες/-εις, -η
+		checkOneTerm(a, "συνήθης", "συνηθ");
+		checkOneTerm(a, "συνήθους", "συνηθ");
+		checkOneTerm(a, "συνήθη", "συνηθ");
+		// note: doesn't conflate
+		checkOneTerm(a, "συνήθεις", "συν");
+		checkOneTerm(a, "συνήθων", "συνηθ");
+		checkOneTerm(a, "σύνηθες", "συνηθ");
+
+		// ending with -υς, -υ/-εις, -ια
+		checkOneTerm(a, "βαθύς", "βαθ");
+		checkOneTerm(a, "βαθέος", "βαθε");
+		checkOneTerm(a, "βαθύ", "βαθ");
+		checkOneTerm(a, "βαθείς", "βαθ");
+		checkOneTerm(a, "βαθέων", "βαθ");
+
+		checkOneTerm(a, "βαθιά", "βαθ");
+		checkOneTerm(a, "βαθιάς", "βαθι");
+		checkOneTerm(a, "βαθιές", "βαθι");
+		checkOneTerm(a, "βαθιών", "βαθ");
+
+		checkOneTerm(a, "βαθέα", "βαθε");
+
+		// comparative/superlative
+		checkOneTerm(a, "ψηλός", "ψηλ");
+		checkOneTerm(a, "ψηλότερος", "ψηλ");
+		checkOneTerm(a, "ψηλότατος", "ψηλ");
+
+		checkOneTerm(a, "ωραίος", "ωραι");
+		checkOneTerm(a, "ωραιότερος", "ωραι");
+		checkOneTerm(a, "ωραιότατος", "ωραι");
+
+		checkOneTerm(a, "επιεικής", "επιεικ");
+		checkOneTerm(a, "επιεικέστερος", "επιεικ");
+		checkOneTerm(a, "επιεικέστατος", "επιεικ");
+	  }
+
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testVerbs() throws Exception
+	  public virtual void testVerbs()
+	  {
+		// note, past/present verb stems will not conflate (from the paper)
+		//-ω,-α/-.ω,-.α
+		checkOneTerm(a, "ορίζω", "οριζ");
+		checkOneTerm(a, "όριζα", "οριζ");
+		checkOneTerm(a, "όριζε", "οριζ");
+		checkOneTerm(a, "ορίζοντας", "οριζ");
+		checkOneTerm(a, "ορίζομαι", "οριζ");
+		checkOneTerm(a, "οριζόμουν", "οριζ");
+		checkOneTerm(a, "ορίζεσαι", "οριζ");
+
+		checkOneTerm(a, "όρισα", "ορισ");
+		checkOneTerm(a, "ορίσω", "ορισ");
+		checkOneTerm(a, "όρισε", "ορισ");
+		checkOneTerm(a, "ορίσει", "ορισ");
+
+		checkOneTerm(a, "ορίστηκα", "οριστ");
+		checkOneTerm(a, "οριστώ", "οριστ");
+		checkOneTerm(a, "οριστείς", "οριστ");
+		checkOneTerm(a, "οριστεί", "οριστ");
+
+		checkOneTerm(a, "ορισμένο", "ορισμεν");
+		checkOneTerm(a, "ορισμένη", "ορισμεν");
+		checkOneTerm(a, "ορισμένος", "ορισμεν");
+
+		// -ω,-α/-ξω,-ξα
+		checkOneTerm(a, "ανοίγω", "ανοιγ");
+		checkOneTerm(a, "άνοιγα", "ανοιγ");
+		checkOneTerm(a, "άνοιγε", "ανοιγ");
+		checkOneTerm(a, "ανοίγοντας", "ανοιγ");
+		checkOneTerm(a, "ανοίγομαι", "ανοιγ");
+		checkOneTerm(a, "ανοιγόμουν", "ανοιγ");
+
+		checkOneTerm(a, "άνοιξα", "ανοιξ");
+		checkOneTerm(a, "ανοίξω", "ανοιξ");
+		checkOneTerm(a, "άνοιξε", "ανοιξ");
+		checkOneTerm(a, "ανοίξει", "ανοιξ");
+
+		checkOneTerm(a, "ανοίχτηκα", "ανοιχτ");
+		checkOneTerm(a, "ανοιχτώ", "ανοιχτ");
+		checkOneTerm(a, "ανοίχτηκα", "ανοιχτ");
+		checkOneTerm(a, "ανοιχτείς", "ανοιχτ");
+		checkOneTerm(a, "ανοιχτεί", "ανοιχτ");
+
+		checkOneTerm(a, "ανοίξου", "ανοιξ");
+
+		//-ώ/-άω,-ούσα/-άσω,-ασα
+		checkOneTerm(a, "περνώ", "περν");
+		checkOneTerm(a, "περνάω", "περν");
+		checkOneTerm(a, "περνούσα", "περν");
+		checkOneTerm(a, "πέρναγα", "περν");
+		checkOneTerm(a, "πέρνα", "περν");
+		checkOneTerm(a, "περνώντας", "περν");
+
+		checkOneTerm(a, "πέρασα", "περασ");
+		checkOneTerm(a, "περάσω", "περασ");
+		checkOneTerm(a, "πέρασε", "περασ");
+		checkOneTerm(a, "περάσει", "περασ");
+
+		checkOneTerm(a, "περνιέμαι", "περν");
+		checkOneTerm(a, "περνιόμουν", "περν");
+
+		checkOneTerm(a, "περάστηκα", "περαστ");
+		checkOneTerm(a, "περαστώ", "περαστ");
+		checkOneTerm(a, "περαστείς", "περαστ");
+		checkOneTerm(a, "περαστεί", "περαστ");
+
+		checkOneTerm(a, "περασμένο", "περασμεν");
+		checkOneTerm(a, "περασμένη", "περασμεν");
+		checkOneTerm(a, "περασμένος", "περασμεν");
+
+		// -ώ/-άω,-ούσα/-άξω,-αξα
+		checkOneTerm(a, "πετώ", "πετ");
+		checkOneTerm(a, "πετάω", "πετ");
+		checkOneTerm(a, "πετούσα", "πετ");
+		checkOneTerm(a, "πέταγα", "πετ");
+		checkOneTerm(a, "πέτα", "πετ");
+		checkOneTerm(a, "πετώντας", "πετ");
+		checkOneTerm(a, "πετιέμαι", "πετ");
+		checkOneTerm(a, "πετιόμουν", "πετ");
+
+		checkOneTerm(a, "πέταξα", "πεταξ");
+		checkOneTerm(a, "πετάξω", "πεταξ");
+		checkOneTerm(a, "πέταξε", "πεταξ");
+		checkOneTerm(a, "πετάξει", "πεταξ");
+
+		checkOneTerm(a, "πετάχτηκα", "πεταχτ");
+		checkOneTerm(a, "πεταχτώ", "πεταχτ");
+		checkOneTerm(a, "πεταχτείς", "πεταχτ");
+		checkOneTerm(a, "πεταχτεί", "πεταχτ");
+
+		checkOneTerm(a, "πεταμένο", "πεταμεν");
+		checkOneTerm(a, "πεταμένη", "πεταμεν");
+		checkOneTerm(a, "πεταμένος", "πεταμεν");
+
+		// -ώ/-άω,-ούσα / -έσω,-εσα
+		checkOneTerm(a, "καλώ", "καλ");
+		checkOneTerm(a, "καλούσα", "καλ");
+		checkOneTerm(a, "καλείς", "καλ");
+		checkOneTerm(a, "καλώντας", "καλ");
+
+		checkOneTerm(a, "καλούμαι", "καλ");
+		// pass. imperfect /imp. progressive doesnt conflate
+		checkOneTerm(a, "καλούμουν", "καλουμ");
+		checkOneTerm(a, "καλείσαι", "καλεισα");
+
+		checkOneTerm(a, "καλέστηκα", "καλεστ");
+		checkOneTerm(a, "καλεστώ", "καλεστ");
+		checkOneTerm(a, "καλεστείς", "καλεστ");
+		checkOneTerm(a, "καλεστεί", "καλεστ");
+
+		checkOneTerm(a, "καλεσμένο", "καλεσμεν");
+		checkOneTerm(a, "καλεσμένη", "καλεσμεν");
+		checkOneTerm(a, "καλεσμένος", "καλεσμεν");
+
+		checkOneTerm(a, "φορώ", "φορ");
+		checkOneTerm(a, "φοράω", "φορ");
+		checkOneTerm(a, "φορούσα", "φορ");
+		checkOneTerm(a, "φόραγα", "φορ");
+		checkOneTerm(a, "φόρα", "φορ");
+		checkOneTerm(a, "φορώντας", "φορ");
+		checkOneTerm(a, "φοριέμαι", "φορ");
+		checkOneTerm(a, "φοριόμουν", "φορ");
+		checkOneTerm(a, "φοριέσαι", "φορ");
+
+		checkOneTerm(a, "φόρεσα", "φορεσ");
+		checkOneTerm(a, "φορέσω", "φορεσ");
+		checkOneTerm(a, "φόρεσε", "φορεσ");
+		checkOneTerm(a, "φορέσει", "φορεσ");
+
+		checkOneTerm(a, "φορέθηκα", "φορεθ");
+		checkOneTerm(a, "φορεθώ", "φορεθ");
+		checkOneTerm(a, "φορεθείς", "φορεθ");
+		checkOneTerm(a, "φορεθεί", "φορεθ");
+
+		checkOneTerm(a, "φορεμένο", "φορεμεν");
+		checkOneTerm(a, "φορεμένη", "φορεμεν");
+		checkOneTerm(a, "φορεμένος", "φορεμεν");
+
+		// -ώ/-άω,-ούσα / -ήσω,-ησα
+		checkOneTerm(a, "κρατώ", "κρατ");
+		checkOneTerm(a, "κρατάω", "κρατ");
+		checkOneTerm(a, "κρατούσα", "κρατ");
+		checkOneTerm(a, "κράταγα", "κρατ");
+		checkOneTerm(a, "κράτα", "κρατ");
+		checkOneTerm(a, "κρατώντας", "κρατ");
+
+		checkOneTerm(a, "κράτησα", "κρατ");
+		checkOneTerm(a, "κρατήσω", "κρατ");
+		checkOneTerm(a, "κράτησε", "κρατ");
+		checkOneTerm(a, "κρατήσει", "κρατ");
+
+		checkOneTerm(a, "κρατούμαι", "κρατ");
+		checkOneTerm(a, "κρατιέμαι", "κρατ");
+		// this imperfect form doesnt conflate 
+		checkOneTerm(a, "κρατούμουν", "κρατουμ");
+		checkOneTerm(a, "κρατιόμουν", "κρατ");
+		// this imp. prog form doesnt conflate
+		checkOneTerm(a, "κρατείσαι", "κρατεισα");
+
+		checkOneTerm(a, "κρατήθηκα", "κρατ");
+		checkOneTerm(a, "κρατηθώ", "κρατ");
+		checkOneTerm(a, "κρατηθείς", "κρατ");
+		checkOneTerm(a, "κρατηθεί", "κρατ");
+		checkOneTerm(a, "κρατήσου", "κρατ");
+
+		checkOneTerm(a, "κρατημένο", "κρατημεν");
+		checkOneTerm(a, "κρατημένη", "κρατημεν");
+		checkOneTerm(a, "κρατημένος", "κρατημεν");
+
+		// -.μαι,-.μουν / -.ώ,-.ηκα
+		checkOneTerm(a, "κοιμάμαι", "κοιμ");
+		checkOneTerm(a, "κοιμόμουν", "κοιμ");
+		checkOneTerm(a, "κοιμάσαι", "κοιμ");
+
+		checkOneTerm(a, "κοιμήθηκα", "κοιμ");
+		checkOneTerm(a, "κοιμηθώ", "κοιμ");
+		checkOneTerm(a, "κοιμήσου", "κοιμ");
+		checkOneTerm(a, "κοιμηθεί", "κοιμ");
+
+		checkOneTerm(a, "κοιμισμένο", "κοιμισμεν");
+		checkOneTerm(a, "κοιμισμένη", "κοιμισμεν");
+		checkOneTerm(a, "κοιμισμένος", "κοιμισμεν");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testExceptions() throws Exception
+	  public virtual void testExceptions()
+	  {
+		checkOneTerm(a, "καθεστώτα", "καθεστ");
+		checkOneTerm(a, "καθεστώτος", "καθεστ");
+		checkOneTerm(a, "καθεστώς", "καθεστ");
+		checkOneTerm(a, "καθεστώτων", "καθεστ");
+
+		checkOneTerm(a, "χουμε", "χουμ");
+		checkOneTerm(a, "χουμ", "χουμ");
+
+		checkOneTerm(a, "υποταγεσ", "υποταγ");
+		checkOneTerm(a, "υποταγ", "υποταγ");
+
+		checkOneTerm(a, "εμετε", "εμετ");
+		checkOneTerm(a, "εμετ", "εμετ");
+
+		checkOneTerm(a, "αρχοντασ", "αρχοντ");
+		checkOneTerm(a, "αρχοντων", "αρχοντ");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestGreekStemmer outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestGreekStemmer outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new GreekStemFilter(tokenizer));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/En/TestEnglishAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/En/TestEnglishAnalyzer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/En/TestEnglishAnalyzer.cs
new file mode 100644
index 0000000..337d8ee
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/En/TestEnglishAnalyzer.cs
@@ -0,0 +1,74 @@
+namespace org.apache.lucene.analysis.en
+{
+
+	/*
+	 * 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 CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+
+	public class TestEnglishAnalyzer : BaseTokenStreamTestCase
+	{
+	  /// <summary>
+	  /// This test fails with NPE when the 
+	  /// stopwords file is missing in classpath 
+	  /// </summary>
+	  public virtual void testResourcesAvailable()
+	  {
+		new EnglishAnalyzer(TEST_VERSION_CURRENT);
+	  }
+
+	  /// <summary>
+	  /// test stopwords and stemming </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBasics() throws java.io.IOException
+	  public virtual void testBasics()
+	  {
+		Analyzer a = new EnglishAnalyzer(TEST_VERSION_CURRENT);
+		// stemming
+		checkOneTerm(a, "books", "book");
+		checkOneTerm(a, "book", "book");
+		// stopword
+		assertAnalyzesTo(a, "the", new string[] {});
+		// possessive removal
+		checkOneTerm(a, "steven's", "steven");
+		checkOneTerm(a, "steven\u2019s", "steven");
+		checkOneTerm(a, "steven\uFF07s", "steven");
+	  }
+
+	  /// <summary>
+	  /// test use of exclusion set </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testExclude() throws java.io.IOException
+	  public virtual void testExclude()
+	  {
+		CharArraySet exclusionSet = new CharArraySet(TEST_VERSION_CURRENT, asSet("books"), false);
+		Analyzer a = new EnglishAnalyzer(TEST_VERSION_CURRENT, EnglishAnalyzer.DefaultStopSet, exclusionSet);
+		checkOneTerm(a, "books", "books");
+		checkOneTerm(a, "book", "book");
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), new EnglishAnalyzer(TEST_VERSION_CURRENT), 1000 * RANDOM_MULTIPLIER);
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/En/TestEnglishMinimalStemFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/En/TestEnglishMinimalStemFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/En/TestEnglishMinimalStemFilter.cs
new file mode 100644
index 0000000..df1aa3e
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/En/TestEnglishMinimalStemFilter.cs
@@ -0,0 +1,95 @@
+namespace org.apache.lucene.analysis.en
+{
+
+	/*
+	 * 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 KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+
+	/// <summary>
+	/// Simple tests for <seealso cref="EnglishMinimalStemFilter"/>
+	/// </summary>
+	public class TestEnglishMinimalStemFilter : BaseTokenStreamTestCase
+	{
+	  private Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper();
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  public AnalyzerAnonymousInnerClassHelper()
+		  {
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer source = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(source, new EnglishMinimalStemFilter(source));
+		  }
+	  }
+
+	  /// <summary>
+	  /// Test some examples from various papers about this technique </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testExamples() throws java.io.IOException
+	  public virtual void testExamples()
+	  {
+		checkOneTerm(analyzer, "queries", "query");
+		checkOneTerm(analyzer, "phrases", "phrase");
+		checkOneTerm(analyzer, "corpus", "corpus");
+		checkOneTerm(analyzer, "stress", "stress");
+		checkOneTerm(analyzer, "kings", "king");
+		checkOneTerm(analyzer, "panels", "panel");
+		checkOneTerm(analyzer, "aerodynamics", "aerodynamic");
+		checkOneTerm(analyzer, "congress", "congress");
+		checkOneTerm(analyzer, "serious", "serious");
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), analyzer, 1000 * RANDOM_MULTIPLIER);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper2(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestEnglishMinimalStemFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestEnglishMinimalStemFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new EnglishMinimalStemFilter(tokenizer));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/En/TestEnglishMinimalStemFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/En/TestEnglishMinimalStemFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/En/TestEnglishMinimalStemFilterFactory.cs
new file mode 100644
index 0000000..554c453
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/En/TestEnglishMinimalStemFilterFactory.cs
@@ -0,0 +1,57 @@
+namespace org.apache.lucene.analysis.en
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the English minimal stem factory is working.
+	/// </summary>
+	public class TestEnglishMinimalStemFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStemming() throws Exception
+	  public virtual void testStemming()
+	  {
+		Reader reader = new StringReader("bricks");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("EnglishMinimalStem").create(stream);
+		assertTokenStreamContents(stream, new string[] {"brick"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("EnglishMinimalStem", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/En/TestKStemFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/En/TestKStemFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/En/TestKStemFilterFactory.cs
new file mode 100644
index 0000000..909cde2
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/En/TestKStemFilterFactory.cs
@@ -0,0 +1,57 @@
+namespace org.apache.lucene.analysis.en
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the kstem filter factory is working.
+	/// </summary>
+	public class TestKStemFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStemming() throws Exception
+	  public virtual void testStemming()
+	  {
+		Reader reader = new StringReader("bricks");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("KStem").create(stream);
+		assertTokenStreamContents(stream, new string[] {"brick"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("KStem", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/En/TestKStemmer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/En/TestKStemmer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/En/TestKStemmer.cs
new file mode 100644
index 0000000..8e7097c
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/En/TestKStemmer.cs
@@ -0,0 +1,124 @@
+namespace org.apache.lucene.analysis.en
+{
+
+	/*
+	 * 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.
+	 */
+
+//JAVA TO C# CONVERTER TODO TASK: This Java 'import static' statement cannot be converted to C#:
+//	import static org.apache.lucene.analysis.VocabularyAssert.assertVocabulary;
+
+
+	using KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+
+	/// <summary>
+	/// Tests for <seealso cref="KStemmer"/>
+	/// </summary>
+	public class TestKStemmer : BaseTokenStreamTestCase
+	{
+	  internal Analyzer a = new AnalyzerAnonymousInnerClassHelper();
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  public AnalyzerAnonymousInnerClassHelper()
+		  {
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, true);
+			return new TokenStreamComponents(tokenizer, new KStemFilter(tokenizer));
+		  }
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), a, 1000 * RANDOM_MULTIPLIER);
+	  }
+
+	  /// <summary>
+	  /// test the kstemmer optimizations against a bunch of words
+	  /// that were stemmed with the original java kstemmer (generated from
+	  /// testCreateMap, commented out below).
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testVocabulary() throws Exception
+	  public virtual void testVocabulary()
+	  {
+		assertVocabulary(a, getDataFile("kstemTestData.zip"), "kstem_examples.txt");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper2(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestKStemmer outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestKStemmer outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new KStemFilter(tokenizer));
+		  }
+	  }
+
+	  /// <summary>
+	  ///**** requires original java kstem source code to create map
+	  /// public void testCreateMap() throws Exception {
+	  ///  String input = getBigDoc();
+	  ///  Reader r = new StringReader(input);
+	  ///  TokenFilter tf = new LowerCaseFilter(new LetterTokenizer(r));
+	  ///  // tf = new KStemFilter(tf);
+	  /// 
+	  ///  KStemmer kstem = new KStemmer();
+	  ///  Map<String,String> map = new TreeMap<>();
+	  ///  for(;;) {
+	  ///    Token t = tf.next();
+	  ///    if (t==null) break;
+	  ///    String s = t.termText();
+	  ///    if (map.containsKey(s)) continue;
+	  ///    map.put(s, kstem.stem(s));
+	  ///  }
+	  /// 
+	  ///  Writer out = new BufferedWriter(new FileWriter("kstem_examples.txt"));
+	  ///  for (String key : map.keySet()) {
+	  ///    out.write(key);
+	  ///    out.write('\t');
+	  ///    out.write(map.get(key));
+	  ///    out.write('\n');
+	  ///  }
+	  ///  out.close();
+	  /// }
+	  /// *****
+	  /// </summary>
+
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/En/TestPorterStemFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/En/TestPorterStemFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/En/TestPorterStemFilter.cs
new file mode 100644
index 0000000..6528e8a
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/En/TestPorterStemFilter.cs
@@ -0,0 +1,105 @@
+namespace org.apache.lucene.analysis.en
+{
+
+	/*
+	 * 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 KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+	using SetKeywordMarkerFilter = org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter;
+	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+
+//JAVA TO C# CONVERTER TODO TASK: This Java 'import static' statement cannot be converted to C#:
+//	import static org.apache.lucene.analysis.VocabularyAssert.*;
+
+	/// <summary>
+	/// Test the PorterStemFilter with Martin Porter's test data.
+	/// </summary>
+	public class TestPorterStemFilter : BaseTokenStreamTestCase
+	{
+	  internal Analyzer a = new AnalyzerAnonymousInnerClassHelper();
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  public AnalyzerAnonymousInnerClassHelper()
+		  {
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer t = new MockTokenizer(reader, MockTokenizer.KEYWORD, false);
+			return new TokenStreamComponents(t, new PorterStemFilter(t));
+		  }
+	  }
+
+	  /// <summary>
+	  /// Run the stemmer against all strings in voc.txt
+	  /// The output should be the same as the string in output.txt
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testPorterStemFilter() throws Exception
+	  public virtual void testPorterStemFilter()
+	  {
+		assertVocabulary(a, getDataFile("porterTestData.zip"), "voc.txt", "output.txt");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testWithKeywordAttribute() throws java.io.IOException
+	  public virtual void testWithKeywordAttribute()
+	  {
+		CharArraySet set = new CharArraySet(TEST_VERSION_CURRENT, 1, true);
+		set.add("yourselves");
+		Tokenizer tokenizer = new MockTokenizer(new StringReader("yourselves yours"), MockTokenizer.WHITESPACE, false);
+		TokenStream filter = new PorterStemFilter(new SetKeywordMarkerFilter(tokenizer, set));
+		assertTokenStreamContents(filter, new string[] {"yourselves", "your"});
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), a, 1000 * RANDOM_MULTIPLIER);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper2(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestPorterStemFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestPorterStemFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new PorterStemFilter(tokenizer));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/En/TestPorterStemFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/En/TestPorterStemFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/En/TestPorterStemFilterFactory.cs
new file mode 100644
index 0000000..0627c02
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/En/TestPorterStemFilterFactory.cs
@@ -0,0 +1,60 @@
+namespace org.apache.lucene.analysis.en
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the Porter stem filter factory is working.
+	/// </summary>
+	public class TestPorterStemFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+	  /// <summary>
+	  /// Ensure the filter actually stems text.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStemming() throws Exception
+	  public virtual void testStemming()
+	  {
+		Reader reader = new StringReader("dogs");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("PorterStem").create(stream);
+		assertTokenStreamContents(stream, new string[] {"dog"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("PorterStem", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Es/TestSpanishAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Es/TestSpanishAnalyzer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Es/TestSpanishAnalyzer.cs
new file mode 100644
index 0000000..d3c166d
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Es/TestSpanishAnalyzer.cs
@@ -0,0 +1,70 @@
+namespace org.apache.lucene.analysis.es
+{
+
+	/*
+	 * 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 CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+
+	public class TestSpanishAnalyzer : BaseTokenStreamTestCase
+	{
+	  /// <summary>
+	  /// This test fails with NPE when the 
+	  /// stopwords file is missing in classpath 
+	  /// </summary>
+	  public virtual void testResourcesAvailable()
+	  {
+		new SpanishAnalyzer(TEST_VERSION_CURRENT);
+	  }
+
+	  /// <summary>
+	  /// test stopwords and stemming </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBasics() throws java.io.IOException
+	  public virtual void testBasics()
+	  {
+		Analyzer a = new SpanishAnalyzer(TEST_VERSION_CURRENT);
+		// stemming
+		checkOneTerm(a, "chicana", "chican");
+		checkOneTerm(a, "chicano", "chican");
+		// stopword
+		assertAnalyzesTo(a, "los", new string[] {});
+	  }
+
+	  /// <summary>
+	  /// test use of exclusion set </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testExclude() throws java.io.IOException
+	  public virtual void testExclude()
+	  {
+		CharArraySet exclusionSet = new CharArraySet(TEST_VERSION_CURRENT, asSet("chicano"), false);
+		Analyzer a = new SpanishAnalyzer(TEST_VERSION_CURRENT, SpanishAnalyzer.DefaultStopSet, exclusionSet);
+		checkOneTerm(a, "chicana", "chican");
+		checkOneTerm(a, "chicano", "chicano");
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), new SpanishAnalyzer(TEST_VERSION_CURRENT), 1000 * RANDOM_MULTIPLIER);
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Es/TestSpanishLightStemFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Es/TestSpanishLightStemFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Es/TestSpanishLightStemFilter.cs
new file mode 100644
index 0000000..4d83803
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Es/TestSpanishLightStemFilter.cs
@@ -0,0 +1,90 @@
+namespace org.apache.lucene.analysis.es
+{
+
+	/*
+	 * 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 KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+
+//JAVA TO C# CONVERTER TODO TASK: This Java 'import static' statement cannot be converted to C#:
+//	import static org.apache.lucene.analysis.VocabularyAssert.*;
+
+	/// <summary>
+	/// Simple tests for <seealso cref="SpanishLightStemFilter"/>
+	/// </summary>
+	public class TestSpanishLightStemFilter : BaseTokenStreamTestCase
+	{
+	  private Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper();
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  public AnalyzerAnonymousInnerClassHelper()
+		  {
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer source = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(source, new SpanishLightStemFilter(source));
+		  }
+	  }
+
+	  /// <summary>
+	  /// Test against a vocabulary from the reference impl </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testVocabulary() throws java.io.IOException
+	  public virtual void testVocabulary()
+	  {
+		assertVocabulary(analyzer, getDataFile("eslighttestdata.zip"), "eslight.txt");
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), analyzer, 1000 * RANDOM_MULTIPLIER);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper2(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestSpanishLightStemFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestSpanishLightStemFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new SpanishLightStemFilter(tokenizer));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Es/TestSpanishLightStemFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Es/TestSpanishLightStemFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Es/TestSpanishLightStemFilterFactory.cs
new file mode 100644
index 0000000..9c9cf4e
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Es/TestSpanishLightStemFilterFactory.cs
@@ -0,0 +1,57 @@
+namespace org.apache.lucene.analysis.es
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the Spanish Light stem factory is working.
+	/// </summary>
+	public class TestSpanishLightStemFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStemming() throws Exception
+	  public virtual void testStemming()
+	  {
+		Reader reader = new StringReader("sociedades");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("SpanishLightStem").create(stream);
+		assertTokenStreamContents(stream, new string[] {"sociedad"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("SpanishLightStem", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Eu/TestBasqueAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Eu/TestBasqueAnalyzer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Eu/TestBasqueAnalyzer.cs
new file mode 100644
index 0000000..4ba6d5d
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Eu/TestBasqueAnalyzer.cs
@@ -0,0 +1,70 @@
+namespace org.apache.lucene.analysis.eu
+{
+
+	/*
+	 * 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 CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+
+	public class TestBasqueAnalyzer : BaseTokenStreamTestCase
+	{
+	  /// <summary>
+	  /// This test fails with NPE when the 
+	  /// stopwords file is missing in classpath 
+	  /// </summary>
+	  public virtual void testResourcesAvailable()
+	  {
+		new BasqueAnalyzer(TEST_VERSION_CURRENT);
+	  }
+
+	  /// <summary>
+	  /// test stopwords and stemming </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBasics() throws java.io.IOException
+	  public virtual void testBasics()
+	  {
+		Analyzer a = new BasqueAnalyzer(TEST_VERSION_CURRENT);
+		// stemming
+		checkOneTerm(a, "zaldi", "zaldi");
+		checkOneTerm(a, "zaldiak", "zaldi");
+		// stopword
+		assertAnalyzesTo(a, "izan", new string[] { });
+	  }
+
+	  /// <summary>
+	  /// test use of exclusion set </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testExclude() throws java.io.IOException
+	  public virtual void testExclude()
+	  {
+		CharArraySet exclusionSet = new CharArraySet(TEST_VERSION_CURRENT, asSet("zaldiak"), false);
+		Analyzer a = new BasqueAnalyzer(TEST_VERSION_CURRENT, BasqueAnalyzer.DefaultStopSet, exclusionSet);
+		checkOneTerm(a, "zaldiak", "zaldiak");
+		checkOneTerm(a, "mendiari", "mendi");
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), new BasqueAnalyzer(TEST_VERSION_CURRENT), 1000 * RANDOM_MULTIPLIER);
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fa/TestPersianAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fa/TestPersianAnalyzer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fa/TestPersianAnalyzer.cs
new file mode 100644
index 0000000..031d2e4
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fa/TestPersianAnalyzer.cs
@@ -0,0 +1,252 @@
+namespace org.apache.lucene.analysis.fa
+{
+
+	/*
+	 * 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 CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+
+	/// <summary>
+	/// Test the Persian Analyzer
+	/// 
+	/// </summary>
+	public class TestPersianAnalyzer : BaseTokenStreamTestCase
+	{
+
+	  /// <summary>
+	  /// This test fails with NPE when the stopwords file is missing in classpath
+	  /// </summary>
+	  public virtual void testResourcesAvailable()
+	  {
+		new PersianAnalyzer(TEST_VERSION_CURRENT);
+	  }
+
+	  /// <summary>
+	  /// This test shows how the combination of tokenization (breaking on zero-width
+	  /// non-joiner), normalization (such as treating arabic YEH and farsi YEH the
+	  /// same), and stopwords creates a light-stemming effect for verbs.
+	  /// 
+	  /// These verb forms are from http://en.wikipedia.org/wiki/Persian_grammar
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBehaviorVerbs() throws Exception
+	  public virtual void testBehaviorVerbs()
+	  {
+		Analyzer a = new PersianAnalyzer(TEST_VERSION_CURRENT);
+		// active present indicative
+		assertAnalyzesTo(a, "می‌خورد", new string[] {"خورد"});
+		// active preterite indicative
+		assertAnalyzesTo(a, "خورد", new string[] {"خورد"});
+		// active imperfective preterite indicative
+		assertAnalyzesTo(a, "می‌خورد", new string[] {"خورد"});
+		// active future indicative
+		assertAnalyzesTo(a, "خواهد خورد", new string[] {"خورد"});
+		// active present progressive indicative
+		assertAnalyzesTo(a, "دارد می‌خورد", new string[] {"خورد"});
+		// active preterite progressive indicative
+		assertAnalyzesTo(a, "داشت می‌خورد", new string[] {"خورد"});
+
+		// active perfect indicative
+		assertAnalyzesTo(a, "خورده‌است", new string[] {"خورده"});
+		// active imperfective perfect indicative
+		assertAnalyzesTo(a, "می‌خورده‌است", new string[] {"خورده"});
+		// active pluperfect indicative
+		assertAnalyzesTo(a, "خورده بود", new string[] {"خورده"});
+		// active imperfective pluperfect indicative
+		assertAnalyzesTo(a, "می‌خورده بود", new string[] {"خورده"});
+		// active preterite subjunctive
+		assertAnalyzesTo(a, "خورده باشد", new string[] {"خورده"});
+		// active imperfective preterite subjunctive
+		assertAnalyzesTo(a, "می‌خورده باشد", new string[] {"خورده"});
+		// active pluperfect subjunctive
+		assertAnalyzesTo(a, "خورده بوده باشد", new string[] {"خورده"});
+		// active imperfective pluperfect subjunctive
+		assertAnalyzesTo(a, "می‌خورده بوده باشد", new string[] {"خورده"});
+		// passive present indicative
+		assertAnalyzesTo(a, "خورده می‌شود", new string[] {"خورده"});
+		// passive preterite indicative
+		assertAnalyzesTo(a, "خورده شد", new string[] {"خورده"});
+		// passive imperfective preterite indicative
+		assertAnalyzesTo(a, "خورده می‌شد", new string[] {"خورده"});
+		// passive perfect indicative
+		assertAnalyzesTo(a, "خورده شده‌است", new string[] {"خورده"});
+		// passive imperfective perfect indicative
+		assertAnalyzesTo(a, "خورده می‌شده‌است", new string[] {"خورده"});
+		// passive pluperfect indicative
+		assertAnalyzesTo(a, "خورده شده بود", new string[] {"خورده"});
+		// passive imperfective pluperfect indicative
+		assertAnalyzesTo(a, "خورده می‌شده بود", new string[] {"خورده"});
+		// passive future indicative
+		assertAnalyzesTo(a, "خورده خواهد شد", new string[] {"خورده"});
+		// passive present progressive indicative
+		assertAnalyzesTo(a, "دارد خورده می‌شود", new string[] {"خورده"});
+		// passive preterite progressive indicative
+		assertAnalyzesTo(a, "داشت خورده می‌شد", new string[] {"خورده"});
+		// passive present subjunctive
+		assertAnalyzesTo(a, "خورده شود", new string[] {"خورده"});
+		// passive preterite subjunctive
+		assertAnalyzesTo(a, "خورده شده باشد", new string[] {"خورده"});
+		// passive imperfective preterite subjunctive
+		assertAnalyzesTo(a, "خورده می‌شده باشد", new string[] {"خورده"});
+		// passive pluperfect subjunctive
+		assertAnalyzesTo(a, "خورده شده بوده باشد", new string[] {"خورده"});
+		// passive imperfective pluperfect subjunctive
+		assertAnalyzesTo(a, "خورده می‌شده بوده باشد", new string[] {"خورده"});
+
+		// active present subjunctive
+		assertAnalyzesTo(a, "بخورد", new string[] {"بخورد"});
+	  }
+
+	  /// <summary>
+	  /// This test shows how the combination of tokenization and stopwords creates a
+	  /// light-stemming effect for verbs.
+	  /// 
+	  /// In this case, these forms are presented with alternative orthography, using
+	  /// arabic yeh and whitespace. This yeh phenomenon is common for legacy text
+	  /// due to some previous bugs in Microsoft Windows.
+	  /// 
+	  /// These verb forms are from http://en.wikipedia.org/wiki/Persian_grammar
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBehaviorVerbsDefective() throws Exception
+	  public virtual void testBehaviorVerbsDefective()
+	  {
+		Analyzer a = new PersianAnalyzer(TEST_VERSION_CURRENT);
+		// active present indicative
+		assertAnalyzesTo(a, "مي خورد", new string[] {"خورد"});
+		// active preterite indicative
+		assertAnalyzesTo(a, "خورد", new string[] {"خورد"});
+		// active imperfective preterite indicative
+		assertAnalyzesTo(a, "مي خورد", new string[] {"خورد"});
+		// active future indicative
+		assertAnalyzesTo(a, "خواهد خورد", new string[] {"خورد"});
+		// active present progressive indicative
+		assertAnalyzesTo(a, "دارد مي خورد", new string[] {"خورد"});
+		// active preterite progressive indicative
+		assertAnalyzesTo(a, "داشت مي خورد", new string[] {"خورد"});
+
+		// active perfect indicative
+		assertAnalyzesTo(a, "خورده است", new string[] {"خورده"});
+		// active imperfective perfect indicative
+		assertAnalyzesTo(a, "مي خورده است", new string[] {"خورده"});
+		// active pluperfect indicative
+		assertAnalyzesTo(a, "خورده بود", new string[] {"خورده"});
+		// active imperfective pluperfect indicative
+		assertAnalyzesTo(a, "مي خورده بود", new string[] {"خورده"});
+		// active preterite subjunctive
+		assertAnalyzesTo(a, "خورده باشد", new string[] {"خورده"});
+		// active imperfective preterite subjunctive
+		assertAnalyzesTo(a, "مي خورده باشد", new string[] {"خورده"});
+		// active pluperfect subjunctive
+		assertAnalyzesTo(a, "خورده بوده باشد", new string[] {"خورده"});
+		// active imperfective pluperfect subjunctive
+		assertAnalyzesTo(a, "مي خورده بوده باشد", new string[] {"خورده"});
+		// passive present indicative
+		assertAnalyzesTo(a, "خورده مي شود", new string[] {"خورده"});
+		// passive preterite indicative
+		assertAnalyzesTo(a, "خورده شد", new string[] {"خورده"});
+		// passive imperfective preterite indicative
+		assertAnalyzesTo(a, "خورده مي شد", new string[] {"خورده"});
+		// passive perfect indicative
+		assertAnalyzesTo(a, "خورده شده است", new string[] {"خورده"});
+		// passive imperfective perfect indicative
+		assertAnalyzesTo(a, "خورده مي شده است", new string[] {"خورده"});
+		// passive pluperfect indicative
+		assertAnalyzesTo(a, "خورده شده بود", new string[] {"خورده"});
+		// passive imperfective pluperfect indicative
+		assertAnalyzesTo(a, "خورده مي شده بود", new string[] {"خورده"});
+		// passive future indicative
+		assertAnalyzesTo(a, "خورده خواهد شد", new string[] {"خورده"});
+		// passive present progressive indicative
+		assertAnalyzesTo(a, "دارد خورده مي شود", new string[] {"خورده"});
+		// passive preterite progressive indicative
+		assertAnalyzesTo(a, "داشت خورده مي شد", new string[] {"خورده"});
+		// passive present subjunctive
+		assertAnalyzesTo(a, "خورده شود", new string[] {"خورده"});
+		// passive preterite subjunctive
+		assertAnalyzesTo(a, "خورده شده باشد", new string[] {"خورده"});
+		// passive imperfective preterite subjunctive
+		assertAnalyzesTo(a, "خورده مي شده باشد", new string[] {"خورده"});
+		// passive pluperfect subjunctive
+		assertAnalyzesTo(a, "خورده شده بوده باشد", new string[] {"خورده"});
+		// passive imperfective pluperfect subjunctive
+		assertAnalyzesTo(a, "خورده مي شده بوده باشد", new string[] {"خورده"});
+
+		// active present subjunctive
+		assertAnalyzesTo(a, "بخورد", new string[] {"بخورد"});
+	  }
+
+	  /// <summary>
+	  /// This test shows how the combination of tokenization (breaking on zero-width
+	  /// non-joiner or space) and stopwords creates a light-stemming effect for
+	  /// nouns, removing the plural -ha.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBehaviorNouns() throws Exception
+	  public virtual void testBehaviorNouns()
+	  {
+		Analyzer a = new PersianAnalyzer(TEST_VERSION_CURRENT);
+		assertAnalyzesTo(a, "برگ ها", new string[] {"برگ"});
+		assertAnalyzesTo(a, "برگ‌ها", new string[] {"برگ"});
+	  }
+
+	  /// <summary>
+	  /// Test showing that non-persian text is treated very much like SimpleAnalyzer
+	  /// (lowercased, etc)
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBehaviorNonPersian() throws Exception
+	  public virtual void testBehaviorNonPersian()
+	  {
+		Analyzer a = new PersianAnalyzer(TEST_VERSION_CURRENT);
+		assertAnalyzesTo(a, "English test.", new string[] {"english", "test"});
+	  }
+
+	  /// <summary>
+	  /// Basic test ensuring that tokenStream works correctly.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testReusableTokenStream() throws Exception
+	  public virtual void testReusableTokenStream()
+	  {
+		Analyzer a = new PersianAnalyzer(TEST_VERSION_CURRENT);
+		assertAnalyzesTo(a, "خورده مي شده بوده باشد", new string[] {"خورده"});
+		assertAnalyzesTo(a, "برگ‌ها", new string[] {"برگ"});
+	  }
+
+	  /// <summary>
+	  /// Test that custom stopwords work, and are not case-sensitive.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCustomStopwords() throws Exception
+	  public virtual void testCustomStopwords()
+	  {
+		PersianAnalyzer a = new PersianAnalyzer(TEST_VERSION_CURRENT, new CharArraySet(TEST_VERSION_CURRENT, asSet("the", "and", "a"), false));
+		assertAnalyzesTo(a, "The quick brown fox.", new string[] {"quick", "brown", "fox"});
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), new PersianAnalyzer(TEST_VERSION_CURRENT), 1000 * RANDOM_MULTIPLIER);
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fa/TestPersianCharFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fa/TestPersianCharFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fa/TestPersianCharFilter.cs
new file mode 100644
index 0000000..71e6912
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fa/TestPersianCharFilter.cs
@@ -0,0 +1,60 @@
+namespace org.apache.lucene.analysis.fa
+{
+
+	/*
+	 * 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.
+	 */
+
+
+	public class TestPersianCharFilter : BaseTokenStreamTestCase
+	{
+	  private Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper();
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  public AnalyzerAnonymousInnerClassHelper()
+		  {
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			return new TokenStreamComponents(new MockTokenizer(reader));
+		  }
+
+		  protected internal override Reader initReader(string fieldName, Reader reader)
+		  {
+			return new PersianCharFilter(reader);
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBasics() throws Exception
+	  public virtual void testBasics()
+	  {
+		assertAnalyzesTo(analyzer, "this is a\u200Ctest", new string[] {"this", "is", "a", "test"});
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), analyzer, 1000 * RANDOM_MULTIPLIER);
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fa/TestPersianNormalizationFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fa/TestPersianNormalizationFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fa/TestPersianNormalizationFilter.cs
new file mode 100644
index 0000000..7d47ae4
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fa/TestPersianNormalizationFilter.cs
@@ -0,0 +1,110 @@
+namespace org.apache.lucene.analysis.fa
+{
+
+	/*
+	 * 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 ArabicLetterTokenizer = org.apache.lucene.analysis.ar.ArabicLetterTokenizer;
+	using KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+
+	/// <summary>
+	/// Test the Persian Normalization Filter
+	/// 
+	/// </summary>
+	public class TestPersianNormalizationFilter : BaseTokenStreamTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFarsiYeh() throws java.io.IOException
+	  public virtual void testFarsiYeh()
+	  {
+		check("های", "هاي");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testYehBarree() throws java.io.IOException
+	  public virtual void testYehBarree()
+	  {
+		check("هاے", "هاي");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testKeheh() throws java.io.IOException
+	  public virtual void testKeheh()
+	  {
+		check("کشاندن", "كشاندن");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testHehYeh() throws java.io.IOException
+	  public virtual void testHehYeh()
+	  {
+		check("كتابۀ", "كتابه");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testHehHamzaAbove() throws java.io.IOException
+	  public virtual void testHehHamzaAbove()
+	  {
+		check("كتابهٔ", "كتابه");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testHehGoal() throws java.io.IOException
+	  public virtual void testHehGoal()
+	  {
+		check("زادہ", "زاده");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: private void check(final String input, final String expected) throws java.io.IOException
+//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
+	  private void check(string input, string expected)
+	  {
+		ArabicLetterTokenizer tokenStream = new ArabicLetterTokenizer(TEST_VERSION_CURRENT, new StringReader(input));
+		PersianNormalizationFilter filter = new PersianNormalizationFilter(tokenStream);
+		assertTokenStreamContents(filter, new string[]{expected});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestPersianNormalizationFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestPersianNormalizationFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new PersianNormalizationFilter(tokenizer));
+		  }
+	  }
+
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fa/TestPersianNormalizationFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fa/TestPersianNormalizationFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fa/TestPersianNormalizationFilterFactory.cs
new file mode 100644
index 0000000..fd666ea
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fa/TestPersianNormalizationFilterFactory.cs
@@ -0,0 +1,60 @@
+namespace org.apache.lucene.analysis.fa
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the Persian normalization factory is working.
+	/// </summary>
+	public class TestPersianNormalizationFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+	  /// <summary>
+	  /// Ensure the filter actually normalizes persian text.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNormalization() throws Exception
+	  public virtual void testNormalization()
+	  {
+		Reader reader = new StringReader("های");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("PersianNormalization").create(stream);
+		assertTokenStreamContents(stream, new string[] {"هاي"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("PersianNormalization", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fi/TestFinnishAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fi/TestFinnishAnalyzer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fi/TestFinnishAnalyzer.cs
new file mode 100644
index 0000000..4cd9941
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fi/TestFinnishAnalyzer.cs
@@ -0,0 +1,70 @@
+namespace org.apache.lucene.analysis.fi
+{
+
+	/*
+	 * 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 CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+
+	public class TestFinnishAnalyzer : BaseTokenStreamTestCase
+	{
+	  /// <summary>
+	  /// This test fails with NPE when the 
+	  /// stopwords file is missing in classpath 
+	  /// </summary>
+	  public virtual void testResourcesAvailable()
+	  {
+		new FinnishAnalyzer(TEST_VERSION_CURRENT);
+	  }
+
+	  /// <summary>
+	  /// test stopwords and stemming </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBasics() throws java.io.IOException
+	  public virtual void testBasics()
+	  {
+		Analyzer a = new FinnishAnalyzer(TEST_VERSION_CURRENT);
+		// stemming
+		checkOneTerm(a, "edeltäjiinsä", "edeltäj");
+		checkOneTerm(a, "edeltäjistään", "edeltäj");
+		// stopword
+		assertAnalyzesTo(a, "olla", new string[] {});
+	  }
+
+	  /// <summary>
+	  /// test use of exclusion set </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testExclude() throws java.io.IOException
+	  public virtual void testExclude()
+	  {
+		CharArraySet exclusionSet = new CharArraySet(TEST_VERSION_CURRENT, asSet("edeltäjistään"), false);
+		Analyzer a = new FinnishAnalyzer(TEST_VERSION_CURRENT, FinnishAnalyzer.DefaultStopSet, exclusionSet);
+		checkOneTerm(a, "edeltäjiinsä", "edeltäj");
+		checkOneTerm(a, "edeltäjistään", "edeltäjistään");
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), new FinnishAnalyzer(TEST_VERSION_CURRENT), 1000 * RANDOM_MULTIPLIER);
+	  }
+	}
+
+}
\ No newline at end of file


[21/27] lucenenet git commit: adding converted analysis common tests

Posted by sy...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestRandomChains.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestRandomChains.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestRandomChains.cs
new file mode 100644
index 0000000..a1e8438
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestRandomChains.cs
@@ -0,0 +1,1587 @@
+using System;
+using System.Diagnostics;
+using System.Collections.Generic;
+
+namespace org.apache.lucene.analysis.core
+{
+
+	/*
+	 * 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 NormalizeCharMap = org.apache.lucene.analysis.charfilter.NormalizeCharMap;
+	using CJKBigramFilter = org.apache.lucene.analysis.cjk.CJKBigramFilter;
+	using CommonGramsFilter = org.apache.lucene.analysis.commongrams.CommonGramsFilter;
+	using CommonGramsQueryFilter = org.apache.lucene.analysis.commongrams.CommonGramsQueryFilter;
+	using HyphenationCompoundWordTokenFilter = org.apache.lucene.analysis.compound.HyphenationCompoundWordTokenFilter;
+	using TestCompoundWordTokenFilter = org.apache.lucene.analysis.compound.TestCompoundWordTokenFilter;
+	using HyphenationTree = org.apache.lucene.analysis.compound.hyphenation.HyphenationTree;
+	using Dictionary = org.apache.lucene.analysis.hunspell.Dictionary;
+	using TestHunspellStemFilter = org.apache.lucene.analysis.hunspell.TestHunspellStemFilter;
+	using HyphenatedWordsFilter = org.apache.lucene.analysis.miscellaneous.HyphenatedWordsFilter;
+	using LimitTokenCountFilter = org.apache.lucene.analysis.miscellaneous.LimitTokenCountFilter;
+	using LimitTokenPositionFilter = org.apache.lucene.analysis.miscellaneous.LimitTokenPositionFilter;
+	using StemmerOverrideFilter = org.apache.lucene.analysis.miscellaneous.StemmerOverrideFilter;
+	using StemmerOverrideMap = org.apache.lucene.analysis.miscellaneous.StemmerOverrideFilter.StemmerOverrideMap;
+	using WordDelimiterFilter = org.apache.lucene.analysis.miscellaneous.WordDelimiterFilter;
+	using EdgeNGramTokenFilter = org.apache.lucene.analysis.ngram.EdgeNGramTokenFilter;
+	using Lucene43EdgeNGramTokenizer = org.apache.lucene.analysis.ngram.Lucene43EdgeNGramTokenizer;
+	using PathHierarchyTokenizer = org.apache.lucene.analysis.path.PathHierarchyTokenizer;
+	using ReversePathHierarchyTokenizer = org.apache.lucene.analysis.path.ReversePathHierarchyTokenizer;
+	using IdentityEncoder = org.apache.lucene.analysis.payloads.IdentityEncoder;
+	using PayloadEncoder = org.apache.lucene.analysis.payloads.PayloadEncoder;
+	using TestSnowball = org.apache.lucene.analysis.snowball.TestSnowball;
+	using StandardTokenizer = org.apache.lucene.analysis.standard.StandardTokenizer;
+	using SynonymMap = org.apache.lucene.analysis.synonym.SynonymMap;
+	using CharArrayMap = org.apache.lucene.analysis.util.CharArrayMap;
+	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+	using WikipediaTokenizer = org.apache.lucene.analysis.wikipedia.WikipediaTokenizer;
+	using AttributeSource = org.apache.lucene.util.AttributeSource;
+	using AttributeFactory = org.apache.lucene.util.AttributeSource.AttributeFactory;
+	using CharsRef = org.apache.lucene.util.CharsRef;
+	using Rethrow = org.apache.lucene.util.Rethrow;
+	using TestUtil = org.apache.lucene.util.TestUtil;
+	using Version = org.apache.lucene.util.Version;
+	using CharacterRunAutomaton = org.apache.lucene.util.automaton.CharacterRunAutomaton;
+	using AfterClass = org.junit.AfterClass;
+	using BeforeClass = org.junit.BeforeClass;
+	using SnowballProgram = org.tartarus.snowball.SnowballProgram;
+	using InputSource = org.xml.sax.InputSource;
+
+	/// <summary>
+	/// tests random analysis chains </summary>
+	public class TestRandomChains : BaseTokenStreamTestCase
+	{
+
+//JAVA TO C# CONVERTER TODO TASK: Java wildcard generics are not converted to .NET:
+//ORIGINAL LINE: static java.util.List<Constructor<? extends org.apache.lucene.analysis.Tokenizer>> tokenizers;
+	  internal static IList<Constructor<?>> tokenizers;
+//JAVA TO C# CONVERTER TODO TASK: Java wildcard generics are not converted to .NET:
+//ORIGINAL LINE: static java.util.List<Constructor<? extends org.apache.lucene.analysis.TokenFilter>> tokenfilters;
+	  internal static IList<Constructor<?>> tokenfilters;
+//JAVA TO C# CONVERTER TODO TASK: Java wildcard generics are not converted to .NET:
+//ORIGINAL LINE: static java.util.List<Constructor<? extends org.apache.lucene.analysis.CharFilter>> charfilters;
+	  internal static IList<Constructor<?>> charfilters;
+
+	  private interface Predicate<T>
+	  {
+		bool apply(T o);
+	  }
+
+	  private static readonly Predicate<object[]> ALWAYS = new PredicateAnonymousInnerClassHelper();
+
+	  private class PredicateAnonymousInnerClassHelper : Predicate<object[]>
+	  {
+		  public PredicateAnonymousInnerClassHelper()
+		  {
+		  }
+
+		  public virtual bool apply(object[] args)
+		  {
+			return true;
+		  };
+	  }
+
+//JAVA TO C# CONVERTER TODO TASK: Java wildcard generics are not converted to .NET:
+//ORIGINAL LINE: private static final java.util.Map<Constructor<?>,Predicate<Object[]>> brokenConstructors = new java.util.HashMap<>();
+	  private static readonly IDictionary<Constructor<?>, Predicate<object[]>> brokenConstructors = new Dictionary<Constructor<?>, Predicate<object[]>>();
+	  static TestRandomChains()
+	  {
+		try
+		{
+		  brokenConstructors[typeof(LimitTokenCountFilter).GetConstructor(typeof(TokenStream), typeof(int))] = ALWAYS;
+		  brokenConstructors[typeof(LimitTokenCountFilter).GetConstructor(typeof(TokenStream), typeof(int), typeof(bool))] = new PredicateAnonymousInnerClassHelper2();
+		  brokenConstructors[typeof(LimitTokenPositionFilter).GetConstructor(typeof(TokenStream), typeof(int))] = ALWAYS;
+		  brokenConstructors[typeof(LimitTokenPositionFilter).GetConstructor(typeof(TokenStream), typeof(int), typeof(bool))] = new PredicateAnonymousInnerClassHelper3();
+		  foreach (Type c in Arrays.asList<Type>(typeof(CachingTokenFilter), typeof(CrankyTokenFilter), typeof(ValidatingTokenFilter)))
+			  // TODO: can we promote some of these to be only
+			  // offsets offenders?
+			  // doesn't actual reset itself!
+			  // Not broken, simulates brokenness:
+			  // Not broken: we forcefully add this, so we shouldn't
+			  // also randomly pick it:
+		  {
+//JAVA TO C# CONVERTER TODO TASK: Java wildcard generics are not converted to .NET:
+//ORIGINAL LINE: for (Constructor<?> ctor : c.getConstructors())
+			foreach (Constructor<?> ctor in c.GetConstructors())
+			{
+			  brokenConstructors[ctor] = ALWAYS;
+			}
+		  }
+		}
+		catch (Exception e)
+		{
+		  throw new Exception(e);
+		}
+		try
+		{
+		  foreach (Type c in Arrays.asList<Type>(typeof(ReversePathHierarchyTokenizer), typeof(PathHierarchyTokenizer), typeof(WikipediaTokenizer), typeof(CJKBigramFilter), typeof(HyphenatedWordsFilter), typeof(CommonGramsFilter), typeof(CommonGramsQueryFilter), typeof(WordDelimiterFilter)))
+			  // TODO: it seems to mess up offsets!?
+			  // TODO: doesn't handle graph inputs
+			  // TODO: doesn't handle graph inputs (or even look at positionIncrement)
+			  // TODO: LUCENE-4983
+			  // TODO: doesn't handle graph inputs
+			  // TODO: probably doesnt handle graph inputs, too afraid to try
+		  {
+//JAVA TO C# CONVERTER TODO TASK: Java wildcard generics are not converted to .NET:
+//ORIGINAL LINE: for (Constructor<?> ctor : c.getConstructors())
+			foreach (Constructor<?> ctor in c.GetConstructors())
+			{
+			  brokenOffsetsConstructors[ctor] = ALWAYS;
+			}
+		  }
+		}
+		catch (Exception e)
+		{
+		  throw new Exception(e);
+		}
+		allowedTokenizerArgs = Collections.newSetFromMap(new IdentityHashMap<Type, bool?>());
+		allowedTokenizerArgs.addAll(argProducers.Keys);
+		allowedTokenizerArgs.Add(typeof(Reader));
+		allowedTokenizerArgs.Add(typeof(AttributeSource.AttributeFactory));
+		allowedTokenizerArgs.Add(typeof(AttributeSource));
+
+		allowedTokenFilterArgs = Collections.newSetFromMap(new IdentityHashMap<Type, bool?>());
+		allowedTokenFilterArgs.addAll(argProducers.Keys);
+		allowedTokenFilterArgs.Add(typeof(TokenStream));
+		// TODO: fix this one, thats broken:
+		allowedTokenFilterArgs.Add(typeof(CommonGramsFilter));
+
+		allowedCharFilterArgs = Collections.newSetFromMap(new IdentityHashMap<Type, bool?>());
+		allowedCharFilterArgs.addAll(argProducers.Keys);
+		allowedCharFilterArgs.Add(typeof(Reader));
+	  }
+
+	  private class PredicateAnonymousInnerClassHelper2 : Predicate<object[]>
+	  {
+		  public PredicateAnonymousInnerClassHelper2()
+		  {
+		  }
+
+		  public virtual bool apply(object[] args)
+		  {
+			Debug.Assert(args.Length == 3);
+			return !((bool?) args[2]); // args are broken if consumeAllTokens is false
+		  }
+	  }
+
+	  private class PredicateAnonymousInnerClassHelper3 : Predicate<object[]>
+	  {
+		  public PredicateAnonymousInnerClassHelper3()
+		  {
+		  }
+
+		  public virtual bool apply(object[] args)
+		  {
+			Debug.Assert(args.Length == 3);
+			return !((bool?) args[2]); // args are broken if consumeAllTokens is false
+		  }
+	  }
+
+	  // TODO: also fix these and remove (maybe):
+	  // Classes/options that don't produce consistent graph offsets:
+//JAVA TO C# CONVERTER TODO TASK: Java wildcard generics are not converted to .NET:
+//ORIGINAL LINE: private static final java.util.Map<Constructor<?>,Predicate<Object[]>> brokenOffsetsConstructors = new java.util.HashMap<>();
+	  private static readonly IDictionary<Constructor<?>, Predicate<object[]>> brokenOffsetsConstructors = new Dictionary<Constructor<?>, Predicate<object[]>>();
+
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @BeforeClass public static void beforeClass() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public static void beforeClass()
+	  {
+		IList<Type> analysisClasses = getClassesForPackage("org.apache.lucene.analysis");
+		tokenizers = new List<>();
+		tokenfilters = new List<>();
+		charfilters = new List<>();
+		foreach (Class c in analysisClasses)
+		{
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int modifiers = c.getModifiers();
+		  int modifiers = c.Modifiers;
+		  if (Modifier.isAbstract(modifiers) || !Modifier.isPublic(modifiers) || c.Synthetic || c.AnonymousClass || c.MemberClass || c.Interface || c.isAnnotationPresent(typeof(Deprecated)) || !(c.IsSubclassOf(typeof(Tokenizer)) || c.IsSubclassOf(typeof(TokenFilter)) || c.IsSubclassOf(typeof(CharFilter))))
+		  {
+			// don't waste time with abstract classes or deprecated known-buggy ones
+			continue;
+		  }
+
+//JAVA TO C# CONVERTER TODO TASK: Java wildcard generics are not converted to .NET:
+//ORIGINAL LINE: for (final Constructor<?> ctor : c.getConstructors())
+		  foreach (Constructor<?> ctor in c.Constructors)
+		  {
+			// don't test synthetic or deprecated ctors, they likely have known bugs:
+			if (ctor.Synthetic || ctor.isAnnotationPresent(typeof(Deprecated)) || brokenConstructors[ctor] == ALWAYS)
+			{
+			  continue;
+			}
+			if (c.IsSubclassOf(typeof(Tokenizer)))
+			{
+//JAVA TO C# CONVERTER TODO TASK: There is no .NET equivalent to the java.util.Collection 'containsAll' method:
+			  assertTrue(ctor.toGenericString() + " has unsupported parameter types", allowedTokenizerArgs.containsAll(Arrays.asList(ctor.ParameterTypes)));
+			  tokenizers.Add(castConstructor(typeof(Tokenizer), ctor));
+			}
+			else if (c.IsSubclassOf(typeof(TokenFilter)))
+			{
+//JAVA TO C# CONVERTER TODO TASK: There is no .NET equivalent to the java.util.Collection 'containsAll' method:
+			  assertTrue(ctor.toGenericString() + " has unsupported parameter types", allowedTokenFilterArgs.containsAll(Arrays.asList(ctor.ParameterTypes)));
+			  tokenfilters.Add(castConstructor(typeof(TokenFilter), ctor));
+			}
+			else if (c.IsSubclassOf(typeof(CharFilter)))
+			{
+//JAVA TO C# CONVERTER TODO TASK: There is no .NET equivalent to the java.util.Collection 'containsAll' method:
+			  assertTrue(ctor.toGenericString() + " has unsupported parameter types", allowedCharFilterArgs.containsAll(Arrays.asList(ctor.ParameterTypes)));
+			  charfilters.Add(castConstructor(typeof(CharFilter), ctor));
+			}
+			else
+			{
+			  fail("Cannot get here");
+			}
+		  }
+		}
+
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final java.util.Comparator<Constructor<?>> ctorComp = new java.util.Comparator<Constructor<?>>()
+//JAVA TO C# CONVERTER TODO TASK: Java wildcard generics are not converted to .NET:
+		IComparer<Constructor<?>> ctorComp = new ComparatorAnonymousInnerClassHelper();
+		tokenizers.Sort(ctorComp);
+		tokenfilters.Sort(ctorComp);
+		charfilters.Sort(ctorComp);
+		if (VERBOSE)
+		{
+		  Console.WriteLine("tokenizers = " + tokenizers);
+		  Console.WriteLine("tokenfilters = " + tokenfilters);
+		  Console.WriteLine("charfilters = " + charfilters);
+		}
+	  }
+
+	  private class ComparatorAnonymousInnerClassHelper : IComparer<Constructor<JavaToDotNetGenericWildcard>>
+	  {
+		  public ComparatorAnonymousInnerClassHelper()
+		  {
+		  }
+
+		  public virtual int compare<T1, T2>(Constructor<T1> arg0, Constructor<T2> arg1)
+		  {
+			return arg0.toGenericString().compareTo(arg1.toGenericString());
+		  }
+	  }
+
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @AfterClass public static void afterClass()
+	  public static void afterClass()
+	  {
+		tokenizers = null;
+		tokenfilters = null;
+		charfilters = null;
+	  }
+
+	  /// <summary>
+	  /// Hack to work around the stupidness of Oracle's strict Java backwards compatibility.
+	  /// {@code Class<T>#getConstructors()} should return unmodifiable {@code List<Constructor<T>>} not array! 
+	  /// </summary>
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @SuppressWarnings("unchecked") private static <T> Constructor<T> castConstructor(Class<T> instanceClazz, Constructor<?> ctor)
+	  private static Constructor<T> castConstructor<T, T1>(Type<T> instanceClazz, Constructor<T1> ctor)
+	  {
+		return (Constructor<T>) ctor;
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public static java.util.List<Class> getClassesForPackage(String pckgname) throws Exception
+	  public static IList<Type> getClassesForPackage(string pckgname)
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final java.util.List<Class> classes = new java.util.ArrayList<>();
+		IList<Type> classes = new List<Type>();
+		collectClassesForPackage(pckgname, classes);
+		assertFalse("No classes found in package '" + pckgname + "'; maybe your test classes are packaged as JAR file?", classes.Count == 0);
+		return classes;
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: private static void collectClassesForPackage(String pckgname, java.util.List<Class> classes) throws Exception
+	  private static void collectClassesForPackage(string pckgname, IList<Type> classes)
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final ClassLoader cld = TestRandomChains.class.getClassLoader();
+		ClassLoader cld = typeof(TestRandomChains).ClassLoader;
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final String path = pckgname.replace('.', '/');
+		string path = pckgname.Replace('.', '/');
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final java.util.Iterator<java.net.URL> resources = cld.getResources(path);
+		IEnumerator<URL> resources = cld.getResources(path);
+		while (resources.MoveNext())
+		{
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final java.net.URI uri = resources.Current.toURI();
+		  URI uri = resources.Current.toURI();
+		  if (!"file".Equals(uri.Scheme, StringComparison.CurrentCultureIgnoreCase))
+		  {
+			continue;
+		  }
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final java.io.File directory = new java.io.File(uri);
+		  File directory = new File(uri);
+		  if (directory.exists())
+		  {
+			string[] files = directory.list();
+			foreach (string file in files)
+			{
+			  if ((new File(directory, file)).Directory)
+			  {
+				// recurse
+				string subPackage = pckgname + "." + file;
+				collectClassesForPackage(subPackage, classes);
+			  }
+			  if (file.EndsWith(".class", StringComparison.Ordinal))
+			  {
+				string clazzName = file.Substring(0, file.Length - 6);
+				// exclude Test classes that happen to be in these packages.
+				// class.ForName'ing some of them can cause trouble.
+				if (!clazzName.EndsWith("Test", StringComparison.Ordinal) && !clazzName.StartsWith("Test", StringComparison.Ordinal))
+				{
+				  // Don't run static initializers, as we won't use most of them.
+				  // Java will do that automatically once accessed/instantiated.
+				  classes.Add(Type.GetType(pckgname + '.' + clazzName, false, cld));
+				}
+			  }
+			}
+		  }
+		}
+	  }
+
+	  private interface ArgProducer
+	  {
+		object create(Random random);
+	  }
+
+	  private static readonly IDictionary<Type, ArgProducer> argProducers = new IdentityHashMapAnonymousInnerClassHelper();
+
+	  private class IdentityHashMapAnonymousInnerClassHelper : IdentityHashMap<Type, ArgProducer>
+	  {
+		  public IdentityHashMapAnonymousInnerClassHelper()
+		  {
+		  }
+
+	//	  {
+	//	put(int.class, new ArgProducer()
+	//	{
+	//	  @@Override public Object create(Random random)
+	//	  {
+	//		// TODO: could cause huge ram usage to use full int range for some filters
+	//		// (e.g. allocate enormous arrays)
+	//		// return Integer.valueOf(random.nextInt());
+	//		return Integer.valueOf(TestUtil.nextInt(random, -100, 100));
+	//	  }
+	//	}
+	//   );
+	//	put(char.class, new ArgProducer()
+	//	{
+	//	  @@Override public Object create(Random random)
+	//	  {
+	//		// TODO: fix any filters that care to throw IAE instead.
+	//		// also add a unicode validating filter to validate termAtt?
+	//		// return Character.valueOf((char)random.nextInt(65536));
+	//		while(true)
+	//		{
+	//		  char c = (char)random.nextInt(65536);
+	//		  if (c < '\uD800' || c > '\uDFFF')
+	//		  {
+	//			return Character.valueOf(c);
+	//		  }
+	//		}
+	//	  }
+	//	}
+	//   );
+	//	put(float.class, new ArgProducer()
+	//	{
+	//	  @@Override public Object create(Random random)
+	//	  {
+	//		return Float.valueOf(random.nextFloat());
+	//	  }
+	//	}
+	//   );
+	//	put(boolean.class, new ArgProducer()
+	//	{
+	//	  @@Override public Object create(Random random)
+	//	  {
+	//		return Boolean.valueOf(random.nextBoolean());
+	//	  }
+	//	}
+	//   );
+	//	put(byte.class, new ArgProducer()
+	//	{
+	//	  @@Override public Object create(Random random)
+	//	  {
+	//		// this wraps to negative when casting to byte
+	//		return Byte.valueOf((byte) random.nextInt(256));
+	//	  }
+	//	}
+	//   );
+	//	put(byte[].class, new ArgProducer()
+	//	{
+	//	  @@Override public Object create(Random random)
+	//	  {
+	//		byte bytes[] = new byte[random.nextInt(256)];
+	//		random.nextBytes(bytes);
+	//		return bytes;
+	//	  }
+	//	}
+	//   );
+	//	put(Random.class, new ArgProducer()
+	//	{
+	//	  @@Override public Object create(Random random)
+	//	  {
+	//		return new Random(random.nextLong());
+	//	  }
+	//	}
+	//   );
+	//	put(Version.class, new ArgProducer()
+	//	{
+	//	  @@Override public Object create(Random random)
+	//	  {
+	//		// we expect bugs in emulating old versions
+	//		return TEST_VERSION_CURRENT;
+	//	  }
+	//	}
+	//   );
+	//	put(Set.class, new ArgProducer()
+	//	{
+	//	  @@Override public Object create(Random random)
+	//	  {
+	//		// TypeTokenFilter
+	//		Set<String> set = new HashSet<>();
+	//		int num = random.nextInt(5);
+	//		for (int i = 0; i < num; i++)
+	//		{
+	//		  set.add(StandardTokenizer.TOKEN_TYPES[random.nextInt(StandardTokenizer.TOKEN_TYPES.length)]);
+	//		}
+	//		return set;
+	//	  }
+	//	}
+	//   );
+	//	put(Collection.class, new ArgProducer()
+	//	{
+	//	  @@Override public Object create(Random random)
+	//	  {
+	//		// CapitalizationFilter
+	//		Collection<char[]> col = new ArrayList<>();
+	//		int num = random.nextInt(5);
+	//		for (int i = 0; i < num; i++)
+	//		{
+	//		  col.add(TestUtil.randomSimpleString(random).toCharArray());
+	//		}
+	//		return col;
+	//	  }
+	//	}
+	//   );
+	//	put(CharArraySet.class, new ArgProducer()
+	//	{
+	//	  @@Override public Object create(Random random)
+	//	  {
+	//		int num = random.nextInt(10);
+	//		CharArraySet set = new CharArraySet(TEST_VERSION_CURRENT, num, random.nextBoolean());
+	//		for (int i = 0; i < num; i++)
+	//		{
+	//		  // TODO: make nastier
+	//		  set.add(TestUtil.randomSimpleString(random));
+	//		}
+	//		return set;
+	//	  }
+	//	}
+	//   );
+	//	put(Pattern.class, new ArgProducer()
+	//	{
+	//	  @@Override public Object create(Random random)
+	//	  {
+	//		// TODO: don't want to make the exponentially slow ones Dawid documents
+	//		// in TestPatternReplaceFilter, so dont use truly random patterns (for now)
+	//		return Pattern.compile("a");
+	//	  }
+	//	}
+	//   );
+	//
+	//	put(Pattern[].class, new ArgProducer()
+	//	{
+	//	  @@Override public Object create(Random random)
+	//	  {
+	//		return new Pattern[] {Pattern.compile("([a-z]+)"), Pattern.compile("([0-9]+)")};
+	//	  }
+	//	}
+	//   );
+	//	put(PayloadEncoder.class, new ArgProducer()
+	//	{
+	//	  @@Override public Object create(Random random)
+	//	  {
+	//		return new IdentityEncoder(); // the other encoders will throw exceptions if tokens arent numbers?
+	//	  }
+	//	}
+	//   );
+	//	put(Dictionary.class, new ArgProducer()
+	//	{
+	//	  @@Override public Object create(Random random)
+	//	  {
+	//		// TODO: make nastier
+	//		InputStream affixStream = TestHunspellStemFilter.class.getResourceAsStream("simple.aff");
+	//		InputStream dictStream = TestHunspellStemFilter.class.getResourceAsStream("simple.dic");
+	//		try
+	//		{
+	//		 return new Dictionary(affixStream, dictStream);
+	//		}
+	//		catch (Exception ex)
+	//		{
+	//		  Rethrow.rethrow(ex);
+	//		  return null; // unreachable code
+	//		}
+	//	  }
+	//	}
+	//   );
+	//	put(Lucene43EdgeNGramTokenizer.Side.class, new ArgProducer()
+	//	{
+	//	  @@Override public Object create(Random random)
+	//	  {
+	//		return random.nextBoolean() ? Lucene43EdgeNGramTokenizer.Side.FRONT : Lucene43EdgeNGramTokenizer.Side.BACK;
+	//	  }
+	//	}
+	//   );
+	//	put(EdgeNGramTokenFilter.Side.class, new ArgProducer()
+	//	{
+	//	  @@Override public Object create(Random random)
+	//	  {
+	//		return random.nextBoolean() ? EdgeNGramTokenFilter.Side.FRONT : EdgeNGramTokenFilter.Side.BACK;
+	//	  }
+	//	}
+	//   );
+	//	put(HyphenationTree.class, new ArgProducer()
+	//	{
+	//	  @@Override public Object create(Random random)
+	//	  {
+	//		// TODO: make nastier
+	//		try
+	//		{
+	//		  InputSource @is = new InputSource(TestCompoundWordTokenFilter.class.getResource("da_UTF8.xml").toExternalForm());
+	//		  HyphenationTree hyphenator = HyphenationCompoundWordTokenFilter.getHyphenationTree(@is);
+	//		  return hyphenator;
+	//		}
+	//		catch (Exception ex)
+	//		{
+	//		  Rethrow.rethrow(ex);
+	//		  return null; // unreachable code
+	//		}
+	//	  }
+	//	}
+	//   );
+	//	put(SnowballProgram.class, new ArgProducer()
+	//	{
+	//	  @@Override public Object create(Random random)
+	//	  {
+	//		try
+	//		{
+	//		  String lang = TestSnowball.SNOWBALL_LANGS[random.nextInt(TestSnowball.SNOWBALL_LANGS.length)];
+	//		  Class<? extends SnowballProgram> clazz = Class.forName("org.tartarus.snowball.ext." + lang + "Stemmer").asSubclass(SnowballProgram.class);
+	//		  return clazz.newInstance();
+	//		}
+	//		catch (Exception ex)
+	//		{
+	//		  Rethrow.rethrow(ex);
+	//		  return null; // unreachable code
+	//		}
+	//	  }
+	//	}
+	//   );
+	//	put(String.class, new ArgProducer()
+	//	{
+	//	  @@Override public Object create(Random random)
+	//	  {
+	//		// TODO: make nastier
+	//		if (random.nextBoolean())
+	//		{
+	//		  // a token type
+	//		  return StandardTokenizer.TOKEN_TYPES[random.nextInt(StandardTokenizer.TOKEN_TYPES.length)];
+	//		}
+	//		else
+	//		{
+	//		  return TestUtil.randomSimpleString(random);
+	//		}
+	//	  }
+	//	}
+	//   );
+	//	put(NormalizeCharMap.class, new ArgProducer()
+	//	{
+	//	  @@Override public Object create(Random random)
+	//	  {
+	//		NormalizeCharMap.Builder builder = new NormalizeCharMap.Builder();
+	//		// we can't add duplicate keys, or NormalizeCharMap gets angry
+	//		Set<String> keys = new HashSet<>();
+	//		int num = random.nextInt(5);
+	//		//System.out.println("NormalizeCharMap=");
+	//		for (int i = 0; i < num; i++)
+	//		{
+	//		  String key = TestUtil.randomSimpleString(random);
+	//		  if (!keys.contains(key) && key.length() > 0)
+	//		  {
+	//			String value = TestUtil.randomSimpleString(random);
+	//			builder.add(key, value);
+	//			keys.add(key);
+	//			//System.out.println("mapping: '" + key + "' => '" + value + "'");
+	//		  }
+	//		}
+	//		return builder.build();
+	//	  }
+	//	}
+	//   );
+	//	put(CharacterRunAutomaton.class, new ArgProducer()
+	//	{
+	//	  @@Override public Object create(Random random)
+	//	  {
+	//		// TODO: could probably use a purely random automaton
+	//		switch(random.nextInt(5))
+	//		{
+	//		  case 0:
+	//			  return MockTokenizer.KEYWORD;
+	//		  case 1:
+	//			  return MockTokenizer.SIMPLE;
+	//		  case 2:
+	//			  return MockTokenizer.WHITESPACE;
+	//		  case 3:
+	//			  return MockTokenFilter.EMPTY_STOPSET;
+	//		  default:
+	//			  return MockTokenFilter.ENGLISH_STOPSET;
+	//		}
+	//	  }
+	//	}
+	//   );
+	//	put(CharArrayMap.class, new ArgProducer()
+	//	{
+	//	  @@Override public Object create(Random random)
+	//	  {
+	//		int num = random.nextInt(10);
+	//		CharArrayMap<String> map = new CharArrayMap<>(TEST_VERSION_CURRENT, num, random.nextBoolean());
+	//		for (int i = 0; i < num; i++)
+	//		{
+	//		  // TODO: make nastier
+	//		  map.put(TestUtil.randomSimpleString(random), TestUtil.randomSimpleString(random));
+	//		}
+	//		return map;
+	//	  }
+	//	}
+	//   );
+	//	put(StemmerOverrideMap.class, new ArgProducer()
+	//	{
+	//	  @@Override public Object create(Random random)
+	//	  {
+	//		int num = random.nextInt(10);
+	//		StemmerOverrideFilter.Builder builder = new StemmerOverrideFilter.Builder(random.nextBoolean());
+	//		for (int i = 0; i < num; i++)
+	//		{
+	//		  String input = "";
+	//		  do
+	//		  {
+	//			input = TestUtil.randomRealisticUnicodeString(random);
+	//		  } while(input.isEmpty());
+	//		  String @out = "";
+	//		  TestUtil.randomSimpleString(random);
+	//		  do
+	//		  {
+	//			@out = TestUtil.randomRealisticUnicodeString(random);
+	//		  } while(@out.isEmpty());
+	//		  builder.add(input, @out);
+	//		}
+	//		try
+	//		{
+	//		  return builder.build();
+	//		}
+	//		catch (Exception ex)
+	//		{
+	//		  Rethrow.rethrow(ex);
+	//		  return null; // unreachable code
+	//		}
+	//	  }
+	//	}
+	//   );
+	//	put(SynonymMap.class, new ArgProducer()
+	//	{
+	//	  @@Override public Object create(Random random)
+	//	  {
+	//		SynonymMap.Builder b = new SynonymMap.Builder(random.nextBoolean());
+	//		final int numEntries = atLeast(10);
+	//		for (int j = 0; j < numEntries; j++)
+	//		{
+	//		  addSyn(b, randomNonEmptyString(random), randomNonEmptyString(random), random.nextBoolean());
+	//		}
+	//		try
+	//		{
+	//		  return b.build();
+	//		}
+	//		catch (Exception ex)
+	//		{
+	//		  Rethrow.rethrow(ex);
+	//		  return null; // unreachable code
+	//		}
+	//	  }
+	//
+	//	  private void addSyn(SynonymMap.Builder b, String input, String output, boolean keepOrig)
+	//	  {
+	//		b.add(new CharsRef(input.replaceAll(" +", "\u0000")), new CharsRef(output.replaceAll(" +", "\u0000")), keepOrig);
+	//	  }
+	//
+	//	  private String randomNonEmptyString(Random random)
+	//	  {
+	//		while(true)
+	//		{
+	//		  final String s = TestUtil.randomUnicodeString(random).trim();
+	//		  if (s.length() != 0 && s.indexOf('\u0000') == -1)
+	//		  {
+	//			return s;
+	//		  }
+	//		}
+	//	  }
+	//	}
+	//   );
+	//  }
+	//  }
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//
+	//  static final Set<Class> allowedTokenizerArgs, allowedTokenFilterArgs, allowedCharFilterArgs;
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//ignore
+	//
+	//  @@SuppressWarnings("unchecked") static <T> T newRandomArg(Random random, Class<T> paramType)
+	//  {
+	//	final ArgProducer producer = argProducers.get(paramType);
+	//	assertNotNull("No producer for arguments of type " + paramType.getName() + " found", producer);
+	//	return (T) producer.create(random);
+	//  }
+	//
+	//  static Object[] newTokenizerArgs(Random random, Reader reader, Class[] paramTypes)
+	//  {
+	//	Object[] args = new Object[paramTypes.length];
+	//	for (int i = 0; i < args.length; i++)
+	//	{
+	//	  Class paramType = paramTypes[i];
+	//	  if (paramType == Reader.class)
+	//	  {
+	//		args[i] = reader;
+	//	  }
+	//	  else if (paramType == AttributeFactory.class)
+	//	  {
+	//		// TODO: maybe the collator one...???
+	//		args[i] = AttributeFactory.DEFAULT_ATTRIBUTE_FACTORY;
+	//	  }
+	//	  else if (paramType == AttributeSource.class)
+	//	  {
+	//		// TODO: args[i] = new AttributeSource();
+	//		// this is currently too scary to deal with!
+	//		args[i] = null; // force IAE
+	//	  }
+	//	  else
+	//	  {
+	//		args[i] = newRandomArg(random, paramType);
+	//	  }
+	//	}
+	//	return args;
+	//  }
+	//
+	//  static Object[] newCharFilterArgs(Random random, Reader reader, Class[] paramTypes)
+	//  {
+	//	Object[] args = new Object[paramTypes.length];
+	//	for (int i = 0; i < args.length; i++)
+	//	{
+	//	  Class paramType = paramTypes[i];
+	//	  if (paramType == Reader.class)
+	//	  {
+	//		args[i] = reader;
+	//	  }
+	//	  else
+	//	  {
+	//		args[i] = newRandomArg(random, paramType);
+	//	  }
+	//	}
+	//	return args;
+	//  }
+	//
+	//  static Object[] newFilterArgs(Random random, TokenStream stream, Class[] paramTypes)
+	//  {
+	//	Object[] args = new Object[paramTypes.length];
+	//	for (int i = 0; i < args.length; i++)
+	//	{
+	//	  Class paramType = paramTypes[i];
+	//	  if (paramType == TokenStream.class)
+	//	  {
+	//		args[i] = stream;
+	//	  }
+	//	  else if (paramType == CommonGramsFilter.class)
+	//	  {
+	//		// TODO: fix this one, thats broken: CommonGramsQueryFilter takes this one explicitly
+	//		args[i] = new CommonGramsFilter(TEST_VERSION_CURRENT, stream, newRandomArg(random, CharArraySet.class));
+	//	  }
+	//	  else
+	//	  {
+	//		args[i] = newRandomArg(random, paramType);
+	//	  }
+	//	}
+	//	return args;
+	//  }
+	//
+	//  static class MockRandomAnalyzer extends Analyzer
+	//  {
+	//	final long seed;
+	//
+	//	MockRandomAnalyzer(long seed)
+	//	{
+	//	  this.seed = seed;
+	//	}
+	//
+	//	public boolean offsetsAreCorrect()
+	//	{
+	//	  // TODO: can we not do the full chain here!?
+	//	  Random random = new Random(seed);
+	//	  TokenizerSpec tokenizerSpec = newTokenizer(random, new StringReader(""));
+	//	  TokenFilterSpec filterSpec = newFilterChain(random, tokenizerSpec.tokenizer, tokenizerSpec.offsetsAreCorrect);
+	//	  return filterSpec.offsetsAreCorrect;
+	//	}
+	//
+	//	@@Override protected TokenStreamComponents createComponents(String fieldName, Reader reader)
+	//	{
+	//	  Random random = new Random(seed);
+	//	  TokenizerSpec tokenizerSpec = newTokenizer(random, reader);
+	//	  //System.out.println("seed=" + seed + ",create tokenizer=" + tokenizerSpec.toString);
+	//	  TokenFilterSpec filterSpec = newFilterChain(random, tokenizerSpec.tokenizer, tokenizerSpec.offsetsAreCorrect);
+	//	  //System.out.println("seed=" + seed + ",create filter=" + filterSpec.toString);
+	//	  return new TokenStreamComponents(tokenizerSpec.tokenizer, filterSpec.stream);
+	//	}
+	//
+	//	@@Override protected Reader initReader(String fieldName, Reader reader)
+	//	{
+	//	  Random random = new Random(seed);
+	//	  CharFilterSpec charfilterspec = newCharFilterChain(random, reader);
+	//	  return charfilterspec.reader;
+	//	}
+	//
+	//	@@Override public String toString()
+	//	{
+	//	  Random random = new Random(seed);
+	//	  StringBuilder sb = new StringBuilder();
+	//	  CharFilterSpec charFilterSpec = newCharFilterChain(random, new StringReader(""));
+	//	  sb.append("\ncharfilters=");
+	//	  sb.append(charFilterSpec.toString);
+	//	  // intentional: initReader gets its own separate random
+	//	  random = new Random(seed);
+	//	  TokenizerSpec tokenizerSpec = newTokenizer(random, charFilterSpec.reader);
+	//	  sb.append("\n");
+	//	  sb.append("tokenizer=");
+	//	  sb.append(tokenizerSpec.toString);
+	//	  TokenFilterSpec tokenFilterSpec = newFilterChain(random, tokenizerSpec.tokenizer, tokenizerSpec.offsetsAreCorrect);
+	//	  sb.append("\n");
+	//	  sb.append("filters=");
+	//	  sb.append(tokenFilterSpec.toString);
+	//	  sb.append("\n");
+	//	  sb.append("offsetsAreCorrect=" + tokenFilterSpec.offsetsAreCorrect);
+	//	  return sb.toString();
+	//	}
+	//
+	//	private <T> T createComponent(Constructor<T> ctor, Object[] args, StringBuilder descr)
+	//	{
+	//	  try
+	//	  {
+	//		final T instance = ctor.newInstance(args);
+	// /*
+	// if (descr.length() > 0) {
+	//   descr.append(",");
+	// }
+	// */
+	//		descr.append("\n  ");
+	//		descr.append(ctor.getDeclaringClass().getName());
+	//		String @params = Arrays.deepToString(args);
+	//		@params = @params.substring(1, (@params.length()-1) - 1);
+	//		descr.append("(").append(@params).append(")");
+	//		return instance;
+	//	  }
+	//	  catch (InvocationTargetException ite)
+	//	  {
+	//		final Throwable cause = ite.getCause();
+	//		if (cause instanceof IllegalArgumentException || cause instanceof UnsupportedOperationException)
+	//	{
+	//		  // thats ok, ignore
+	//		  if (VERBOSE)
+	//		  {
+	//			System.err.println("Ignoring IAE/UOE from ctor:");
+	//			cause.printStackTrace(System.err);
+	//		  }
+	//		}
+	//		else
+	//		{
+	//		  Rethrow.rethrow(cause);
+	//		}
+	//	  }
+	//	  catch (IllegalAccessException iae)
+	//	  {
+	//		Rethrow.rethrow(iae);
+	//	  }
+	//	  catch (InstantiationException ie)
+	//	  {
+	//		Rethrow.rethrow(ie);
+	//	  }
+	//	  return null; // no success
+	//	}
+	//
+	//	private boolean broken(Constructor<?> ctor, Object[] args)
+	//	{
+	//	  final Predicate<Object[]> pred = brokenConstructors.get(ctor);
+	//	  return pred != null && pred.apply(args);
+	//	}
+	//
+	//	private boolean brokenOffsets(Constructor<?> ctor, Object[] args)
+	//	{
+	//	  final Predicate<Object[]> pred = brokenOffsetsConstructors.get(ctor);
+	//	  return pred != null && pred.apply(args);
+	//	}
+	//
+	//	// create a new random tokenizer from classpath
+	//	private TokenizerSpec newTokenizer(Random random, Reader reader)
+	//	{
+	//	  TokenizerSpec spec = new TokenizerSpec();
+	//	  while (spec.tokenizer == null)
+	//	  {
+	//		final Constructor<? extends Tokenizer> ctor = tokenizers.get(random.nextInt(tokenizers.size()));
+	//		final StringBuilder descr = new StringBuilder();
+	//		final CheckThatYouDidntReadAnythingReaderWrapper wrapper = new CheckThatYouDidntReadAnythingReaderWrapper(reader);
+	//		final Object args[] = newTokenizerArgs(random, wrapper, ctor.getParameterTypes());
+	//		if (broken(ctor, args))
+	//		{
+	//		  continue;
+	//		}
+	//		spec.tokenizer = createComponent(ctor, args, descr);
+	//		if (spec.tokenizer != null)
+	//		{
+	//		  spec.offsetsAreCorrect &= !brokenOffsets(ctor, args);
+	//		  spec.toString = descr.toString();
+	//		}
+	//		else
+	//		{
+	//		  assertFalse(ctor.getDeclaringClass().getName() + " has read something in ctor but failed with UOE/IAE", wrapper.readSomething);
+	//		}
+	//	  }
+	//	  return spec;
+	//	}
+	//
+	//	private CharFilterSpec newCharFilterChain(Random random, Reader reader)
+	//	{
+	//	  CharFilterSpec spec = new CharFilterSpec();
+	//	  spec.reader = reader;
+	//	  StringBuilder descr = new StringBuilder();
+	//	  int numFilters = random.nextInt(3);
+	//	  for (int i = 0; i < numFilters; i++)
+	//	  {
+	//		while (true)
+	//		{
+	//		  final Constructor<? extends CharFilter> ctor = charfilters.get(random.nextInt(charfilters.size()));
+	//		  final Object args[] = newCharFilterArgs(random, spec.reader, ctor.getParameterTypes());
+	//		  if (broken(ctor, args))
+	//		  {
+	//			continue;
+	//		  }
+	//		  reader = createComponent(ctor, args, descr);
+	//		  if (reader != null)
+	//		  {
+	//			spec.reader = reader;
+	//			break;
+	//		  }
+	//		}
+	//	  }
+	//	  spec.toString = descr.toString();
+	//	  return spec;
+	//	}
+	//
+	//	private TokenFilterSpec newFilterChain(Random random, Tokenizer tokenizer, boolean offsetsAreCorrect)
+	//	{
+	//	  TokenFilterSpec spec = new TokenFilterSpec();
+	//	  spec.offsetsAreCorrect = offsetsAreCorrect;
+	//	  spec.stream = tokenizer;
+	//	  StringBuilder descr = new StringBuilder();
+	//	  int numFilters = random.nextInt(5);
+	//	  for (int i = 0; i < numFilters; i++)
+	//	  {
+	//
+	//		// Insert ValidatingTF after each stage so we can
+	//		// catch problems right after the TF that "caused"
+	//		// them:
+	//		spec.stream = new ValidatingTokenFilter(spec.stream, "stage " + i, spec.offsetsAreCorrect);
+	//
+	//		while (true)
+	//		{
+	//		  final Constructor<? extends TokenFilter> ctor = tokenfilters.get(random.nextInt(tokenfilters.size()));
+	//
+	//		  // hack: MockGraph/MockLookahead has assertions that will trip if they follow
+	//		  // an offsets violator. so we cant use them after e.g. wikipediatokenizer
+	//		  if (!spec.offsetsAreCorrect && (ctor.getDeclaringClass().equals(MockGraphTokenFilter.class) || ctor.getDeclaringClass().equals(MockRandomLookaheadTokenFilter.class)))
+	//		  {
+	//			continue;
+	//		  }
+	//
+	//		  final Object args[] = newFilterArgs(random, spec.stream, ctor.getParameterTypes());
+	//		  if (broken(ctor, args))
+	//		  {
+	//			continue;
+	//		  }
+	//		  final TokenFilter flt = createComponent(ctor, args, descr);
+	//		  if (flt != null)
+	//		  {
+	//			spec.offsetsAreCorrect &= !brokenOffsets(ctor, args);
+	//			spec.stream = flt;
+	//			break;
+	//		  }
+	//		}
+	//	  }
+	//
+	//	  // Insert ValidatingTF after each stage so we can
+	//	  // catch problems right after the TF that "caused"
+	//	  // them:
+	//	  spec.stream = new ValidatingTokenFilter(spec.stream, "last stage", spec.offsetsAreCorrect);
+	//
+	//	  spec.toString = descr.toString();
+	//	  return spec;
+	//	}
+	//  }
+	//
+	//  static class CheckThatYouDidntReadAnythingReaderWrapper extends CharFilter
+	//  {
+	//	boolean readSomething;
+	//
+	//	CheckThatYouDidntReadAnythingReaderWrapper(Reader @in)
+	//	{
+	//	  base(@in);
+	//	}
+	//
+	//	@@Override public int correct(int currentOff)
+	//	{
+	//	  return currentOff; // we don't change any offsets
+	//	}
+	//
+	//	@@Override public int read(char[] cbuf, int off, int len) throws IOException
+	//	{
+	//	  readSomething = true;
+	//	  return input.read(cbuf, off, len);
+	//	}
+	//
+	//	@@Override public int read() throws IOException
+	//	{
+	//	  readSomething = true;
+	//	  return input.read();
+	//	}
+	//
+	//	@@Override public int read(CharBuffer target) throws IOException
+	//	{
+	//	  readSomething = true;
+	//	  return input.read(target);
+	//	}
+	//
+	//	@@Override public int read(char[] cbuf) throws IOException
+	//	{
+	//	  readSomething = true;
+	//	  return input.read(cbuf);
+	//	}
+	//
+	//	@@Override public long skip(long n) throws IOException
+	//	{
+	//	  readSomething = true;
+	//	  return input.skip(n);
+	//	}
+	//
+	//	@@Override public void mark(int readAheadLimit) throws IOException
+	//	{
+	//	  input.mark(readAheadLimit);
+	//	}
+	//
+	//	@@Override public boolean markSupported()
+	//	{
+	//	  return input.markSupported();
+	//	}
+	//
+	//	@@Override public boolean ready() throws IOException
+	//	{
+	//	  return input.ready();
+	//	}
+	//
+	//	@@Override public void reset() throws IOException
+	//	{
+	//	  input.reset();
+	//	}
+	//  }
+	//
+	//  static class TokenizerSpec
+	//  {
+	//	Tokenizer tokenizer;
+	//	String toString;
+	//	boolean offsetsAreCorrect = true;
+	//  }
+	//
+	//  static class TokenFilterSpec
+	//  {
+	//	TokenStream stream;
+	//	String toString;
+	//	boolean offsetsAreCorrect = true;
+	//  }
+	//
+	//  static class CharFilterSpec
+	//  {
+	//	Reader reader;
+	//	String toString;
+	//  }
+	//
+	//  public void testRandomChains() throws Throwable
+	//  {
+	//	int numIterations = atLeast(20);
+	//	Random random = random();
+	//	for (int i = 0; i < numIterations; i++)
+	//	{
+	//	  MockRandomAnalyzer a = new MockRandomAnalyzer(random.nextLong());
+	//	  if (VERBOSE)
+	//	  {
+	//		System.out.println("Creating random analyzer:" + a);
+	//	  }
+	//	  try
+	//	  {
+	//		checkRandomData(random, a, 500*RANDOM_MULTIPLIER, 20, false, false); // We already validate our own offsets...
+	//	  }
+	//	  catch (Throwable e)
+	//	  {
+	//		System.err.println("Exception from random analyzer: " + a);
+	//		throw e;
+	//	  }
+	//	}
+	//  }
+	//
+	//  // we might regret this decision...
+	//  public void testRandomChainsWithLargeStrings() throws Throwable
+	//  {
+	//	int numIterations = atLeast(20);
+	//	Random random = random();
+	//	for (int i = 0; i < numIterations; i++)
+	//	{
+	//	  MockRandomAnalyzer a = new MockRandomAnalyzer(random.nextLong());
+	//	  if (VERBOSE)
+	//	  {
+	//		System.out.println("Creating random analyzer:" + a);
+	//	  }
+	//	  try
+	//	  {
+	//		checkRandomData(random, a, 50*RANDOM_MULTIPLIER, 128, false, false); // We already validate our own offsets...
+	//	  }
+	//	  catch (Throwable e)
+	//	  {
+	//		System.err.println("Exception from random analyzer: " + a);
+	//		throw e;
+	//	  }
+	//	}
+	//  }
+	//}
+
+	  }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestStandardAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestStandardAnalyzer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestStandardAnalyzer.cs
new file mode 100644
index 0000000..4465288
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestStandardAnalyzer.cs
@@ -0,0 +1,453 @@
+using System;
+using System.Text;
+
+namespace org.apache.lucene.analysis.core
+{
+
+	/*
+	 * 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 StandardAnalyzer = org.apache.lucene.analysis.standard.StandardAnalyzer;
+	using StandardTokenizer = org.apache.lucene.analysis.standard.StandardTokenizer;
+	using Version = org.apache.lucene.util.Version;
+
+	public class TestStandardAnalyzer : BaseTokenStreamTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testHugeDoc() throws java.io.IOException
+	  public virtual void testHugeDoc()
+	  {
+		StringBuilder sb = new StringBuilder();
+		char[] whitespace = new char[4094];
+		Arrays.fill(whitespace, ' ');
+		sb.Append(whitespace);
+		sb.Append("testing 1234");
+		string input = sb.ToString();
+		StandardTokenizer tokenizer = new StandardTokenizer(TEST_VERSION_CURRENT, new StringReader(input));
+		BaseTokenStreamTestCase.assertTokenStreamContents(tokenizer, new string[] {"testing", "1234"});
+	  }
+
+	  private Analyzer a = new AnalyzerAnonymousInnerClassHelper();
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  public AnalyzerAnonymousInnerClassHelper()
+		  {
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+
+			Tokenizer tokenizer = new StandardTokenizer(TEST_VERSION_CURRENT, reader);
+			return new TokenStreamComponents(tokenizer);
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testArmenian() throws Exception
+	  public virtual void testArmenian()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "Վիքիպեդիայի 13 միլիոն հոդվածները (4,600` հայերեն վիքիպեդիայում) գրվել են կամավորների կողմից ու համարյա բոլոր հոդվածները կարող է խմբագրել ցանկաց մարդ ով կարող է բացել Վիքիպեդիայի կայքը։", new string[] {"Վիքիպեդիայի", "13", "միլիոն", "հոդվածները", "4,600", "հայերեն", "վիքիպեդիայում", "գրվել", "են", "կամավորների", "կողմից", "ու", "համարյա", "բոլոր", "հոդվածները", "կարող", "է", "խմբագրել", "ցանկաց", "մարդ", "ով", "կարող", "է", "բացել", "Վիքիպեդիայի", "կայքը"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testAmharic() throws Exception
+	  public virtual void testAmharic()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "ዊኪፔድያ የባለ ብዙ ቋንቋ የተሟላ ትክክለኛና ነጻ መዝገበ ዕውቀት (ኢንሳይክሎፒዲያ) ነው። ማንኛውም", new string[] {"ዊኪፔድያ", "የባለ", "ብዙ", "ቋንቋ", "የተሟላ", "ትክክለኛና", "ነጻ", "መዝገበ", "ዕውቀት", "ኢንሳይክሎፒዲያ", "ነው", "ማንኛውም"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testArabic() throws Exception
+	  public virtual void testArabic()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "الفيلم الوثائقي الأول عن ويكيبيديا يسمى \"الحقيقة بالأرقام: قصة ويكيبيديا\" (بالإنجليزية: Truth in Numbers: The Wikipedia Story)، سيتم إطلاقه في 2008.", new string[] {"الفيلم", "الوثائقي", "الأول", "عن", "ويكيبيديا", "يسمى", "الحقيقة", "بالأرقام", "قصة", "ويكيبيديا", "بالإنجليزية", "Truth", "in", "Numbers", "The", "Wikipedia", "Story", "سيتم", "إطلاقه", "في", "2008"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testAramaic() throws Exception
+	  public virtual void testAramaic()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "ܘܝܩܝܦܕܝܐ (ܐܢܓܠܝܐ: Wikipedia) ܗܘ ܐܝܢܣܩܠܘܦܕܝܐ ܚܐܪܬܐ ܕܐܢܛܪܢܛ ܒܠܫܢ̈ܐ ܣܓܝܐ̈ܐ܂ ܫܡܗ ܐܬܐ ܡܢ ܡ̈ܠܬܐ ܕ\"ܘܝܩܝ\" ܘ\"ܐܝܢܣܩܠܘܦܕܝܐ\"܀", new string[] {"ܘܝܩܝܦܕܝܐ", "ܐܢܓܠܝܐ", "Wikipedia", "ܗܘ", "ܐܝܢܣܩܠܘܦܕܝܐ", "ܚܐܪܬܐ", "ܕܐܢܛܪܢܛ", "ܒܠܫܢ̈ܐ", "ܣܓܝܐ̈ܐ", "ܫܡܗ", "ܐܬܐ", "ܡܢ", "ܡ̈ܠܬܐ", "ܕ", "ܘܝܩܝ", "ܘ", "ܐܝܢܣܩܠܘܦܕܝܐ"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBengali() throws Exception
+	  public virtual void testBengali()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "এই বিশ্বকোষ পরিচালনা করে উইকিমিডিয়া ফাউন্ডেশন (একটি অলাভজনক সংস্থা)। উইকিপিডিয়ার শুরু ১৫ জানুয়ারি, ২০০১ সালে। এখন পর্যন্ত ২০০টিরও বেশী ভাষায় উইকিপিডিয়া রয়েছে।", new string[] {"এই", "বিশ্বকোষ", "পরিচালনা", "করে", "উইকিমিডিয়া", "ফাউন্ডেশন", "একটি", "অলাভজনক", "সংস্থা", "উইকিপিডিয়ার", "শুরু", "১৫", "জানুয়ারি", "২০০১", "সালে", "এখন", "পর্যন্ত", "২০০টিরও", "বেশী", "ভাষায়", "উইকিপিডিয়া", "রয়�
 �ছে"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFarsi() throws Exception
+	  public virtual void testFarsi()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "ویکی پدیای انگلیسی در تاریخ ۲۵ دی ۱۳۷۹ به صورت مکملی برای دانشنامهٔ تخصصی نوپدیا نوشته شد.", new string[] {"ویکی", "پدیای", "انگلیسی", "در", "تاریخ", "۲۵", "دی", "۱۳۷۹", "به", "صورت", "مکملی", "برای", "دانشنامهٔ", "تخصصی", "نوپدیا", "نوشته", "شد"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testGreek() throws Exception
+	  public virtual void testGreek()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "Γράφεται σε συνεργασία από εθελοντές με το λογισμικό wiki, κάτι που σημαίνει ότι άρθρα μπορεί να προστεθούν ή να αλλάξουν από τον καθένα.", new string[] {"Γράφεται", "σε", "συνεργασία", "από", "εθελοντές", "με", "το", "λογισμικό", "wiki", "κάτι", "που", "σημαίνει", "ότι", "άρθρα", "μπορεί", "να", "προστεθούν", "ή", "να", "αλλάξουν", "από", "τον", "καθένα"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testThai() throws Exception
+	  public virtual void testThai()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "การที่ได้ต้องแสดงว่างานดี. แล้วเธอจะไปไหน? ๑๒๓๔", new string[] {"การที่ได้ต้องแสดงว่างานดี", "แล้วเธอจะไปไหน", "๑๒๓๔"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testLao() throws Exception
+	  public virtual void testLao()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "ສາທາລະນະລັດ ປະຊາທິປະໄຕ ປະຊາຊົນລາວ", new string[] {"ສາທາລະນະລັດ", "ປະຊາທິປະໄຕ", "ປະຊາຊົນລາວ"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTibetan() throws Exception
+	  public virtual void testTibetan()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "སྣོན་མཛོད་དང་ལས་འདིས་བོད་ཡིག་མི་ཉམས་གོང་འཕེལ་དུ་གཏོང་བར་ཧ་ཅང་དགེ་མཚན་མཆིས་སོ། །", new string[] {"སྣོན", "མཛོད", "དང", "ལས", "འདིས", "བོད", "ཡིག", "མི", "ཉམས", "གོང", "འཕེལ", "དུ", "གཏོང", "བར", "ཧ", "ཅང", "དགེ", "མཚན", "མཆིས", "སོ"});
+	  }
+
+	  /*
+	   * For chinese, tokenize as char (these can later form bigrams or whatever)
+	   */
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testChinese() throws Exception
+	  public virtual void testChinese()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "我是中国人。 1234 Tests ", new string[] {"我", "是", "中", "国", "人", "1234", "Tests"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmpty() throws Exception
+	  public virtual void testEmpty()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "", new string[] {});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, ".", new string[] {});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, " ", new string[] {});
+	  }
+
+	  /* test various jira issues this analyzer is related to */
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testLUCENE1545() throws Exception
+	  public virtual void testLUCENE1545()
+	  {
+		/*
+		 * Standard analyzer does not correctly tokenize combining character U+0364 COMBINING LATIN SMALL LETTRE E.
+		 * The word "moͤchte" is incorrectly tokenized into "mo" "chte", the combining character is lost.
+		 * Expected result is only on token "moͤchte".
+		 */
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "moͤchte", new string[] {"moͤchte"});
+	  }
+
+	  /* Tests from StandardAnalyzer, just to show behavior is similar */
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testAlphanumericSA() throws Exception
+	  public virtual void testAlphanumericSA()
+	  {
+		// alphanumeric tokens
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "B2B", new string[]{"B2B"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "2B", new string[]{"2B"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testDelimitersSA() throws Exception
+	  public virtual void testDelimitersSA()
+	  {
+		// other delimiters: "-", "/", ","
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "some-dashed-phrase", new string[]{"some", "dashed", "phrase"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "dogs,chase,cats", new string[]{"dogs", "chase", "cats"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "ac/dc", new string[]{"ac", "dc"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testApostrophesSA() throws Exception
+	  public virtual void testApostrophesSA()
+	  {
+		// internal apostrophes: O'Reilly, you're, O'Reilly's
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "O'Reilly", new string[]{"O'Reilly"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "you're", new string[]{"you're"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "she's", new string[]{"she's"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "Jim's", new string[]{"Jim's"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "don't", new string[]{"don't"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "O'Reilly's", new string[]{"O'Reilly's"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNumericSA() throws Exception
+	  public virtual void testNumericSA()
+	  {
+		// floating point, serial, model numbers, ip addresses, etc.
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "21.35", new string[]{"21.35"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "R2D2 C3PO", new string[]{"R2D2", "C3PO"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "216.239.63.104", new string[]{"216.239.63.104"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "216.239.63.104", new string[]{"216.239.63.104"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTextWithNumbersSA() throws Exception
+	  public virtual void testTextWithNumbersSA()
+	  {
+		// numbers
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "David has 5000 bones", new string[]{"David", "has", "5000", "bones"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testVariousTextSA() throws Exception
+	  public virtual void testVariousTextSA()
+	  {
+		// various
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "C embedded developers wanted", new string[]{"C", "embedded", "developers", "wanted"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "foo bar FOO BAR", new string[]{"foo", "bar", "FOO", "BAR"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "foo      bar .  FOO <> BAR", new string[]{"foo", "bar", "FOO", "BAR"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "\"QUOTED\" word", new string[]{"QUOTED", "word"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testKoreanSA() throws Exception
+	  public virtual void testKoreanSA()
+	  {
+		// Korean words
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "안녕하세요 한글입니다", new string[]{"안녕하세요", "한글입니다"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testOffsets() throws Exception
+	  public virtual void testOffsets()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "David has 5000 bones", new string[] {"David", "has", "5000", "bones"}, new int[] {0, 6, 10, 15}, new int[] {5, 9, 14, 20});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTypes() throws Exception
+	  public virtual void testTypes()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "David has 5000 bones", new string[] {"David", "has", "5000", "bones"}, new string[] {"<ALPHANUM>", "<ALPHANUM>", "<NUM>", "<ALPHANUM>"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testUnicodeWordBreaks() throws Exception
+	  public virtual void testUnicodeWordBreaks()
+	  {
+		WordBreakTestUnicode_6_3_0 wordBreakTest = new WordBreakTestUnicode_6_3_0();
+		wordBreakTest.test(a);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testSupplementary() throws Exception
+	  public virtual void testSupplementary()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "𩬅艱鍟䇹愯瀛", new string[] {"𩬅", "艱", "鍟", "䇹", "愯", "瀛"}, new string[] {"<IDEOGRAPHIC>", "<IDEOGRAPHIC>", "<IDEOGRAPHIC>", "<IDEOGRAPHIC>", "<IDEOGRAPHIC>", "<IDEOGRAPHIC>"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testKorean() throws Exception
+	  public virtual void testKorean()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "훈민정음", new string[] {"훈민정음"}, new string[] {"<HANGUL>"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testJapanese() throws Exception
+	  public virtual void testJapanese()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "仮名遣い カタカナ", new string[] {"仮", "名", "遣", "い", "カタカナ"}, new string[] {"<IDEOGRAPHIC>", "<IDEOGRAPHIC>", "<IDEOGRAPHIC>", "<HIRAGANA>", "<KATAKANA>"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCombiningMarks() throws Exception
+	  public virtual void testCombiningMarks()
+	  {
+		checkOneTerm(a, "ざ", "ざ"); // hiragana
+		checkOneTerm(a, "ザ", "ザ"); // katakana
+		checkOneTerm(a, "壹゙", "壹゙"); // ideographic
+		checkOneTerm(a, "아゙", "아゙"); // hangul
+	  }
+
+	  /// <summary>
+	  /// Multiple consecutive chars in \p{WB:MidLetter}, \p{WB:MidNumLet},
+	  /// and/or \p{MidNum} should trigger a token split.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMid() throws Exception
+	  public virtual void testMid()
+	  {
+		// ':' is in \p{WB:MidLetter}, which should trigger a split unless there is a Letter char on both sides
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "A:B", new string[] {"A:B"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "A::B", new string[] {"A", "B"});
+
+		// '.' is in \p{WB:MidNumLet}, which should trigger a split unless there is a Letter or Numeric char on both sides
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "1.2", new string[] {"1.2"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "A.B", new string[] {"A.B"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "1..2", new string[] {"1", "2"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "A..B", new string[] {"A", "B"});
+
+		// ',' is in \p{WB:MidNum}, which should trigger a split unless there is a Numeric char on both sides
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "1,2", new string[] {"1,2"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "1,,2", new string[] {"1", "2"});
+
+		// Mixed consecutive \p{WB:MidLetter} and \p{WB:MidNumLet} should trigger a split
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "A.:B", new string[] {"A", "B"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "A:.B", new string[] {"A", "B"});
+
+		// Mixed consecutive \p{WB:MidNum} and \p{WB:MidNumLet} should trigger a split
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "1,.2", new string[] {"1", "2"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "1.,2", new string[] {"1", "2"});
+
+		// '_' is in \p{WB:ExtendNumLet}
+
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "A:B_A:B", new string[] {"A:B_A:B"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "A:B_A::B", new string[] {"A:B_A", "B"});
+
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "1.2_1.2", new string[] {"1.2_1.2"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "A.B_A.B", new string[] {"A.B_A.B"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "1.2_1..2", new string[] {"1.2_1", "2"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "A.B_A..B", new string[] {"A.B_A", "B"});
+
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "1,2_1,2", new string[] {"1,2_1,2"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "1,2_1,,2", new string[] {"1,2_1", "2"});
+
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "C_A.:B", new string[] {"C_A", "B"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "C_A:.B", new string[] {"C_A", "B"});
+
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "3_1,.2", new string[] {"3_1", "2"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "3_1.,2", new string[] {"3_1", "2"});
+	  }
+
+
+	  /// @deprecated remove this and sophisticated backwards layer in 5.0 
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Deprecated("remove this and sophisticated backwards layer in 5.0") public void testCombiningMarksBackwards() throws Exception
+	  [Obsolete("remove this and sophisticated backwards layer in 5.0")]
+	  public virtual void testCombiningMarksBackwards()
+	  {
+		Analyzer a = new StandardAnalyzer(Version.LUCENE_33);
+		checkOneTerm(a, "ざ", "さ"); // hiragana Bug
+		checkOneTerm(a, "ザ", "ザ"); // katakana Works
+		checkOneTerm(a, "壹゙", "壹"); // ideographic Bug
+		checkOneTerm(a, "아゙", "아゙"); // hangul Works
+	  }
+
+	  /// @deprecated uses older unicode (6.0). simple test to make sure its basically working 
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Deprecated("uses older unicode (6.0). simple test to make sure its basically working") public void testVersion36() throws Exception
+	  [Obsolete("uses older unicode (6.0). simple test to make sure its basically working")]
+	  public virtual void testVersion36()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper2(this);
+		assertAnalyzesTo(a, "this is just a t\u08E6st lucene@apache.org", new string[] {"this", "is", "just", "a", "t", "st", "lucene", "apache.org"}); // new combining mark in 6.1
+	  };
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestStandardAnalyzer outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestStandardAnalyzer outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new StandardTokenizer(Version.LUCENE_36, reader);
+			return new TokenStreamComponents(tokenizer);
+		  }
+	  }
+
+	  /// @deprecated uses older unicode (6.1). simple test to make sure its basically working 
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Deprecated("uses older unicode (6.1). simple test to make sure its basically working") public void testVersion40() throws Exception
+	  [Obsolete("uses older unicode (6.1). simple test to make sure its basically working")]
+	  public virtual void testVersion40()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper3(this);
+		// U+061C is a new combining mark in 6.3, found using "[[\p{WB:Format}\p{WB:Extend}]&[^\p{Age:6.2}]]"
+		// on the online UnicodeSet utility: <http://unicode.org/cldr/utility/list-unicodeset.jsp>
+		assertAnalyzesTo(a, "this is just a t\u061Cst lucene@apache.org", new string[] {"this", "is", "just", "a", "t", "st", "lucene", "apache.org"});
+	  };
+
+	  private class AnalyzerAnonymousInnerClassHelper3 : Analyzer
+	  {
+		  private readonly TestStandardAnalyzer outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper3(TestStandardAnalyzer outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new StandardTokenizer(Version.LUCENE_40, reader);
+			return new TokenStreamComponents(tokenizer);
+		  }
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), new StandardAnalyzer(TEST_VERSION_CURRENT), 1000 * RANDOM_MULTIPLIER);
+	  }
+
+	  /// <summary>
+	  /// blast some random large strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomHugeStrings() throws Exception
+	  public virtual void testRandomHugeStrings()
+	  {
+		Random random = random();
+		checkRandomData(random, new StandardAnalyzer(TEST_VERSION_CURRENT), 100 * RANDOM_MULTIPLIER, 8192);
+	  }
+
+	  // Adds random graph after:
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomHugeStringsGraphAfter() throws Exception
+	  public virtual void testRandomHugeStringsGraphAfter()
+	  {
+		Random random = random();
+		checkRandomData(random, new AnalyzerAnonymousInnerClassHelper4(this), 100 * RANDOM_MULTIPLIER, 8192);
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper4 : Analyzer
+	  {
+		  private readonly TestStandardAnalyzer outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper4(TestStandardAnalyzer outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new StandardTokenizer(TEST_VERSION_CURRENT, reader);
+			TokenStream tokenStream = new MockGraphTokenFilter(random(), tokenizer);
+			return new TokenStreamComponents(tokenizer, tokenStream);
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestStopAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestStopAnalyzer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestStopAnalyzer.cs
new file mode 100644
index 0000000..433692f
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestStopAnalyzer.cs
@@ -0,0 +1,134 @@
+using System.Collections.Generic;
+
+namespace org.apache.lucene.analysis.core
+{
+
+	/*
+	 * 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 PositionIncrementAttribute = org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
+	using CharTermAttribute = org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
+	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+	using IOUtils = org.apache.lucene.util.IOUtils;
+	using Version = org.apache.lucene.util.Version;
+
+
+	public class TestStopAnalyzer : BaseTokenStreamTestCase
+	{
+
+	  private StopAnalyzer stop = new StopAnalyzer(TEST_VERSION_CURRENT);
+	  private ISet<object> inValidTokens = new HashSet<object>();
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Override public void setUp() throws Exception
+	  public override void setUp()
+	  {
+		base.setUp();
+
+//JAVA TO C# CONVERTER TODO TASK: Java wildcard generics are not converted to .NET:
+//ORIGINAL LINE: java.util.Iterator<?> it = StopAnalyzer.ENGLISH_STOP_WORDS_SET.iterator();
+		IEnumerator<?> it = StopAnalyzer.ENGLISH_STOP_WORDS_SET.GetEnumerator();
+		while (it.MoveNext())
+		{
+		  inValidTokens.Add(it.Current);
+		}
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testDefaults() throws java.io.IOException
+	  public virtual void testDefaults()
+	  {
+		assertTrue(stop != null);
+		TokenStream stream = stop.tokenStream("test", "This is a test of the english stop analyzer");
+		try
+		{
+		  assertTrue(stream != null);
+		  CharTermAttribute termAtt = stream.getAttribute(typeof(CharTermAttribute));
+		  stream.reset();
+
+		  while (stream.incrementToken())
+		  {
+			assertFalse(inValidTokens.Contains(termAtt.ToString()));
+		  }
+		  stream.end();
+		}
+		finally
+		{
+		  IOUtils.closeWhileHandlingException(stream);
+		}
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStopList() throws java.io.IOException
+	  public virtual void testStopList()
+	  {
+		CharArraySet stopWordsSet = new CharArraySet(TEST_VERSION_CURRENT, asSet("good", "test", "analyzer"), false);
+		StopAnalyzer newStop = new StopAnalyzer(TEST_VERSION_CURRENT, stopWordsSet);
+		TokenStream stream = newStop.tokenStream("test", "This is a good test of the english stop analyzer");
+		try
+		{
+		  assertNotNull(stream);
+		  CharTermAttribute termAtt = stream.getAttribute(typeof(CharTermAttribute));
+
+		  stream.reset();
+		  while (stream.incrementToken())
+		  {
+			string text = termAtt.ToString();
+			assertFalse(stopWordsSet.contains(text));
+		  }
+		  stream.end();
+		}
+		finally
+		{
+		  IOUtils.closeWhileHandlingException(stream);
+		}
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStopListPositions() throws java.io.IOException
+	  public virtual void testStopListPositions()
+	  {
+		CharArraySet stopWordsSet = new CharArraySet(TEST_VERSION_CURRENT, asSet("good", "test", "analyzer"), false);
+		StopAnalyzer newStop = new StopAnalyzer(TEST_VERSION_CURRENT, stopWordsSet);
+		string s = "This is a good test of the english stop analyzer with positions";
+		int[] expectedIncr = new int[] {1, 1, 1, 3, 1, 1, 1, 2, 1};
+		TokenStream stream = newStop.tokenStream("test", s);
+		try
+		{
+		  assertNotNull(stream);
+		  int i = 0;
+		  CharTermAttribute termAtt = stream.getAttribute(typeof(CharTermAttribute));
+		  PositionIncrementAttribute posIncrAtt = stream.addAttribute(typeof(PositionIncrementAttribute));
+
+		  stream.reset();
+		  while (stream.incrementToken())
+		  {
+			string text = termAtt.ToString();
+			assertFalse(stopWordsSet.contains(text));
+			assertEquals(expectedIncr[i++],posIncrAtt.PositionIncrement);
+		  }
+		  stream.end();
+		}
+		finally
+		{
+		  IOUtils.closeWhileHandlingException(stream);
+		}
+	  }
+
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestStopFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestStopFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestStopFilter.cs
new file mode 100644
index 0000000..b1923ed
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestStopFilter.cs
@@ -0,0 +1,243 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace org.apache.lucene.analysis.core
+{
+
+	/// <summary>
+	/// Copyright 2005 The Apache Software Foundation
+	/// 
+	/// Licensed 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>
+
+
+	using CharTermAttribute = org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
+	using PositionIncrementAttribute = org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
+	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+	using English = org.apache.lucene.util.English;
+	using Version = org.apache.lucene.util.Version;
+
+
+	public class TestStopFilter : BaseTokenStreamTestCase
+	{
+
+	  // other StopFilter functionality is already tested by TestStopAnalyzer
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testExactCase() throws java.io.IOException
+	  public virtual void testExactCase()
+	  {
+		StringReader reader = new StringReader("Now is The Time");
+		CharArraySet stopWords = new CharArraySet(TEST_VERSION_CURRENT, asSet("is", "the", "Time"), false);
+		TokenStream stream = new StopFilter(TEST_VERSION_CURRENT, new MockTokenizer(reader, MockTokenizer.WHITESPACE, false), stopWords);
+		assertTokenStreamContents(stream, new string[] {"Now", "The"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStopFilt() throws java.io.IOException
+	  public virtual void testStopFilt()
+	  {
+		StringReader reader = new StringReader("Now is The Time");
+		string[] stopWords = new string[] {"is", "the", "Time"};
+		CharArraySet stopSet = StopFilter.makeStopSet(TEST_VERSION_CURRENT, stopWords);
+		TokenStream stream = new StopFilter(TEST_VERSION_CURRENT, new MockTokenizer(reader, MockTokenizer.WHITESPACE, false), stopSet);
+		assertTokenStreamContents(stream, new string[] {"Now", "The"});
+	  }
+
+	  /// <summary>
+	  /// Test Position increments applied by StopFilter with and without enabling this option.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStopPositons() throws java.io.IOException
+	  public virtual void testStopPositons()
+	  {
+		StringBuilder sb = new StringBuilder();
+		List<string> a = new List<string>();
+		for (int i = 0; i < 20; i++)
+		{
+		  string w = English.intToEnglish(i).trim();
+		  sb.Append(w).Append(" ");
+		  if (i % 3 != 0)
+		  {
+			  a.Add(w);
+		  }
+		}
+		log(sb.ToString());
+		string[] stopWords = a.ToArray();
+		for (int i = 0; i < a.Count; i++)
+		{
+			log("Stop: " + stopWords[i]);
+		}
+		CharArraySet stopSet = StopFilter.makeStopSet(TEST_VERSION_CURRENT, stopWords);
+		// with increments
+		StringReader reader = new StringReader(sb.ToString());
+		StopFilter stpf = new StopFilter(Version.LUCENE_40, new MockTokenizer(reader, MockTokenizer.WHITESPACE, false), stopSet);
+		doTestStopPositons(stpf,true);
+		// without increments
+		reader = new StringReader(sb.ToString());
+		stpf = new StopFilter(Version.LUCENE_43, new MockTokenizer(reader, MockTokenizer.WHITESPACE, false), stopSet);
+		doTestStopPositons(stpf,false);
+		// with increments, concatenating two stop filters
+		List<string> a0 = new List<string>();
+		List<string> a1 = new List<string>();
+		for (int i = 0; i < a.Count; i++)
+		{
+		  if (i % 2 == 0)
+		  {
+			a0.Add(a[i]);
+		  }
+		  else
+		  {
+			a1.Add(a[i]);
+		  }
+		}
+		string[] stopWords0 = a0.ToArray();
+		for (int i = 0; i < a0.Count; i++)
+		{
+			log("Stop0: " + stopWords0[i]);
+		}
+		string[] stopWords1 = a1.ToArray();
+		for (int i = 0; i < a1.Count; i++)
+		{
+			log("Stop1: " + stopWords1[i]);
+		}
+		CharArraySet stopSet0 = StopFilter.makeStopSet(TEST_VERSION_CURRENT, stopWords0);
+		CharArraySet stopSet1 = StopFilter.makeStopSet(TEST_VERSION_CURRENT, stopWords1);
+		reader = new StringReader(sb.ToString());
+		StopFilter stpf0 = new StopFilter(TEST_VERSION_CURRENT, new MockTokenizer(reader, MockTokenizer.WHITESPACE, false), stopSet0); // first part of the set
+		stpf0.EnablePositionIncrements = true;
+		StopFilter stpf01 = new StopFilter(TEST_VERSION_CURRENT, stpf0, stopSet1); // two stop filters concatenated!
+		doTestStopPositons(stpf01,true);
+	  }
+
+	  // LUCENE-3849: make sure after .end() we see the "ending" posInc
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEndStopword() throws Exception
+	  public virtual void testEndStopword()
+	  {
+		CharArraySet stopSet = StopFilter.makeStopSet(TEST_VERSION_CURRENT, "of");
+		StopFilter stpf = new StopFilter(TEST_VERSION_CURRENT, new MockTokenizer(new StringReader("test of"), MockTokenizer.WHITESPACE, false), stopSet);
+		assertTokenStreamContents(stpf, new string[] {"test"}, new int[] {0}, new int[] {4}, null, new int[] {1}, null, 7, 1, null, true);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: private void doTestStopPositons(StopFilter stpf, boolean enableIcrements) throws java.io.IOException
+	  private void doTestStopPositons(StopFilter stpf, bool enableIcrements)
+	  {
+		log("---> test with enable-increments-" + (enableIcrements?"enabled":"disabled"));
+		stpf.EnablePositionIncrements = enableIcrements;
+		CharTermAttribute termAtt = stpf.getAttribute(typeof(CharTermAttribute));
+		PositionIncrementAttribute posIncrAtt = stpf.getAttribute(typeof(PositionIncrementAttribute));
+		stpf.reset();
+		for (int i = 0; i < 20; i += 3)
+		{
+		  assertTrue(stpf.incrementToken());
+		  log("Token " + i + ": " + stpf);
+		  string w = English.intToEnglish(i).trim();
+		  assertEquals("expecting token " + i + " to be " + w,w,termAtt.ToString());
+		  assertEquals("all but first token must have position increment of 3",enableIcrements?(i == 0?1:3):1,posIncrAtt.PositionIncrement);
+		}
+		assertFalse(stpf.incrementToken());
+		stpf.end();
+		stpf.close();
+	  }
+
+	  // print debug info depending on VERBOSE
+	  private static void log(string s)
+	  {
+		if (VERBOSE)
+		{
+		  Console.WriteLine(s);
+		}
+	  }
+
+	  // stupid filter that inserts synonym of 'hte' for 'the'
+	  private class MockSynonymFilter : TokenFilter
+	  {
+		  private readonly TestStopFilter outerInstance;
+
+		internal State bufferedState;
+		internal CharTermAttribute termAtt = addAttribute(typeof(CharTermAttribute));
+		internal PositionIncrementAttribute posIncAtt = addAttribute(typeof(PositionIncrementAttribute));
+
+		internal MockSynonymFilter(TestStopFilter outerInstance, TokenStream input) : base(input)
+		{
+			this.outerInstance = outerInstance;
+		}
+
+//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 (bufferedState != null)
+		  {
+			restoreState(bufferedState);
+			posIncAtt.PositionIncrement = 0;
+			termAtt.setEmpty().append("hte");
+			bufferedState = null;
+			return true;
+		  }
+		  else if (input.incrementToken())
+		  {
+			if (termAtt.ToString().Equals("the"))
+			{
+			  bufferedState = captureState();
+			}
+			return true;
+		  }
+		  else
+		  {
+			return 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()
+		{
+		  base.reset();
+		  bufferedState = null;
+		}
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFirstPosInc() throws Exception
+	  public virtual void testFirstPosInc()
+	  {
+		Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper(this);
+
+		assertAnalyzesTo(analyzer, "the quick brown fox", new string[] {"hte", "quick", "brown", "fox"}, new int[] {1, 1, 1, 1});
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestStopFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestStopFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			TokenFilter filter = new MockSynonymFilter(outerInstance, tokenizer);
+			StopFilter stopfilter = new StopFilter(Version.LUCENE_43, filter, StopAnalyzer.ENGLISH_STOP_WORDS_SET);
+			stopfilter.EnablePositionIncrements = false;
+			return new TokenStreamComponents(tokenizer, stopfilter);
+		  }
+	  }
+	}
+
+}
\ No newline at end of file


[05/27] lucenenet git commit: adding converted analysis common tests

Posted by sy...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Sinks/TokenTypeSinkTokenizerTest.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Sinks/TokenTypeSinkTokenizerTest.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Sinks/TokenTypeSinkTokenizerTest.cs
new file mode 100644
index 0000000..ecb782a
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Sinks/TokenTypeSinkTokenizerTest.cs
@@ -0,0 +1,95 @@
+namespace org.apache.lucene.analysis.sinks
+{
+
+	/// <summary>
+	/// Copyright 2004 The Apache Software Foundation
+	/// 
+	/// Licensed 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>
+
+
+	using CharTermAttribute = org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
+	using TypeAttribute = org.apache.lucene.analysis.tokenattributes.TypeAttribute;
+
+	public class TokenTypeSinkTokenizerTest : BaseTokenStreamTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void test() throws java.io.IOException
+	  public virtual void test()
+	  {
+		TokenTypeSinkFilter sinkFilter = new TokenTypeSinkFilter("D");
+		string test = "The quick red fox jumped over the lazy brown dogs";
+
+		TeeSinkTokenFilter ttf = new TeeSinkTokenFilter(new WordTokenFilter(this, new MockTokenizer(new StringReader(test), MockTokenizer.WHITESPACE, false)));
+		TeeSinkTokenFilter.SinkTokenStream sink = ttf.newSinkTokenStream(sinkFilter);
+
+		bool seenDogs = false;
+
+		CharTermAttribute termAtt = ttf.addAttribute(typeof(CharTermAttribute));
+		TypeAttribute typeAtt = ttf.addAttribute(typeof(TypeAttribute));
+		ttf.reset();
+		while (ttf.incrementToken())
+		{
+		  if (termAtt.ToString().Equals("dogs"))
+		  {
+			seenDogs = true;
+			assertTrue(typeAtt.type() + " is not equal to " + "D", typeAtt.type().Equals("D") == true);
+		  }
+		  else
+		  {
+			assertTrue(typeAtt.type() + " is not null and it should be", typeAtt.type().Equals("word"));
+		  }
+		}
+		assertTrue(seenDogs + " does not equal: " + true, seenDogs == true);
+
+		int sinkCount = 0;
+		sink.reset();
+		while (sink.incrementToken())
+		{
+		  sinkCount++;
+		}
+
+		assertTrue("sink Size: " + sinkCount + " is not: " + 1, sinkCount == 1);
+	  }
+
+	  private class WordTokenFilter : TokenFilter
+	  {
+		  private readonly TokenTypeSinkTokenizerTest outerInstance;
+
+		internal readonly CharTermAttribute termAtt = addAttribute(typeof(CharTermAttribute));
+		internal readonly TypeAttribute typeAtt = addAttribute(typeof(TypeAttribute));
+
+		internal WordTokenFilter(TokenTypeSinkTokenizerTest outerInstance, TokenStream input) : base(input)
+		{
+			this.outerInstance = outerInstance;
+		}
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Override public final boolean incrementToken() throws java.io.IOException
+		public override bool incrementToken()
+		{
+		  if (!input.incrementToken())
+		  {
+			  return false;
+		  }
+
+		  if (termAtt.ToString().Equals("dogs"))
+		  {
+			typeAtt.Type = "D";
+		  }
+		  return true;
+		}
+	  }
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Snowball/TestSnowball.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Snowball/TestSnowball.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Snowball/TestSnowball.cs
new file mode 100644
index 0000000..43de13c
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Snowball/TestSnowball.cs
@@ -0,0 +1,232 @@
+using System;
+
+namespace org.apache.lucene.analysis.snowball
+{
+
+	/*
+	 * 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 TokenStreamComponents = org.apache.lucene.analysis.Analyzer.TokenStreamComponents;
+	using KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+	using StandardAnalyzer = org.apache.lucene.analysis.standard.StandardAnalyzer;
+	using CharTermAttribute = org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
+	using FlagsAttribute = org.apache.lucene.analysis.tokenattributes.FlagsAttribute;
+	using OffsetAttribute = org.apache.lucene.analysis.tokenattributes.OffsetAttribute;
+	using PayloadAttribute = org.apache.lucene.analysis.tokenattributes.PayloadAttribute;
+	using PositionIncrementAttribute = org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
+	using TypeAttribute = org.apache.lucene.analysis.tokenattributes.TypeAttribute;
+	using BytesRef = org.apache.lucene.util.BytesRef;
+	using Version = org.apache.lucene.util.Version;
+
+	public class TestSnowball : BaseTokenStreamTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEnglish() throws Exception
+	  public virtual void testEnglish()
+	  {
+		Analyzer a = new SnowballAnalyzer(TEST_VERSION_CURRENT, "English");
+		assertAnalyzesTo(a, "he abhorred accents", new string[]{"he", "abhor", "accent"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStopwords() throws Exception
+	  public virtual void testStopwords()
+	  {
+		Analyzer a = new SnowballAnalyzer(TEST_VERSION_CURRENT, "English", StandardAnalyzer.STOP_WORDS_SET);
+		assertAnalyzesTo(a, "the quick brown fox jumped", new string[]{"quick", "brown", "fox", "jump"});
+	  }
+
+	  /// <summary>
+	  /// Test english lowercasing. Test both cases (pre-3.1 and post-3.1) to ensure
+	  /// we lowercase I correct for non-Turkish languages in either case.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEnglishLowerCase() throws Exception
+	  public virtual void testEnglishLowerCase()
+	  {
+		Analyzer a = new SnowballAnalyzer(TEST_VERSION_CURRENT, "English");
+		assertAnalyzesTo(a, "cryogenic", new string[] {"cryogen"});
+		assertAnalyzesTo(a, "CRYOGENIC", new string[] {"cryogen"});
+
+		Analyzer b = new SnowballAnalyzer(Version.LUCENE_30, "English");
+		assertAnalyzesTo(b, "cryogenic", new string[] {"cryogen"});
+		assertAnalyzesTo(b, "CRYOGENIC", new string[] {"cryogen"});
+	  }
+
+	  /// <summary>
+	  /// Test turkish lowercasing
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTurkish() throws Exception
+	  public virtual void testTurkish()
+	  {
+		Analyzer a = new SnowballAnalyzer(TEST_VERSION_CURRENT, "Turkish");
+
+		assertAnalyzesTo(a, "ağacı", new string[] {"ağaç"});
+		assertAnalyzesTo(a, "AĞACI", new string[] {"ağaç"});
+	  }
+
+	  /// <summary>
+	  /// Test turkish lowercasing (old buggy behavior) </summary>
+	  /// @deprecated (3.1) Remove this when support for 3.0 indexes is no longer required (5.0) 
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Deprecated("(3.1) Remove this when support for 3.0 indexes is no longer required (5.0)") public void testTurkishBWComp() throws Exception
+	  [Obsolete("(3.1) Remove this when support for 3.0 indexes is no longer required (5.0)")]
+	  public virtual void testTurkishBWComp()
+	  {
+		Analyzer a = new SnowballAnalyzer(Version.LUCENE_30, "Turkish");
+		// AĞACI in turkish lowercases to ağacı, but with lowercase filter ağaci.
+		// this fails due to wrong casing, because the stemmer
+		// will only remove -ı, not -i
+		assertAnalyzesTo(a, "ağacı", new string[] {"ağaç"});
+		assertAnalyzesTo(a, "AĞACI", new string[] {"ağaci"});
+	  }
+
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testReusableTokenStream() throws Exception
+	  public virtual void testReusableTokenStream()
+	  {
+		Analyzer a = new SnowballAnalyzer(TEST_VERSION_CURRENT, "English");
+		assertAnalyzesTo(a, "he abhorred accents", new string[]{"he", "abhor", "accent"});
+		assertAnalyzesTo(a, "she abhorred him", new string[]{"she", "abhor", "him"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFilterTokens() throws Exception
+	  public virtual void testFilterTokens()
+	  {
+		SnowballFilter filter = new SnowballFilter(new TestTokenStream(this), "English");
+		CharTermAttribute termAtt = filter.getAttribute(typeof(CharTermAttribute));
+		OffsetAttribute offsetAtt = filter.getAttribute(typeof(OffsetAttribute));
+		TypeAttribute typeAtt = filter.getAttribute(typeof(TypeAttribute));
+		PayloadAttribute payloadAtt = filter.getAttribute(typeof(PayloadAttribute));
+		PositionIncrementAttribute posIncAtt = filter.getAttribute(typeof(PositionIncrementAttribute));
+		FlagsAttribute flagsAtt = filter.getAttribute(typeof(FlagsAttribute));
+
+		filter.incrementToken();
+
+		assertEquals("accent", termAtt.ToString());
+		assertEquals(2, offsetAtt.startOffset());
+		assertEquals(7, offsetAtt.endOffset());
+		assertEquals("wrd", typeAtt.type());
+		assertEquals(3, posIncAtt.PositionIncrement);
+		assertEquals(77, flagsAtt.Flags);
+		assertEquals(new BytesRef(new sbyte[]{0,1,2,3}), payloadAtt.Payload);
+	  }
+
+	  private sealed class TestTokenStream : TokenStream
+	  {
+		  private readonly TestSnowball outerInstance;
+
+		internal readonly CharTermAttribute termAtt = addAttribute(typeof(CharTermAttribute));
+		internal readonly OffsetAttribute offsetAtt = addAttribute(typeof(OffsetAttribute));
+		internal readonly TypeAttribute typeAtt = addAttribute(typeof(TypeAttribute));
+		internal readonly PayloadAttribute payloadAtt = addAttribute(typeof(PayloadAttribute));
+		internal readonly PositionIncrementAttribute posIncAtt = addAttribute(typeof(PositionIncrementAttribute));
+		internal readonly FlagsAttribute flagsAtt = addAttribute(typeof(FlagsAttribute));
+
+		internal TestTokenStream(TestSnowball outerInstance) : base()
+		{
+			this.outerInstance = outerInstance;
+		}
+
+		public override bool incrementToken()
+		{
+		  clearAttributes();
+		  termAtt.setEmpty().append("accents");
+		  offsetAtt.setOffset(2, 7);
+		  typeAtt.Type = "wrd";
+		  posIncAtt.PositionIncrement = 3;
+		  payloadAtt.Payload = new BytesRef(new sbyte[]{0,1,2,3});
+		  flagsAtt.Flags = 77;
+		  return true;
+		}
+	  }
+
+	  /// <summary>
+	  /// for testing purposes ONLY </summary>
+	  public static string[] SNOWBALL_LANGS = new string[] {"Armenian", "Basque", "Catalan", "Danish", "Dutch", "English", "Finnish", "French", "German2", "German", "Hungarian", "Irish", "Italian", "Kp", "Lovins", "Norwegian", "Porter", "Portuguese", "Romanian", "Russian", "Spanish", "Swedish", "Turkish"};
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		foreach (String lang in SNOWBALL_LANGS)
+		{
+		  Analyzer a = new AnalyzerAnonymousInnerClassHelper(this);
+		  checkOneTerm(a, "", "");
+		}
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestSnowball outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestSnowball outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override Analyzer.TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new Analyzer.TokenStreamComponents(tokenizer, new SnowballFilter(tokenizer, lang));
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws java.io.IOException
+	  public virtual void testRandomStrings()
+	  {
+		foreach (string lang in SNOWBALL_LANGS)
+		{
+		  checkRandomStrings(lang);
+		}
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void checkRandomStrings(final String snowballLanguage) throws java.io.IOException
+//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
+	  public virtual void checkRandomStrings(string snowballLanguage)
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper2(this, snowballLanguage);
+		checkRandomData(random(), a, 1000 * RANDOM_MULTIPLIER);
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestSnowball outerInstance;
+
+		  private string snowballLanguage;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestSnowball outerInstance, string snowballLanguage)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.snowballLanguage = snowballLanguage;
+		  }
+
+		  protected internal override Analyzer.TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer t = new MockTokenizer(reader);
+			return new Analyzer.TokenStreamComponents(t, new SnowballFilter(t, snowballLanguage));
+		  }
+	  }
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Snowball/TestSnowballPorterFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Snowball/TestSnowballPorterFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Snowball/TestSnowballPorterFilterFactory.cs
new file mode 100644
index 0000000..2197f19
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Snowball/TestSnowballPorterFilterFactory.cs
@@ -0,0 +1,82 @@
+namespace org.apache.lucene.analysis.snowball
+{
+
+	/// <summary>
+	/// Copyright 2004 The Apache Software Foundation
+	/// 
+	/// Licensed 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>
+
+	using BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+	using StringMockResourceLoader = org.apache.lucene.analysis.util.StringMockResourceLoader;
+	using EnglishStemmer = org.tartarus.snowball.ext.EnglishStemmer;
+
+
+	public class TestSnowballPorterFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void test() throws Exception
+	  public virtual void test()
+	  {
+		string text = "The fledgling banks were counting on a big boom in banking";
+		EnglishStemmer stemmer = new EnglishStemmer();
+		string[] test = text.Split("\\s", true);
+		string[] gold = new string[test.Length];
+		for (int i = 0; i < test.Length; i++)
+		{
+		  stemmer.Current = test[i];
+		  stemmer.stem();
+		  gold[i] = stemmer.Current;
+		}
+
+		Reader reader = new StringReader(text);
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("SnowballPorter", "language", "English").create(stream);
+		assertTokenStreamContents(stream, gold);
+	  }
+
+	  /// <summary>
+	  /// Test the protected words mechanism of SnowballPorterFilterFactory
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testProtected() throws Exception
+	  public virtual void testProtected()
+	  {
+		Reader reader = new StringReader("ridding of some stemming");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("SnowballPorter", TEST_VERSION_CURRENT, new StringMockResourceLoader("ridding"), "protected", "protwords.txt", "language", "English").create(stream);
+
+		assertTokenStreamContents(stream, new string[] {"ridding", "of", "some", "stem"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("SnowballPorter", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Snowball/TestSnowballVocab.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Snowball/TestSnowballVocab.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Snowball/TestSnowballVocab.cs
new file mode 100644
index 0000000..b598421
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Snowball/TestSnowballVocab.cs
@@ -0,0 +1,106 @@
+using System;
+
+namespace org.apache.lucene.analysis.snowball
+{
+
+	/*
+	 * 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 KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+	using LuceneTestCase = org.apache.lucene.util.LuceneTestCase;
+
+//JAVA TO C# CONVERTER TODO TASK: This Java 'import static' statement cannot be converted to C#:
+//	import static org.apache.lucene.analysis.VocabularyAssert.*;
+
+	/// <summary>
+	/// Test the snowball filters against the snowball data tests
+	/// </summary>
+	public class TestSnowballVocab : LuceneTestCase
+	{
+	  /// <summary>
+	  /// Run all languages against their snowball vocabulary tests.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStemmers() throws java.io.IOException
+	  public virtual void testStemmers()
+	  {
+		assertCorrectOutput("Danish", "danish");
+		assertCorrectOutput("Dutch", "dutch");
+		assertCorrectOutput("English", "english");
+		// disabled due to snowball java code generation bug: 
+		// see http://article.gmane.org/gmane.comp.search.snowball/1139
+		// assertCorrectOutput("Finnish", "finnish");
+		assertCorrectOutput("French", "french");
+		assertCorrectOutput("German", "german");
+		assertCorrectOutput("German2", "german2");
+		assertCorrectOutput("Hungarian", "hungarian");
+		assertCorrectOutput("Italian", "italian");
+		assertCorrectOutput("Kp", "kraaij_pohlmann");
+		// disabled due to snowball java code generation bug: 
+		// see http://article.gmane.org/gmane.comp.search.snowball/1139
+		// assertCorrectOutput("Lovins", "lovins");
+		assertCorrectOutput("Norwegian", "norwegian");
+		assertCorrectOutput("Porter", "porter");
+		assertCorrectOutput("Portuguese", "portuguese");
+		assertCorrectOutput("Romanian", "romanian");
+		assertCorrectOutput("Russian", "russian");
+		assertCorrectOutput("Spanish", "spanish");
+		assertCorrectOutput("Swedish", "swedish");
+		assertCorrectOutput("Turkish", "turkish");
+	  }
+
+	  /// <summary>
+	  /// For the supplied language, run the stemmer against all strings in voc.txt
+	  /// The output should be the same as the string in output.txt
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: private void assertCorrectOutput(final String snowballLanguage, String dataDirectory) throws java.io.IOException
+//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
+	  private void assertCorrectOutput(string snowballLanguage, string dataDirectory)
+	  {
+		if (VERBOSE)
+		{
+			Console.WriteLine("checking snowball language: " + snowballLanguage);
+		}
+
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper(this, snowballLanguage);
+
+		assertVocabulary(a, getDataFile("TestSnowballVocabData.zip"), dataDirectory + "/voc.txt", dataDirectory + "/output.txt");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestSnowballVocab outerInstance;
+
+		  private string snowballLanguage;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestSnowballVocab outerInstance, string snowballLanguage)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.snowballLanguage = snowballLanguage;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer t = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(t, new SnowballFilter(t, snowballLanguage));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Standard/TestStandardFactories.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Standard/TestStandardFactories.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Standard/TestStandardFactories.cs
new file mode 100644
index 0000000..c6f2e09
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Standard/TestStandardFactories.cs
@@ -0,0 +1,249 @@
+using System.Text;
+
+namespace org.apache.lucene.analysis.standard
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the standard lucene factories are working.
+	/// </summary>
+	public class TestStandardFactories : BaseTokenStreamFactoryTestCase
+	{
+	  /// <summary>
+	  /// Test StandardTokenizerFactory
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStandardTokenizer() throws Exception
+	  public virtual void testStandardTokenizer()
+	  {
+		Reader reader = new StringReader("Wha\u0301t's this thing do?");
+		TokenStream stream = tokenizerFactory("Standard").create(reader);
+		assertTokenStreamContents(stream, new string[] {"Wha\u0301t's", "this", "thing", "do"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStandardTokenizerMaxTokenLength() throws Exception
+	  public virtual void testStandardTokenizerMaxTokenLength()
+	  {
+		StringBuilder builder = new StringBuilder();
+		for (int i = 0 ; i < 100 ; ++i)
+		{
+		  builder.Append("abcdefg"); // 7 * 100 = 700 char "word"
+		}
+		string longWord = builder.ToString();
+		string content = "one two three " + longWord + " four five six";
+		Reader reader = new StringReader(content);
+		Tokenizer stream = tokenizerFactory("Standard", "maxTokenLength", "1000").create(reader);
+		assertTokenStreamContents(stream, new string[] {"one", "two", "three", longWord, "four", "five", "six"});
+	  }
+
+	  /// <summary>
+	  /// Test ClassicTokenizerFactory
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testClassicTokenizer() throws Exception
+	  public virtual void testClassicTokenizer()
+	  {
+		Reader reader = new StringReader("What's this thing do?");
+		TokenStream stream = tokenizerFactory("Classic").create(reader);
+		assertTokenStreamContents(stream, new string[] {"What's", "this", "thing", "do"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testClassicTokenizerMaxTokenLength() throws Exception
+	  public virtual void testClassicTokenizerMaxTokenLength()
+	  {
+		StringBuilder builder = new StringBuilder();
+		for (int i = 0 ; i < 100 ; ++i)
+		{
+		  builder.Append("abcdefg"); // 7 * 100 = 700 char "word"
+		}
+		string longWord = builder.ToString();
+		string content = "one two three " + longWord + " four five six";
+		Reader reader = new StringReader(content);
+		Tokenizer stream = tokenizerFactory("Classic", "maxTokenLength", "1000").create(reader);
+		assertTokenStreamContents(stream, new string[] {"one", "two", "three", longWord, "four", "five", "six"});
+	  }
+
+	  /// <summary>
+	  /// Test ClassicFilterFactory
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStandardFilter() throws Exception
+	  public virtual void testStandardFilter()
+	  {
+		Reader reader = new StringReader("What's this thing do?");
+		TokenStream stream = tokenizerFactory("Classic").create(reader);
+		stream = tokenFilterFactory("Classic").create(stream);
+		assertTokenStreamContents(stream, new string[] {"What", "this", "thing", "do"});
+	  }
+
+	  /// <summary>
+	  /// Test KeywordTokenizerFactory
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testKeywordTokenizer() throws Exception
+	  public virtual void testKeywordTokenizer()
+	  {
+		Reader reader = new StringReader("What's this thing do?");
+		TokenStream stream = tokenizerFactory("Keyword").create(reader);
+		assertTokenStreamContents(stream, new string[] {"What's this thing do?"});
+	  }
+
+	  /// <summary>
+	  /// Test WhitespaceTokenizerFactory
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testWhitespaceTokenizer() throws Exception
+	  public virtual void testWhitespaceTokenizer()
+	  {
+		Reader reader = new StringReader("What's this thing do?");
+		TokenStream stream = tokenizerFactory("Whitespace").create(reader);
+		assertTokenStreamContents(stream, new string[] {"What's", "this", "thing", "do?"});
+	  }
+
+	  /// <summary>
+	  /// Test LetterTokenizerFactory
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testLetterTokenizer() throws Exception
+	  public virtual void testLetterTokenizer()
+	  {
+		Reader reader = new StringReader("What's this thing do?");
+		TokenStream stream = tokenizerFactory("Letter").create(reader);
+		assertTokenStreamContents(stream, new string[] {"What", "s", "this", "thing", "do"});
+	  }
+
+	  /// <summary>
+	  /// Test LowerCaseTokenizerFactory
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testLowerCaseTokenizer() throws Exception
+	  public virtual void testLowerCaseTokenizer()
+	  {
+		Reader reader = new StringReader("What's this thing do?");
+		TokenStream stream = tokenizerFactory("LowerCase").create(reader);
+		assertTokenStreamContents(stream, new string[] {"what", "s", "this", "thing", "do"});
+	  }
+
+	  /// <summary>
+	  /// Ensure the ASCIIFoldingFilterFactory works
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testASCIIFolding() throws Exception
+	  public virtual void testASCIIFolding()
+	  {
+		Reader reader = new StringReader("Česká");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("ASCIIFolding").create(stream);
+		assertTokenStreamContents(stream, new string[] {"Ceska"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenizerFactory("Standard", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+
+		try
+		{
+		  tokenizerFactory("Classic", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+
+		try
+		{
+		  tokenizerFactory("Whitespace", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+
+		try
+		{
+		  tokenizerFactory("Letter", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+
+		try
+		{
+		  tokenizerFactory("LowerCase", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+
+		try
+		{
+		  tokenFilterFactory("ASCIIFolding", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+
+		try
+		{
+		  tokenFilterFactory("Standard", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+
+		try
+		{
+		  tokenFilterFactory("Classic", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Standard/TestUAX29URLEmailTokenizerFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Standard/TestUAX29URLEmailTokenizerFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Standard/TestUAX29URLEmailTokenizerFactory.cs
new file mode 100644
index 0000000..50542ff
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Standard/TestUAX29URLEmailTokenizerFactory.cs
@@ -0,0 +1,169 @@
+using System;
+using System.Text;
+
+namespace org.apache.lucene.analysis.standard
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+	using ClasspathResourceLoader = org.apache.lucene.analysis.util.ClasspathResourceLoader;
+	using Version = org.apache.lucene.util.Version;
+
+	/// <summary>
+	/// A few tests based on org.apache.lucene.analysis.TestUAX29URLEmailTokenizer
+	/// </summary>
+
+	public class TestUAX29URLEmailTokenizerFactory : BaseTokenStreamFactoryTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testUAX29URLEmailTokenizer() throws Exception
+	  public virtual void testUAX29URLEmailTokenizer()
+	  {
+		Reader reader = new StringReader("Wha\u0301t's this thing do?");
+		TokenStream stream = tokenizerFactory("UAX29URLEmail").create(reader);
+		assertTokenStreamContents(stream, new string[] {"Wha\u0301t's", "this", "thing", "do"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testArabic() throws Exception
+	  public virtual void testArabic()
+	  {
+		Reader reader = new StringReader("الفيلم الوثائقي الأول عن ويكيبيديا يسمى \"الحقيقة بالأرقام: قصة ويكيبيديا\" (بالإنجليزية: Truth in Numbers: The Wikipedia Story)، سيتم إطلاقه في 2008.");
+		TokenStream stream = tokenizerFactory("UAX29URLEmail").create(reader);
+		assertTokenStreamContents(stream, new string[] {"الفيلم", "الوثائقي", "الأول", "عن", "ويكيبيديا", "يسمى", "الحقيقة", "بالأرقام", "قصة", "ويكيبيديا", "بالإنجليزية", "Truth", "in", "Numbers", "The", "Wikipedia", "Story", "سيتم", "إطلاقه", "في", "2008"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testChinese() throws Exception
+	  public virtual void testChinese()
+	  {
+		Reader reader = new StringReader("我是中国人。 1234 Tests ");
+		TokenStream stream = tokenizerFactory("UAX29URLEmail").create(reader);
+		assertTokenStreamContents(stream, new string[] {"我", "是", "中", "国", "人", "1234", "Tests"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testKorean() throws Exception
+	  public virtual void testKorean()
+	  {
+		Reader reader = new StringReader("안녕하세요 한글입니다");
+		TokenStream stream = tokenizerFactory("UAX29URLEmail").create(reader);
+		assertTokenStreamContents(stream, new string[] {"안녕하세요", "한글입니다"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testHyphen() throws Exception
+	  public virtual void testHyphen()
+	  {
+		Reader reader = new StringReader("some-dashed-phrase");
+		TokenStream stream = tokenizerFactory("UAX29URLEmail").create(reader);
+		assertTokenStreamContents(stream, new string[] {"some", "dashed", "phrase"});
+	  }
+
+	  // Test with some URLs from TestUAX29URLEmailTokenizer's 
+	  // urls.from.random.text.with.urls.txt
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testURLs() throws Exception
+	  public virtual void testURLs()
+	  {
+		string textWithURLs = "http://johno.jsmf.net/knowhow/ngrams/index.php?table=en-dickens-word-2gram&paragraphs=50&length=200&no-ads=on\n" + " some extra\nWords thrown in here. " + "http://c5-3486.bisynxu.FR/aI.YnNms/" + " samba Halta gamba " + "ftp://119.220.152.185/JgJgdZ/31aW5c/viWlfQSTs5/1c8U5T/ih5rXx/YfUJ/xBW1uHrQo6.R\n" + "M19nq.0URV4A.Me.CC/mj0kgt6hue/dRXv8YVLOw9v/CIOqb\n" + "Https://yu7v33rbt.vC6U3.XN--KPRW13D/y%4fMSzkGFlm/wbDF4m" + " inter Locutio " + "[c2d4::]/%471j5l/j3KFN%AAAn/Fip-NisKH/\n" + "file:///aXvSZS34is/eIgM8s~U5dU4Ifd%c7" + " blah Sirrah woof " + "http://[a42:a7b6::]/qSmxSUU4z/%52qVl4\n";
+		Reader reader = new StringReader(textWithURLs);
+		TokenStream stream = tokenizerFactory("UAX29URLEmail").create(reader);
+		assertTokenStreamContents(stream, new string[] {"http://johno.jsmf.net/knowhow/ngrams/index.php?table=en-dickens-word-2gram&paragraphs=50&length=200&no-ads=on", "some", "extra", "Words", "thrown", "in", "here", "http://c5-3486.bisynxu.FR/aI.YnNms/", "samba", "Halta", "gamba", "ftp://119.220.152.185/JgJgdZ/31aW5c/viWlfQSTs5/1c8U5T/ih5rXx/YfUJ/xBW1uHrQo6.R", "M19nq.0URV4A.Me.CC/mj0kgt6hue/dRXv8YVLOw9v/CIOqb", "Https://yu7v33rbt.vC6U3.XN--KPRW13D/y%4fMSzkGFlm/wbDF4m", "inter", "Locutio", "[c2d4::]/%471j5l/j3KFN%AAAn/Fip-NisKH/", "file:///aXvSZS34is/eIgM8s~U5dU4Ifd%c7", "blah", "Sirrah", "woof", "http://[a42:a7b6::]/qSmxSUU4z/%52qVl4"});
+	  }
+
+	  // Test with some emails from TestUAX29URLEmailTokenizer's 
+	  // email.addresses.from.random.text.with.email.addresses.txt
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmails() throws Exception
+	  public virtual void testEmails()
+	  {
+		string textWithEmails = " some extra\nWords thrown in here. " + "dJ8ngFi@avz13m.CC\n" + "kU-l6DS@[082.015.228.189]\n" + "\"%U\u0012@?\\B\"@Fl2d.md" + " samba Halta gamba " + "Bvd#@tupjv.sn\n" + "SBMm0Nm.oyk70.rMNdd8k.#ru3LI.gMMLBI.0dZRD4d.RVK2nY@au58t.B13albgy4u.mt\n" + "~+Kdz@3mousnl.SE\n" + " inter Locutio " + "C'ts`@Vh4zk.uoafcft-dr753x4odt04q.UY\n" + "}0tzWYDBuy@cSRQAABB9B.7c8xawf75-cyo.PM" + " blah Sirrah woof " + "lMahAA.j/5.RqUjS745.DtkcYdi@d2-4gb-l6.ae\n" + "lv'p@tqk.vj5s0tgl.0dlu7su3iyiaz.dqso.494.3hb76.XN--MGBAAM7A8H\n";
+		Reader reader = new StringReader(textWithEmails);
+		TokenStream stream = tokenizerFactory("UAX29URLEmail").create(reader);
+		assertTokenStreamContents(stream, new string[] {"some", "extra", "Words", "thrown", "in", "here", "dJ8ngFi@avz13m.CC", "kU-l6DS@[082.015.228.189]", "\"%U\u0012@?\\B\"@Fl2d.md", "samba", "Halta", "gamba", "Bvd#@tupjv.sn", "SBMm0Nm.oyk70.rMNdd8k.#ru3LI.gMMLBI.0dZRD4d.RVK2nY@au58t.B13albgy4u.mt", "~+Kdz@3mousnl.SE", "inter", "Locutio", "C'ts`@Vh4zk.uoafcft-dr753x4odt04q.UY", "}0tzWYDBuy@cSRQAABB9B.7c8xawf75-cyo.PM", "blah", "Sirrah", "woof", "lMahAA.j/5.RqUjS745.DtkcYdi@d2-4gb-l6.ae", "lv'p@tqk.vj5s0tgl.0dlu7su3iyiaz.dqso.494.3hb76.XN--MGBAAM7A8H"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMaxTokenLength() throws Exception
+	  public virtual void testMaxTokenLength()
+	  {
+		StringBuilder builder = new StringBuilder();
+		for (int i = 0 ; i < 100 ; ++i)
+		{
+		  builder.Append("abcdefg"); // 7 * 100 = 700 char "word"
+		}
+		string longWord = builder.ToString();
+		string content = "one two three " + longWord + " four five six";
+		Reader reader = new StringReader(content);
+		TokenStream stream = tokenizerFactory("UAX29URLEmail", "maxTokenLength", "1000").create(reader);
+		assertTokenStreamContents(stream, new string[] {"one", "two", "three", longWord, "four", "five", "six"});
+	  }
+
+	  /// @deprecated nuke this test in lucene 5.0 
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Deprecated("nuke this test in lucene 5.0") public void testMatchVersion() throws Exception
+	  [Obsolete("nuke this test in lucene 5.0")]
+	  public virtual void testMatchVersion()
+	  {
+		Reader reader = new StringReader("ざ");
+		TokenStream stream = tokenizerFactory("UAX29URLEmail").create(reader);
+		assertTokenStreamContents(stream, new string[] {"ざ"});
+
+		reader = new StringReader("ざ");
+		stream = tokenizerFactory("UAX29URLEmail", Version.LUCENE_31, new ClasspathResourceLoader(this.GetType())).create(reader);
+		assertTokenStreamContents(stream, new string[] {"さ"}); // old broken behavior
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenizerFactory("UAX29URLEmail", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testIllegalArguments() throws Exception
+	 public virtual void testIllegalArguments()
+	 {
+		try
+		{
+		  tokenizerFactory("UAX29URLEmail", "maxTokenLength", "-1").create(new StringReader("hello"));
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("maxTokenLength must be greater than zero"));
+		}
+	 }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Sv/TestSwedishAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Sv/TestSwedishAnalyzer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Sv/TestSwedishAnalyzer.cs
new file mode 100644
index 0000000..1848f66
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Sv/TestSwedishAnalyzer.cs
@@ -0,0 +1,70 @@
+namespace org.apache.lucene.analysis.sv
+{
+
+	/*
+	 * 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 CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+
+	public class TestSwedishAnalyzer : BaseTokenStreamTestCase
+	{
+	  /// <summary>
+	  /// This test fails with NPE when the 
+	  /// stopwords file is missing in classpath 
+	  /// </summary>
+	  public virtual void testResourcesAvailable()
+	  {
+		new SwedishAnalyzer(TEST_VERSION_CURRENT);
+	  }
+
+	  /// <summary>
+	  /// test stopwords and stemming </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBasics() throws java.io.IOException
+	  public virtual void testBasics()
+	  {
+		Analyzer a = new SwedishAnalyzer(TEST_VERSION_CURRENT);
+		// stemming
+		checkOneTerm(a, "jaktkarlarne", "jaktkarl");
+		checkOneTerm(a, "jaktkarlens", "jaktkarl");
+		// stopword
+		assertAnalyzesTo(a, "och", new string[] {});
+	  }
+
+	  /// <summary>
+	  /// test use of exclusion set </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testExclude() throws java.io.IOException
+	  public virtual void testExclude()
+	  {
+		CharArraySet exclusionSet = new CharArraySet(TEST_VERSION_CURRENT, asSet("jaktkarlarne"), false);
+		Analyzer a = new SwedishAnalyzer(TEST_VERSION_CURRENT, SwedishAnalyzer.DefaultStopSet, exclusionSet);
+		checkOneTerm(a, "jaktkarlarne", "jaktkarlarne");
+		checkOneTerm(a, "jaktkarlens", "jaktkarl");
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), new SwedishAnalyzer(TEST_VERSION_CURRENT), 1000 * RANDOM_MULTIPLIER);
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Sv/TestSwedishLightStemFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Sv/TestSwedishLightStemFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Sv/TestSwedishLightStemFilter.cs
new file mode 100644
index 0000000..f4b29bd
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Sv/TestSwedishLightStemFilter.cs
@@ -0,0 +1,123 @@
+namespace org.apache.lucene.analysis.sv
+{
+
+	/*
+	 * 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 KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+	using SetKeywordMarkerFilter = org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter;
+	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+
+//JAVA TO C# CONVERTER TODO TASK: This Java 'import static' statement cannot be converted to C#:
+//	import static org.apache.lucene.analysis.VocabularyAssert.*;
+
+	/// <summary>
+	/// Simple tests for <seealso cref="SwedishLightStemFilter"/>
+	/// </summary>
+	public class TestSwedishLightStemFilter : BaseTokenStreamTestCase
+	{
+	  private Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper();
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  public AnalyzerAnonymousInnerClassHelper()
+		  {
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer source = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(source, new SwedishLightStemFilter(source));
+		  }
+	  }
+
+	  /// <summary>
+	  /// Test against a vocabulary from the reference impl </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testVocabulary() throws java.io.IOException
+	  public virtual void testVocabulary()
+	  {
+		assertVocabulary(analyzer, getDataFile("svlighttestdata.zip"), "svlight.txt");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testKeyword() throws java.io.IOException
+	  public virtual void testKeyword()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.util.CharArraySet exclusionSet = new org.apache.lucene.analysis.util.CharArraySet(TEST_VERSION_CURRENT, asSet("jaktkarlens"), false);
+		CharArraySet exclusionSet = new CharArraySet(TEST_VERSION_CURRENT, asSet("jaktkarlens"), false);
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper2(this, exclusionSet);
+		checkOneTerm(a, "jaktkarlens", "jaktkarlens");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestSwedishLightStemFilter outerInstance;
+
+		  private CharArraySet exclusionSet;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestSwedishLightStemFilter outerInstance, CharArraySet exclusionSet)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.exclusionSet = exclusionSet;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer source = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			TokenStream sink = new SetKeywordMarkerFilter(source, exclusionSet);
+			return new TokenStreamComponents(source, new SwedishLightStemFilter(sink));
+		  }
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), analyzer, 1000 * RANDOM_MULTIPLIER);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper3(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper3 : Analyzer
+	  {
+		  private readonly TestSwedishLightStemFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper3(TestSwedishLightStemFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new SwedishLightStemFilter(tokenizer));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Sv/TestSwedishLightStemFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Sv/TestSwedishLightStemFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Sv/TestSwedishLightStemFilterFactory.cs
new file mode 100644
index 0000000..6a53c73
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Sv/TestSwedishLightStemFilterFactory.cs
@@ -0,0 +1,57 @@
+namespace org.apache.lucene.analysis.sv
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the Swedish Light stem factory is working.
+	/// </summary>
+	public class TestSwedishLightStemFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStemming() throws Exception
+	  public virtual void testStemming()
+	  {
+		Reader reader = new StringReader("äpplen äpple");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("SwedishLightStem").create(stream);
+		assertTokenStreamContents(stream, new string[] {"äppl", "äppl"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("SwedishLightStem", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestMultiWordSynonyms.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestMultiWordSynonyms.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestMultiWordSynonyms.cs
new file mode 100644
index 0000000..98f531f
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestMultiWordSynonyms.cs
@@ -0,0 +1,62 @@
+using System;
+using System.Collections.Generic;
+
+namespace org.apache.lucene.analysis.synonym
+{
+
+	/*
+	 * Licensed to the Apache Software Foundation (ASF) under one or more
+	 * contributor license agreements.  See the NOTICE file distributed with
+	 * this work for additional information regarding copyright ownership.
+	 * The ASF licenses this file to You under the Apache License, Version 2.0
+	 * (the "License"); you may not use this file except in compliance with
+	 * the License.  You may obtain a copy of the License at
+	 *
+	 *     http://www.apache.org/licenses/LICENSE-2.0
+	 *
+	 * Unless required by applicable law or agreed to in writing, software
+	 * distributed under the License is distributed on an "AS IS" BASIS,
+	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+	 * See the License for the specific language governing permissions and
+	 * limitations under the License.
+	 */
+
+	using BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+	using StringMockResourceLoader = org.apache.lucene.analysis.util.StringMockResourceLoader;
+
+
+	/// <summary>
+	/// @since solr 1.4
+	/// </summary>
+	public class TestMultiWordSynonyms : BaseTokenStreamFactoryTestCase
+	{
+
+	  /// @deprecated Remove this test in 5.0 
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Deprecated("Remove this test in 5.0") public void testMultiWordSynonymsOld() throws java.io.IOException
+	  [Obsolete("Remove this test in 5.0")]
+	  public virtual void testMultiWordSynonymsOld()
+	  {
+		IList<string> rules = new List<string>();
+		rules.Add("a b c,d");
+		SlowSynonymMap synMap = new SlowSynonymMap(true);
+		SlowSynonymFilterFactory.parseRules(rules, synMap, "=>", ",", true, null);
+
+		SlowSynonymFilter ts = new SlowSynonymFilter(new MockTokenizer(new StringReader("a e"), MockTokenizer.WHITESPACE, false), synMap);
+		// This fails because ["e","e"] is the value of the token stream
+		assertTokenStreamContents(ts, new string[] {"a", "e"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMultiWordSynonyms() throws Exception
+	  public virtual void testMultiWordSynonyms()
+	  {
+		Reader reader = new StringReader("a e");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("Synonym", TEST_VERSION_CURRENT, new StringMockResourceLoader("a b c,d"), "synonyms", "synonyms.txt").create(stream);
+		// This fails because ["e","e"] is the value of the token stream
+		assertTokenStreamContents(stream, new string[] {"a", "e"});
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestSlowSynonymFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestSlowSynonymFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestSlowSynonymFilter.cs
new file mode 100644
index 0000000..0a337cd
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestSlowSynonymFilter.cs
@@ -0,0 +1,387 @@
+using System;
+using System.Collections.Generic;
+
+namespace org.apache.lucene.analysis.synonym
+{
+
+	/*
+	 * Licensed to the Apache Software Foundation (ASF) under one or more
+	 * contributor license agreements.  See the NOTICE file distributed with
+	 * this work for additional information regarding copyright ownership.
+	 * The ASF licenses this file to You under the Apache License, Version 2.0
+	 * (the "License"); you may not use this file except in compliance with
+	 * the License.  You may obtain a copy of the License at
+	 *
+	 *     http://www.apache.org/licenses/LICENSE-2.0
+	 *
+	 * Unless required by applicable law or agreed to in writing, software
+	 * distributed under the License is distributed on an "AS IS" BASIS,
+	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+	 * See the License for the specific language governing permissions and
+	 * limitations under the License.
+	 */
+
+
+	using org.apache.lucene.analysis.tokenattributes;
+
+	/// @deprecated Remove this test in Lucene 5.0 
+	[Obsolete("Remove this test in Lucene 5.0")]
+	public class TestSlowSynonymFilter : BaseTokenStreamTestCase
+	{
+
+	  internal static IList<string> strings(string str)
+	  {
+		string[] arr = str.Split(" ", true);
+		return Arrays.asList(arr);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: static void assertTokenizesTo(SlowSynonymMap dict, String input, String expected[]) throws java.io.IOException
+	  internal static void assertTokenizesTo(SlowSynonymMap dict, string input, string[] expected)
+	  {
+		Tokenizer tokenizer = new MockTokenizer(new StringReader(input), MockTokenizer.WHITESPACE, false);
+		SlowSynonymFilter stream = new SlowSynonymFilter(tokenizer, dict);
+		assertTokenStreamContents(stream, expected);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: static void assertTokenizesTo(SlowSynonymMap dict, String input, String expected[], int posIncs[]) throws java.io.IOException
+	  internal static void assertTokenizesTo(SlowSynonymMap dict, string input, string[] expected, int[] posIncs)
+	  {
+		Tokenizer tokenizer = new MockTokenizer(new StringReader(input), MockTokenizer.WHITESPACE, false);
+		SlowSynonymFilter stream = new SlowSynonymFilter(tokenizer, dict);
+		assertTokenStreamContents(stream, expected, posIncs);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: static void assertTokenizesTo(SlowSynonymMap dict, java.util.List<org.apache.lucene.analysis.Token> input, String expected[], int posIncs[]) throws java.io.IOException
+	  internal static void assertTokenizesTo(SlowSynonymMap dict, IList<Token> input, string[] expected, int[] posIncs)
+	  {
+		TokenStream tokenizer = new IterTokenStream(input);
+		SlowSynonymFilter stream = new SlowSynonymFilter(tokenizer, dict);
+		assertTokenStreamContents(stream, expected, posIncs);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: static void assertTokenizesTo(SlowSynonymMap dict, java.util.List<org.apache.lucene.analysis.Token> input, String expected[], int startOffsets[], int endOffsets[], int posIncs[]) throws java.io.IOException
+	  internal static void assertTokenizesTo(SlowSynonymMap dict, IList<Token> input, string[] expected, int[] startOffsets, int[] endOffsets, int[] posIncs)
+	  {
+		TokenStream tokenizer = new IterTokenStream(input);
+		SlowSynonymFilter stream = new SlowSynonymFilter(tokenizer, dict);
+		assertTokenStreamContents(stream, expected, startOffsets, endOffsets, posIncs);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMatching() throws java.io.IOException
+	  public virtual void testMatching()
+	  {
+		SlowSynonymMap map = new SlowSynonymMap();
+
+		bool orig = false;
+		bool merge = true;
+		map.add(strings("a b"), tokens("ab"), orig, merge);
+		map.add(strings("a c"), tokens("ac"), orig, merge);
+		map.add(strings("a"), tokens("aa"), orig, merge);
+		map.add(strings("b"), tokens("bb"), orig, merge);
+		map.add(strings("z x c v"), tokens("zxcv"), orig, merge);
+		map.add(strings("x c"), tokens("xc"), orig, merge);
+
+		assertTokenizesTo(map, "$", new string[] {"$"});
+		assertTokenizesTo(map, "a", new string[] {"aa"});
+		assertTokenizesTo(map, "a $", new string[] {"aa", "$"});
+		assertTokenizesTo(map, "$ a", new string[] {"$", "aa"});
+		assertTokenizesTo(map, "a a", new string[] {"aa", "aa"});
+		assertTokenizesTo(map, "b", new string[] {"bb"});
+		assertTokenizesTo(map, "z x c v", new string[] {"zxcv"});
+		assertTokenizesTo(map, "z x c $", new string[] {"z", "xc", "$"});
+
+		// repeats
+		map.add(strings("a b"), tokens("ab"), orig, merge);
+		map.add(strings("a b"), tokens("ab"), orig, merge);
+
+		// FIXME: the below test intended to be { "ab" }
+		assertTokenizesTo(map, "a b", new string[] {"ab", "ab", "ab"});
+
+		// check for lack of recursion
+		map.add(strings("zoo"), tokens("zoo"), orig, merge);
+		assertTokenizesTo(map, "zoo zoo $ zoo", new string[] {"zoo", "zoo", "$", "zoo"});
+		map.add(strings("zoo"), tokens("zoo zoo"), orig, merge);
+		// FIXME: the below test intended to be { "zoo", "zoo", "zoo", "zoo", "$", "zoo", "zoo" }
+		// maybe this was just a typo in the old test????
+		assertTokenizesTo(map, "zoo zoo $ zoo", new string[] {"zoo", "zoo", "zoo", "zoo", "zoo", "zoo", "$", "zoo", "zoo", "zoo"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testIncludeOrig() throws java.io.IOException
+	  public virtual void testIncludeOrig()
+	  {
+		SlowSynonymMap map = new SlowSynonymMap();
+
+		bool orig = true;
+		bool merge = true;
+		map.add(strings("a b"), tokens("ab"), orig, merge);
+		map.add(strings("a c"), tokens("ac"), orig, merge);
+		map.add(strings("a"), tokens("aa"), orig, merge);
+		map.add(strings("b"), tokens("bb"), orig, merge);
+		map.add(strings("z x c v"), tokens("zxcv"), orig, merge);
+		map.add(strings("x c"), tokens("xc"), orig, merge);
+
+		assertTokenizesTo(map, "$", new string[] {"$"}, new int[] {1});
+		assertTokenizesTo(map, "a", new string[] {"a", "aa"}, new int[] {1, 0});
+		assertTokenizesTo(map, "a", new string[] {"a", "aa"}, new int[] {1, 0});
+		assertTokenizesTo(map, "$ a", new string[] {"$", "a", "aa"}, new int[] {1, 1, 0});
+		assertTokenizesTo(map, "a $", new string[] {"a", "aa", "$"}, new int[] {1, 0, 1});
+		assertTokenizesTo(map, "$ a !", new string[] {"$", "a", "aa", "!"}, new int[] {1, 1, 0, 1});
+		assertTokenizesTo(map, "a a", new string[] {"a", "aa", "a", "aa"}, new int[] {1, 0, 1, 0});
+		assertTokenizesTo(map, "b", new string[] {"b", "bb"}, new int[] {1, 0});
+		assertTokenizesTo(map, "z x c v", new string[] {"z", "zxcv", "x", "c", "v"}, new int[] {1, 0, 1, 1, 1});
+		assertTokenizesTo(map, "z x c $", new string[] {"z", "x", "xc", "c", "$"}, new int[] {1, 1, 0, 1, 1});
+
+		// check for lack of recursion
+		map.add(strings("zoo zoo"), tokens("zoo"), orig, merge);
+		// CHECKME: I think the previous test (with 4 zoo's), was just a typo.
+		assertTokenizesTo(map, "zoo zoo $ zoo", new string[] {"zoo", "zoo", "zoo", "$", "zoo"}, new int[] {1, 0, 1, 1, 1});
+
+		map.add(strings("zoo"), tokens("zoo zoo"), orig, merge);
+		assertTokenizesTo(map, "zoo zoo $ zoo", new string[] {"zoo", "zoo", "zoo", "$", "zoo", "zoo", "zoo"}, new int[] {1, 0, 1, 1, 1, 0, 1});
+	  }
+
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMapMerge() throws java.io.IOException
+	  public virtual void testMapMerge()
+	  {
+		SlowSynonymMap map = new SlowSynonymMap();
+
+		bool orig = false;
+		bool merge = true;
+		map.add(strings("a"), tokens("a5,5"), orig, merge);
+		map.add(strings("a"), tokens("a3,3"), orig, merge);
+
+		assertTokenizesTo(map, "a", new string[] {"a3", "a5"}, new int[] {1, 2});
+
+		map.add(strings("b"), tokens("b3,3"), orig, merge);
+		map.add(strings("b"), tokens("b5,5"), orig, merge);
+
+		assertTokenizesTo(map, "b", new string[] {"b3", "b5"}, new int[] {1, 2});
+
+		map.add(strings("a"), tokens("A3,3"), orig, merge);
+		map.add(strings("a"), tokens("A5,5"), orig, merge);
+
+		assertTokenizesTo(map, "a", new string[] {"a3", "A3", "a5", "A5"}, new int[] {1, 0, 2, 0});
+
+		map.add(strings("a"), tokens("a1"), orig, merge);
+		assertTokenizesTo(map, "a", new string[] {"a1", "a3", "A3", "a5", "A5"}, new int[] {1, 2, 0, 2, 0});
+
+		map.add(strings("a"), tokens("a2,2"), orig, merge);
+		map.add(strings("a"), tokens("a4,4 a6,2"), orig, merge);
+		assertTokenizesTo(map, "a", new string[] {"a1", "a2", "a3", "A3", "a4", "a5", "A5", "a6"}, new int[] {1, 1, 1, 0, 1, 1, 0, 1});
+	  }
+
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testOverlap() throws java.io.IOException
+	  public virtual void testOverlap()
+	  {
+		SlowSynonymMap map = new SlowSynonymMap();
+
+		bool orig = false;
+		bool merge = true;
+		map.add(strings("qwe"), tokens("qq/ww/ee"), orig, merge);
+		map.add(strings("qwe"), tokens("xx"), orig, merge);
+		map.add(strings("qwe"), tokens("yy"), orig, merge);
+		map.add(strings("qwe"), tokens("zz"), orig, merge);
+		assertTokenizesTo(map, "$", new string[] {"$"});
+		assertTokenizesTo(map, "qwe", new string[] {"qq", "ww", "ee", "xx", "yy", "zz"}, new int[] {1, 0, 0, 0, 0, 0});
+
+		// test merging within the map
+
+		map.add(strings("a"), tokens("a5,5 a8,3 a10,2"), orig, merge);
+		map.add(strings("a"), tokens("a3,3 a7,4 a9,2 a11,2 a111,100"), orig, merge);
+		assertTokenizesTo(map, "a", new string[] {"a3", "a5", "a7", "a8", "a9", "a10", "a11", "a111"}, new int[] {1, 2, 2, 1, 1, 1, 1, 100});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testPositionIncrements() throws java.io.IOException
+	  public virtual void testPositionIncrements()
+	  {
+		SlowSynonymMap map = new SlowSynonymMap();
+
+		bool orig = false;
+		bool merge = true;
+
+		// test that generated tokens start at the same posInc as the original
+		map.add(strings("a"), tokens("aa"), orig, merge);
+		assertTokenizesTo(map, tokens("a,5"), new string[] {"aa"}, new int[] {5});
+		assertTokenizesTo(map, tokens("b,1 a,0"), new string[] {"b", "aa"}, new int[] {1, 0});
+
+		// test that offset of first replacement is ignored (always takes the orig offset)
+		map.add(strings("b"), tokens("bb,100"), orig, merge);
+		assertTokenizesTo(map, tokens("b,5"), new string[] {"bb"}, new int[] {5});
+		assertTokenizesTo(map, tokens("c,1 b,0"), new string[] {"c", "bb"}, new int[] {1, 0});
+
+		// test that subsequent tokens are adjusted accordingly
+		map.add(strings("c"), tokens("cc,100 c2,2"), orig, merge);
+		assertTokenizesTo(map, tokens("c,5"), new string[] {"cc", "c2"}, new int[] {5, 2});
+		assertTokenizesTo(map, tokens("d,1 c,0"), new string[] {"d", "cc", "c2"}, new int[] {1, 0, 2});
+	  }
+
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testPositionIncrementsWithOrig() throws java.io.IOException
+	  public virtual void testPositionIncrementsWithOrig()
+	  {
+		SlowSynonymMap map = new SlowSynonymMap();
+
+		bool orig = true;
+		bool merge = true;
+
+		// test that generated tokens start at the same offset as the original
+		map.add(strings("a"), tokens("aa"), orig, merge);
+		assertTokenizesTo(map, tokens("a,5"), new string[] {"a", "aa"}, new int[] {5, 0});
+		assertTokenizesTo(map, tokens("b,1 a,0"), new string[] {"b", "a", "aa"}, new int[] {1, 0, 0});
+
+		// test that offset of first replacement is ignored (always takes the orig offset)
+		map.add(strings("b"), tokens("bb,100"), orig, merge);
+		assertTokenizesTo(map, tokens("b,5"), new string[] {"b", "bb"}, new int[] {5, 0});
+		assertTokenizesTo(map, tokens("c,1 b,0"), new string[] {"c", "b", "bb"}, new int[] {1, 0, 0});
+
+		// test that subsequent tokens are adjusted accordingly
+		map.add(strings("c"), tokens("cc,100 c2,2"), orig, merge);
+		assertTokenizesTo(map, tokens("c,5"), new string[] {"c", "cc", "c2"}, new int[] {5, 0, 2});
+		assertTokenizesTo(map, tokens("d,1 c,0"), new string[] {"d", "c", "cc", "c2"}, new int[] {1, 0, 0, 2});
+	  }
+
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testOffsetBug() throws java.io.IOException
+	  public virtual void testOffsetBug()
+	  {
+		// With the following rules:
+		// a a=>b
+		// x=>y
+		// analysing "a x" causes "y" to have a bad offset (end less than start)
+		// SOLR-167
+		SlowSynonymMap map = new SlowSynonymMap();
+
+		bool orig = false;
+		bool merge = true;
+
+		map.add(strings("a a"), tokens("b"), orig, merge);
+		map.add(strings("x"), tokens("y"), orig, merge);
+
+		// "a a x" => "b y"
+		assertTokenizesTo(map, tokens("a,1,0,1 a,1,2,3 x,1,4,5"), new string[] {"b", "y"}, new int[] {0, 4}, new int[] {3, 5}, new int[] {1, 1});
+	  }
+
+
+	  /// <summary>
+	  ///*
+	  /// Return a list of tokens according to a test string format:
+	  /// a b c  =>  returns List<Token> [a,b,c]
+	  /// a/b   => tokens a and b share the same spot (b.positionIncrement=0)
+	  /// a,3/b/c => a,b,c all share same position (a.positionIncrement=3, b.positionIncrement=0, c.positionIncrement=0)
+	  /// a,1,10,11  => "a" with positionIncrement=1, startOffset=10, endOffset=11 </summary>
+	  /// @deprecated (3.0) does not support attributes api 
+	  [Obsolete("(3.0) does not support attributes api")]
+	  private IList<Token> tokens(string str)
+	  {
+		string[] arr = str.Split(" ", true);
+		IList<Token> result = new List<Token>();
+		for (int i = 0; i < arr.Length; i++)
+		{
+		  string[] toks = arr[i].Split("/", true);
+		  string[] @params = toks[0].Split(",", true);
+
+		  int posInc;
+		  int start;
+		  int end;
+
+		  if (@params.Length > 1)
+		  {
+			posInc = int.Parse(@params[1]);
+		  }
+		  else
+		  {
+			posInc = 1;
+		  }
+
+		  if (@params.Length > 2)
+		  {
+			start = int.Parse(@params[2]);
+		  }
+		  else
+		  {
+			start = 0;
+		  }
+
+		  if (@params.Length > 3)
+		  {
+			end = int.Parse(@params[3]);
+		  }
+		  else
+		  {
+			end = start + @params[0].Length;
+		  }
+
+		  Token t = new Token(@params[0],start,end,"TEST");
+		  t.PositionIncrement = posInc;
+
+		  result.Add(t);
+		  for (int j = 1; j < toks.Length; j++)
+		  {
+			t = new Token(toks[j],0,0,"TEST");
+			t.PositionIncrement = 0;
+			result.Add(t);
+		  }
+		}
+		return result;
+	  }
+
+	  /// @deprecated (3.0) does not support custom attributes 
+	  [Obsolete("(3.0) does not support custom attributes")]
+	  private class IterTokenStream : TokenStream
+	  {
+		internal readonly Token[] tokens;
+		internal int index = 0;
+		internal CharTermAttribute termAtt = addAttribute(typeof(CharTermAttribute));
+		internal OffsetAttribute offsetAtt = addAttribute(typeof(OffsetAttribute));
+		internal PositionIncrementAttribute posIncAtt = addAttribute(typeof(PositionIncrementAttribute));
+		internal FlagsAttribute flagsAtt = addAttribute(typeof(FlagsAttribute));
+		internal TypeAttribute typeAtt = addAttribute(typeof(TypeAttribute));
+		internal PayloadAttribute payloadAtt = addAttribute(typeof(PayloadAttribute));
+
+		public IterTokenStream(params Token[] tokens) : base()
+		{
+		  this.tokens = tokens;
+		}
+
+		public IterTokenStream(ICollection<Token> tokens) : this(tokens.toArray(new Token[tokens.Count]))
+		{
+		}
+
+//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 (index >= tokens.Length)
+		  {
+			return false;
+		  }
+		  else
+		  {
+			clearAttributes();
+			Token token = tokens[index++];
+			termAtt.setEmpty().append(token);
+			offsetAtt.setOffset(token.startOffset(), token.endOffset());
+			posIncAtt.PositionIncrement = token.PositionIncrement;
+			flagsAtt.Flags = token.Flags;
+			typeAtt.Type = token.type();
+			payloadAtt.Payload = token.Payload;
+			return true;
+		  }
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestSolrSynonymParser.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestSolrSynonymParser.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestSolrSynonymParser.cs
new file mode 100644
index 0000000..735a6c2
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestSolrSynonymParser.cs
@@ -0,0 +1,177 @@
+namespace org.apache.lucene.analysis.synonym
+{
+
+	/*
+	 * Licensed to the Apache Software Foundation (ASF) under one or more
+	 * contributor license agreements.  See the NOTICE file distributed with
+	 * this work for additional information regarding copyright ownership.
+	 * The ASF licenses this file to You under the Apache License, Version 2.0
+	 * (the "License"); you may not use this file except in compliance with
+	 * the License.  You may obtain a copy of the License at
+	 *
+	 *     http://www.apache.org/licenses/LICENSE-2.0
+	 *
+	 * Unless required by applicable law or agreed to in writing, software
+	 * distributed under the License is distributed on an "AS IS" BASIS,
+	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+	 * See the License for the specific language governing permissions and
+	 * limitations under the License.
+	 */
+
+
+	using EnglishAnalyzer = org.apache.lucene.analysis.en.EnglishAnalyzer;
+	using Test = org.junit.Test;
+
+	/// <summary>
+	/// Tests parser for the Solr synonyms format
+	/// @lucene.experimental
+	/// </summary>
+	public class TestSolrSynonymParser : BaseTokenStreamTestCase
+	{
+
+	  /// <summary>
+	  /// Tests some simple examples from the solr wiki </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testSimple() throws Exception
+	  public virtual void testSimple()
+	  {
+		string testFile = "i-pod, ipod, ipoooood\n" + "foo => foo bar\n" + "foo => baz\n" + "this test, that testing";
+
+		SolrSynonymParser parser = new SolrSynonymParser(true, true, new MockAnalyzer(random()));
+		parser.parse(new StringReader(testFile));
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final SynonymMap map = parser.build();
+		SynonymMap map = parser.build();
+
+		Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper(this, map);
+
+		assertAnalyzesTo(analyzer, "ball", new string[] {"ball"}, new int[] {1});
+
+		assertAnalyzesTo(analyzer, "i-pod", new string[] {"i-pod", "ipod", "ipoooood"}, new int[] {1, 0, 0});
+
+		assertAnalyzesTo(analyzer, "foo", new string[] {"foo", "baz", "bar"}, new int[] {1, 0, 1});
+
+		assertAnalyzesTo(analyzer, "this test", new string[] {"this", "that", "test", "testing"}, new int[] {1, 0, 1, 0});
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestSolrSynonymParser outerInstance;
+
+		  private SynonymMap map;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestSolrSynonymParser outerInstance, SynonymMap map)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.map = map;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, true);
+			return new TokenStreamComponents(tokenizer, new SynonymFilter(tokenizer, map, true));
+		  }
+	  }
+
+	  /// <summary>
+	  /// parse a syn file with bad syntax </summary>
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @Test(expected=java.text.ParseException.class) public void testInvalidDoubleMap() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public virtual void testInvalidDoubleMap()
+	  {
+		string testFile = "a => b => c";
+		SolrSynonymParser parser = new SolrSynonymParser(true, true, new MockAnalyzer(random()));
+		parser.parse(new StringReader(testFile));
+	  }
+
+	  /// <summary>
+	  /// parse a syn file with bad syntax </summary>
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @Test(expected=java.text.ParseException.class) public void testInvalidAnalyzesToNothingOutput() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public virtual void testInvalidAnalyzesToNothingOutput()
+	  {
+		string testFile = "a => 1";
+		SolrSynonymParser parser = new SolrSynonymParser(true, true, new MockAnalyzer(random(), MockTokenizer.SIMPLE, false));
+		parser.parse(new StringReader(testFile));
+	  }
+
+	  /// <summary>
+	  /// parse a syn file with bad syntax </summary>
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @Test(expected=java.text.ParseException.class) public void testInvalidAnalyzesToNothingInput() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public virtual void testInvalidAnalyzesToNothingInput()
+	  {
+		string testFile = "1 => a";
+		SolrSynonymParser parser = new SolrSynonymParser(true, true, new MockAnalyzer(random(), MockTokenizer.SIMPLE, false));
+		parser.parse(new StringReader(testFile));
+	  }
+
+	  /// <summary>
+	  /// parse a syn file with bad syntax </summary>
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @Test(expected=java.text.ParseException.class) public void testInvalidPositionsInput() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public virtual void testInvalidPositionsInput()
+	  {
+		string testFile = "testola => the test";
+		SolrSynonymParser parser = new SolrSynonymParser(true, true, new EnglishAnalyzer(TEST_VERSION_CURRENT));
+		parser.parse(new StringReader(testFile));
+	  }
+
+	  /// <summary>
+	  /// parse a syn file with bad syntax </summary>
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @Test(expected=java.text.ParseException.class) public void testInvalidPositionsOutput() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public virtual void testInvalidPositionsOutput()
+	  {
+		string testFile = "the test => testola";
+		SolrSynonymParser parser = new SolrSynonymParser(true, true, new EnglishAnalyzer(TEST_VERSION_CURRENT));
+		parser.parse(new StringReader(testFile));
+	  }
+
+	  /// <summary>
+	  /// parse a syn file with some escaped syntax chars </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEscapedStuff() throws Exception
+	  public virtual void testEscapedStuff()
+	  {
+		string testFile = "a\\=>a => b\\=>b\n" + "a\\,a => b\\,b";
+		SolrSynonymParser parser = new SolrSynonymParser(true, true, new MockAnalyzer(random(), MockTokenizer.KEYWORD, false));
+		parser.parse(new StringReader(testFile));
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final SynonymMap map = parser.build();
+		SynonymMap map = parser.build();
+		Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper2(this, map);
+
+		assertAnalyzesTo(analyzer, "ball", new string[] {"ball"}, new int[] {1});
+
+		assertAnalyzesTo(analyzer, "a=>a", new string[] {"b=>b"}, new int[] {1});
+
+		assertAnalyzesTo(analyzer, "a,a", new string[] {"b,b"}, new int[] {1});
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestSolrSynonymParser outerInstance;
+
+		  private SynonymMap map;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestSolrSynonymParser outerInstance, SynonymMap map)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.map = map;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.KEYWORD, false);
+			return new TokenStreamComponents(tokenizer, new SynonymFilter(tokenizer, map, false));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file


[24/27] lucenenet git commit: adding converted analysis common tests

Posted by sy...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cjk/TestCJKBigramFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cjk/TestCJKBigramFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cjk/TestCJKBigramFilter.cs
new file mode 100644
index 0000000..12e0b5b
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cjk/TestCJKBigramFilter.cs
@@ -0,0 +1,171 @@
+using System;
+
+namespace org.apache.lucene.analysis.cjk
+{
+
+	/*
+	 * 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 StandardTokenizer = org.apache.lucene.analysis.standard.StandardTokenizer;
+
+	public class TestCJKBigramFilter : BaseTokenStreamTestCase
+	{
+	  internal Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper();
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  public AnalyzerAnonymousInnerClassHelper()
+		  {
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer t = new StandardTokenizer(TEST_VERSION_CURRENT, reader);
+			return new TokenStreamComponents(t, new CJKBigramFilter(t));
+		  }
+	  }
+
+	  internal Analyzer unibiAnalyzer = new AnalyzerAnonymousInnerClassHelper2();
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  public AnalyzerAnonymousInnerClassHelper2()
+		  {
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer t = new StandardTokenizer(TEST_VERSION_CURRENT, reader);
+			return new TokenStreamComponents(t, new CJKBigramFilter(t, 0xff, true));
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testHuge() throws Exception
+	  public virtual void testHuge()
+	  {
+		assertAnalyzesTo(analyzer, "多くの学生が試験に落ちた" + "多くの学生が試験に落ちた" + "多くの学生が試験に落ちた" + "多くの学生が試験に落ちた" + "多くの学生が試験に落ちた" + "多くの学生が試験に落ちた" + "多くの学生が試験に落ちた" + "多くの学生が試験に落ちた" + "多くの学生が試験に落ちた" + "多くの学生が試験に落ちた" + "多くの学生が試験に落ちた", new string[] {"多く", "くの", "の学", "学生", "生が", "が試", "試験", "験に", "に落", "落ち", "ちた", "た多", "多く", "くの", "の学", "学生", "生が", "が試", "試験", "験に", "に落", "落ち", "ちた", "た多", "多く", "くの", "の学", "学生", "生が", "が試", "試験", "験に", "に落", "落ち", "ちた", "た多", "多く", "くの", "の学", "学生", "生が", "が試", "試験", "験に", "に落", "落ち", "ちた", "た多", "多く", "くの", "の
 学", "学生", "生が", "が試", "試験", "験に", "に落", "落ち", "ちた", "た多", "多く", "くの", "の学", "学生", "生が", "が試", "試験", "験に", "に落", "落ち", "ちた", "た多", "多く", "くの", "の学", "学生", "生が", "が試", "試験", "験に", "に落", "落ち", "ちた", "た多", "多く", "くの", "の学", "学生", "生が", "が試", "試験", "験に", "に落", "落ち", "ちた", "た多", "多く", "くの", "の学", "学生", "生が", "が試", "試験", "験に", "に落", "落ち", "ちた", "た多", "多く", "くの", "の学", "学生", "生が", "が試", "試験", "験に", "に落", "落ち", "ちた", "た多", "多く", "くの", "の学", "学生", "生が", "が試", "試験", "験に", "に落", "落ち", "ちた"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testHanOnly() throws Exception
+	  public virtual void testHanOnly()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper3(this);
+		assertAnalyzesTo(a, "多くの学生が試験に落ちた。", new string[] {"多", "く", "の", "学生", "が", "試験", "に", "落", "ち", "た"}, new int[] {0, 1, 2, 3, 5, 6, 8, 9, 10, 11}, new int[] {1, 2, 3, 5, 6, 8, 9, 10, 11, 12}, new string[] {"<SINGLE>", "<HIRAGANA>", "<HIRAGANA>", "<DOUBLE>", "<HIRAGANA>", "<DOUBLE>", "<HIRAGANA>", "<SINGLE>", "<HIRAGANA>", "<HIRAGANA>", "<SINGLE>"}, new int[] {1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, new int[] {1, 1, 1, 1, 1, 1, 1, 1, 1, 1});
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper3 : Analyzer
+	  {
+		  private readonly TestCJKBigramFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper3(TestCJKBigramFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer t = new StandardTokenizer(TEST_VERSION_CURRENT, reader);
+			return new TokenStreamComponents(t, new CJKBigramFilter(t, CJKBigramFilter.HAN));
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testAllScripts() throws Exception
+	  public virtual void testAllScripts()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper4(this);
+		assertAnalyzesTo(a, "多くの学生が試験に落ちた。", new string[] {"多く", "くの", "の学", "学生", "生が", "が試", "試験", "験に", "に落", "落ち", "ちた"});
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper4 : Analyzer
+	  {
+		  private readonly TestCJKBigramFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper4(TestCJKBigramFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer t = new StandardTokenizer(TEST_VERSION_CURRENT, reader);
+			return new TokenStreamComponents(t, new CJKBigramFilter(t, 0xff, false));
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testUnigramsAndBigramsAllScripts() throws Exception
+	  public virtual void testUnigramsAndBigramsAllScripts()
+	  {
+		assertAnalyzesTo(unibiAnalyzer, "多くの学生が試験に落ちた。", new string[] {"多", "多く", "く", "くの", "の", "の学", "学", "学生", "生", "生が", "が", "が試", "試", "試験", "験", "験に", "に", "に落", "落", "落ち", "ち", "ちた", "た"}, new int[] {0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11}, new int[] {1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12}, new string[] {"<SINGLE>", "<DOUBLE>", "<SINGLE>", "<DOUBLE>", "<SINGLE>", "<DOUBLE>", "<SINGLE>", "<DOUBLE>", "<SINGLE>", "<DOUBLE>", "<SINGLE>", "<DOUBLE>", "<SINGLE>", "<DOUBLE>", "<SINGLE>", "<DOUBLE>", "<SINGLE>", "<DOUBLE>", "<SINGLE>", "<DOUBLE>", "<SINGLE>", "<DOUBLE>", "<SINGLE>"}, new int[] {1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1}, new int[] {1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testUnigramsAndBigramsHanOnly() throws Exception
+	  public virtual void testUnigramsAndBigramsHanOnly()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper5(this);
+		assertAnalyzesTo(a, "多くの学生が試験に落ちた。", new string[] {"多", "く", "の", "学", "学生", "生", "が", "試", "試験", "験", "に", "落", "ち", "た"}, new int[] {0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 10, 11}, new int[] {1, 2, 3, 4, 5, 5, 6, 7, 8, 8, 9, 10, 11, 12}, new string[] {"<SINGLE>", "<HIRAGANA>", "<HIRAGANA>", "<SINGLE>", "<DOUBLE>", "<SINGLE>", "<HIRAGANA>", "<SINGLE>", "<DOUBLE>", "<SINGLE>", "<HIRAGANA>", "<SINGLE>", "<HIRAGANA>", "<HIRAGANA>", "<SINGLE>"}, new int[] {1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1}, new int[] {1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1});
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper5 : Analyzer
+	  {
+		  private readonly TestCJKBigramFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper5(TestCJKBigramFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer t = new StandardTokenizer(TEST_VERSION_CURRENT, reader);
+			return new TokenStreamComponents(t, new CJKBigramFilter(t, CJKBigramFilter.HAN, true));
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testUnigramsAndBigramsHuge() throws Exception
+	  public virtual void testUnigramsAndBigramsHuge()
+	  {
+		assertAnalyzesTo(unibiAnalyzer, "多くの学生が試験に落ちた" + "多くの学生が試験に落ちた" + "多くの学生が試験に落ちた" + "多くの学生が試験に落ちた" + "多くの学生が試験に落ちた" + "多くの学生が試験に落ちた" + "多くの学生が試験に落ちた" + "多くの学生が試験に落ちた" + "多くの学生が試験に落ちた" + "多くの学生が試験に落ちた" + "多くの学生が試験に落ちた", new string[] {"多", "多く", "く", "くの", "の", "の学", "学", "学生", "生", "生が", "が", "が試", "試", "試験", "験", "験に", "に", "に落", "落", "落ち", "ち", "ちた", "た", "た多", "多", "多く", "く", "くの", "の", "の学", "学", "学生", "生", "生が", "が", "が試", "試", "試験", "験", "験に", "に", "に落", "落", "落ち", "ち", "ちた", "た", "た多", "多", "多く", "く", "くの", "の", "の学", "学", "学生", "生", "生が", "が",
  "が試", "試", "試験", "験", "験に", "に", "に落", "落", "落ち", "ち", "ちた", "た", "た多", "多", "多く", "く", "くの", "の", "の学", "学", "学生", "生", "生が", "が", "が試", "試", "試験", "験", "験に", "に", "に落", "落", "落ち", "ち", "ちた", "た", "た多", "多", "多く", "く", "くの", "の", "の学", "学", "学生", "生", "生が", "が", "が試", "試", "試験", "験", "験に", "に", "に落", "落", "落ち", "ち", "ちた", "た", "た多", "多", "多く", "く", "くの", "の", "の学", "学", "学生", "生", "生が", "が", "が試", "試", "試験", "験", "験に", "に", "に落", "落", "落ち", "ち", "ちた", "た", "た多", "多", "多く", "く", "くの", "の", "の学", "学", "学生", "生", "生が", "が", "が試", "試", "試験", "験", "験に", "に", "に落", "落", "落ち", "ち", "ちた", "た", "た多", "多", "多く", "く", "くの", "の", "の学", "学", "学生", 
 "生", "生が", "が", "が試", "試", "試験", "験", "験に", "に", "に落", "落", "落ち", "ち", "ちた", "た", "た多", "多", "多く", "く", "くの", "の", "の学", "学", "学生", "生", "生が", "が", "が試", "試", "試験", "験", "験に", "に", "に落", "落", "落ち", "ち", "ちた", "た", "た多", "多", "多く", "く", "くの", "の", "の学", "学", "学生", "生", "生が", "が", "が試", "試", "試験", "験", "験に", "に", "に落", "落", "落ち", "ち", "ちた", "た", "た多", "多", "多く", "く", "くの", "の", "の学", "学", "学生", "生", "生が", "が", "が試", "試", "試験", "験", "験に", "に", "に落", "落", "落ち", "ち", "ちた", "た"});
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomUnibiStrings() throws Exception
+	  public virtual void testRandomUnibiStrings()
+	  {
+		checkRandomData(random(), unibiAnalyzer, 1000 * RANDOM_MULTIPLIER);
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomUnibiHugeStrings() throws Exception
+	  public virtual void testRandomUnibiHugeStrings()
+	  {
+		Random random = random();
+		checkRandomData(random, unibiAnalyzer, 100 * RANDOM_MULTIPLIER, 8192);
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cjk/TestCJKBigramFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cjk/TestCJKBigramFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cjk/TestCJKBigramFilterFactory.cs
new file mode 100644
index 0000000..fd0d186
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cjk/TestCJKBigramFilterFactory.cs
@@ -0,0 +1,77 @@
+namespace org.apache.lucene.analysis.cjk
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the CJK bigram factory is working.
+	/// </summary>
+	public class TestCJKBigramFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testDefaults() throws Exception
+	  public virtual void testDefaults()
+	  {
+		Reader reader = new StringReader("多くの学生が試験に落ちた。");
+		TokenStream stream = tokenizerFactory("standard").create(reader);
+		stream = tokenFilterFactory("CJKBigram").create(stream);
+		assertTokenStreamContents(stream, new string[] {"多く", "くの", "の学", "学生", "生が", "が試", "試験", "験に", "に落", "落ち", "ちた"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testHanOnly() throws Exception
+	  public virtual void testHanOnly()
+	  {
+		Reader reader = new StringReader("多くの学生が試験に落ちた。");
+		TokenStream stream = tokenizerFactory("standard").create(reader);
+		stream = tokenFilterFactory("CJKBigram", "hiragana", "false").create(stream);
+		assertTokenStreamContents(stream, new string[] {"多", "く", "の", "学生", "が", "試験", "に", "落", "ち", "た"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testHanOnlyUnigrams() throws Exception
+	  public virtual void testHanOnlyUnigrams()
+	  {
+		Reader reader = new StringReader("多くの学生が試験に落ちた。");
+		TokenStream stream = tokenizerFactory("standard").create(reader);
+		stream = tokenFilterFactory("CJKBigram", "hiragana", "false", "outputUnigrams", "true").create(stream);
+		assertTokenStreamContents(stream, new string[] {"多", "く", "の", "学", "学生", "生", "が", "試", "試験", "験", "に", "落", "ち", "た"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("CJKBigram", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cjk/TestCJKTokenizer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cjk/TestCJKTokenizer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cjk/TestCJKTokenizer.cs
new file mode 100644
index 0000000..e1639d5
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cjk/TestCJKTokenizer.cs
@@ -0,0 +1,240 @@
+using System;
+
+namespace org.apache.lucene.analysis.cjk
+{
+
+	/*
+	 * 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 Version = org.apache.lucene.util.Version;
+
+	/// @deprecated Remove when CJKTokenizer is removed (5.0) 
+	[Obsolete("Remove when CJKTokenizer is removed (5.0)")]
+	public class TestCJKTokenizer : BaseTokenStreamTestCase
+	{
+
+	  internal class TestToken
+	  {
+		  private readonly TestCJKTokenizer outerInstance;
+
+		  public TestToken(TestCJKTokenizer outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		internal string termText;
+		internal int start;
+		internal int end;
+		internal string type;
+	  }
+
+	  public virtual TestToken newToken(string termText, int start, int end, int type)
+	  {
+		TestToken token = new TestToken(this);
+		token.termText = termText;
+		token.type = CJKTokenizer.TOKEN_TYPE_NAMES[type];
+		token.start = start;
+		token.end = end;
+		return token;
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void checkCJKToken(final String str, final TestToken[] out_tokens) throws java.io.IOException
+//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
+	  public virtual void checkCJKToken(string str, TestToken[] out_tokens)
+	  {
+		Analyzer analyzer = new CJKAnalyzer(Version.LUCENE_30);
+		string[] terms = new string[out_tokens.Length];
+		int[] startOffsets = new int[out_tokens.Length];
+		int[] endOffsets = new int[out_tokens.Length];
+		string[] types = new string[out_tokens.Length];
+		for (int i = 0; i < out_tokens.Length; i++)
+		{
+		  terms[i] = out_tokens[i].termText;
+		  startOffsets[i] = out_tokens[i].start;
+		  endOffsets[i] = out_tokens[i].end;
+		  types[i] = out_tokens[i].type;
+		}
+		assertAnalyzesTo(analyzer, str, terms, startOffsets, endOffsets, types, null);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void checkCJKTokenReusable(final org.apache.lucene.analysis.Analyzer a, final String str, final TestToken[] out_tokens) throws java.io.IOException
+//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
+	  public virtual void checkCJKTokenReusable(Analyzer a, string str, TestToken[] out_tokens)
+	  {
+		Analyzer analyzer = new CJKAnalyzer(Version.LUCENE_30);
+		string[] terms = new string[out_tokens.Length];
+		int[] startOffsets = new int[out_tokens.Length];
+		int[] endOffsets = new int[out_tokens.Length];
+		string[] types = new string[out_tokens.Length];
+		for (int i = 0; i < out_tokens.Length; i++)
+		{
+		  terms[i] = out_tokens[i].termText;
+		  startOffsets[i] = out_tokens[i].start;
+		  endOffsets[i] = out_tokens[i].end;
+		  types[i] = out_tokens[i].type;
+		}
+		assertAnalyzesTo(analyzer, str, terms, startOffsets, endOffsets, types, null);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testJa1() throws java.io.IOException
+	  public virtual void testJa1()
+	  {
+		string str = "\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d\u5341";
+
+		TestToken[] out_tokens = new TestToken[] {newToken("\u4e00\u4e8c", 0, 2, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("\u4e8c\u4e09", 1, 3, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("\u4e09\u56db", 2, 4, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("\u56db\u4e94", 3, 5, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("\u4e94\u516d", 4, 6, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("\u516d\u4e03", 5, 7, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("\u4e03\u516b", 6, 8, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("\u516b\u4e5d", 7, 9, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("\u4e5d\u5341", 8,10, CJKTokenizer.DOUBLE_TOKEN_TYPE)};
+		checkCJKToken(str, out_tokens);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testJa2() throws java.io.IOException
+	  public virtual void testJa2()
+	  {
+		string str = "\u4e00 \u4e8c\u4e09\u56db \u4e94\u516d\u4e03\u516b\u4e5d \u5341";
+
+		TestToken[] out_tokens = new TestToken[] {newToken("\u4e00", 0, 1, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("\u4e8c\u4e09", 2, 4, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("\u4e09\u56db", 3, 5, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("\u4e94\u516d", 6, 8, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("\u516d\u4e03", 7, 9, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("\u4e03\u516b", 8, 10, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("\u516b\u4e5d", 9, 11, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("\u5341", 12,13, CJKTokenizer.DOUBLE_TOKEN_TYPE)};
+		checkCJKToken(str, out_tokens);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testC() throws java.io.IOException
+	  public virtual void testC()
+	  {
+		string str = "abc defgh ijklmn opqrstu vwxy z";
+
+		TestToken[] out_tokens = new TestToken[] {newToken("abc", 0, 3, CJKTokenizer.SINGLE_TOKEN_TYPE), newToken("defgh", 4, 9, CJKTokenizer.SINGLE_TOKEN_TYPE), newToken("ijklmn", 10, 16, CJKTokenizer.SINGLE_TOKEN_TYPE), newToken("opqrstu", 17, 24, CJKTokenizer.SINGLE_TOKEN_TYPE), newToken("vwxy", 25, 29, CJKTokenizer.SINGLE_TOKEN_TYPE), newToken("z", 30, 31, CJKTokenizer.SINGLE_TOKEN_TYPE)};
+		checkCJKToken(str, out_tokens);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMix() throws java.io.IOException
+	  public virtual void testMix()
+	  {
+		string str = "\u3042\u3044\u3046\u3048\u304aabc\u304b\u304d\u304f\u3051\u3053";
+
+		TestToken[] out_tokens = new TestToken[] {newToken("\u3042\u3044", 0, 2, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("\u3044\u3046", 1, 3, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("\u3046\u3048", 2, 4, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("\u3048\u304a", 3, 5, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("abc", 5, 8, CJKTokenizer.SINGLE_TOKEN_TYPE), newToken("\u304b\u304d", 8, 10, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("\u304d\u304f", 9, 11, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("\u304f\u3051", 10,12, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("\u3051\u3053", 11,13, CJKTokenizer.DOUBLE_TOKEN_TYPE)};
+		checkCJKToken(str, out_tokens);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMix2() throws java.io.IOException
+	  public virtual void testMix2()
+	  {
+		string str = "\u3042\u3044\u3046\u3048\u304aab\u3093c\u304b\u304d\u304f\u3051 \u3053";
+
+		TestToken[] out_tokens = new TestToken[] {newToken("\u3042\u3044", 0, 2, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("\u3044\u3046", 1, 3, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("\u3046\u3048", 2, 4, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("\u3048\u304a", 3, 5, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("ab", 5, 7, CJKTokenizer.SINGLE_TOKEN_TYPE), newToken("\u3093", 7, 8, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("c", 8, 9, CJKTokenizer.SINGLE_TOKEN_TYPE), newToken("\u304b\u304d", 9, 11, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("\u304d\u304f", 10, 12, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("\u304f\u3051", 11,13, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("\u3053", 14,15, CJKTokenizer.DOUBLE_TOKEN_TYPE)};
+		checkCJKToken(str, out_tokens);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testSingleChar() throws java.io.IOException
+	  public virtual void testSingleChar()
+	  {
+		string str = "\u4e00";
+
+		TestToken[] out_tokens = new TestToken[] {newToken("\u4e00", 0, 1, CJKTokenizer.DOUBLE_TOKEN_TYPE)};
+		checkCJKToken(str, out_tokens);
+	  }
+
+	  /*
+	   * Full-width text is normalized to half-width 
+	   */
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFullWidth() throws Exception
+	  public virtual void testFullWidth()
+	  {
+		string str = "Test 1234";
+		TestToken[] out_tokens = new TestToken[] {newToken("test", 0, 4, CJKTokenizer.SINGLE_TOKEN_TYPE), newToken("1234", 5, 9, CJKTokenizer.SINGLE_TOKEN_TYPE)};
+		checkCJKToken(str, out_tokens);
+	  }
+
+	  /*
+	   * Non-english text (not just CJK) is treated the same as CJK: C1C2 C2C3 
+	   */
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNonIdeographic() throws Exception
+	  public virtual void testNonIdeographic()
+	  {
+		string str = "\u4e00 روبرت موير";
+		TestToken[] out_tokens = new TestToken[] {newToken("\u4e00", 0, 1, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("رو", 2, 4, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("وب", 3, 5, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("بر", 4, 6, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("رت", 5, 7, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("مو", 8, 10, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("وي", 9, 11, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("ير", 10, 12, CJKTokenizer.DOUBLE_TOKEN_TYPE)};
+		checkCJKToken(str, out_tokens);
+	  }
+
+	  /*
+	   * Non-english text with nonletters (non-spacing marks,etc) is treated as C1C2 C2C3,
+	   * except for words are split around non-letters.
+	   */
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNonIdeographicNonLetter() throws Exception
+	  public virtual void testNonIdeographicNonLetter()
+	  {
+		string str = "\u4e00 رُوبرت موير";
+		TestToken[] out_tokens = new TestToken[] {newToken("\u4e00", 0, 1, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("ر", 2, 3, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("وب", 4, 6, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("بر", 5, 7, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("رت", 6, 8, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("مو", 9, 11, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("وي", 10, 12, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("ير", 11, 13, CJKTokenizer.DOUBLE_TOKEN_TYPE)};
+		checkCJKToken(str, out_tokens);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTokenStream() throws Exception
+	  public virtual void testTokenStream()
+	  {
+		Analyzer analyzer = new CJKAnalyzer(Version.LUCENE_30);
+		assertAnalyzesTo(analyzer, "\u4e00\u4e01\u4e02", new string[] {"\u4e00\u4e01", "\u4e01\u4e02"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testReusableTokenStream() throws Exception
+	  public virtual void testReusableTokenStream()
+	  {
+		Analyzer analyzer = new CJKAnalyzer(Version.LUCENE_30);
+		string str = "\u3042\u3044\u3046\u3048\u304aabc\u304b\u304d\u304f\u3051\u3053";
+
+		TestToken[] out_tokens = new TestToken[] {newToken("\u3042\u3044", 0, 2, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("\u3044\u3046", 1, 3, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("\u3046\u3048", 2, 4, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("\u3048\u304a", 3, 5, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("abc", 5, 8, CJKTokenizer.SINGLE_TOKEN_TYPE), newToken("\u304b\u304d", 8, 10, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("\u304d\u304f", 9, 11, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("\u304f\u3051", 10,12, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("\u3051\u3053", 11,13, CJKTokenizer.DOUBLE_TOKEN_TYPE)};
+		checkCJKTokenReusable(analyzer, str, out_tokens);
+
+		str = "\u3042\u3044\u3046\u3048\u304aab\u3093c\u304b\u304d\u304f\u3051 \u3053";
+		TestToken[] out_tokens2 = new TestToken[] {newToken("\u3042\u3044", 0, 2, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("\u3044\u3046", 1, 3, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("\u3046\u3048", 2, 4, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("\u3048\u304a", 3, 5, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("ab", 5, 7, CJKTokenizer.SINGLE_TOKEN_TYPE), newToken("\u3093", 7, 8, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("c", 8, 9, CJKTokenizer.SINGLE_TOKEN_TYPE), newToken("\u304b\u304d", 9, 11, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("\u304d\u304f", 10, 12, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("\u304f\u3051", 11,13, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("\u3053", 14,15, CJKTokenizer.DOUBLE_TOKEN_TYPE)};
+		checkCJKTokenReusable(analyzer, str, out_tokens2);
+	  }
+
+	  /// <summary>
+	  /// LUCENE-2207: wrong offset calculated by end() 
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFinalOffset() throws java.io.IOException
+	  public virtual void testFinalOffset()
+	  {
+		checkCJKToken("あい", new TestToken[] {newToken("あい", 0, 2, CJKTokenizer.DOUBLE_TOKEN_TYPE)});
+		checkCJKToken("あい   ", new TestToken[] {newToken("あい", 0, 2, CJKTokenizer.DOUBLE_TOKEN_TYPE)});
+		checkCJKToken("test", new TestToken[] {newToken("test", 0, 4, CJKTokenizer.SINGLE_TOKEN_TYPE)});
+		checkCJKToken("test   ", new TestToken[] {newToken("test", 0, 4, CJKTokenizer.SINGLE_TOKEN_TYPE)});
+		checkCJKToken("あいtest", new TestToken[] {newToken("あい", 0, 2, CJKTokenizer.DOUBLE_TOKEN_TYPE), newToken("test", 2, 6, CJKTokenizer.SINGLE_TOKEN_TYPE)});
+		checkCJKToken("testあい    ", new TestToken[] {newToken("test", 0, 4, CJKTokenizer.SINGLE_TOKEN_TYPE), newToken("あい", 4, 6, CJKTokenizer.DOUBLE_TOKEN_TYPE)});
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), new CJKAnalyzer(Version.LUCENE_30), 10000 * RANDOM_MULTIPLIER);
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cjk/TestCJKTokenizerFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cjk/TestCJKTokenizerFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cjk/TestCJKTokenizerFactory.cs
new file mode 100644
index 0000000..ab58c6f
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cjk/TestCJKTokenizerFactory.cs
@@ -0,0 +1,62 @@
+using System;
+
+namespace org.apache.lucene.analysis.cjk
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the CJK tokenizer factory is working. </summary>
+	/// @deprecated remove this test in 5.0 
+	[Obsolete("remove this test in 5.0")]
+	public class TestCJKTokenizerFactory : BaseTokenStreamFactoryTestCase
+	{
+	  /// <summary>
+	  /// Ensure the tokenizer actually tokenizes CJK text correctly
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTokenizer() throws Exception
+	  public virtual void testTokenizer()
+	  {
+		Reader reader = new StringReader("我是中国人");
+		TokenStream stream = tokenizerFactory("CJK").create(reader);
+		assertTokenStreamContents(stream, new string[] {"我是", "是中", "中国", "国人"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenizerFactory("CJK", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cjk/TestCJKWidthFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cjk/TestCJKWidthFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cjk/TestCJKWidthFilter.cs
new file mode 100644
index 0000000..85f195b
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cjk/TestCJKWidthFilter.cs
@@ -0,0 +1,100 @@
+namespace org.apache.lucene.analysis.cjk
+{
+
+	/*
+	 * 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 KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+
+	/// <summary>
+	/// Tests for <seealso cref="CJKWidthFilter"/>
+	/// </summary>
+	public class TestCJKWidthFilter : BaseTokenStreamTestCase
+	{
+	  private Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper();
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  public AnalyzerAnonymousInnerClassHelper()
+		  {
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer source = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(source, new CJKWidthFilter(source));
+		  }
+	  }
+
+	  /// <summary>
+	  /// Full-width ASCII forms normalized to half-width (basic latin)
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFullWidthASCII() throws java.io.IOException
+	  public virtual void testFullWidthASCII()
+	  {
+		assertAnalyzesTo(analyzer, "Test 1234", new string[] {"Test", "1234"}, new int[] {0, 5}, new int[] {4, 9});
+	  }
+
+	  /// <summary>
+	  /// Half-width katakana forms normalized to standard katakana.
+	  /// A bit trickier in some cases, since half-width forms are decomposed
+	  /// and voice marks need to be recombined with a preceding base form. 
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testHalfWidthKana() throws java.io.IOException
+	  public virtual void testHalfWidthKana()
+	  {
+		assertAnalyzesTo(analyzer, "カタカナ", new string[] {"カタカナ"});
+		assertAnalyzesTo(analyzer, "ヴィッツ", new string[] {"ヴィッツ"});
+		assertAnalyzesTo(analyzer, "パナソニック", new string[] {"パナソニック"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomData() throws java.io.IOException
+	  public virtual void testRandomData()
+	  {
+		checkRandomData(random(), analyzer, 1000 * RANDOM_MULTIPLIER);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper2(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestCJKWidthFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestCJKWidthFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new CJKWidthFilter(tokenizer));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cjk/TestCJKWidthFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cjk/TestCJKWidthFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cjk/TestCJKWidthFilterFactory.cs
new file mode 100644
index 0000000..b139d10
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cjk/TestCJKWidthFilterFactory.cs
@@ -0,0 +1,57 @@
+namespace org.apache.lucene.analysis.cjk
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the CJKWidthFilterFactory is working
+	/// </summary>
+	public class TestCJKWidthFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void test() throws Exception
+	  public virtual void test()
+	  {
+		Reader reader = new StringReader("Test 1234");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("CJKWidth").create(stream);
+		assertTokenStreamContents(stream, new string[] {"Test", "1234"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("CJKWidth", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ckb/TestSoraniAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ckb/TestSoraniAnalyzer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ckb/TestSoraniAnalyzer.cs
new file mode 100644
index 0000000..3a9a555
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ckb/TestSoraniAnalyzer.cs
@@ -0,0 +1,82 @@
+namespace org.apache.lucene.analysis.ckb
+{
+
+	/*
+	 * 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 CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+
+	/// <summary>
+	/// Test the Sorani analyzer
+	/// </summary>
+	public class TestSoraniAnalyzer : BaseTokenStreamTestCase
+	{
+
+	  /// <summary>
+	  /// This test fails with NPE when the stopwords file is missing in classpath
+	  /// </summary>
+	  public virtual void testResourcesAvailable()
+	  {
+		new SoraniAnalyzer(TEST_VERSION_CURRENT);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStopwords() throws java.io.IOException
+	  public virtual void testStopwords()
+	  {
+		Analyzer a = new SoraniAnalyzer(TEST_VERSION_CURRENT);
+		assertAnalyzesTo(a, "ئەم پیاوە", new string[] {"پیاو"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCustomStopwords() throws java.io.IOException
+	  public virtual void testCustomStopwords()
+	  {
+		Analyzer a = new SoraniAnalyzer(TEST_VERSION_CURRENT, CharArraySet.EMPTY_SET);
+		assertAnalyzesTo(a, "ئەم پیاوە", new string[] {"ئەم", "پیاو"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testReusableTokenStream() throws java.io.IOException
+	  public virtual void testReusableTokenStream()
+	  {
+		Analyzer a = new SoraniAnalyzer(TEST_VERSION_CURRENT);
+		assertAnalyzesTo(a, "پیاوە", new string[] {"پیاو"});
+		assertAnalyzesTo(a, "پیاو", new string[] {"پیاو"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testWithStemExclusionSet() throws java.io.IOException
+	  public virtual void testWithStemExclusionSet()
+	  {
+		CharArraySet set = new CharArraySet(TEST_VERSION_CURRENT, 1, true);
+		set.add("پیاوە");
+		Analyzer a = new SoraniAnalyzer(TEST_VERSION_CURRENT, CharArraySet.EMPTY_SET, set);
+		assertAnalyzesTo(a, "پیاوە", new string[] {"پیاوە"});
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), new SoraniAnalyzer(TEST_VERSION_CURRENT), 1000 * RANDOM_MULTIPLIER);
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ckb/TestSoraniNormalizationFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ckb/TestSoraniNormalizationFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ckb/TestSoraniNormalizationFilter.cs
new file mode 100644
index 0000000..90738f0
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ckb/TestSoraniNormalizationFilter.cs
@@ -0,0 +1,122 @@
+namespace org.apache.lucene.analysis.ckb
+{
+
+	/*
+	 * 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 KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+
+	/// <summary>
+	/// Tests normalization for Sorani (this is more critical than stemming...)
+	/// </summary>
+	public class TestSoraniNormalizationFilter : BaseTokenStreamTestCase
+	{
+	  internal Analyzer a = new AnalyzerAnonymousInnerClassHelper();
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  public AnalyzerAnonymousInnerClassHelper()
+		  {
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new SoraniNormalizationFilter(tokenizer));
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testY() throws Exception
+	  public virtual void testY()
+	  {
+		checkOneTerm(a, "\u064A", "\u06CC");
+		checkOneTerm(a, "\u0649", "\u06CC");
+		checkOneTerm(a, "\u06CC", "\u06CC");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testK() throws Exception
+	  public virtual void testK()
+	  {
+		checkOneTerm(a, "\u0643", "\u06A9");
+		checkOneTerm(a, "\u06A9", "\u06A9");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testH() throws Exception
+	  public virtual void testH()
+	  {
+		// initial
+		checkOneTerm(a, "\u0647\u200C", "\u06D5");
+		// medial
+		checkOneTerm(a, "\u0647\u200C\u06A9", "\u06D5\u06A9");
+
+		checkOneTerm(a, "\u06BE", "\u0647");
+		checkOneTerm(a, "\u0629", "\u06D5");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFinalH() throws Exception
+	  public virtual void testFinalH()
+	  {
+		// always (and in final form by def), so frequently omitted
+		checkOneTerm(a, "\u0647\u0647\u0647", "\u0647\u0647\u06D5");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRR() throws Exception
+	  public virtual void testRR()
+	  {
+		checkOneTerm(a, "\u0692", "\u0695");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testInitialRR() throws Exception
+	  public virtual void testInitialRR()
+	  {
+		// always, so frequently omitted
+		checkOneTerm(a, "\u0631\u0631\u0631", "\u0695\u0631\u0631");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRemove() throws Exception
+	  public virtual void testRemove()
+	  {
+		checkOneTerm(a, "\u0640", "");
+		checkOneTerm(a, "\u064B", "");
+		checkOneTerm(a, "\u064C", "");
+		checkOneTerm(a, "\u064D", "");
+		checkOneTerm(a, "\u064E", "");
+		checkOneTerm(a, "\u064F", "");
+		checkOneTerm(a, "\u0650", "");
+		checkOneTerm(a, "\u0651", "");
+		checkOneTerm(a, "\u0652", "");
+		// we peek backwards in this case to look for h+200C, ensure this works
+		checkOneTerm(a, "\u200C", "");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		checkOneTerm(a, "", "");
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ckb/TestSoraniNormalizationFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ckb/TestSoraniNormalizationFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ckb/TestSoraniNormalizationFilterFactory.cs
new file mode 100644
index 0000000..30e5d0b
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ckb/TestSoraniNormalizationFilterFactory.cs
@@ -0,0 +1,58 @@
+namespace org.apache.lucene.analysis.ckb
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the Sorani normalization factory is working.
+	/// </summary>
+	public class TestSoraniNormalizationFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNormalization() throws Exception
+	  public virtual void testNormalization()
+	  {
+		Reader reader = new StringReader("پیــــاوەکان");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("SoraniNormalization").create(stream);
+		assertTokenStreamContents(stream, new string[] {"پیاوەکان"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("SoraniNormalization", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ckb/TestSoraniStemFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ckb/TestSoraniStemFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ckb/TestSoraniStemFilter.cs
new file mode 100644
index 0000000..4aebe0e
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ckb/TestSoraniStemFilter.cs
@@ -0,0 +1,144 @@
+namespace org.apache.lucene.analysis.ckb
+{
+
+	/*
+	 * 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.
+	 */
+
+//JAVA TO C# CONVERTER TODO TASK: This Java 'import static' statement cannot be converted to C#:
+//	import static org.apache.lucene.analysis.VocabularyAssert.assertVocabulary;
+
+
+	using KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+
+	/// <summary>
+	/// Test the Sorani Stemmer.
+	/// </summary>
+	public class TestSoraniStemFilter : BaseTokenStreamTestCase
+	{
+	  internal SoraniAnalyzer a = new SoraniAnalyzer(TEST_VERSION_CURRENT);
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testIndefiniteSingular() throws Exception
+	  public virtual void testIndefiniteSingular()
+	  {
+		checkOneTerm(a, "پیاوێک", "پیاو"); // -ek
+		checkOneTerm(a, "دەرگایەک", "دەرگا"); // -yek
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testDefiniteSingular() throws Exception
+	  public virtual void testDefiniteSingular()
+	  {
+		checkOneTerm(a, "پیاوەكە", "پیاو"); // -aka
+		checkOneTerm(a, "دەرگاكە", "دەرگا"); // -ka
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testDemonstrativeSingular() throws Exception
+	  public virtual void testDemonstrativeSingular()
+	  {
+		checkOneTerm(a, "کتاویە", "کتاوی"); // -a
+		checkOneTerm(a, "دەرگایە", "دەرگا"); // -ya
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testIndefinitePlural() throws Exception
+	  public virtual void testIndefinitePlural()
+	  {
+		checkOneTerm(a, "پیاوان", "پیاو"); // -An
+		checkOneTerm(a, "دەرگایان", "دەرگا"); // -yAn
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testDefinitePlural() throws Exception
+	  public virtual void testDefinitePlural()
+	  {
+		checkOneTerm(a, "پیاوەکان", "پیاو"); // -akAn
+		checkOneTerm(a, "دەرگاکان", "دەرگا"); // -kAn
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testDemonstrativePlural() throws Exception
+	  public virtual void testDemonstrativePlural()
+	  {
+		checkOneTerm(a, "پیاوانە", "پیاو"); // -Ana
+		checkOneTerm(a, "دەرگایانە", "دەرگا"); // -yAna
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEzafe() throws Exception
+	  public virtual void testEzafe()
+	  {
+		checkOneTerm(a, "هۆتیلی", "هۆتیل"); // singular
+		checkOneTerm(a, "هۆتیلێکی", "هۆتیل"); // indefinite
+		checkOneTerm(a, "هۆتیلانی", "هۆتیل"); // plural
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testPostpositions() throws Exception
+	  public virtual void testPostpositions()
+	  {
+		checkOneTerm(a, "دوورەوە", "دوور"); // -awa
+		checkOneTerm(a, "نیوەشەودا", "نیوەشەو"); // -dA
+		checkOneTerm(a, "سۆرانا", "سۆران"); // -A
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testPossessives() throws Exception
+	  public virtual void testPossessives()
+	  {
+		checkOneTerm(a, "پارەمان", "پارە"); // -mAn
+		checkOneTerm(a, "پارەتان", "پارە"); // -tAn
+		checkOneTerm(a, "پارەیان", "پارە"); // -yAn
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestSoraniStemFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestSoraniStemFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new SoraniStemFilter(tokenizer));
+		  }
+	  }
+
+	  /// <summary>
+	  /// test against a basic vocabulary file </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testVocabulary() throws Exception
+	  public virtual void testVocabulary()
+	  {
+		// top 8k words or so: freq > 1000
+		assertVocabulary(a, getDataFile("ckbtestdata.zip"), "testdata.txt");
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ckb/TestSoraniStemFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ckb/TestSoraniStemFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ckb/TestSoraniStemFilterFactory.cs
new file mode 100644
index 0000000..ae5bdd8
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ckb/TestSoraniStemFilterFactory.cs
@@ -0,0 +1,58 @@
+namespace org.apache.lucene.analysis.ckb
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the Sorani stem factory is working.
+	/// </summary>
+	public class TestSoraniStemFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStemming() throws Exception
+	  public virtual void testStemming()
+	  {
+		Reader reader = new StringReader("پیاوەکان");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("SoraniStem").create(stream);
+		assertTokenStreamContents(stream, new string[] {"پیاو"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("SoraniStem", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cn/TestChineseFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cn/TestChineseFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cn/TestChineseFilterFactory.cs
new file mode 100644
index 0000000..5b8f9b1
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cn/TestChineseFilterFactory.cs
@@ -0,0 +1,60 @@
+namespace org.apache.lucene.analysis.cn
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the Chinese filter factory is working.
+	/// </summary>
+	public class TestChineseFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+	  /// <summary>
+	  /// Ensure the filter actually normalizes text (numerics, stopwords)
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFiltering() throws Exception
+	  public virtual void testFiltering()
+	  {
+		Reader reader = new StringReader("this 1234 Is such a silly filter");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("Chinese").create(stream);
+		assertTokenStreamContents(stream, new string[] {"Is", "silly", "filter"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("Chinese", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cn/TestChineseTokenizer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cn/TestChineseTokenizer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cn/TestChineseTokenizer.cs
new file mode 100644
index 0000000..0cc6a8d
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cn/TestChineseTokenizer.cs
@@ -0,0 +1,151 @@
+using System;
+
+namespace org.apache.lucene.analysis.cn
+{
+
+	/*
+	 * 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 org.apache.lucene.analysis;
+	using WhitespaceTokenizer = org.apache.lucene.analysis.core.WhitespaceTokenizer;
+	using OffsetAttribute = org.apache.lucene.analysis.tokenattributes.OffsetAttribute;
+	using Version = org.apache.lucene.util.Version;
+
+
+	/// @deprecated Remove this test when ChineseAnalyzer is removed. 
+	[Obsolete("Remove this test when ChineseAnalyzer is removed.")]
+	public class TestChineseTokenizer : BaseTokenStreamTestCase
+	{
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testOtherLetterOffset() throws java.io.IOException
+		public virtual void testOtherLetterOffset()
+		{
+			string s = "a天b";
+			ChineseTokenizer tokenizer = new ChineseTokenizer(new StringReader(s));
+
+			int correctStartOffset = 0;
+			int correctEndOffset = 1;
+			OffsetAttribute offsetAtt = tokenizer.getAttribute(typeof(OffsetAttribute));
+			tokenizer.reset();
+			while (tokenizer.incrementToken())
+			{
+			  assertEquals(correctStartOffset, offsetAtt.startOffset());
+			  assertEquals(correctEndOffset, offsetAtt.endOffset());
+			  correctStartOffset++;
+			  correctEndOffset++;
+			}
+			tokenizer.end();
+			tokenizer.close();
+		}
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testReusableTokenStream() throws Exception
+		public virtual void testReusableTokenStream()
+		{
+		  Analyzer a = new ChineseAnalyzer();
+		  assertAnalyzesTo(a, "中华人民共和国", new string[] {"中", "华", "人", "民", "共", "和", "国"}, new int[] {0, 1, 2, 3, 4, 5, 6}, new int[] {1, 2, 3, 4, 5, 6, 7});
+		  assertAnalyzesTo(a, "北京市", new string[] {"北", "京", "市"}, new int[] {0, 1, 2}, new int[] {1, 2, 3});
+		}
+
+		/*
+		 * Analyzer that just uses ChineseTokenizer, not ChineseFilter.
+		 * convenience to show the behavior of the tokenizer
+		 */
+		private class JustChineseTokenizerAnalyzer : Analyzer
+		{
+			private readonly TestChineseTokenizer outerInstance;
+
+			public JustChineseTokenizerAnalyzer(TestChineseTokenizer outerInstance)
+			{
+				this.outerInstance = outerInstance;
+			}
+
+		  public override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			return new TokenStreamComponents(new ChineseTokenizer(reader));
+		  }
+		}
+
+		/*
+		 * Analyzer that just uses ChineseFilter, not ChineseTokenizer.
+		 * convenience to show the behavior of the filter.
+		 */
+		private class JustChineseFilterAnalyzer : Analyzer
+		{
+			private readonly TestChineseTokenizer outerInstance;
+
+			public JustChineseFilterAnalyzer(TestChineseTokenizer outerInstance)
+			{
+				this.outerInstance = outerInstance;
+			}
+
+		  public override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new WhitespaceTokenizer(Version.LUCENE_CURRENT, reader);
+			return new TokenStreamComponents(tokenizer, new ChineseFilter(tokenizer));
+		  }
+		}
+
+		/*
+		 * ChineseTokenizer tokenizes numbers as one token, but they are filtered by ChineseFilter
+		 */
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNumerics() throws Exception
+		public virtual void testNumerics()
+		{
+		  Analyzer justTokenizer = new JustChineseTokenizerAnalyzer(this);
+		  assertAnalyzesTo(justTokenizer, "中1234", new string[] {"中", "1234"});
+
+		  // in this case the ChineseAnalyzer (which applies ChineseFilter) will remove the numeric token.
+		  Analyzer a = new ChineseAnalyzer();
+		  assertAnalyzesTo(a, "中1234", new string[] {"中"});
+		}
+
+		/*
+		 * ChineseTokenizer tokenizes english similar to SimpleAnalyzer.
+		 * it will lowercase terms automatically.
+		 * 
+		 * ChineseFilter has an english stopword list, it also removes any single character tokens.
+		 * the stopword list is case-sensitive.
+		 */
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEnglish() throws Exception
+		public virtual void testEnglish()
+		{
+		  Analyzer chinese = new ChineseAnalyzer();
+		  assertAnalyzesTo(chinese, "This is a Test. b c d", new string[] {"test"});
+
+		  Analyzer justTokenizer = new JustChineseTokenizerAnalyzer(this);
+		  assertAnalyzesTo(justTokenizer, "This is a Test. b c d", new string[] {"this", "is", "a", "test", "b", "c", "d"});
+
+		  Analyzer justFilter = new JustChineseFilterAnalyzer(this);
+		  assertAnalyzesTo(justFilter, "This is a Test. b c d", new string[] {"This", "Test."});
+		}
+
+		/// <summary>
+		/// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+		public virtual void testRandomStrings()
+		{
+		  checkRandomData(random(), new ChineseAnalyzer(), 10000 * RANDOM_MULTIPLIER);
+		}
+
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cn/TestChineseTokenizerFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cn/TestChineseTokenizerFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cn/TestChineseTokenizerFactory.cs
new file mode 100644
index 0000000..03f8055
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Cn/TestChineseTokenizerFactory.cs
@@ -0,0 +1,59 @@
+namespace org.apache.lucene.analysis.cn
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the Chinese tokenizer factory is working.
+	/// </summary>
+	public class TestChineseTokenizerFactory : BaseTokenStreamFactoryTestCase
+	{
+	  /// <summary>
+	  /// Ensure the tokenizer actually tokenizes chinese text correctly
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTokenizer() throws Exception
+	  public virtual void testTokenizer()
+	  {
+		Reader reader = new StringReader("我是中国人");
+		TokenStream stream = tokenizerFactory("Chinese").create(reader);
+		assertTokenStreamContents(stream, new string[] {"我", "是", "中", "国", "人"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenizerFactory("Chinese", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file


[22/27] lucenenet git commit: adding converted analysis common tests

Posted by sy...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestBugInSomething.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestBugInSomething.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestBugInSomething.cs
new file mode 100644
index 0000000..73ccad8
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestBugInSomething.cs
@@ -0,0 +1,383 @@
+using System;
+using System.Collections.Generic;
+
+namespace org.apache.lucene.analysis.core
+{
+
+
+	using MappingCharFilter = org.apache.lucene.analysis.charfilter.MappingCharFilter;
+	using NormalizeCharMap = org.apache.lucene.analysis.charfilter.NormalizeCharMap;
+	using CommonGramsFilter = org.apache.lucene.analysis.commongrams.CommonGramsFilter;
+	using WordDelimiterFilter = org.apache.lucene.analysis.miscellaneous.WordDelimiterFilter;
+	using EdgeNGramTokenizer = org.apache.lucene.analysis.ngram.EdgeNGramTokenizer;
+	using NGramTokenFilter = org.apache.lucene.analysis.ngram.NGramTokenFilter;
+	using ShingleFilter = org.apache.lucene.analysis.shingle.ShingleFilter;
+	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+	using WikipediaTokenizer = org.apache.lucene.analysis.wikipedia.WikipediaTokenizer;
+	using SuppressCodecs = org.apache.lucene.util.LuceneTestCase.SuppressCodecs;
+
+	/*
+	 * 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.
+	 */
+
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @SuppressCodecs("Direct") public class TestBugInSomething extends org.apache.lucene.analysis.BaseTokenStreamTestCase
+	public class TestBugInSomething : BaseTokenStreamTestCase
+	{
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void test() throws Exception
+	  public virtual void test()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.util.CharArraySet cas = new org.apache.lucene.analysis.util.CharArraySet(TEST_VERSION_CURRENT, 3, false);
+		CharArraySet cas = new CharArraySet(TEST_VERSION_CURRENT, 3, false);
+		cas.add("jjp");
+		cas.add("wlmwoknt");
+		cas.add("tcgyreo");
+
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.charfilter.NormalizeCharMap.Builder builder = new org.apache.lucene.analysis.charfilter.NormalizeCharMap.Builder();
+		NormalizeCharMap.Builder builder = new NormalizeCharMap.Builder();
+		builder.add("mtqlpi", "");
+		builder.add("mwoknt", "jjp");
+		builder.add("tcgyreo", "zpfpajyws");
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.charfilter.NormalizeCharMap map = builder.build();
+		NormalizeCharMap map = builder.build();
+
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper(this, cas, map);
+		checkAnalysisConsistency(random(), a, false, "wmgddzunizdomqyj");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestBugInSomething outerInstance;
+
+		  private CharArraySet cas;
+		  private NormalizeCharMap map;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestBugInSomething outerInstance, CharArraySet cas, NormalizeCharMap map)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.cas = cas;
+			  this.map = map;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer t = new MockTokenizer(new TestRandomChains.CheckThatYouDidntReadAnythingReaderWrapper(reader), MockTokenFilter.ENGLISH_STOPSET, false, -65);
+			TokenFilter f = new CommonGramsFilter(TEST_VERSION_CURRENT, t, cas);
+			return new TokenStreamComponents(t, f);
+		  }
+
+		  protected internal override Reader initReader(string fieldName, Reader reader)
+		  {
+			reader = new MockCharFilter(reader, 0);
+			reader = new MappingCharFilter(map, reader);
+			return reader;
+		  }
+	  }
+
+	  internal CharFilter wrappedStream = new CharFilterAnonymousInnerClassHelper(new StringReader("bogus"));
+
+	  private class CharFilterAnonymousInnerClassHelper : CharFilter
+	  {
+		  public CharFilterAnonymousInnerClassHelper(StringReader java) : base(StringReader)
+		  {
+		  }
+
+
+		  public override void mark(int readAheadLimit)
+		  {
+			throw new System.NotSupportedException("mark(int)");
+		  }
+
+		  public override bool markSupported()
+		  {
+			throw new System.NotSupportedException("markSupported()");
+		  }
+
+		  public override int read()
+		  {
+			throw new System.NotSupportedException("read()");
+		  }
+
+		  public override int read(char[] cbuf)
+		  {
+			throw new System.NotSupportedException("read(char[])");
+		  }
+
+		  public override int read(CharBuffer target)
+		  {
+			throw new System.NotSupportedException("read(CharBuffer)");
+		  }
+
+		  public override bool ready()
+		  {
+			throw new System.NotSupportedException("ready()");
+		  }
+
+		  public override void reset()
+		  {
+			throw new System.NotSupportedException("reset()");
+		  }
+
+		  public override long skip(long n)
+		  {
+			throw new System.NotSupportedException("skip(long)");
+		  }
+
+		  public override int correct(int currentOff)
+		  {
+			throw new System.NotSupportedException("correct(int)");
+		  }
+
+		  public override void close()
+		  {
+			throw new System.NotSupportedException("close()");
+		  }
+
+		  public override int read(char[] arg0, int arg1, int arg2)
+		  {
+			throw new System.NotSupportedException("read(char[], int, int)");
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testWrapping() throws Exception
+	  public virtual void testWrapping()
+	  {
+		CharFilter cs = new TestRandomChains.CheckThatYouDidntReadAnythingReaderWrapper(wrappedStream);
+		try
+		{
+		  cs.mark(1);
+		  fail();
+		}
+		catch (Exception e)
+		{
+		  assertEquals("mark(int)", e.Message);
+		}
+
+		try
+		{
+		  cs.markSupported();
+		  fail();
+		}
+		catch (Exception e)
+		{
+		  assertEquals("markSupported()", e.Message);
+		}
+
+		try
+		{
+		  cs.read();
+		  fail();
+		}
+		catch (Exception e)
+		{
+		  assertEquals("read()", e.Message);
+		}
+
+		try
+		{
+		  cs.read(new char[0]);
+		  fail();
+		}
+		catch (Exception e)
+		{
+		  assertEquals("read(char[])", e.Message);
+		}
+
+		try
+		{
+		  cs.read(CharBuffer.wrap(new char[0]));
+		  fail();
+		}
+		catch (Exception e)
+		{
+		  assertEquals("read(CharBuffer)", e.Message);
+		}
+
+		try
+		{
+		  cs.reset();
+		  fail();
+		}
+		catch (Exception e)
+		{
+		  assertEquals("reset()", e.Message);
+		}
+
+		try
+		{
+		  cs.skip(1);
+		  fail();
+		}
+		catch (Exception e)
+		{
+		  assertEquals("skip(long)", e.Message);
+		}
+
+		try
+		{
+		  cs.correctOffset(1);
+		  fail();
+		}
+		catch (Exception e)
+		{
+		  assertEquals("correct(int)", e.Message);
+		}
+
+		try
+		{
+		  cs.close();
+		  fail();
+		}
+		catch (Exception e)
+		{
+		  assertEquals("close()", e.Message);
+		}
+
+		try
+		{
+		  cs.read(new char[0], 0, 0);
+		  fail();
+		}
+		catch (Exception e)
+		{
+		  assertEquals("read(char[], int, int)", e.Message);
+		}
+	  }
+
+	  // todo: test framework?
+
+	  internal sealed class SopTokenFilter : TokenFilter
+	  {
+
+		internal SopTokenFilter(TokenStream input) : base(input)
+		{
+		}
+
+//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())
+		  {
+			Console.WriteLine(input.GetType().Name + "->" + this.reflectAsString(false));
+			return true;
+		  }
+		  else
+		  {
+			return false;
+		  }
+		}
+
+//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()
+		{
+		  base.end();
+		  Console.WriteLine(input.GetType().Name + ".end()");
+		}
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Override public void close() throws java.io.IOException
+		public override void close()
+		{
+		  base.close();
+		  Console.WriteLine(input.GetType().Name + ".close()");
+		}
+
+//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()
+		{
+		  base.reset();
+		  Console.WriteLine(input.GetType().Name + ".reset()");
+		}
+	  }
+
+	  // LUCENE-5269
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testUnicodeShinglesAndNgrams() throws Exception
+	  public virtual void testUnicodeShinglesAndNgrams()
+	  {
+		Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper(this);
+		checkRandomData(random(), analyzer, 2000);
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestBugInSomething outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestBugInSomething outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new EdgeNGramTokenizer(TEST_VERSION_CURRENT, reader, 2, 94);
+			//TokenStream stream = new SopTokenFilter(tokenizer);
+			TokenStream stream = new ShingleFilter(tokenizer, 5);
+			//stream = new SopTokenFilter(stream);
+			stream = new NGramTokenFilter(TEST_VERSION_CURRENT, stream, 55, 83);
+			//stream = new SopTokenFilter(stream);
+			return new TokenStreamComponents(tokenizer, stream);
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCuriousWikipediaString() throws Exception
+	  public virtual void testCuriousWikipediaString()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.util.CharArraySet protWords = new org.apache.lucene.analysis.util.CharArraySet(TEST_VERSION_CURRENT, new java.util.HashSet<>(java.util.Arrays.asList("rrdpafa", "pupmmlu", "xlq", "dyy", "zqrxrrck", "o", "hsrlfvcha")), false);
+		CharArraySet protWords = new CharArraySet(TEST_VERSION_CURRENT, new HashSet<>(Arrays.asList("rrdpafa", "pupmmlu", "xlq", "dyy", "zqrxrrck", "o", "hsrlfvcha")), false);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final byte table[] = new byte[] { -57, 26, 1, 48, 63, -23, 55, -84, 18, 120, -97, 103, 58, 13, 84, 89, 57, -13, -63, 5, 28, 97, -54, -94, 102, -108, -5, 5, 46, 40, 43, 78, 43, -72, 36, 29, 124, -106, -22, -51, 65, 5, 31, -42, 6, -99, 97, 14, 81, -128, 74, 100, 54, -55, -25, 53, -71, -98, 44, 33, 86, 106, -42, 47, 115, -89, -18, -26, 22, -95, -43, 83, -125, 105, -104, -24, 106, -16, 126, 115, -105, 97, 65, -33, 57, 44, -1, 123, -68, 100, 13, -41, -64, -119, 0, 92, 94, -36, 53, -9, -102, -18, 90, 94, -26, 31, 71, -20 };
+		sbyte[] table = new sbyte[] {-57, 26, 1, 48, 63, -23, 55, -84, 18, 120, -97, 103, 58, 13, 84, 89, 57, -13, -63, 5, 28, 97, -54, -94, 102, -108, -5, 5, 46, 40, 43, 78, 43, -72, 36, 29, 124, -106, -22, -51, 65, 5, 31, -42, 6, -99, 97, 14, 81, -128, 74, 100, 54, -55, -25, 53, -71, -98, 44, 33, 86, 106, -42, 47, 115, -89, -18, -26, 22, -95, -43, 83, -125, 105, -104, -24, 106, -16, 126, 115, -105, 97, 65, -33, 57, 44, -1, 123, -68, 100, 13, -41, -64, -119, 0, 92, 94, -36, 53, -9, -102, -18, 90, 94, -26, 31, 71, -20};
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper2(this, protWords, table);
+		checkAnalysisConsistency(random(), a, false, "B\u28c3\ue0f8[ \ud800\udfc2 </p> jb");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestBugInSomething outerInstance;
+
+		  private CharArraySet protWords;
+		  private sbyte[] table;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestBugInSomething outerInstance, CharArraySet protWords, sbyte[] table)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.protWords = protWords;
+			  this.table = table;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new WikipediaTokenizer(reader);
+			TokenStream stream = new SopTokenFilter(tokenizer);
+			stream = new WordDelimiterFilter(TEST_VERSION_CURRENT, stream, table, -50, protWords);
+			stream = new SopTokenFilter(stream);
+			return new TokenStreamComponents(tokenizer, stream);
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestClassicAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestClassicAnalyzer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestClassicAnalyzer.cs
new file mode 100644
index 0000000..9b3f425
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestClassicAnalyzer.cs
@@ -0,0 +1,395 @@
+using System;
+
+namespace org.apache.lucene.analysis.core
+{
+
+	using ClassicAnalyzer = org.apache.lucene.analysis.standard.ClassicAnalyzer;
+	using Document = org.apache.lucene.document.Document;
+	using Field = org.apache.lucene.document.Field;
+	using TextField = org.apache.lucene.document.TextField;
+	using DocsAndPositionsEnum = org.apache.lucene.index.DocsAndPositionsEnum;
+	using DocsEnum = org.apache.lucene.index.DocsEnum;
+	using IndexReader = org.apache.lucene.index.IndexReader;
+	using IndexWriter = org.apache.lucene.index.IndexWriter;
+	using IndexWriterConfig = org.apache.lucene.index.IndexWriterConfig;
+	using MultiFields = org.apache.lucene.index.MultiFields;
+	using Term = org.apache.lucene.index.Term;
+	using DocIdSetIterator = org.apache.lucene.search.DocIdSetIterator;
+	using RAMDirectory = org.apache.lucene.store.RAMDirectory;
+	using BytesRef = org.apache.lucene.util.BytesRef;
+	using Version = org.apache.lucene.util.Version;
+
+
+
+	/// <summary>
+	/// Copyright 2004 The Apache Software Foundation
+	/// <p/>
+	/// Licensed 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
+	/// <p/>
+	/// http://www.apache.org/licenses/LICENSE-2.0
+	/// <p/>
+	/// 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>
+
+	public class TestClassicAnalyzer : BaseTokenStreamTestCase
+	{
+
+	  private Analyzer a = new ClassicAnalyzer(TEST_VERSION_CURRENT);
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMaxTermLength() throws Exception
+	  public virtual void testMaxTermLength()
+	  {
+		ClassicAnalyzer sa = new ClassicAnalyzer(TEST_VERSION_CURRENT);
+		sa.MaxTokenLength = 5;
+		assertAnalyzesTo(sa, "ab cd toolong xy z", new string[]{"ab", "cd", "xy", "z"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMaxTermLength2() throws Exception
+	  public virtual void testMaxTermLength2()
+	  {
+		ClassicAnalyzer sa = new ClassicAnalyzer(TEST_VERSION_CURRENT);
+		assertAnalyzesTo(sa, "ab cd toolong xy z", new string[]{"ab", "cd", "toolong", "xy", "z"});
+		sa.MaxTokenLength = 5;
+
+		assertAnalyzesTo(sa, "ab cd toolong xy z", new string[]{"ab", "cd", "xy", "z"}, new int[]{1, 1, 2, 1});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMaxTermLength3() throws Exception
+	  public virtual void testMaxTermLength3()
+	  {
+		char[] chars = new char[255];
+		for (int i = 0;i < 255;i++)
+		{
+		  chars[i] = 'a';
+		}
+		string longTerm = new string(chars, 0, 255);
+
+		assertAnalyzesTo(a, "ab cd " + longTerm + " xy z", new string[]{"ab", "cd", longTerm, "xy", "z"});
+		assertAnalyzesTo(a, "ab cd " + longTerm + "a xy z", new string[]{"ab", "cd", "xy", "z"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testAlphanumeric() throws Exception
+	  public virtual void testAlphanumeric()
+	  {
+		// alphanumeric tokens
+		assertAnalyzesTo(a, "B2B", new string[]{"b2b"});
+		assertAnalyzesTo(a, "2B", new string[]{"2b"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testUnderscores() throws Exception
+	  public virtual void testUnderscores()
+	  {
+		// underscores are delimiters, but not in email addresses (below)
+		assertAnalyzesTo(a, "word_having_underscore", new string[]{"word", "having", "underscore"});
+		assertAnalyzesTo(a, "word_with_underscore_and_stopwords", new string[]{"word", "underscore", "stopwords"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testDelimiters() throws Exception
+	  public virtual void testDelimiters()
+	  {
+		// other delimiters: "-", "/", ","
+		assertAnalyzesTo(a, "some-dashed-phrase", new string[]{"some", "dashed", "phrase"});
+		assertAnalyzesTo(a, "dogs,chase,cats", new string[]{"dogs", "chase", "cats"});
+		assertAnalyzesTo(a, "ac/dc", new string[]{"ac", "dc"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testApostrophes() throws Exception
+	  public virtual void testApostrophes()
+	  {
+		// internal apostrophes: O'Reilly, you're, O'Reilly's
+		// possessives are actually removed by StardardFilter, not the tokenizer
+		assertAnalyzesTo(a, "O'Reilly", new string[]{"o'reilly"});
+		assertAnalyzesTo(a, "you're", new string[]{"you're"});
+		assertAnalyzesTo(a, "she's", new string[]{"she"});
+		assertAnalyzesTo(a, "Jim's", new string[]{"jim"});
+		assertAnalyzesTo(a, "don't", new string[]{"don't"});
+		assertAnalyzesTo(a, "O'Reilly's", new string[]{"o'reilly"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTSADash() throws Exception
+	  public virtual void testTSADash()
+	  {
+		// t and s had been stopwords in Lucene <= 2.0, which made it impossible
+		// to correctly search for these terms:
+		assertAnalyzesTo(a, "s-class", new string[]{"s", "class"});
+		assertAnalyzesTo(a, "t-com", new string[]{"t", "com"});
+		// 'a' is still a stopword:
+		assertAnalyzesTo(a, "a-class", new string[]{"class"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCompanyNames() throws Exception
+	  public virtual void testCompanyNames()
+	  {
+		// company names
+		assertAnalyzesTo(a, "AT&T", new string[]{"at&t"});
+		assertAnalyzesTo(a, "Excite@Home", new string[]{"excite@home"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testLucene1140() throws Exception
+	  public virtual void testLucene1140()
+	  {
+		try
+		{
+		  ClassicAnalyzer analyzer = new ClassicAnalyzer(TEST_VERSION_CURRENT);
+		  assertAnalyzesTo(analyzer, "www.nutch.org.", new string[]{"www.nutch.org"}, new string[] {"<HOST>"});
+		}
+		catch (System.NullReferenceException)
+		{
+		  fail("Should not throw an NPE and it did");
+		}
+
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testDomainNames() throws Exception
+	  public virtual void testDomainNames()
+	  {
+		// Current lucene should not show the bug
+		ClassicAnalyzer a2 = new ClassicAnalyzer(TEST_VERSION_CURRENT);
+
+		// domain names
+		assertAnalyzesTo(a2, "www.nutch.org", new string[]{"www.nutch.org"});
+		//Notice the trailing .  See https://issues.apache.org/jira/browse/LUCENE-1068.
+		// the following should be recognized as HOST:
+		assertAnalyzesTo(a2, "www.nutch.org.", new string[]{"www.nutch.org"}, new string[] {"<HOST>"});
+
+		// 2.3 should show the bug. But, alas, it's obsolete, we don't support it.
+		// a2 = new ClassicAnalyzer(org.apache.lucene.util.Version.LUCENE_23);
+		// assertAnalyzesTo(a2, "www.nutch.org.", new String[]{ "wwwnutchorg" }, new String[] { "<ACRONYM>" });
+
+		// 2.4 should not show the bug. But, alas, it's also obsolete,
+		// so we check latest released (Robert's gonna break this on 4.0 soon :) )
+		a2 = new ClassicAnalyzer(Version.LUCENE_31);
+		assertAnalyzesTo(a2, "www.nutch.org.", new string[]{"www.nutch.org"}, new string[] {"<HOST>"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEMailAddresses() throws Exception
+	  public virtual void testEMailAddresses()
+	  {
+		// email addresses, possibly with underscores, periods, etc
+		assertAnalyzesTo(a, "test@example.com", new string[]{"test@example.com"});
+		assertAnalyzesTo(a, "first.lastname@example.com", new string[]{"first.lastname@example.com"});
+		assertAnalyzesTo(a, "first_lastname@example.com", new string[]{"first_lastname@example.com"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNumeric() throws Exception
+	  public virtual void testNumeric()
+	  {
+		// floating point, serial, model numbers, ip addresses, etc.
+		// every other segment must have at least one digit
+		assertAnalyzesTo(a, "21.35", new string[]{"21.35"});
+		assertAnalyzesTo(a, "R2D2 C3PO", new string[]{"r2d2", "c3po"});
+		assertAnalyzesTo(a, "216.239.63.104", new string[]{"216.239.63.104"});
+		assertAnalyzesTo(a, "1-2-3", new string[]{"1-2-3"});
+		assertAnalyzesTo(a, "a1-b2-c3", new string[]{"a1-b2-c3"});
+		assertAnalyzesTo(a, "a1-b-c3", new string[]{"a1-b-c3"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTextWithNumbers() throws Exception
+	  public virtual void testTextWithNumbers()
+	  {
+		// numbers
+		assertAnalyzesTo(a, "David has 5000 bones", new string[]{"david", "has", "5000", "bones"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testVariousText() throws Exception
+	  public virtual void testVariousText()
+	  {
+		// various
+		assertAnalyzesTo(a, "C embedded developers wanted", new string[]{"c", "embedded", "developers", "wanted"});
+		assertAnalyzesTo(a, "foo bar FOO BAR", new string[]{"foo", "bar", "foo", "bar"});
+		assertAnalyzesTo(a, "foo      bar .  FOO <> BAR", new string[]{"foo", "bar", "foo", "bar"});
+		assertAnalyzesTo(a, "\"QUOTED\" word", new string[]{"quoted", "word"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testAcronyms() throws Exception
+	  public virtual void testAcronyms()
+	  {
+		// acronyms have their dots stripped
+		assertAnalyzesTo(a, "U.S.A.", new string[]{"usa"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCPlusPlusHash() throws Exception
+	  public virtual void testCPlusPlusHash()
+	  {
+		// It would be nice to change the grammar in StandardTokenizer.jj to make "C#" and "C++" end up as tokens.
+		assertAnalyzesTo(a, "C++", new string[]{"c"});
+		assertAnalyzesTo(a, "C#", new string[]{"c"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testKorean() throws Exception
+	  public virtual void testKorean()
+	  {
+		// Korean words
+		assertAnalyzesTo(a, "안녕하세요 한글입니다", new string[]{"안녕하세요", "한글입니다"});
+	  }
+
+	  // Compliance with the "old" JavaCC-based analyzer, see:
+	  // https://issues.apache.org/jira/browse/LUCENE-966#action_12516752
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testComplianceFileName() throws Exception
+	  public virtual void testComplianceFileName()
+	  {
+		assertAnalyzesTo(a, "2004.jpg", new string[]{"2004.jpg"}, new string[]{"<HOST>"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testComplianceNumericIncorrect() throws Exception
+	  public virtual void testComplianceNumericIncorrect()
+	  {
+		assertAnalyzesTo(a, "62.46", new string[]{"62.46"}, new string[]{"<HOST>"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testComplianceNumericLong() throws Exception
+	  public virtual void testComplianceNumericLong()
+	  {
+		assertAnalyzesTo(a, "978-0-94045043-1", new string[]{"978-0-94045043-1"}, new string[]{"<NUM>"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testComplianceNumericFile() throws Exception
+	  public virtual void testComplianceNumericFile()
+	  {
+		assertAnalyzesTo(a, "78academyawards/rules/rule02.html", new string[]{"78academyawards/rules/rule02.html"}, new string[]{"<NUM>"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testComplianceNumericWithUnderscores() throws Exception
+	  public virtual void testComplianceNumericWithUnderscores()
+	  {
+		assertAnalyzesTo(a, "2006-03-11t082958z_01_ban130523_rtridst_0_ozabs", new string[]{"2006-03-11t082958z_01_ban130523_rtridst_0_ozabs"}, new string[]{"<NUM>"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testComplianceNumericWithDash() throws Exception
+	  public virtual void testComplianceNumericWithDash()
+	  {
+		assertAnalyzesTo(a, "mid-20th", new string[]{"mid-20th"}, new string[]{"<NUM>"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testComplianceManyTokens() throws Exception
+	  public virtual void testComplianceManyTokens()
+	  {
+		assertAnalyzesTo(a, "/money.cnn.com/magazines/fortune/fortune_archive/2007/03/19/8402357/index.htm " + "safari-0-sheikh-zayed-grand-mosque.jpg", new string[]{"money.cnn.com", "magazines", "fortune", "fortune", "archive/2007/03/19/8402357", "index.htm", "safari-0-sheikh", "zayed", "grand", "mosque.jpg"}, new string[]{"<HOST>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<NUM>", "<HOST>", "<NUM>", "<ALPHANUM>", "<ALPHANUM>", "<HOST>"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testJava14BWCompatibility() throws Exception
+	  public virtual void testJava14BWCompatibility()
+	  {
+		ClassicAnalyzer sa = new ClassicAnalyzer(Version.LUCENE_30);
+		assertAnalyzesTo(sa, "test\u02C6test", new string[] {"test", "test"});
+	  }
+
+	  /// <summary>
+	  /// Make sure we skip wicked long terms.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testWickedLongTerm() throws java.io.IOException
+	  public virtual void testWickedLongTerm()
+	  {
+		RAMDirectory dir = new RAMDirectory();
+		IndexWriter writer = new IndexWriter(dir, new IndexWriterConfig(TEST_VERSION_CURRENT, new ClassicAnalyzer(TEST_VERSION_CURRENT)));
+
+		char[] chars = new char[IndexWriter.MAX_TERM_LENGTH];
+		Arrays.fill(chars, 'x');
+		Document doc = new Document();
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final String bigTerm = new String(chars);
+		string bigTerm = new string(chars);
+
+		// This produces a too-long term:
+		string contents = "abc xyz x" + bigTerm + " another term";
+		doc.add(new TextField("content", contents, Field.Store.NO));
+		writer.addDocument(doc);
+
+		// Make sure we can add another normal document
+		doc = new Document();
+		doc.add(new TextField("content", "abc bbb ccc", Field.Store.NO));
+		writer.addDocument(doc);
+		writer.close();
+
+		IndexReader reader = IndexReader.open(dir);
+
+		// Make sure all terms < max size were indexed
+		assertEquals(2, reader.docFreq(new Term("content", "abc")));
+		assertEquals(1, reader.docFreq(new Term("content", "bbb")));
+		assertEquals(1, reader.docFreq(new Term("content", "term")));
+		assertEquals(1, reader.docFreq(new Term("content", "another")));
+
+		// Make sure position is still incremented when
+		// massive term is skipped:
+		DocsAndPositionsEnum tps = MultiFields.getTermPositionsEnum(reader, MultiFields.getLiveDocs(reader), "content", new BytesRef("another"));
+		assertTrue(tps.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
+		assertEquals(1, tps.freq());
+		assertEquals(3, tps.nextPosition());
+
+		// Make sure the doc that has the massive term is in
+		// the index:
+		assertEquals("document with wicked long term should is not in the index!", 2, reader.numDocs());
+
+		reader.close();
+
+		// Make sure we can add a document with exactly the
+		// maximum length term, and search on that term:
+		doc = new Document();
+		doc.add(new TextField("content", bigTerm, Field.Store.NO));
+		ClassicAnalyzer sa = new ClassicAnalyzer(TEST_VERSION_CURRENT);
+		sa.MaxTokenLength = 100000;
+		writer = new IndexWriter(dir, new IndexWriterConfig(TEST_VERSION_CURRENT, sa));
+		writer.addDocument(doc);
+		writer.close();
+		reader = IndexReader.open(dir);
+		assertEquals(1, reader.docFreq(new Term("content", bigTerm)));
+		reader.close();
+
+		dir.close();
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), new ClassicAnalyzer(TEST_VERSION_CURRENT), 1000 * RANDOM_MULTIPLIER);
+	  }
+
+	  /// <summary>
+	  /// blast some random large strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomHugeStrings() throws Exception
+	  public virtual void testRandomHugeStrings()
+	  {
+		Random random = random();
+		checkRandomData(random, new ClassicAnalyzer(TEST_VERSION_CURRENT), 100 * RANDOM_MULTIPLIER, 8192);
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestDuelingAnalyzers.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestDuelingAnalyzers.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestDuelingAnalyzers.cs
new file mode 100644
index 0000000..6155918
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestDuelingAnalyzers.cs
@@ -0,0 +1,302 @@
+using System;
+
+namespace org.apache.lucene.analysis.core
+{
+
+	/*
+	 * 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 CharTermAttribute = org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
+	using OffsetAttribute = org.apache.lucene.analysis.tokenattributes.OffsetAttribute;
+	using PositionIncrementAttribute = org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
+	using LuceneTestCase = org.apache.lucene.util.LuceneTestCase;
+	using TestUtil = org.apache.lucene.util.TestUtil;
+	using Automaton = org.apache.lucene.util.automaton.Automaton;
+	using BasicOperations = org.apache.lucene.util.automaton.BasicOperations;
+	using CharacterRunAutomaton = org.apache.lucene.util.automaton.CharacterRunAutomaton;
+	using State = org.apache.lucene.util.automaton.State;
+	using Transition = org.apache.lucene.util.automaton.Transition;
+
+	/// <summary>
+	/// Compares MockTokenizer (which is simple with no optimizations) with equivalent 
+	/// core tokenizers (that have optimizations like buffering).
+	/// 
+	/// Any tests here need to probably consider unicode version of the JRE (it could
+	/// cause false fails).
+	/// </summary>
+	public class TestDuelingAnalyzers : LuceneTestCase
+	{
+	  private CharacterRunAutomaton jvmLetter;
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Override public void setUp() throws Exception
+	  public override void setUp()
+	  {
+		base.setUp();
+		// build an automaton matching this jvm's letter definition
+		State initial = new State();
+		State accept = new State();
+		accept.Accept = true;
+		for (int i = 0; i <= 0x10FFFF; i++)
+		{
+		  if (char.IsLetter(i))
+		  {
+			initial.addTransition(new Transition(i, i, accept));
+		  }
+		}
+		Automaton single = new Automaton(initial);
+		single.reduce();
+		Automaton repeat = BasicOperations.repeat(single);
+		jvmLetter = new CharacterRunAutomaton(repeat);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testLetterAscii() throws Exception
+	  public virtual void testLetterAscii()
+	  {
+		Random random = random();
+		Analyzer left = new MockAnalyzer(random, jvmLetter, false);
+		Analyzer right = new AnalyzerAnonymousInnerClassHelper(this);
+		for (int i = 0; i < 1000; i++)
+		{
+		  string s = TestUtil.randomSimpleString(random);
+		  assertEquals(s, left.tokenStream("foo", newStringReader(s)), right.tokenStream("foo", newStringReader(s)));
+		}
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestDuelingAnalyzers outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestDuelingAnalyzers outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new LetterTokenizer(TEST_VERSION_CURRENT, reader);
+			return new TokenStreamComponents(tokenizer, tokenizer);
+		  }
+	  }
+
+	  // not so useful since its all one token?!
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testLetterAsciiHuge() throws Exception
+	  public virtual void testLetterAsciiHuge()
+	  {
+		Random random = random();
+		int maxLength = 8192; // CharTokenizer.IO_BUFFER_SIZE*2
+		MockAnalyzer left = new MockAnalyzer(random, jvmLetter, false);
+		left.MaxTokenLength = 255; // match CharTokenizer's max token length
+		Analyzer right = new AnalyzerAnonymousInnerClassHelper2(this);
+		int numIterations = atLeast(50);
+		for (int i = 0; i < numIterations; i++)
+		{
+		  string s = TestUtil.randomSimpleString(random, maxLength);
+		  assertEquals(s, left.tokenStream("foo", newStringReader(s)), right.tokenStream("foo", newStringReader(s)));
+		}
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestDuelingAnalyzers outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestDuelingAnalyzers outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new LetterTokenizer(TEST_VERSION_CURRENT, reader);
+			return new TokenStreamComponents(tokenizer, tokenizer);
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testLetterHtmlish() throws Exception
+	  public virtual void testLetterHtmlish()
+	  {
+		Random random = random();
+		Analyzer left = new MockAnalyzer(random, jvmLetter, false);
+		Analyzer right = new AnalyzerAnonymousInnerClassHelper3(this);
+		for (int i = 0; i < 1000; i++)
+		{
+		  string s = TestUtil.randomHtmlishString(random, 20);
+		  assertEquals(s, left.tokenStream("foo", newStringReader(s)), right.tokenStream("foo", newStringReader(s)));
+		}
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper3 : Analyzer
+	  {
+		  private readonly TestDuelingAnalyzers outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper3(TestDuelingAnalyzers outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new LetterTokenizer(TEST_VERSION_CURRENT, reader);
+			return new TokenStreamComponents(tokenizer, tokenizer);
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testLetterHtmlishHuge() throws Exception
+	  public virtual void testLetterHtmlishHuge()
+	  {
+		Random random = random();
+		int maxLength = 1024; // this is number of elements, not chars!
+		MockAnalyzer left = new MockAnalyzer(random, jvmLetter, false);
+		left.MaxTokenLength = 255; // match CharTokenizer's max token length
+		Analyzer right = new AnalyzerAnonymousInnerClassHelper4(this);
+		int numIterations = atLeast(50);
+		for (int i = 0; i < numIterations; i++)
+		{
+		  string s = TestUtil.randomHtmlishString(random, maxLength);
+		  assertEquals(s, left.tokenStream("foo", newStringReader(s)), right.tokenStream("foo", newStringReader(s)));
+		}
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper4 : Analyzer
+	  {
+		  private readonly TestDuelingAnalyzers outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper4(TestDuelingAnalyzers outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new LetterTokenizer(TEST_VERSION_CURRENT, reader);
+			return new TokenStreamComponents(tokenizer, tokenizer);
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testLetterUnicode() throws Exception
+	  public virtual void testLetterUnicode()
+	  {
+		Random random = random();
+		Analyzer left = new MockAnalyzer(random(), jvmLetter, false);
+		Analyzer right = new AnalyzerAnonymousInnerClassHelper5(this);
+		for (int i = 0; i < 1000; i++)
+		{
+		  string s = TestUtil.randomUnicodeString(random);
+		  assertEquals(s, left.tokenStream("foo", newStringReader(s)), right.tokenStream("foo", newStringReader(s)));
+		}
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper5 : Analyzer
+	  {
+		  private readonly TestDuelingAnalyzers outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper5(TestDuelingAnalyzers outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new LetterTokenizer(TEST_VERSION_CURRENT, reader);
+			return new TokenStreamComponents(tokenizer, tokenizer);
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testLetterUnicodeHuge() throws Exception
+	  public virtual void testLetterUnicodeHuge()
+	  {
+		Random random = random();
+		int maxLength = 4300; // CharTokenizer.IO_BUFFER_SIZE + fudge
+		MockAnalyzer left = new MockAnalyzer(random, jvmLetter, false);
+		left.MaxTokenLength = 255; // match CharTokenizer's max token length
+		Analyzer right = new AnalyzerAnonymousInnerClassHelper6(this);
+		int numIterations = atLeast(50);
+		for (int i = 0; i < numIterations; i++)
+		{
+		  string s = TestUtil.randomUnicodeString(random, maxLength);
+		  assertEquals(s, left.tokenStream("foo", newStringReader(s)), right.tokenStream("foo", newStringReader(s)));
+		}
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper6 : Analyzer
+	  {
+		  private readonly TestDuelingAnalyzers outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper6(TestDuelingAnalyzers outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new LetterTokenizer(TEST_VERSION_CURRENT, reader);
+			return new TokenStreamComponents(tokenizer, tokenizer);
+		  }
+	  }
+
+	  // we only check a few core attributes here.
+	  // TODO: test other things
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void assertEquals(String s, org.apache.lucene.analysis.TokenStream left, org.apache.lucene.analysis.TokenStream right) throws Exception
+	  public virtual void assertEquals(string s, TokenStream left, TokenStream right)
+	  {
+		left.reset();
+		right.reset();
+		CharTermAttribute leftTerm = left.addAttribute(typeof(CharTermAttribute));
+		CharTermAttribute rightTerm = right.addAttribute(typeof(CharTermAttribute));
+		OffsetAttribute leftOffset = left.addAttribute(typeof(OffsetAttribute));
+		OffsetAttribute rightOffset = right.addAttribute(typeof(OffsetAttribute));
+		PositionIncrementAttribute leftPos = left.addAttribute(typeof(PositionIncrementAttribute));
+		PositionIncrementAttribute rightPos = right.addAttribute(typeof(PositionIncrementAttribute));
+
+		while (left.incrementToken())
+		{
+		  assertTrue("wrong number of tokens for input: " + s, right.incrementToken());
+		  assertEquals("wrong term text for input: " + s, leftTerm.ToString(), rightTerm.ToString());
+		  assertEquals("wrong position for input: " + s, leftPos.PositionIncrement, rightPos.PositionIncrement);
+		  assertEquals("wrong start offset for input: " + s, leftOffset.startOffset(), rightOffset.startOffset());
+		  assertEquals("wrong end offset for input: " + s, leftOffset.endOffset(), rightOffset.endOffset());
+		};
+		assertFalse("wrong number of tokens for input: " + s, right.incrementToken());
+		left.end();
+		right.end();
+		assertEquals("wrong final offset for input: " + s, leftOffset.endOffset(), rightOffset.endOffset());
+		left.close();
+		right.close();
+	  }
+
+	  // TODO: maybe push this out to TestUtil or LuceneTestCase and always use it instead?
+	  private static Reader newStringReader(string s)
+	  {
+		Random random = random();
+		Reader r = new StringReader(s);
+		if (random.nextBoolean())
+		{
+		  r = new MockReaderWrapper(random, r);
+		}
+		return r;
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestFactories.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestFactories.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestFactories.cs
new file mode 100644
index 0000000..8af7962
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestFactories.cs
@@ -0,0 +1,263 @@
+using System;
+using System.Diagnostics;
+using System.Collections;
+using System.Collections.Generic;
+
+namespace org.apache.lucene.analysis.core
+{
+
+	/*
+	 * 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 AbstractAnalysisFactory = org.apache.lucene.analysis.util.AbstractAnalysisFactory;
+	using CharFilterFactory = org.apache.lucene.analysis.util.CharFilterFactory;
+	using MultiTermAwareComponent = org.apache.lucene.analysis.util.MultiTermAwareComponent;
+	using ResourceLoaderAware = org.apache.lucene.analysis.util.ResourceLoaderAware;
+	using StringMockResourceLoader = org.apache.lucene.analysis.util.StringMockResourceLoader;
+	using TokenFilterFactory = org.apache.lucene.analysis.util.TokenFilterFactory;
+	using TokenizerFactory = org.apache.lucene.analysis.util.TokenizerFactory;
+	using AttributeFactory = org.apache.lucene.util.AttributeSource.AttributeFactory;
+
+	/// <summary>
+	/// Sanity check some things about all factories,
+	/// we do our best to see if we can sanely initialize it with
+	/// no parameters and smoke test it, etc.
+	/// </summary>
+	// TODO: move this, TestRandomChains, and TestAllAnalyzersHaveFactories
+	// to an integration test module that sucks in all analysis modules.
+	// currently the only way to do this is via eclipse etc (LUCENE-3974)
+	public class TestFactories : BaseTokenStreamTestCase
+	{
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void test() throws java.io.IOException
+	  public virtual void test()
+	  {
+		foreach (string tokenizer in TokenizerFactory.availableTokenizers())
+		{
+		  doTestTokenizer(tokenizer);
+		}
+
+		foreach (string tokenFilter in TokenFilterFactory.availableTokenFilters())
+		{
+		  doTestTokenFilter(tokenFilter);
+		}
+
+		foreach (string charFilter in CharFilterFactory.availableCharFilters())
+		{
+		  doTestCharFilter(charFilter);
+		}
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: private void doTestTokenizer(String tokenizer) throws java.io.IOException
+	  private void doTestTokenizer(string tokenizer)
+	  {
+//JAVA TO C# CONVERTER TODO TASK: Java wildcard generics are not converted to .NET:
+//ORIGINAL LINE: Class<? extends org.apache.lucene.analysis.util.TokenizerFactory> factoryClazz = org.apache.lucene.analysis.util.TokenizerFactory.lookupClass(tokenizer);
+		Type<?> factoryClazz = TokenizerFactory.lookupClass(tokenizer);
+		TokenizerFactory factory = (TokenizerFactory) initialize(factoryClazz);
+		if (factory != null)
+		{
+		  // we managed to fully create an instance. check a few more things:
+
+		  // if it implements MultiTermAware, sanity check its impl
+		  if (factory is MultiTermAwareComponent)
+		  {
+			AbstractAnalysisFactory mtc = ((MultiTermAwareComponent) factory).MultiTermComponent;
+			assertNotNull(mtc);
+			// its not ok to return e.g. a charfilter here: but a tokenizer could wrap a filter around it
+			assertFalse(mtc is CharFilterFactory);
+		  }
+
+		  // beast it just a little, it shouldnt throw exceptions:
+		  // (it should have thrown them in initialize)
+		  checkRandomData(random(), new FactoryAnalyzer(factory, null, null), 100, 20, false, false);
+		}
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: private void doTestTokenFilter(String tokenfilter) throws java.io.IOException
+	  private void doTestTokenFilter(string tokenfilter)
+	  {
+//JAVA TO C# CONVERTER TODO TASK: Java wildcard generics are not converted to .NET:
+//ORIGINAL LINE: Class<? extends org.apache.lucene.analysis.util.TokenFilterFactory> factoryClazz = org.apache.lucene.analysis.util.TokenFilterFactory.lookupClass(tokenfilter);
+		Type<?> factoryClazz = TokenFilterFactory.lookupClass(tokenfilter);
+		TokenFilterFactory factory = (TokenFilterFactory) initialize(factoryClazz);
+		if (factory != null)
+		{
+		  // we managed to fully create an instance. check a few more things:
+
+		  // if it implements MultiTermAware, sanity check its impl
+		  if (factory is MultiTermAwareComponent)
+		  {
+			AbstractAnalysisFactory mtc = ((MultiTermAwareComponent) factory).MultiTermComponent;
+			assertNotNull(mtc);
+			// its not ok to return a charfilter or tokenizer here, this makes no sense
+			assertTrue(mtc is TokenFilterFactory);
+		  }
+
+		  // beast it just a little, it shouldnt throw exceptions:
+		  // (it should have thrown them in initialize)
+		  checkRandomData(random(), new FactoryAnalyzer(assertingTokenizer, factory, null), 100, 20, false, false);
+		}
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: private void doTestCharFilter(String charfilter) throws java.io.IOException
+	  private void doTestCharFilter(string charfilter)
+	  {
+//JAVA TO C# CONVERTER TODO TASK: Java wildcard generics are not converted to .NET:
+//ORIGINAL LINE: Class<? extends org.apache.lucene.analysis.util.CharFilterFactory> factoryClazz = org.apache.lucene.analysis.util.CharFilterFactory.lookupClass(charfilter);
+		Type<?> factoryClazz = CharFilterFactory.lookupClass(charfilter);
+		CharFilterFactory factory = (CharFilterFactory) initialize(factoryClazz);
+		if (factory != null)
+		{
+		  // we managed to fully create an instance. check a few more things:
+
+		  // if it implements MultiTermAware, sanity check its impl
+		  if (factory is MultiTermAwareComponent)
+		  {
+			AbstractAnalysisFactory mtc = ((MultiTermAwareComponent) factory).MultiTermComponent;
+			assertNotNull(mtc);
+			// its not ok to return a tokenizer or tokenfilter here, this makes no sense
+			assertTrue(mtc is CharFilterFactory);
+		  }
+
+		  // beast it just a little, it shouldnt throw exceptions:
+		  // (it should have thrown them in initialize)
+		  checkRandomData(random(), new FactoryAnalyzer(assertingTokenizer, null, factory), 100, 20, false, false);
+		}
+	  }
+
+	  /// <summary>
+	  /// tries to initialize a factory with no arguments </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: private org.apache.lucene.analysis.util.AbstractAnalysisFactory initialize(Class<? extends org.apache.lucene.analysis.util.AbstractAnalysisFactory> factoryClazz) throws java.io.IOException
+	  private AbstractAnalysisFactory initialize<T1>(Type<T1> factoryClazz) where T1 : org.apache.lucene.analysis.util.AbstractAnalysisFactory
+	  {
+		IDictionary<string, string> args = new Dictionary<string, string>();
+		args["luceneMatchVersion"] = TEST_VERSION_CURRENT.ToString();
+//JAVA TO C# CONVERTER TODO TASK: Java wildcard generics are not converted to .NET:
+//ORIGINAL LINE: Constructor<? extends org.apache.lucene.analysis.util.AbstractAnalysisFactory> ctor;
+		Constructor<?> ctor;
+		try
+		{
+		  ctor = factoryClazz.GetConstructor(typeof(IDictionary));
+		}
+		catch (Exception)
+		{
+		  throw new Exception("factory '" + factoryClazz + "' does not have a proper ctor!");
+		}
+
+		AbstractAnalysisFactory factory = null;
+		try
+		{
+		  factory = ctor.newInstance(args);
+		}
+		catch (InstantiationException e)
+		{
+		  throw new Exception(e);
+		}
+		catch (IllegalAccessException e)
+		{
+		  throw new Exception(e);
+		}
+		catch (InvocationTargetException e)
+		{
+		  if (e.InnerException is System.ArgumentException)
+		  {
+			// its ok if we dont provide the right parameters to throw this
+			return null;
+		  }
+		}
+
+		if (factory is ResourceLoaderAware)
+		{
+		  try
+		  {
+			((ResourceLoaderAware) factory).inform(new StringMockResourceLoader(""));
+		  }
+		  catch (IOException)
+		  {
+			// its ok if the right files arent available or whatever to throw this
+		  }
+		  catch (System.ArgumentException)
+		  {
+			// is this ok? I guess so
+		  }
+		}
+		return factory;
+	  }
+
+	  // some silly classes just so we can use checkRandomData
+	  private TokenizerFactory assertingTokenizer = new TokenizerFactoryAnonymousInnerClassHelper(new Dictionary<string, string>());
+
+	  private class TokenizerFactoryAnonymousInnerClassHelper : TokenizerFactory
+	  {
+		  public TokenizerFactoryAnonymousInnerClassHelper(Dictionary<string, string> java) : base(Hashtable<string, string>)
+		  {
+		  }
+
+		  public override MockTokenizer create(AttributeFactory factory, Reader input)
+		  {
+			return new MockTokenizer(factory, input);
+		  }
+	  }
+
+	  private class FactoryAnalyzer : Analyzer
+	  {
+		internal readonly TokenizerFactory tokenizer;
+		internal readonly CharFilterFactory charFilter;
+		internal readonly TokenFilterFactory tokenfilter;
+
+		internal FactoryAnalyzer(TokenizerFactory tokenizer, TokenFilterFactory tokenfilter, CharFilterFactory charFilter)
+		{
+		  Debug.Assert(tokenizer != null);
+		  this.tokenizer = tokenizer;
+		  this.charFilter = charFilter;
+		  this.tokenfilter = tokenfilter;
+		}
+
+		protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		{
+		  Tokenizer tf = tokenizer.create(reader);
+		  if (tokenfilter != null)
+		  {
+			return new TokenStreamComponents(tf, tokenfilter.create(tf));
+		  }
+		  else
+		  {
+			return new TokenStreamComponents(tf);
+		  }
+		}
+
+		protected internal override Reader initReader(string fieldName, Reader reader)
+		{
+		  if (charFilter != null)
+		  {
+			return charFilter.create(reader);
+		  }
+		  else
+		  {
+			return reader;
+		  }
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestKeywordAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestKeywordAnalyzer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestKeywordAnalyzer.cs
new file mode 100644
index 0000000..ecde6df
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestKeywordAnalyzer.cs
@@ -0,0 +1,143 @@
+namespace org.apache.lucene.analysis.core
+{
+
+	/*
+	 * 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 OffsetAttribute = org.apache.lucene.analysis.tokenattributes.OffsetAttribute;
+	using Document = org.apache.lucene.document.Document;
+	using Field = org.apache.lucene.document.Field;
+	using StringField = org.apache.lucene.document.StringField;
+	using TextField = org.apache.lucene.document.TextField;
+	using DirectoryReader = org.apache.lucene.index.DirectoryReader;
+	using DocsEnum = org.apache.lucene.index.DocsEnum;
+	using IndexReader = org.apache.lucene.index.IndexReader;
+	using IndexWriter = org.apache.lucene.index.IndexWriter;
+	using IndexWriterConfig = org.apache.lucene.index.IndexWriterConfig;
+	using MultiFields = org.apache.lucene.index.MultiFields;
+	using DocIdSetIterator = org.apache.lucene.search.DocIdSetIterator;
+	using IndexSearcher = org.apache.lucene.search.IndexSearcher;
+	using Directory = org.apache.lucene.store.Directory;
+	using RAMDirectory = org.apache.lucene.store.RAMDirectory;
+	using BytesRef = org.apache.lucene.util.BytesRef;
+	using IOUtils = org.apache.lucene.util.IOUtils;
+	using TestUtil = org.apache.lucene.util.TestUtil;
+
+	public class TestKeywordAnalyzer : BaseTokenStreamTestCase
+	{
+
+	  private Directory directory;
+	  private IndexSearcher searcher;
+	  private IndexReader reader;
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Override public void setUp() throws Exception
+	  public override void setUp()
+	  {
+		base.setUp();
+		directory = newDirectory();
+		IndexWriter writer = new IndexWriter(directory, new IndexWriterConfig(TEST_VERSION_CURRENT, new SimpleAnalyzer(TEST_VERSION_CURRENT)));
+
+		Document doc = new Document();
+		doc.add(new StringField("partnum", "Q36", Field.Store.YES));
+		doc.add(new TextField("description", "Illidium Space Modulator", Field.Store.YES));
+		writer.addDocument(doc);
+
+		writer.close();
+
+		reader = DirectoryReader.open(directory);
+		searcher = newSearcher(reader);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Override public void tearDown() throws Exception
+	  public override void tearDown()
+	  {
+		reader.close();
+		directory.close();
+		base.tearDown();
+	  }
+
+	  /*
+	  public void testPerFieldAnalyzer() throws Exception {
+	    PerFieldAnalyzerWrapper analyzer = new PerFieldAnalyzerWrapper(new SimpleAnalyzer(TEST_VERSION_CURRENT));
+	    analyzer.addAnalyzer("partnum", new KeywordAnalyzer());
+	
+	    QueryParser queryParser = new QueryParser(TEST_VERSION_CURRENT, "description", analyzer);
+	    Query query = queryParser.parse("partnum:Q36 AND SPACE");
+	
+	    ScoreDoc[] hits = searcher.search(query, null, 1000).scoreDocs;
+	    assertEquals("Q36 kept as-is",
+	              "+partnum:Q36 +space", query.toString("description"));
+	    assertEquals("doc found!", 1, hits.length);
+	  }
+	  */
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMutipleDocument() throws Exception
+	  public virtual void testMutipleDocument()
+	  {
+		RAMDirectory dir = new RAMDirectory();
+		IndexWriter writer = new IndexWriter(dir, new IndexWriterConfig(TEST_VERSION_CURRENT, new KeywordAnalyzer()));
+		Document doc = new Document();
+		doc.add(new TextField("partnum", "Q36", Field.Store.YES));
+		writer.addDocument(doc);
+		doc = new Document();
+		doc.add(new TextField("partnum", "Q37", Field.Store.YES));
+		writer.addDocument(doc);
+		writer.close();
+
+		IndexReader reader = DirectoryReader.open(dir);
+		DocsEnum td = TestUtil.docs(random(), reader, "partnum", new BytesRef("Q36"), MultiFields.getLiveDocs(reader), null, 0);
+		assertTrue(td.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
+		td = TestUtil.docs(random(), reader, "partnum", new BytesRef("Q37"), MultiFields.getLiveDocs(reader), null, 0);
+		assertTrue(td.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
+	  }
+
+	  // LUCENE-1441
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testOffsets() throws Exception
+	  public virtual void testOffsets()
+	  {
+		TokenStream stream = (new KeywordAnalyzer()).tokenStream("field", new StringReader("abcd"));
+		try
+		{
+		  OffsetAttribute offsetAtt = stream.addAttribute(typeof(OffsetAttribute));
+		  stream.reset();
+		  assertTrue(stream.incrementToken());
+		  assertEquals(0, offsetAtt.startOffset());
+		  assertEquals(4, offsetAtt.endOffset());
+		  assertFalse(stream.incrementToken());
+		  stream.end();
+		}
+		finally
+		{
+		  IOUtils.closeWhileHandlingException(stream);
+		}
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), new KeywordAnalyzer(), 1000 * RANDOM_MULTIPLIER);
+	  }
+	}
+
+}
\ No newline at end of file


[09/27] lucenenet git commit: adding converted analysis common tests

Posted by sy...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/No/TestNorwegianMinimalStemFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/No/TestNorwegianMinimalStemFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/No/TestNorwegianMinimalStemFilter.cs
new file mode 100644
index 0000000..50d744a
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/No/TestNorwegianMinimalStemFilter.cs
@@ -0,0 +1,156 @@
+using System;
+
+namespace org.apache.lucene.analysis.no
+{
+
+	/*
+	 * 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 KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+	using SetKeywordMarkerFilter = org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter;
+	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+
+//JAVA TO C# CONVERTER TODO TASK: This Java 'import static' statement cannot be converted to C#:
+//	import static org.apache.lucene.analysis.VocabularyAssert.*;
+//JAVA TO C# CONVERTER TODO TASK: This Java 'import static' statement cannot be converted to C#:
+//	import static org.apache.lucene.analysis.no.NorwegianLightStemmer.BOKMAAL;
+//JAVA TO C# CONVERTER TODO TASK: This Java 'import static' statement cannot be converted to C#:
+//	import static org.apache.lucene.analysis.no.NorwegianLightStemmer.NYNORSK;
+
+	/// <summary>
+	/// Simple tests for <seealso cref="NorwegianMinimalStemFilter"/>
+	/// </summary>
+	public class TestNorwegianMinimalStemFilter : BaseTokenStreamTestCase
+	{
+	  private Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper();
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  public AnalyzerAnonymousInnerClassHelper()
+		  {
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer source = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(source, new NorwegianMinimalStemFilter(source, BOKMAAL));
+		  }
+	  }
+
+	  /// <summary>
+	  /// Test against a Bokmål vocabulary file </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testVocabulary() throws java.io.IOException
+	  public virtual void testVocabulary()
+	  {
+		assertVocabulary(analyzer, new System.IO.FileStream(getDataFile("nb_minimal.txt"), System.IO.FileMode.Open, System.IO.FileAccess.Read));
+	  }
+
+	  /// <summary>
+	  /// Test against a Nynorsk vocabulary file </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNynorskVocabulary() throws java.io.IOException
+	  public virtual void testNynorskVocabulary()
+	  {
+		Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper2(this);
+		assertVocabulary(analyzer, new System.IO.FileStream(getDataFile("nn_minimal.txt"), System.IO.FileMode.Open, System.IO.FileAccess.Read));
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestNorwegianMinimalStemFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestNorwegianMinimalStemFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer source = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(source, new NorwegianMinimalStemFilter(source, NYNORSK));
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testKeyword() throws java.io.IOException
+	  public virtual void testKeyword()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.util.CharArraySet exclusionSet = new org.apache.lucene.analysis.util.CharArraySet(TEST_VERSION_CURRENT, asSet("sekretæren"), false);
+		CharArraySet exclusionSet = new CharArraySet(TEST_VERSION_CURRENT, asSet("sekretæren"), false);
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper3(this, exclusionSet);
+		checkOneTerm(a, "sekretæren", "sekretæren");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper3 : Analyzer
+	  {
+		  private readonly TestNorwegianMinimalStemFilter outerInstance;
+
+		  private CharArraySet exclusionSet;
+
+		  public AnalyzerAnonymousInnerClassHelper3(TestNorwegianMinimalStemFilter outerInstance, CharArraySet exclusionSet)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.exclusionSet = exclusionSet;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer source = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			TokenStream sink = new SetKeywordMarkerFilter(source, exclusionSet);
+			return new TokenStreamComponents(source, new NorwegianMinimalStemFilter(sink));
+		  }
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		Random random = random();
+		checkRandomData(random, analyzer, 1000 * RANDOM_MULTIPLIER);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper4(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper4 : Analyzer
+	  {
+		  private readonly TestNorwegianMinimalStemFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper4(TestNorwegianMinimalStemFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new NorwegianMinimalStemFilter(tokenizer));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/No/TestNorwegianMinimalStemFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/No/TestNorwegianMinimalStemFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/No/TestNorwegianMinimalStemFilterFactory.cs
new file mode 100644
index 0000000..2deaf8d
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/No/TestNorwegianMinimalStemFilterFactory.cs
@@ -0,0 +1,81 @@
+namespace org.apache.lucene.analysis.no
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the Norwegian Minimal stem factory is working.
+	/// </summary>
+	public class TestNorwegianMinimalStemFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStemming() throws Exception
+	  public virtual void testStemming()
+	  {
+		Reader reader = new StringReader("eple eplet epler eplene eplets eplenes");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("NorwegianMinimalStem").create(stream);
+		assertTokenStreamContents(stream, new string[] {"epl", "epl", "epl", "epl", "epl", "epl"});
+	  }
+
+	  /// <summary>
+	  /// Test stemming with variant set explicitly to Bokmål </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBokmaalStemming() throws Exception
+	  public virtual void testBokmaalStemming()
+	  {
+		Reader reader = new StringReader("eple eplet epler eplene eplets eplenes");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("NorwegianMinimalStem", "variant", "nb").create(stream);
+		assertTokenStreamContents(stream, new string[] {"epl", "epl", "epl", "epl", "epl", "epl"});
+	  }
+
+	  /// <summary>
+	  /// Test stemming with variant set explicitly to Nynorsk </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNynorskStemming() throws Exception
+	  public virtual void testNynorskStemming()
+	  {
+		Reader reader = new StringReader("gut guten gutar gutane gutens gutanes");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("NorwegianMinimalStem", "variant", "nn").create(stream);
+		assertTokenStreamContents(stream, new string[] {"gut", "gut", "gut", "gut", "gut", "gut"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("NorwegianMinimalStem", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Path/TestPathHierarchyTokenizer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Path/TestPathHierarchyTokenizer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Path/TestPathHierarchyTokenizer.cs
new file mode 100644
index 0000000..491d008
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Path/TestPathHierarchyTokenizer.cs
@@ -0,0 +1,223 @@
+using System;
+
+namespace org.apache.lucene.analysis.path
+{
+
+	/*
+	 * 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 MappingCharFilter = org.apache.lucene.analysis.charfilter.MappingCharFilter;
+	using NormalizeCharMap = org.apache.lucene.analysis.charfilter.NormalizeCharMap;
+
+	public class TestPathHierarchyTokenizer : BaseTokenStreamTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBasic() throws Exception
+	  public virtual void testBasic()
+	  {
+		string path = "/a/b/c";
+		PathHierarchyTokenizer t = new PathHierarchyTokenizer(new StringReader(path));
+		assertTokenStreamContents(t, new string[]{"/a", "/a/b", "/a/b/c"}, new int[]{0, 0, 0}, new int[]{2, 4, 6}, new int[]{1, 0, 0}, path.Length);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEndOfDelimiter() throws Exception
+	  public virtual void testEndOfDelimiter()
+	  {
+		string path = "/a/b/c/";
+		PathHierarchyTokenizer t = new PathHierarchyTokenizer(new StringReader(path));
+		assertTokenStreamContents(t, new string[]{"/a", "/a/b", "/a/b/c", "/a/b/c/"}, new int[]{0, 0, 0, 0}, new int[]{2, 4, 6, 7}, new int[]{1, 0, 0, 0}, path.Length);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStartOfChar() throws Exception
+	  public virtual void testStartOfChar()
+	  {
+		string path = "a/b/c";
+		PathHierarchyTokenizer t = new PathHierarchyTokenizer(new StringReader(path));
+		assertTokenStreamContents(t, new string[]{"a", "a/b", "a/b/c"}, new int[]{0, 0, 0}, new int[]{1, 3, 5}, new int[]{1, 0, 0}, path.Length);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStartOfCharEndOfDelimiter() throws Exception
+	  public virtual void testStartOfCharEndOfDelimiter()
+	  {
+		string path = "a/b/c/";
+		PathHierarchyTokenizer t = new PathHierarchyTokenizer(new StringReader(path));
+		assertTokenStreamContents(t, new string[]{"a", "a/b", "a/b/c", "a/b/c/"}, new int[]{0, 0, 0, 0}, new int[]{1, 3, 5, 6}, new int[]{1, 0, 0, 0}, path.Length);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testOnlyDelimiter() throws Exception
+	  public virtual void testOnlyDelimiter()
+	  {
+		string path = "/";
+		PathHierarchyTokenizer t = new PathHierarchyTokenizer(new StringReader(path));
+		assertTokenStreamContents(t, new string[]{"/"}, new int[]{0}, new int[]{1}, new int[]{1}, path.Length);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testOnlyDelimiters() throws Exception
+	  public virtual void testOnlyDelimiters()
+	  {
+		string path = "//";
+		PathHierarchyTokenizer t = new PathHierarchyTokenizer(new StringReader(path));
+		assertTokenStreamContents(t, new string[]{"/", "//"}, new int[]{0, 0}, new int[]{1, 2}, new int[]{1, 0}, path.Length);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testReplace() throws Exception
+	  public virtual void testReplace()
+	  {
+		string path = "/a/b/c";
+		PathHierarchyTokenizer t = new PathHierarchyTokenizer(new StringReader(path), '/', '\\');
+		assertTokenStreamContents(t, new string[]{"\\a", "\\a\\b", "\\a\\b\\c"}, new int[]{0, 0, 0}, new int[]{2, 4, 6}, new int[]{1, 0, 0}, path.Length);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testWindowsPath() throws Exception
+	  public virtual void testWindowsPath()
+	  {
+		string path = "c:\\a\\b\\c";
+		PathHierarchyTokenizer t = new PathHierarchyTokenizer(new StringReader(path), '\\', '\\');
+		assertTokenStreamContents(t, new string[]{"c:", "c:\\a", "c:\\a\\b", "c:\\a\\b\\c"}, new int[]{0, 0, 0, 0}, new int[]{2, 4, 6, 8}, new int[]{1, 0, 0, 0}, path.Length);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNormalizeWinDelimToLinuxDelim() throws Exception
+	  public virtual void testNormalizeWinDelimToLinuxDelim()
+	  {
+		NormalizeCharMap.Builder builder = new NormalizeCharMap.Builder();
+		builder.add("\\", "/");
+		NormalizeCharMap normMap = builder.build();
+		string path = "c:\\a\\b\\c";
+		Reader cs = new MappingCharFilter(normMap, new StringReader(path));
+		PathHierarchyTokenizer t = new PathHierarchyTokenizer(cs);
+		assertTokenStreamContents(t, new string[]{"c:", "c:/a", "c:/a/b", "c:/a/b/c"}, new int[]{0, 0, 0, 0}, new int[]{2, 4, 6, 8}, new int[]{1, 0, 0, 0}, path.Length);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBasicSkip() throws Exception
+	  public virtual void testBasicSkip()
+	  {
+		string path = "/a/b/c";
+		PathHierarchyTokenizer t = new PathHierarchyTokenizer(new StringReader(path), 1);
+		assertTokenStreamContents(t, new string[]{"/b", "/b/c"}, new int[]{2, 2}, new int[]{4, 6}, new int[]{1, 0}, path.Length);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEndOfDelimiterSkip() throws Exception
+	  public virtual void testEndOfDelimiterSkip()
+	  {
+		string path = "/a/b/c/";
+		PathHierarchyTokenizer t = new PathHierarchyTokenizer(new StringReader(path), 1);
+		assertTokenStreamContents(t, new string[]{"/b", "/b/c", "/b/c/"}, new int[]{2, 2, 2}, new int[]{4, 6, 7}, new int[]{1, 0, 0}, path.Length);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStartOfCharSkip() throws Exception
+	  public virtual void testStartOfCharSkip()
+	  {
+		string path = "a/b/c";
+		PathHierarchyTokenizer t = new PathHierarchyTokenizer(new StringReader(path), 1);
+		assertTokenStreamContents(t, new string[]{"/b", "/b/c"}, new int[]{1, 1}, new int[]{3, 5}, new int[]{1, 0}, path.Length);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStartOfCharEndOfDelimiterSkip() throws Exception
+	  public virtual void testStartOfCharEndOfDelimiterSkip()
+	  {
+		string path = "a/b/c/";
+		PathHierarchyTokenizer t = new PathHierarchyTokenizer(new StringReader(path), 1);
+		assertTokenStreamContents(t, new string[]{"/b", "/b/c", "/b/c/"}, new int[]{1, 1, 1}, new int[]{3, 5, 6}, new int[]{1, 0, 0}, path.Length);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testOnlyDelimiterSkip() throws Exception
+	  public virtual void testOnlyDelimiterSkip()
+	  {
+		string path = "/";
+		PathHierarchyTokenizer t = new PathHierarchyTokenizer(new StringReader(path), 1);
+		assertTokenStreamContents(t, new string[]{}, new int[]{}, new int[]{}, new int[]{}, path.Length);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testOnlyDelimitersSkip() throws Exception
+	  public virtual void testOnlyDelimitersSkip()
+	  {
+		string path = "//";
+		PathHierarchyTokenizer t = new PathHierarchyTokenizer(new StringReader(path), 1);
+		assertTokenStreamContents(t, new string[]{"/"}, new int[]{1}, new int[]{2}, new int[]{1}, path.Length);
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper(this);
+		checkRandomData(random(), a, 1000 * RANDOM_MULTIPLIER);
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestPathHierarchyTokenizer outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestPathHierarchyTokenizer outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new PathHierarchyTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, tokenizer);
+		  }
+	  }
+
+	  /// <summary>
+	  /// blast some random large strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomHugeStrings() throws Exception
+	  public virtual void testRandomHugeStrings()
+	  {
+		Random random = random();
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper2(this);
+		checkRandomData(random, a, 100 * RANDOM_MULTIPLIER, 1027);
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestPathHierarchyTokenizer outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestPathHierarchyTokenizer outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new PathHierarchyTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, tokenizer);
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Path/TestReversePathHierarchyTokenizer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Path/TestReversePathHierarchyTokenizer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Path/TestReversePathHierarchyTokenizer.cs
new file mode 100644
index 0000000..a33bf5e
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Path/TestReversePathHierarchyTokenizer.cs
@@ -0,0 +1,191 @@
+using System;
+
+namespace org.apache.lucene.analysis.path
+{
+
+	/*
+	 * 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 TokenStreamComponents = org.apache.lucene.analysis.Analyzer.TokenStreamComponents;
+
+	public class TestReversePathHierarchyTokenizer : BaseTokenStreamTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBasicReverse() throws Exception
+	  public virtual void testBasicReverse()
+	  {
+		string path = "/a/b/c";
+		ReversePathHierarchyTokenizer t = new ReversePathHierarchyTokenizer(new StringReader(path));
+		assertTokenStreamContents(t, new string[]{"/a/b/c", "a/b/c", "b/c", "c"}, new int[]{0, 1, 3, 5}, new int[]{6, 6, 6, 6}, new int[]{1, 0, 0, 0}, path.Length);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEndOfDelimiterReverse() throws Exception
+	  public virtual void testEndOfDelimiterReverse()
+	  {
+		string path = "/a/b/c/";
+		ReversePathHierarchyTokenizer t = new ReversePathHierarchyTokenizer(new StringReader(path));
+		assertTokenStreamContents(t, new string[]{"/a/b/c/", "a/b/c/", "b/c/", "c/"}, new int[]{0, 1, 3, 5}, new int[]{7, 7, 7, 7}, new int[]{1, 0, 0, 0}, path.Length);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStartOfCharReverse() throws Exception
+	  public virtual void testStartOfCharReverse()
+	  {
+		string path = "a/b/c";
+		ReversePathHierarchyTokenizer t = new ReversePathHierarchyTokenizer(new StringReader(path));
+		assertTokenStreamContents(t, new string[]{"a/b/c", "b/c", "c"}, new int[]{0, 2, 4}, new int[]{5, 5, 5}, new int[]{1, 0, 0}, path.Length);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStartOfCharEndOfDelimiterReverse() throws Exception
+	  public virtual void testStartOfCharEndOfDelimiterReverse()
+	  {
+		string path = "a/b/c/";
+		ReversePathHierarchyTokenizer t = new ReversePathHierarchyTokenizer(new StringReader(path));
+		assertTokenStreamContents(t, new string[]{"a/b/c/", "b/c/", "c/"}, new int[]{0, 2, 4}, new int[]{6, 6, 6}, new int[]{1, 0, 0}, path.Length);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testOnlyDelimiterReverse() throws Exception
+	  public virtual void testOnlyDelimiterReverse()
+	  {
+		string path = "/";
+		ReversePathHierarchyTokenizer t = new ReversePathHierarchyTokenizer(new StringReader(path));
+		assertTokenStreamContents(t, new string[]{"/"}, new int[]{0}, new int[]{1}, new int[]{1}, path.Length);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testOnlyDelimitersReverse() throws Exception
+	  public virtual void testOnlyDelimitersReverse()
+	  {
+		string path = "//";
+		ReversePathHierarchyTokenizer t = new ReversePathHierarchyTokenizer(new StringReader(path));
+		assertTokenStreamContents(t, new string[]{"//", "/"}, new int[]{0, 1}, new int[]{2, 2}, new int[]{1, 0}, path.Length);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEndOfDelimiterReverseSkip() throws Exception
+	  public virtual void testEndOfDelimiterReverseSkip()
+	  {
+		string path = "/a/b/c/";
+		ReversePathHierarchyTokenizer t = new ReversePathHierarchyTokenizer(new StringReader(path), 1);
+		assertTokenStreamContents(t, new string[]{"/a/b/", "a/b/", "b/"}, new int[]{0, 1, 3}, new int[]{5, 5, 5}, new int[]{1, 0, 0}, path.Length);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStartOfCharReverseSkip() throws Exception
+	  public virtual void testStartOfCharReverseSkip()
+	  {
+		string path = "a/b/c";
+		ReversePathHierarchyTokenizer t = new ReversePathHierarchyTokenizer(new StringReader(path), 1);
+		assertTokenStreamContents(t, new string[]{"a/b/", "b/"}, new int[]{0, 2}, new int[]{4, 4}, new int[]{1, 0}, path.Length);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStartOfCharEndOfDelimiterReverseSkip() throws Exception
+	  public virtual void testStartOfCharEndOfDelimiterReverseSkip()
+	  {
+		string path = "a/b/c/";
+		ReversePathHierarchyTokenizer t = new ReversePathHierarchyTokenizer(new StringReader(path), 1);
+		assertTokenStreamContents(t, new string[]{"a/b/", "b/"}, new int[]{0, 2}, new int[]{4, 4}, new int[]{1, 0}, path.Length);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testOnlyDelimiterReverseSkip() throws Exception
+	  public virtual void testOnlyDelimiterReverseSkip()
+	  {
+		string path = "/";
+		ReversePathHierarchyTokenizer t = new ReversePathHierarchyTokenizer(new StringReader(path), 1);
+		assertTokenStreamContents(t, new string[]{}, new int[]{}, new int[]{}, new int[]{}, path.Length);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testOnlyDelimitersReverseSkip() throws Exception
+	  public virtual void testOnlyDelimitersReverseSkip()
+	  {
+		string path = "//";
+		ReversePathHierarchyTokenizer t = new ReversePathHierarchyTokenizer(new StringReader(path), 1);
+		assertTokenStreamContents(t, new string[]{"/"}, new int[]{0}, new int[]{1}, new int[]{1}, path.Length);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testReverseSkip2() throws Exception
+	  public virtual void testReverseSkip2()
+	  {
+		string path = "/a/b/c/";
+		ReversePathHierarchyTokenizer t = new ReversePathHierarchyTokenizer(new StringReader(path), 2);
+		assertTokenStreamContents(t, new string[]{"/a/", "a/"}, new int[]{0, 1}, new int[]{3, 3}, new int[]{1, 0}, path.Length);
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper(this);
+		checkRandomData(random(), a, 1000 * RANDOM_MULTIPLIER);
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestReversePathHierarchyTokenizer outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestReversePathHierarchyTokenizer outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override Analyzer.TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new ReversePathHierarchyTokenizer(reader);
+			return new Analyzer.TokenStreamComponents(tokenizer, tokenizer);
+		  }
+	  }
+
+	  /// <summary>
+	  /// blast some random large strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomHugeStrings() throws Exception
+	  public virtual void testRandomHugeStrings()
+	  {
+		Random random = random();
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper2(this);
+		checkRandomData(random, a, 100 * RANDOM_MULTIPLIER, 1027);
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestReversePathHierarchyTokenizer outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestReversePathHierarchyTokenizer outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override Analyzer.TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new ReversePathHierarchyTokenizer(reader);
+			return new Analyzer.TokenStreamComponents(tokenizer, tokenizer);
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pattern/TestPatternCaptureGroupTokenFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pattern/TestPatternCaptureGroupTokenFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pattern/TestPatternCaptureGroupTokenFilter.cs
new file mode 100644
index 0000000..69ebbcc
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pattern/TestPatternCaptureGroupTokenFilter.cs
@@ -0,0 +1,231 @@
+namespace org.apache.lucene.analysis.pattern
+{
+
+	/*
+	 * 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.
+	 */
+
+
+	public class TestPatternCaptureGroupTokenFilter : BaseTokenStreamTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNoPattern() throws Exception
+	  public virtual void testNoPattern()
+	  {
+		testPatterns("foobarbaz", new string[] {}, new string[] {"foobarbaz"}, new int[] {0}, new int[] {9}, new int[] {1}, false);
+		testPatterns("foobarbaz", new string[] {}, new string[] {"foobarbaz"}, new int[] {0}, new int[] {9}, new int[] {1}, true);
+
+		testPatterns("foo bar baz", new string[] {}, new string[] {"foo","bar","baz"}, new int[] {0,4,8}, new int[] {3,7,11}, new int[] {1,1,1}, false);
+
+		testPatterns("foo bar baz", new string[] {}, new string[] {"foo","bar","baz"}, new int[] {0,4,8}, new int[] {3,7,11}, new int[] {1,1,1}, true);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNoMatch() throws Exception
+	  public virtual void testNoMatch()
+	  {
+		testPatterns("foobarbaz", new string[] {"xx"}, new string[] {"foobarbaz"}, new int[] {0}, new int[] {9}, new int[] {1}, false);
+		testPatterns("foobarbaz", new string[] {"xx"}, new string[] {"foobarbaz"}, new int[] {0}, new int[] {9}, new int[] {1}, true);
+
+		testPatterns("foo bar baz", new string[] {"xx"}, new string[] {"foo","bar","baz"}, new int[] {0,4,8}, new int[] {3,7,11}, new int[] {1,1,1}, false);
+
+		testPatterns("foo bar baz", new string[] {"xx"}, new string[] {"foo","bar","baz"}, new int[] {0,4,8}, new int[] {3,7,11}, new int[] {1,1,1}, true);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNoCapture() throws Exception
+	  public virtual void testNoCapture()
+	  {
+		testPatterns("foobarbaz", new string[] {".."}, new string[] {"foobarbaz"}, new int[] {0}, new int[] {9}, new int[] {1}, false);
+		testPatterns("foobarbaz", new string[] {".."}, new string[] {"foobarbaz"}, new int[] {0}, new int[] {9}, new int[] {1}, true);
+
+		testPatterns("foo bar baz", new string[] {".."}, new string[] {"foo","bar","baz"}, new int[] {0,4,8}, new int[] {3,7,11}, new int[] {1,1,1}, false);
+
+		testPatterns("foo bar baz", new string[] {".."}, new string[] {"foo","bar","baz"}, new int[] {0,4,8}, new int[] {3,7,11}, new int[] {1,1,1}, true);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyCapture() throws Exception
+	  public virtual void testEmptyCapture()
+	  {
+		testPatterns("foobarbaz", new string[] {".(y*)"}, new string[] {"foobarbaz"}, new int[] {0}, new int[] {9}, new int[] {1}, false);
+		testPatterns("foobarbaz", new string[] {".(y*)"}, new string[] {"foobarbaz"}, new int[] {0}, new int[] {9}, new int[] {1}, true);
+
+		testPatterns("foo bar baz", new string[] {".(y*)"}, new string[] {"foo","bar","baz"}, new int[] {0,4,8}, new int[] {3,7,11}, new int[] {1,1,1}, false);
+
+		testPatterns("foo bar baz", new string[] {".(y*)"}, new string[] {"foo","bar","baz"}, new int[] {0,4,8}, new int[] {3,7,11}, new int[] {1,1,1}, true);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCaptureAll() throws Exception
+	  public virtual void testCaptureAll()
+	  {
+		testPatterns("foobarbaz", new string[] {"(.+)"}, new string[] {"foobarbaz"}, new int[] {0}, new int[] {9}, new int[] {1}, false);
+		testPatterns("foobarbaz", new string[] {"(.+)"}, new string[] {"foobarbaz"}, new int[] {0}, new int[] {9}, new int[] {1}, true);
+
+		testPatterns("foo bar baz", new string[] {"(.+)"}, new string[] {"foo","bar","baz"}, new int[] {0,4,8}, new int[] {3,7,11}, new int[] {1,1,1}, false);
+
+		testPatterns("foo bar baz", new string[] {"(.+)"}, new string[] {"foo","bar","baz"}, new int[] {0,4,8}, new int[] {3,7,11}, new int[] {1,1,1}, true);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCaptureStart() throws Exception
+	  public virtual void testCaptureStart()
+	  {
+		testPatterns("foobarbaz", new string[] {"^(.)"}, new string[] {"f"}, new int[] {0}, new int[] {9}, new int[] {1}, false);
+		testPatterns("foobarbaz", new string[] {"^(.)"}, new string[] {"foobarbaz","f"}, new int[] {0,0}, new int[] {9,9}, new int[] {1,0}, true);
+
+		testPatterns("foo bar baz", new string[] {"^(.)"}, new string[] {"f","b","b"}, new int[] {0,4,8}, new int[] {3,7,11}, new int[] {1,1,1}, false);
+
+		testPatterns("foo bar baz", new string[] {"^(.)"}, new string[] {"foo","f","bar","b","baz","b"}, new int[] {0,0,4,4,8,8}, new int[] {3,3,7,7,11,11}, new int[] {1,0,1,0,1,0}, true);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCaptureMiddle() throws Exception
+	  public virtual void testCaptureMiddle()
+	  {
+		testPatterns("foobarbaz", new string[] {"^.(.)."}, new string[] {"o"}, new int[] {0}, new int[] {9}, new int[] {1}, false);
+		testPatterns("foobarbaz", new string[] {"^.(.)."}, new string[] {"foobarbaz","o"}, new int[] {0,0}, new int[] {9,9}, new int[] {1,0}, true);
+
+		testPatterns("foo bar baz", new string[] {"^.(.)."}, new string[] {"o","a","a"}, new int[] {0,4,8}, new int[] {3,7,11}, new int[] {1,1,1}, false);
+
+		testPatterns("foo bar baz", new string[] {"^.(.)."}, new string[] {"foo","o","bar","a","baz","a"}, new int[] {0,0,4,4,8,8}, new int[] {3,3,7,7,11,11}, new int[] {1,0,1,0,1,0}, true);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCaptureEnd() throws Exception
+	  public virtual void testCaptureEnd()
+	  {
+		testPatterns("foobarbaz", new string[] {"(.)$"}, new string[] {"z"}, new int[] {0}, new int[] {9}, new int[] {1}, false);
+		testPatterns("foobarbaz", new string[] {"(.)$"}, new string[] {"foobarbaz","z"}, new int[] {0,0}, new int[] {9,9}, new int[] {1,0}, true);
+
+		testPatterns("foo bar baz", new string[] {"(.)$"}, new string[] {"o","r","z"}, new int[] {0,4,8}, new int[] {3,7,11}, new int[] {1,1,1}, false);
+
+		testPatterns("foo bar baz", new string[] {"(.)$"}, new string[] {"foo","o","bar","r","baz","z"}, new int[] {0,0,4,4,8,8}, new int[] {3,3,7,7,11,11}, new int[] {1,0,1,0,1,0}, true);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCaptureStartMiddle() throws Exception
+	  public virtual void testCaptureStartMiddle()
+	  {
+		testPatterns("foobarbaz", new string[] {"^(.)(.)"}, new string[] {"f","o"}, new int[] {0,0}, new int[] {9,9}, new int[] {1,0}, false);
+		testPatterns("foobarbaz", new string[] {"^(.)(.)"}, new string[] {"foobarbaz","f","o"}, new int[] {0,0,0}, new int[] {9,9,9}, new int[] {1,0,0}, true);
+
+		testPatterns("foo bar baz", new string[] {"^(.)(.)"}, new string[] {"f","o","b","a","b","a"}, new int[] {0,0,4,4,8,8}, new int[] {3,3,7,7,11,11}, new int[] {1,0,1,0,1,0}, false);
+
+		testPatterns("foo bar baz", new string[] {"^(.)(.)"}, new string[] {"foo","f","o","bar","b","a","baz","b","a"}, new int[] {0,0,0,4,4,4,8,8,8}, new int[] {3,3,3,7,7,7,11,11,11}, new int[] {1,0,0,1,0,0,1,0,0}, true);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCaptureStartEnd() throws Exception
+	  public virtual void testCaptureStartEnd()
+	  {
+		testPatterns("foobarbaz", new string[] {"^(.).+(.)$"}, new string[] {"f","z"}, new int[] {0,0}, new int[] {9,9}, new int[] {1,0}, false);
+		testPatterns("foobarbaz", new string[] {"^(.).+(.)$"}, new string[] {"foobarbaz","f","z"}, new int[] {0,0,0}, new int[] {9,9,9}, new int[] {1,0,0}, true);
+
+		testPatterns("foo bar baz", new string[] {"^(.).+(.)$"}, new string[] {"f","o","b","r","b","z"}, new int[] {0,0,4,4,8,8}, new int[] {3,3,7,7,11,11}, new int[] {1,0,1,0,1,0}, false);
+
+		testPatterns("foo bar baz", new string[] {"^(.).+(.)$"}, new string[] {"foo","f","o","bar","b","r","baz","b","z"}, new int[] {0,0,0,4,4,4,8,8,8}, new int[] {3,3,3,7,7,7,11,11,11}, new int[] {1,0,0,1,0,0,1,0,0}, true);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCaptureMiddleEnd() throws Exception
+	  public virtual void testCaptureMiddleEnd()
+	  {
+		testPatterns("foobarbaz", new string[] {"(.)(.)$"}, new string[] {"a","z"}, new int[] {0,0}, new int[] {9,9}, new int[] {1,0}, false);
+		testPatterns("foobarbaz", new string[] {"(.)(.)$"}, new string[] {"foobarbaz","a","z"}, new int[] {0,0,0}, new int[] {9,9,9}, new int[] {1,0,0}, true);
+
+		testPatterns("foo bar baz", new string[] {"(.)(.)$"}, new string[] {"o","o","a","r","a","z"}, new int[] {0,0,4,4,8,8}, new int[] {3,3,7,7,11,11}, new int[] {1,0,1,0,1,0}, false);
+
+		testPatterns("foo bar baz", new string[] {"(.)(.)$"}, new string[] {"foo","o","o","bar","a","r","baz","a","z"}, new int[] {0,0,0,4,4,4,8,8,8}, new int[] {3,3,3,7,7,7,11,11,11}, new int[] {1,0,0,1,0,0,1,0,0}, true);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMultiCaptureOverlap() throws Exception
+	  public virtual void testMultiCaptureOverlap()
+	  {
+		testPatterns("foobarbaz", new string[] {"(.(.(.)))"}, new string[] {"foo","oo","o","bar","ar","r","baz","az","z"}, new int[] {0,0,0,0,0,0,0,0,0}, new int[] {9,9,9,9,9,9,9,9,9}, new int[] {1,0,0,0,0,0,0,0,0}, false);
+		testPatterns("foobarbaz", new string[] {"(.(.(.)))"}, new string[] {"foobarbaz","foo","oo","o","bar","ar","r","baz","az","z"}, new int[] {0,0,0,0,0,0,0,0,0,0}, new int[] {9,9,9,9,9,9,9,9,9,9}, new int[] {1,0,0,0,0,0,0,0,0,0}, true);
+
+		testPatterns("foo bar baz", new string[] {"(.(.(.)))"}, new string[] {"foo","oo","o","bar","ar","r","baz","az","z"}, new int[] {0,0,0,4,4,4,8,8,8}, new int[] {3,3,3,7,7,7,11,11,11}, new int[] {1,0,0,1,0,0,1,0,0}, false);
+
+		testPatterns("foo bar baz", new string[] {"(.(.(.)))"}, new string[] {"foo","oo","o","bar","ar","r","baz","az","z"}, new int[] {0,0,0,4,4,4,8,8,8}, new int[] {3,3,3,7,7,7,11,11,11}, new int[] {1,0,0,1,0,0,1,0,0}, true);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMultiPattern() throws Exception
+	  public virtual void testMultiPattern()
+	  {
+		testPatterns("aaabbbaaa", new string[] {"(aaa)","(bbb)","(ccc)"}, new string[] {"aaa","bbb","aaa"}, new int[] {0,0,0}, new int[] {9,9,9}, new int[] {1,0,0}, false);
+		testPatterns("aaabbbaaa", new string[] {"(aaa)","(bbb)","(ccc)"}, new string[] {"aaabbbaaa","aaa","bbb","aaa"}, new int[] {0,0,0,0}, new int[] {9,9,9,9}, new int[] {1,0,0,0}, true);
+
+		testPatterns("aaa bbb aaa", new string[] {"(aaa)","(bbb)","(ccc)"}, new string[] {"aaa","bbb","aaa"}, new int[] {0,4,8}, new int[] {3,7,11}, new int[] {1,1,1}, false);
+
+		testPatterns("aaa bbb aaa", new string[] {"(aaa)","(bbb)","(ccc)"}, new string[] {"aaa","bbb","aaa"}, new int[] {0,4,8}, new int[] {3,7,11}, new int[] {1,1,1}, true);
+	  }
+
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCamelCase() throws Exception
+	  public virtual void testCamelCase()
+	  {
+		testPatterns("letsPartyLIKEits1999_dude", new string[] {"([A-Z]{2,})", "(?<![A-Z])([A-Z][a-z]+)", "(?:^|\\b|(?<=[0-9_])|(?<=[A-Z]{2}))([a-z]+)", "([0-9]+)"}, new string[] {"lets","Party","LIKE","its","1999","dude"}, new int[] {0,0,0,0,0,0}, new int[] {25,25,25,25,25,25}, new int[] {1,0,0,0,0,0,0}, false);
+		testPatterns("letsPartyLIKEits1999_dude", new string[] {"([A-Z]{2,})", "(?<![A-Z])([A-Z][a-z]+)", "(?:^|\\b|(?<=[0-9_])|(?<=[A-Z]{2}))([a-z]+)", "([0-9]+)"}, new string[] {"letsPartyLIKEits1999_dude","lets","Party","LIKE","its","1999","dude"}, new int[] {0,0,0,0,0,0,0}, new int[] {25,25,25,25,25,25,25}, new int[] {1,0,0,0,0,0,0,0}, true);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomString() throws Exception
+	  public virtual void testRandomString()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper(this);
+
+		checkRandomData(random(), a, 1000 * RANDOM_MULTIPLIER);
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestPatternCaptureGroupTokenFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestPatternCaptureGroupTokenFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(tokenizer, new PatternCaptureGroupTokenFilter(tokenizer, false, Pattern.compile("((..)(..))")));
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: private void testPatterns(String input, String[] regexes, String[] tokens, int[] startOffsets, int[] endOffsets, int[] positions, boolean preserveOriginal) throws Exception
+	  private void testPatterns(string input, string[] regexes, string[] tokens, int[] startOffsets, int[] endOffsets, int[] positions, bool preserveOriginal)
+	  {
+		Pattern[] patterns = new Pattern[regexes.Length];
+		for (int i = 0; i < regexes.Length; i++)
+		{
+		  patterns[i] = Pattern.compile(regexes[i]);
+		}
+		TokenStream ts = new PatternCaptureGroupTokenFilter(new MockTokenizer(new StringReader(input), MockTokenizer.WHITESPACE, false), preserveOriginal, patterns);
+		assertTokenStreamContents(ts, tokens, startOffsets, endOffsets, positions);
+	  }
+
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pattern/TestPatternReplaceCharFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pattern/TestPatternReplaceCharFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pattern/TestPatternReplaceCharFilter.cs
new file mode 100644
index 0000000..2423cfd
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pattern/TestPatternReplaceCharFilter.cs
@@ -0,0 +1,313 @@
+using System;
+using System.Text;
+
+/*
+ * 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 org.apache.lucene.analysis.pattern
+{
+
+
+	using TestUtil = org.apache.lucene.util.TestUtil;
+	using Ignore = org.junit.Ignore;
+
+	/// <summary>
+	/// Tests <seealso cref="PatternReplaceCharFilter"/>
+	/// </summary>
+	public class TestPatternReplaceCharFilter : BaseTokenStreamTestCase
+	{
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFailingDot() throws java.io.IOException
+	  public virtual void testFailingDot()
+	  {
+		checkOutput("A. .B.", "\\.[\\s]*", ".", "A..B.", "A..B.");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testLongerReplacement() throws java.io.IOException
+	  public virtual void testLongerReplacement()
+	  {
+		checkOutput("XXabcZZabcYY", "abc", "abcde", "XXabcdeZZabcdeYY", "XXabcccZZabcccYY");
+		checkOutput("XXabcabcYY", "abc", "abcde", "XXabcdeabcdeYY", "XXabcccabcccYY");
+		checkOutput("abcabcYY", "abc", "abcde", "abcdeabcdeYY", "abcccabcccYY");
+		checkOutput("YY", "^", "abcde", "abcdeYY", "YYYYYYY");
+			// Should be: "-----YY" but we're enforcing non-negative offsets.
+		checkOutput("YY", "$", "abcde", "YYabcde", "YYYYYYY");
+		checkOutput("XYZ", ".", "abc", "abcabcabc", "XXXYYYZZZ");
+		checkOutput("XYZ", ".", "$0abc", "XabcYabcZabc", "XXXXYYYYZZZZ");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testShorterReplacement() throws java.io.IOException
+	  public virtual void testShorterReplacement()
+	  {
+		checkOutput("XXabcZZabcYY", "abc", "xy", "XXxyZZxyYY", "XXabZZabYY");
+		checkOutput("XXabcabcYY", "abc", "xy", "XXxyxyYY", "XXababYY");
+		checkOutput("abcabcYY", "abc", "xy", "xyxyYY", "ababYY");
+		checkOutput("abcabcYY", "abc", "", "YY", "YY");
+		checkOutput("YYabcabc", "abc", "", "YY", "YY");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: private void checkOutput(String input, String pattern, String replacement, String expectedOutput, String expectedIndexMatchedOutput) throws java.io.IOException
+	  private void checkOutput(string input, string pattern, string replacement, string expectedOutput, string expectedIndexMatchedOutput)
+	  {
+		  CharFilter cs = new PatternReplaceCharFilter(pattern(pattern), replacement, new StringReader(input));
+
+		StringBuilder output = new StringBuilder();
+		for (int chr = cs.read(); chr > 0; chr = cs.read())
+		{
+		  output.Append((char) chr);
+		}
+
+		StringBuilder indexMatched = new StringBuilder();
+		for (int i = 0; i < output.Length; i++)
+		{
+		  indexMatched.Append((cs.correctOffset(i) < 0 ? "-" : input[cs.correctOffset(i)]));
+		}
+
+		bool outputGood = expectedOutput.Equals(output.ToString());
+		bool indexMatchedGood = expectedIndexMatchedOutput.Equals(indexMatched.ToString());
+
+		if (!outputGood || !indexMatchedGood || false)
+		{
+		  Console.WriteLine("Pattern : " + pattern);
+		  Console.WriteLine("Replac. : " + replacement);
+		  Console.WriteLine("Input   : " + input);
+		  Console.WriteLine("Output  : " + output);
+		  Console.WriteLine("Expected: " + expectedOutput);
+		  Console.WriteLine("Output/i: " + indexMatched);
+		  Console.WriteLine("Expected: " + expectedIndexMatchedOutput);
+		  Console.WriteLine();
+		}
+
+		assertTrue("Output doesn't match.", outputGood);
+		assertTrue("Index-matched output doesn't match.", indexMatchedGood);
+	  }
+
+	  //           1111
+	  // 01234567890123
+	  // this is test.
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNothingChange() throws java.io.IOException
+	  public virtual void testNothingChange()
+	  {
+		const string BLOCK = "this is test.";
+		CharFilter cs = new PatternReplaceCharFilter(pattern("(aa)\\s+(bb)\\s+(cc)"), "$1$2$3", new StringReader(BLOCK));
+		TokenStream ts = new MockTokenizer(cs, MockTokenizer.WHITESPACE, false);
+		assertTokenStreamContents(ts, new string[] {"this", "is", "test."}, new int[] {0, 5, 8}, new int[] {4, 7, 13}, BLOCK.Length);
+	  }
+
+	  // 012345678
+	  // aa bb cc
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testReplaceByEmpty() throws java.io.IOException
+	  public virtual void testReplaceByEmpty()
+	  {
+		const string BLOCK = "aa bb cc";
+		CharFilter cs = new PatternReplaceCharFilter(pattern("(aa)\\s+(bb)\\s+(cc)"), "", new StringReader(BLOCK));
+		TokenStream ts = new MockTokenizer(cs, MockTokenizer.WHITESPACE, false);
+		assertTokenStreamContents(ts, new string[] {});
+	  }
+
+	  // 012345678
+	  // aa bb cc
+	  // aa#bb#cc
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void test1block1matchSameLength() throws java.io.IOException
+	  public virtual void test1block1matchSameLength()
+	  {
+		const string BLOCK = "aa bb cc";
+		CharFilter cs = new PatternReplaceCharFilter(pattern("(aa)\\s+(bb)\\s+(cc)"), "$1#$2#$3", new StringReader(BLOCK));
+		TokenStream ts = new MockTokenizer(cs, MockTokenizer.WHITESPACE, false);
+		assertTokenStreamContents(ts, new string[] {"aa#bb#cc"}, new int[] {0}, new int[] {8}, BLOCK.Length);
+	  }
+
+	  //           11111
+	  // 012345678901234
+	  // aa bb cc dd
+	  // aa##bb###cc dd
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void test1block1matchLonger() throws java.io.IOException
+	  public virtual void test1block1matchLonger()
+	  {
+		const string BLOCK = "aa bb cc dd";
+		CharFilter cs = new PatternReplaceCharFilter(pattern("(aa)\\s+(bb)\\s+(cc)"), "$1##$2###$3", new StringReader(BLOCK));
+		TokenStream ts = new MockTokenizer(cs, MockTokenizer.WHITESPACE, false);
+		assertTokenStreamContents(ts, new string[] {"aa##bb###cc", "dd"}, new int[] {0, 9}, new int[] {8, 11}, BLOCK.Length);
+	  }
+
+	  // 01234567
+	  //  a  a
+	  //  aa  aa
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void test1block2matchLonger() throws java.io.IOException
+	  public virtual void test1block2matchLonger()
+	  {
+		const string BLOCK = " a  a";
+		CharFilter cs = new PatternReplaceCharFilter(pattern("a"), "aa", new StringReader(BLOCK));
+		TokenStream ts = new MockTokenizer(cs, MockTokenizer.WHITESPACE, false);
+		assertTokenStreamContents(ts, new string[] {"aa", "aa"}, new int[] {1, 4}, new int[] {2, 5}, BLOCK.Length);
+	  }
+
+	  //           11111
+	  // 012345678901234
+	  // aa  bb   cc dd
+	  // aa#bb dd
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void test1block1matchShorter() throws java.io.IOException
+	  public virtual void test1block1matchShorter()
+	  {
+		const string BLOCK = "aa  bb   cc dd";
+		CharFilter cs = new PatternReplaceCharFilter(pattern("(aa)\\s+(bb)\\s+(cc)"), "$1#$2", new StringReader(BLOCK));
+		TokenStream ts = new MockTokenizer(cs, MockTokenizer.WHITESPACE, false);
+		assertTokenStreamContents(ts, new string[] {"aa#bb", "dd"}, new int[] {0, 12}, new int[] {11, 14}, BLOCK.Length);
+	  }
+
+	  //           111111111122222222223333
+	  // 0123456789012345678901234567890123
+	  //   aa bb cc --- aa bb aa   bb   cc
+	  //   aa  bb  cc --- aa bb aa  bb  cc
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void test1blockMultiMatches() throws java.io.IOException
+	  public virtual void test1blockMultiMatches()
+	  {
+		const string BLOCK = "  aa bb cc --- aa bb aa   bb   cc";
+		CharFilter cs = new PatternReplaceCharFilter(pattern("(aa)\\s+(bb)\\s+(cc)"), "$1  $2  $3", new StringReader(BLOCK));
+		TokenStream ts = new MockTokenizer(cs, MockTokenizer.WHITESPACE, false);
+		assertTokenStreamContents(ts, new string[] {"aa", "bb", "cc", "---", "aa", "bb", "aa", "bb", "cc"}, new int[] {2, 6, 9, 11, 15, 18, 21, 25, 29}, new int[] {4, 8, 10, 14, 17, 20, 23, 27, 33}, BLOCK.Length);
+	  }
+
+	  //           11111111112222222222333333333
+	  // 012345678901234567890123456789012345678
+	  //   aa bb cc --- aa bb aa. bb aa   bb cc
+	  //   aa##bb cc --- aa##bb aa. bb aa##bb cc
+
+	  //   aa bb cc --- aa bbbaa. bb aa   b cc
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void test2blocksMultiMatches() throws java.io.IOException
+	  public virtual void test2blocksMultiMatches()
+	  {
+		const string BLOCK = "  aa bb cc --- aa bb aa. bb aa   bb cc";
+
+		CharFilter cs = new PatternReplaceCharFilter(pattern("(aa)\\s+(bb)"), "$1##$2", new StringReader(BLOCK));
+		TokenStream ts = new MockTokenizer(cs, MockTokenizer.WHITESPACE, false);
+		assertTokenStreamContents(ts, new string[] {"aa##bb", "cc", "---", "aa##bb", "aa.", "bb", "aa##bb", "cc"}, new int[] {2, 8, 11, 15, 21, 25, 28, 36}, new int[] {7, 10, 14, 20, 24, 27, 35, 38}, BLOCK.Length);
+	  }
+
+	  //           11111111112222222222333333333
+	  // 012345678901234567890123456789012345678
+	  //  a bb - ccc . --- bb a . ccc ccc bb
+	  //  aa b - c . --- b aa . c c b
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testChain() throws java.io.IOException
+	  public virtual void testChain()
+	  {
+		const string BLOCK = " a bb - ccc . --- bb a . ccc ccc bb";
+		CharFilter cs = new PatternReplaceCharFilter(pattern("a"), "aa", new StringReader(BLOCK));
+		cs = new PatternReplaceCharFilter(pattern("bb"), "b", cs);
+		cs = new PatternReplaceCharFilter(pattern("ccc"), "c", cs);
+		TokenStream ts = new MockTokenizer(cs, MockTokenizer.WHITESPACE, false);
+		assertTokenStreamContents(ts, new string[] {"aa", "b", "-", "c", ".", "---", "b", "aa", ".", "c", "c", "b"}, new int[] {1, 3, 6, 8, 12, 14, 18, 21, 23, 25, 29, 33}, new int[] {2, 5, 7, 11, 13, 17, 20, 22, 24, 28, 32, 35}, BLOCK.Length);
+	  }
+
+	  private Pattern pattern(string p)
+	  {
+		return Pattern.compile(p);
+	  }
+
+	  /// <summary>
+	  /// A demonstration of how backtracking regular expressions can lead to relatively 
+	  /// easy DoS attacks.
+	  /// </summary>
+	  /// <seealso cref= "http://swtch.com/~rsc/regexp/regexp1.html" </seealso>
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @Ignore public void testNastyPattern() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public virtual void testNastyPattern()
+	  {
+		Pattern p = Pattern.compile("(c.+)*xy");
+		string input = "[;<!--aecbbaa--><    febcfdc fbb = \"fbeeebff\" fc = dd   >\\';<eefceceaa e= babae\" eacbaff =\"fcfaccacd\" = bcced>>><  bccaafe edb = ecfccdff\"   <?</script><    edbd ebbcd=\"faacfcc\" aeca= bedbc ceeaac =adeafde aadccdaf = \"afcc ffda=aafbe &#x16921ed5\"1843785582']";
+		for (int i = 0; i < input.Length; i++)
+		{
+		  Matcher matcher = p.matcher(input.Substring(0, i));
+		  long t = DateTimeHelperClass.CurrentUnixTimeMillis();
+		  if (matcher.find())
+		  {
+			Console.WriteLine(matcher.group());
+		  }
+		  Console.WriteLine(i + " > " + (DateTimeHelperClass.CurrentUnixTimeMillis() - t) / 1000.0);
+		}
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		int numPatterns = 10 + random().Next(20);
+		Random random = new Random(random().nextLong());
+		for (int i = 0; i < numPatterns; i++)
+		{
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final java.util.regex.Pattern p = org.apache.lucene.util.TestUtil.randomPattern(random());
+		  Pattern p = TestUtil.randomPattern(random());
+
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final String replacement = org.apache.lucene.util.TestUtil.randomSimpleString(random);
+		  string replacement = TestUtil.randomSimpleString(random);
+		  Analyzer a = new AnalyzerAnonymousInnerClassHelper(this, p, replacement);
+
+		  /* max input length. don't make it longer -- exponential processing
+		   * time for certain patterns. */ 
+		  const int maxInputLength = 30;
+		  /* ASCII only input?: */
+		  const bool asciiOnly = true;
+		  checkRandomData(random, a, 250 * RANDOM_MULTIPLIER, maxInputLength, asciiOnly);
+		}
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestPatternReplaceCharFilter outerInstance;
+
+		  private Pattern p;
+		  private string replacement;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestPatternReplaceCharFilter outerInstance, Pattern p, string replacement)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.p = p;
+			  this.replacement = replacement;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(tokenizer, tokenizer);
+		  }
+
+		  protected internal override Reader initReader(string fieldName, Reader reader)
+		  {
+			return new PatternReplaceCharFilter(p, replacement, reader);
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pattern/TestPatternReplaceCharFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pattern/TestPatternReplaceCharFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pattern/TestPatternReplaceCharFilterFactory.cs
new file mode 100644
index 0000000..a41564b
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pattern/TestPatternReplaceCharFilterFactory.cs
@@ -0,0 +1,86 @@
+namespace org.apache.lucene.analysis.pattern
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure this factory is working
+	/// </summary>
+	public class TestPatternReplaceCharFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+
+	  //           1111
+	  // 01234567890123
+	  // this is test.
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNothingChange() throws Exception
+	  public virtual void testNothingChange()
+	  {
+		Reader reader = new StringReader("this is test.");
+		reader = charFilterFactory("PatternReplace", "pattern", "(aa)\\s+(bb)\\s+(cc)", "replacement", "$1$2$3").create(reader);
+		TokenStream ts = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		assertTokenStreamContents(ts, new string[] {"this", "is", "test."}, new int[] {0, 5, 8}, new int[] {4, 7, 13});
+	  }
+
+	  // 012345678
+	  // aa bb cc
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testReplaceByEmpty() throws Exception
+	  public virtual void testReplaceByEmpty()
+	  {
+		Reader reader = new StringReader("aa bb cc");
+		reader = charFilterFactory("PatternReplace", "pattern", "(aa)\\s+(bb)\\s+(cc)").create(reader);
+		TokenStream ts = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		assertTokenStreamContents(ts, new string[] {});
+	  }
+
+	  // 012345678
+	  // aa bb cc
+	  // aa#bb#cc
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void test1block1matchSameLength() throws Exception
+	  public virtual void test1block1matchSameLength()
+	  {
+		Reader reader = new StringReader("aa bb cc");
+		reader = charFilterFactory("PatternReplace", "pattern", "(aa)\\s+(bb)\\s+(cc)", "replacement", "$1#$2#$3").create(reader);
+		TokenStream ts = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		assertTokenStreamContents(ts, new string[] {"aa#bb#cc"}, new int[] {0}, new int[] {8});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  charFilterFactory("PatternReplace", "pattern", "something", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pattern/TestPatternReplaceFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pattern/TestPatternReplaceFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pattern/TestPatternReplaceFilter.cs
new file mode 100644
index 0000000..1c077a3
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pattern/TestPatternReplaceFilter.cs
@@ -0,0 +1,145 @@
+/*
+ * 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 org.apache.lucene.analysis.pattern
+{
+
+	using KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+
+
+	public class TestPatternReplaceFilter : BaseTokenStreamTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testReplaceAll() throws Exception
+	  public virtual void testReplaceAll()
+	  {
+		string input = "aabfooaabfooabfoob ab caaaaaaaaab";
+		TokenStream ts = new PatternReplaceFilter(new MockTokenizer(new StringReader(input), MockTokenizer.WHITESPACE, false), Pattern.compile("a*b"), "-", true);
+		assertTokenStreamContents(ts, new string[] {"-foo-foo-foo-", "-", "c-"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testReplaceFirst() throws Exception
+	  public virtual void testReplaceFirst()
+	  {
+		string input = "aabfooaabfooabfoob ab caaaaaaaaab";
+		TokenStream ts = new PatternReplaceFilter(new MockTokenizer(new StringReader(input), MockTokenizer.WHITESPACE, false), Pattern.compile("a*b"), "-", false);
+		assertTokenStreamContents(ts, new string[] {"-fooaabfooabfoob", "-", "c-"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStripFirst() throws Exception
+	  public virtual void testStripFirst()
+	  {
+		string input = "aabfooaabfooabfoob ab caaaaaaaaab";
+		TokenStream ts = new PatternReplaceFilter(new MockTokenizer(new StringReader(input), MockTokenizer.WHITESPACE, false), Pattern.compile("a*b"), null, false);
+		assertTokenStreamContents(ts, new string[] {"fooaabfooabfoob", "", "c"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStripAll() throws Exception
+	  public virtual void testStripAll()
+	  {
+		string input = "aabfooaabfooabfoob ab caaaaaaaaab";
+		TokenStream ts = new PatternReplaceFilter(new MockTokenizer(new StringReader(input), MockTokenizer.WHITESPACE, false), Pattern.compile("a*b"), null, true);
+		assertTokenStreamContents(ts, new string[] {"foofoofoo", "", "c"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testReplaceAllWithBackRef() throws Exception
+	  public virtual void testReplaceAllWithBackRef()
+	  {
+		string input = "aabfooaabfooabfoob ab caaaaaaaaab";
+		TokenStream ts = new PatternReplaceFilter(new MockTokenizer(new StringReader(input), MockTokenizer.WHITESPACE, false), Pattern.compile("(a*)b"), "$1\\$", true);
+		assertTokenStreamContents(ts, new string[] {"aa$fooaa$fooa$foo$", "a$", "caaaaaaaaa$"});
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper(this);
+		checkRandomData(random(), a, 1000 * RANDOM_MULTIPLIER);
+
+		Analyzer b = new AnalyzerAnonymousInnerClassHelper2(this);
+		checkRandomData(random(), b, 1000 * RANDOM_MULTIPLIER);
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestPatternReplaceFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestPatternReplaceFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			TokenStream filter = new PatternReplaceFilter(tokenizer, Pattern.compile("a"), "b", false);
+			return new TokenStreamComponents(tokenizer, filter);
+		  }
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestPatternReplaceFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestPatternReplaceFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			TokenStream filter = new PatternReplaceFilter(tokenizer, Pattern.compile("a"), "b", true);
+			return new TokenStreamComponents(tokenizer, filter);
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper3(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper3 : Analyzer
+	  {
+		  private readonly TestPatternReplaceFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper3(TestPatternReplaceFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new PatternReplaceFilter(tokenizer, Pattern.compile("a"), "b", true));
+		  }
+	  }
+
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pattern/TestPatternReplaceFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pattern/TestPatternReplaceFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pattern/TestPatternReplaceFilterFactory.cs
new file mode 100644
index 0000000..306d38c
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pattern/TestPatternReplaceFilterFactory.cs
@@ -0,0 +1,59 @@
+namespace org.apache.lucene.analysis.pattern
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+
+	/// <summary>
+	/// Simple tests to ensure this factory is working
+	/// </summary>
+	public class TestPatternReplaceFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testReplaceAll() throws Exception
+	  public virtual void testReplaceAll()
+	  {
+		Reader reader = new StringReader("aabfooaabfooabfoob ab caaaaaaaaab");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("PatternReplace", "pattern", "a*b", "replacement", "-").create(stream);
+
+		assertTokenStreamContents(stream, new string[] {"-foo-foo-foo-", "-", "c-"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("PatternReplace", "pattern", "something", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pattern/TestPatternTokenizer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pattern/TestPatternTokenizer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pattern/TestPatternTokenizer.cs
new file mode 100644
index 0000000..28d8b03
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pattern/TestPatternTokenizer.cs
@@ -0,0 +1,170 @@
+using System.Collections.Generic;
+using System.Text;
+
+/*
+ * 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 org.apache.lucene.analysis.pattern
+{
+
+
+	using TokenStreamComponents = org.apache.lucene.analysis.Analyzer.TokenStreamComponents;
+	using MappingCharFilter = org.apache.lucene.analysis.charfilter.MappingCharFilter;
+	using NormalizeCharMap = org.apache.lucene.analysis.charfilter.NormalizeCharMap;
+	using PathHierarchyTokenizer = org.apache.lucene.analysis.path.PathHierarchyTokenizer;
+	using CharTermAttribute = org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
+
+	public class TestPatternTokenizer : BaseTokenStreamTestCase
+	{
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testSplitting() throws Exception
+	  public virtual void testSplitting()
+	  {
+		string qpattern = "\\'([^\\']+)\\'"; // get stuff between "'"
+		string[][] tests = new string[][]
+		{
+			new string[] {"-1", "--", "aaa--bbb--ccc", "aaa bbb ccc"},
+			new string[] {"-1", ":", "aaa:bbb:ccc", "aaa bbb ccc"},
+			new string[] {"-1", "\\p{Space}", "aaa   bbb \t\tccc  ", "aaa bbb ccc"},
+			new string[] {"-1", ":", "boo:and:foo", "boo and foo"},
+			new string[] {"-1", "o", "boo:and:foo", "b :and:f"},
+			new string[] {"0", ":", "boo:and:foo", ": :"},
+			new string[] {"0", qpattern, "aaa 'bbb' 'ccc'", "'bbb' 'ccc'"},
+			new string[] {"1", qpattern, "aaa 'bbb' 'ccc'", "bbb ccc"}
+		};
+
+		foreach (string[] test in tests)
+		{
+		  TokenStream stream = new PatternTokenizer(new StringReader(test[2]), Pattern.compile(test[1]), int.Parse(test[0]));
+		  string @out = tsToString(stream);
+		  // System.out.println( test[2] + " ==> " + out );
+
+		  assertEquals("pattern: " + test[1] + " with input: " + test[2], test[3], @out);
+
+		  // Make sure it is the same as if we called 'split'
+		  // test disabled, as we remove empty tokens
+		  /*if( "-1".equals( test[0] ) ) {
+		    String[] split = test[2].split( test[1] );
+		    stream = tokenizer.create( new StringReader( test[2] ) );
+		    int i=0;
+		    for( Token t = stream.next(); null != t; t = stream.next() ) 
+		    {
+		      assertEquals( "split: "+test[1] + " "+i, split[i++], new String(t.termBuffer(), 0, t.termLength()) );
+		    }
+		  }*/
+		}
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testOffsetCorrection() throws Exception
+	  public virtual void testOffsetCorrection()
+	  {
+		const string INPUT = "G&uuml;nther G&uuml;nther is here";
+
+		// create MappingCharFilter
+		IList<string> mappingRules = new List<string>();
+		mappingRules.Add("\"&uuml;\" => \"ü\"");
+		NormalizeCharMap.Builder builder = new NormalizeCharMap.Builder();
+		builder.add("&uuml;", "ü");
+		NormalizeCharMap normMap = builder.build();
+		CharFilter charStream = new MappingCharFilter(normMap, new StringReader(INPUT));
+
+		// create PatternTokenizer
+		TokenStream stream = new PatternTokenizer(charStream, Pattern.compile("[,;/\\s]+"), -1);
+		assertTokenStreamContents(stream, new string[] {"Günther", "Günther", "is", "here"}, new int[] {0, 13, 26, 29}, new int[] {12, 25, 28, 33}, INPUT.Length);
+
+		charStream = new MappingCharFilter(normMap, new StringReader(INPUT));
+		stream = new PatternTokenizer(charStream, Pattern.compile("Günther"), 0);
+		assertTokenStreamContents(stream, new string[] {"Günther", "Günther"}, new int[] {0, 13}, new int[] {12, 25}, INPUT.Length);
+	  }
+
+	  /// <summary>
+	  /// TODO: rewrite tests not to use string comparison.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: private static String tsToString(org.apache.lucene.analysis.TokenStream in) throws java.io.IOException
+	  private static string tsToString(TokenStream @in)
+	  {
+		StringBuilder @out = new StringBuilder();
+		CharTermAttribute termAtt = @in.addAttribute(typeof(CharTermAttribute));
+		// extra safety to enforce, that the state is not preserved and also
+		// assign bogus values
+		@in.clearAttributes();
+		termAtt.setEmpty().append("bogusTerm");
+		@in.reset();
+		while (@in.incrementToken())
+		{
+		  if (@out.Length > 0)
+		  {
+			@out.Append(' ');
+		  }
+		  @out.Append(termAtt.ToString());
+		  @in.clearAttributes();
+		  termAtt.setEmpty().append("bogusTerm");
+		}
+
+		@in.close();
+		return @out.ToString();
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper(this);
+		checkRandomData(random(), a, 1000 * RANDOM_MULTIPLIER);
+
+		Analyzer b = new AnalyzerAnonymousInnerClassHelper2(this);
+		checkRandomData(random(), b, 1000 * RANDOM_MULTIPLIER);
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestPatternTokenizer outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestPatternTokenizer outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override Analyzer.TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new PatternTokenizer(reader, Pattern.compile("a"), -1);
+			return new Analyzer.TokenStreamComponents(tokenizer);
+		  }
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestPatternTokenizer outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestPatternTokenizer outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override Analyzer.TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new PatternTokenizer(reader, Pattern.compile("a"), 0);
+			return new Analyzer.TokenStreamComponents(tokenizer);
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pattern/TestPatternTokenizerFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pattern/TestPatternTokenizerFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pattern/TestPatternTokenizerFactory.cs
new file mode 100644
index 0000000..1435951
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Pattern/TestPatternTokenizerFactory.cs
@@ -0,0 +1,58 @@
+namespace org.apache.lucene.analysis.pattern
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple Tests to ensure this factory is working </summary>
+	public class TestPatternTokenizerFactory : BaseTokenStreamFactoryTestCase
+	{
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFactory() throws Exception
+	  public virtual void testFactory()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final java.io.Reader reader = new java.io.StringReader("Günther Günther is here");
+		Reader reader = new StringReader("Günther Günther is here");
+		// create PatternTokenizer
+		TokenStream stream = tokenizerFactory("Pattern", "pattern", "[,;/\\s]+").create(reader);
+		assertTokenStreamContents(stream, new string[] {"Günther", "Günther", "is", "here"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenizerFactory("Pattern", "pattern", "something", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file


[16/27] lucenenet git commit: adding converted analysis common tests

Posted by sy...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fi/TestFinnishLightStemFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fi/TestFinnishLightStemFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fi/TestFinnishLightStemFilter.cs
new file mode 100644
index 0000000..27b4a7f
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fi/TestFinnishLightStemFilter.cs
@@ -0,0 +1,123 @@
+namespace org.apache.lucene.analysis.fi
+{
+
+	/*
+	 * 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 KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+	using SetKeywordMarkerFilter = org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter;
+	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+
+//JAVA TO C# CONVERTER TODO TASK: This Java 'import static' statement cannot be converted to C#:
+//	import static org.apache.lucene.analysis.VocabularyAssert.*;
+
+	/// <summary>
+	/// Simple tests for <seealso cref="FinnishLightStemFilter"/>
+	/// </summary>
+	public class TestFinnishLightStemFilter : BaseTokenStreamTestCase
+	{
+	  private Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper();
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  public AnalyzerAnonymousInnerClassHelper()
+		  {
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer source = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(source, new FinnishLightStemFilter(source));
+		  }
+	  }
+
+	  /// <summary>
+	  /// Test against a vocabulary from the reference impl </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testVocabulary() throws java.io.IOException
+	  public virtual void testVocabulary()
+	  {
+		assertVocabulary(analyzer, getDataFile("filighttestdata.zip"), "filight.txt");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testKeyword() throws java.io.IOException
+	  public virtual void testKeyword()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.util.CharArraySet exclusionSet = new org.apache.lucene.analysis.util.CharArraySet(TEST_VERSION_CURRENT, asSet("edeltäjistään"), false);
+		CharArraySet exclusionSet = new CharArraySet(TEST_VERSION_CURRENT, asSet("edeltäjistään"), false);
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper2(this, exclusionSet);
+		checkOneTerm(a, "edeltäjistään", "edeltäjistään");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestFinnishLightStemFilter outerInstance;
+
+		  private CharArraySet exclusionSet;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestFinnishLightStemFilter outerInstance, CharArraySet exclusionSet)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.exclusionSet = exclusionSet;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer source = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			TokenStream sink = new SetKeywordMarkerFilter(source, exclusionSet);
+			return new TokenStreamComponents(source, new FinnishLightStemFilter(sink));
+		  }
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), analyzer, 1000 * RANDOM_MULTIPLIER);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper3(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper3 : Analyzer
+	  {
+		  private readonly TestFinnishLightStemFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper3(TestFinnishLightStemFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new FinnishLightStemFilter(tokenizer));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fi/TestFinnishLightStemFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fi/TestFinnishLightStemFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fi/TestFinnishLightStemFilterFactory.cs
new file mode 100644
index 0000000..d10e428
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fi/TestFinnishLightStemFilterFactory.cs
@@ -0,0 +1,57 @@
+namespace org.apache.lucene.analysis.fi
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the Finnish light stem factory is working.
+	/// </summary>
+	public class TestFinnishLightStemFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStemming() throws Exception
+	  public virtual void testStemming()
+	  {
+		Reader reader = new StringReader("aseistettujen");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("FinnishLightStem").create(stream);
+		assertTokenStreamContents(stream, new string[] {"aseistet"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("FinnishLightStem", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fr/TestFrenchAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fr/TestFrenchAnalyzer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fr/TestFrenchAnalyzer.cs
new file mode 100644
index 0000000..73d61ce
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fr/TestFrenchAnalyzer.cs
@@ -0,0 +1,202 @@
+using System;
+
+namespace org.apache.lucene.analysis.fr
+{
+
+	/*
+	 * 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 CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+	using Version = org.apache.lucene.util.Version;
+
+	/// <summary>
+	/// Test case for FrenchAnalyzer.
+	/// 
+	/// </summary>
+
+	public class TestFrenchAnalyzer : BaseTokenStreamTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testAnalyzer() throws Exception
+	  public virtual void testAnalyzer()
+	  {
+		FrenchAnalyzer fa = new FrenchAnalyzer(TEST_VERSION_CURRENT);
+
+		assertAnalyzesTo(fa, "", new string[] { });
+
+		assertAnalyzesTo(fa, "chien chat cheval", new string[] {"chien", "chat", "cheval"});
+
+		assertAnalyzesTo(fa, "chien CHAT CHEVAL", new string[] {"chien", "chat", "cheval"});
+
+		assertAnalyzesTo(fa, "  chien  ,? + = -  CHAT /: > CHEVAL", new string[] {"chien", "chat", "cheval"});
+
+		assertAnalyzesTo(fa, "chien++", new string[] {"chien"});
+
+		assertAnalyzesTo(fa, "mot \"entreguillemet\"", new string[] {"mot", "entreguilemet"});
+
+		// let's do some french specific tests now
+
+		/* 1. couldn't resist
+		 I would expect this to stay one term as in French the minus
+		sign is often used for composing words */
+		assertAnalyzesTo(fa, "Jean-François", new string[] {"jean", "francoi"});
+
+		// 2. stopwords
+		assertAnalyzesTo(fa, "le la chien les aux chat du des à cheval", new string[] {"chien", "chat", "cheval"});
+
+		// some nouns and adjectives
+		assertAnalyzesTo(fa, "lances chismes habitable chiste éléments captifs", new string[] {"lanc", "chism", "habitabl", "chist", "element", "captif"});
+
+		// some verbs
+		assertAnalyzesTo(fa, "finissions souffrirent rugissante", new string[] {"finision", "soufrirent", "rugisant"});
+
+		// some everything else
+		// aujourd'hui stays one term which is OK
+		assertAnalyzesTo(fa, "C3PO aujourd'hui oeuf ïâöûàä anticonstitutionnellement Java++ ", new string[] {"c3po", "aujourd'hui", "oeuf", "ïaöuaä", "anticonstitutionel", "java"});
+
+		// some more everything else
+		// here 1940-1945 stays as one term, 1940:1945 not ?
+		assertAnalyzesTo(fa, "33Bis 1940-1945 1940:1945 (---i+++)*", new string[] {"33bi", "1940", "1945", "1940", "1945", "i"});
+
+	  }
+
+	  /// @deprecated (3.1) remove this test for Lucene 5.0 
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Deprecated("(3.1) remove this test for Lucene 5.0") public void testAnalyzer30() throws Exception
+	  [Obsolete("(3.1) remove this test for Lucene 5.0")]
+	  public virtual void testAnalyzer30()
+	  {
+		  FrenchAnalyzer fa = new FrenchAnalyzer(Version.LUCENE_30);
+
+		  assertAnalyzesTo(fa, "", new string[] { });
+
+		  assertAnalyzesTo(fa, "chien chat cheval", new string[] {"chien", "chat", "cheval"});
+
+		  assertAnalyzesTo(fa, "chien CHAT CHEVAL", new string[] {"chien", "chat", "cheval"});
+
+		  assertAnalyzesTo(fa, "  chien  ,? + = -  CHAT /: > CHEVAL", new string[] {"chien", "chat", "cheval"});
+
+		  assertAnalyzesTo(fa, "chien++", new string[] {"chien"});
+
+		  assertAnalyzesTo(fa, "mot \"entreguillemet\"", new string[] {"mot", "entreguillemet"});
+
+		  // let's do some french specific tests now
+
+		  /* 1. couldn't resist
+		   I would expect this to stay one term as in French the minus
+		  sign is often used for composing words */
+		  assertAnalyzesTo(fa, "Jean-François", new string[] {"jean", "françois"});
+
+		  // 2. stopwords
+		  assertAnalyzesTo(fa, "le la chien les aux chat du des à cheval", new string[] {"chien", "chat", "cheval"});
+
+		  // some nouns and adjectives
+		  assertAnalyzesTo(fa, "lances chismes habitable chiste éléments captifs", new string[] {"lanc", "chism", "habit", "chist", "élément", "captif"});
+
+		  // some verbs
+		  assertAnalyzesTo(fa, "finissions souffrirent rugissante", new string[] {"fin", "souffr", "rug"});
+
+		  // some everything else
+		  // aujourd'hui stays one term which is OK
+		  assertAnalyzesTo(fa, "C3PO aujourd'hui oeuf ïâöûàä anticonstitutionnellement Java++ ", new string[] {"c3po", "aujourd'hui", "oeuf", "ïâöûàä", "anticonstitutionnel", "jav"});
+
+		  // some more everything else
+		  // here 1940-1945 stays as one term, 1940:1945 not ?
+		  assertAnalyzesTo(fa, "33Bis 1940-1945 1940:1945 (---i+++)*", new string[] {"33bis", "1940-1945", "1940", "1945", "i"});
+
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testReusableTokenStream() throws Exception
+	  public virtual void testReusableTokenStream()
+	  {
+		FrenchAnalyzer fa = new FrenchAnalyzer(TEST_VERSION_CURRENT);
+		// stopwords
+		  assertAnalyzesTo(fa, "le la chien les aux chat du des à cheval", new string[] {"chien", "chat", "cheval"});
+
+		  // some nouns and adjectives
+		  assertAnalyzesTo(fa, "lances chismes habitable chiste éléments captifs", new string[] {"lanc", "chism", "habitabl", "chist", "element", "captif"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testExclusionTableViaCtor() throws Exception
+	  public virtual void testExclusionTableViaCtor()
+	  {
+		CharArraySet set = new CharArraySet(TEST_VERSION_CURRENT, 1, true);
+		set.add("habitable");
+		FrenchAnalyzer fa = new FrenchAnalyzer(TEST_VERSION_CURRENT, CharArraySet.EMPTY_SET, set);
+		assertAnalyzesTo(fa, "habitable chiste", new string[] {"habitable", "chist"});
+
+		fa = new FrenchAnalyzer(TEST_VERSION_CURRENT, CharArraySet.EMPTY_SET, set);
+		assertAnalyzesTo(fa, "habitable chiste", new string[] {"habitable", "chist"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testElision() throws Exception
+	  public virtual void testElision()
+	  {
+		FrenchAnalyzer fa = new FrenchAnalyzer(TEST_VERSION_CURRENT);
+		assertAnalyzesTo(fa, "voir l'embrouille", new string[] {"voir", "embrouil"});
+	  }
+
+	  /// <summary>
+	  /// Prior to 3.1, this analyzer had no lowercase filter.
+	  /// stopwords were case sensitive. Preserve this for back compat. </summary>
+	  /// @deprecated (3.1) Remove this test in Lucene 5.0 
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Deprecated("(3.1) Remove this test in Lucene 5.0") public void testBuggyStopwordsCasing() throws java.io.IOException
+	  [Obsolete("(3.1) Remove this test in Lucene 5.0")]
+	  public virtual void testBuggyStopwordsCasing()
+	  {
+		FrenchAnalyzer a = new FrenchAnalyzer(Version.LUCENE_30);
+		assertAnalyzesTo(a, "Votre", new string[] {"votr"});
+	  }
+
+	  /// <summary>
+	  /// Test that stopwords are not case sensitive
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStopwordsCasing() throws java.io.IOException
+	  public virtual void testStopwordsCasing()
+	  {
+		FrenchAnalyzer a = new FrenchAnalyzer(Version.LUCENE_31);
+		assertAnalyzesTo(a, "Votre", new string[] { });
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), new FrenchAnalyzer(TEST_VERSION_CURRENT), 1000 * RANDOM_MULTIPLIER);
+	  }
+
+	  /// <summary>
+	  /// test accent-insensitive </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testAccentInsensitive() throws Exception
+	  public virtual void testAccentInsensitive()
+	  {
+		Analyzer a = new FrenchAnalyzer(TEST_VERSION_CURRENT);
+		checkOneTerm(a, "sécuritaires", "securitair");
+		checkOneTerm(a, "securitaires", "securitair");
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fr/TestFrenchLightStemFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fr/TestFrenchLightStemFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fr/TestFrenchLightStemFilter.cs
new file mode 100644
index 0000000..150fad5
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fr/TestFrenchLightStemFilter.cs
@@ -0,0 +1,257 @@
+namespace org.apache.lucene.analysis.fr
+{
+
+	/*
+	 * 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 KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+	using SetKeywordMarkerFilter = org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter;
+	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+
+//JAVA TO C# CONVERTER TODO TASK: This Java 'import static' statement cannot be converted to C#:
+//	import static org.apache.lucene.analysis.VocabularyAssert.*;
+
+	/// <summary>
+	/// Simple tests for <seealso cref="FrenchLightStemFilter"/>
+	/// </summary>
+	public class TestFrenchLightStemFilter : BaseTokenStreamTestCase
+	{
+	  private Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper();
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  public AnalyzerAnonymousInnerClassHelper()
+		  {
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer source = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(source, new FrenchLightStemFilter(source));
+		  }
+	  }
+
+	  /// <summary>
+	  /// Test some examples from the paper </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testExamples() throws java.io.IOException
+	  public virtual void testExamples()
+	  {
+		checkOneTerm(analyzer, "chevaux", "cheval");
+		checkOneTerm(analyzer, "cheval", "cheval");
+
+		checkOneTerm(analyzer, "hiboux", "hibou");
+		checkOneTerm(analyzer, "hibou", "hibou");
+
+		checkOneTerm(analyzer, "chantés", "chant");
+		checkOneTerm(analyzer, "chanter", "chant");
+		checkOneTerm(analyzer, "chante", "chant");
+		checkOneTerm(analyzer, "chant", "chant");
+
+		checkOneTerm(analyzer, "baronnes", "baron");
+		checkOneTerm(analyzer, "barons", "baron");
+		checkOneTerm(analyzer, "baron", "baron");
+
+		checkOneTerm(analyzer, "peaux", "peau");
+		checkOneTerm(analyzer, "peau", "peau");
+
+		checkOneTerm(analyzer, "anneaux", "aneau");
+		checkOneTerm(analyzer, "anneau", "aneau");
+
+		checkOneTerm(analyzer, "neveux", "neveu");
+		checkOneTerm(analyzer, "neveu", "neveu");
+
+		checkOneTerm(analyzer, "affreux", "afreu");
+		checkOneTerm(analyzer, "affreuse", "afreu");
+
+		checkOneTerm(analyzer, "investissement", "investi");
+		checkOneTerm(analyzer, "investir", "investi");
+
+		checkOneTerm(analyzer, "assourdissant", "asourdi");
+		checkOneTerm(analyzer, "assourdir", "asourdi");
+
+		checkOneTerm(analyzer, "pratiquement", "pratiqu");
+		checkOneTerm(analyzer, "pratique", "pratiqu");
+
+		checkOneTerm(analyzer, "administrativement", "administratif");
+		checkOneTerm(analyzer, "administratif", "administratif");
+
+		checkOneTerm(analyzer, "justificatrice", "justifi");
+		checkOneTerm(analyzer, "justificateur", "justifi");
+		checkOneTerm(analyzer, "justifier", "justifi");
+
+		checkOneTerm(analyzer, "educatrice", "eduqu");
+		checkOneTerm(analyzer, "eduquer", "eduqu");
+
+		checkOneTerm(analyzer, "communicateur", "comuniqu");
+		checkOneTerm(analyzer, "communiquer", "comuniqu");
+
+		checkOneTerm(analyzer, "accompagnatrice", "acompagn");
+		checkOneTerm(analyzer, "accompagnateur", "acompagn");
+
+		checkOneTerm(analyzer, "administrateur", "administr");
+		checkOneTerm(analyzer, "administrer", "administr");
+
+		checkOneTerm(analyzer, "productrice", "product");
+		checkOneTerm(analyzer, "producteur", "product");
+
+		checkOneTerm(analyzer, "acheteuse", "achet");
+		checkOneTerm(analyzer, "acheteur", "achet");
+
+		checkOneTerm(analyzer, "planteur", "plant");
+		checkOneTerm(analyzer, "plante", "plant");
+
+		checkOneTerm(analyzer, "poreuse", "poreu");
+		checkOneTerm(analyzer, "poreux", "poreu");
+
+		checkOneTerm(analyzer, "plieuse", "plieu");
+
+		checkOneTerm(analyzer, "bijoutière", "bijouti");
+		checkOneTerm(analyzer, "bijoutier", "bijouti");
+
+		checkOneTerm(analyzer, "caissière", "caisi");
+		checkOneTerm(analyzer, "caissier", "caisi");
+
+		checkOneTerm(analyzer, "abrasive", "abrasif");
+		checkOneTerm(analyzer, "abrasif", "abrasif");
+
+		checkOneTerm(analyzer, "folle", "fou");
+		checkOneTerm(analyzer, "fou", "fou");
+
+		checkOneTerm(analyzer, "personnelle", "person");
+		checkOneTerm(analyzer, "personne", "person");
+
+		// algo bug: too short length
+		//checkOneTerm(analyzer, "personnel", "person");
+
+		checkOneTerm(analyzer, "complète", "complet");
+		checkOneTerm(analyzer, "complet", "complet");
+
+		checkOneTerm(analyzer, "aromatique", "aromat");
+
+		checkOneTerm(analyzer, "faiblesse", "faibl");
+		checkOneTerm(analyzer, "faible", "faibl");
+
+		checkOneTerm(analyzer, "patinage", "patin");
+		checkOneTerm(analyzer, "patin", "patin");
+
+		checkOneTerm(analyzer, "sonorisation", "sono");
+
+		checkOneTerm(analyzer, "ritualisation", "rituel");
+		checkOneTerm(analyzer, "rituel", "rituel");
+
+		// algo bug: masked by rules above
+		//checkOneTerm(analyzer, "colonisateur", "colon");
+
+		checkOneTerm(analyzer, "nomination", "nomin");
+
+		checkOneTerm(analyzer, "disposition", "dispos");
+		checkOneTerm(analyzer, "dispose", "dispos");
+
+		// SOLR-3463 : abusive compression of repeated characters in numbers
+		// Trailing repeated char elision :
+		checkOneTerm(analyzer, "1234555", "1234555");
+		// Repeated char within numbers with more than 4 characters :
+		checkOneTerm(analyzer, "12333345", "12333345");
+		// Short numbers weren't affected already:
+		checkOneTerm(analyzer, "1234", "1234");
+		// Ensure behaviour is preserved for words!
+		// Trailing repeated char elision :
+		checkOneTerm(analyzer, "abcdeff", "abcdef");
+		// Repeated char within words with more than 4 characters :
+		checkOneTerm(analyzer, "abcccddeef", "abcdef");
+		checkOneTerm(analyzer, "créées", "cre");
+		// Combined letter and digit repetition
+		checkOneTerm(analyzer, "22hh00", "22h00"); // 10:00pm
+	  }
+
+	  /// <summary>
+	  /// Test against a vocabulary from the reference impl </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testVocabulary() throws java.io.IOException
+	  public virtual void testVocabulary()
+	  {
+		assertVocabulary(analyzer, getDataFile("frlighttestdata.zip"), "frlight.txt");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testKeyword() throws java.io.IOException
+	  public virtual void testKeyword()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.util.CharArraySet exclusionSet = new org.apache.lucene.analysis.util.CharArraySet(TEST_VERSION_CURRENT, asSet("chevaux"), false);
+		CharArraySet exclusionSet = new CharArraySet(TEST_VERSION_CURRENT, asSet("chevaux"), false);
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper2(this, exclusionSet);
+		checkOneTerm(a, "chevaux", "chevaux");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestFrenchLightStemFilter outerInstance;
+
+		  private CharArraySet exclusionSet;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestFrenchLightStemFilter outerInstance, CharArraySet exclusionSet)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.exclusionSet = exclusionSet;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer source = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			TokenStream sink = new SetKeywordMarkerFilter(source, exclusionSet);
+			return new TokenStreamComponents(source, new FrenchLightStemFilter(sink));
+		  }
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), analyzer, 1000 * RANDOM_MULTIPLIER);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper3(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper3 : Analyzer
+	  {
+		  private readonly TestFrenchLightStemFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper3(TestFrenchLightStemFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new FrenchLightStemFilter(tokenizer));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fr/TestFrenchLightStemFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fr/TestFrenchLightStemFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fr/TestFrenchLightStemFilterFactory.cs
new file mode 100644
index 0000000..2ef3fb8
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fr/TestFrenchLightStemFilterFactory.cs
@@ -0,0 +1,57 @@
+namespace org.apache.lucene.analysis.fr
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the French light stem factory is working.
+	/// </summary>
+	public class TestFrenchLightStemFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStemming() throws Exception
+	  public virtual void testStemming()
+	  {
+		Reader reader = new StringReader("administrativement");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("FrenchLightStem").create(stream);
+		assertTokenStreamContents(stream, new string[] {"administratif"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("FrenchLightStem", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fr/TestFrenchMinimalStemFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fr/TestFrenchMinimalStemFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fr/TestFrenchMinimalStemFilter.cs
new file mode 100644
index 0000000..5116ae0
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fr/TestFrenchMinimalStemFilter.cs
@@ -0,0 +1,141 @@
+namespace org.apache.lucene.analysis.fr
+{
+
+	/*
+	 * 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 KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+	using SetKeywordMarkerFilter = org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter;
+	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+
+//JAVA TO C# CONVERTER TODO TASK: This Java 'import static' statement cannot be converted to C#:
+//	import static org.apache.lucene.analysis.VocabularyAssert.*;
+
+	/// <summary>
+	/// Simple tests for <seealso cref="FrenchMinimalStemFilter"/>
+	/// </summary>
+	public class TestFrenchMinimalStemFilter : BaseTokenStreamTestCase
+	{
+	  private Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper();
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  public AnalyzerAnonymousInnerClassHelper()
+		  {
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer source = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(source, new FrenchMinimalStemFilter(source));
+		  }
+	  }
+
+	  /// <summary>
+	  /// Test some examples from the paper </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testExamples() throws java.io.IOException
+	  public virtual void testExamples()
+	  {
+		checkOneTerm(analyzer, "chevaux", "cheval");
+		checkOneTerm(analyzer, "hiboux", "hibou");
+
+		checkOneTerm(analyzer, "chantés", "chant");
+		checkOneTerm(analyzer, "chanter", "chant");
+		checkOneTerm(analyzer, "chante", "chant");
+
+		checkOneTerm(analyzer, "baronnes", "baron");
+		checkOneTerm(analyzer, "barons", "baron");
+		checkOneTerm(analyzer, "baron", "baron");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testKeyword() throws java.io.IOException
+	  public virtual void testKeyword()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.util.CharArraySet exclusionSet = new org.apache.lucene.analysis.util.CharArraySet(TEST_VERSION_CURRENT, asSet("chevaux"), false);
+		CharArraySet exclusionSet = new CharArraySet(TEST_VERSION_CURRENT, asSet("chevaux"), false);
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper2(this, exclusionSet);
+		checkOneTerm(a, "chevaux", "chevaux");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestFrenchMinimalStemFilter outerInstance;
+
+		  private CharArraySet exclusionSet;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestFrenchMinimalStemFilter outerInstance, CharArraySet exclusionSet)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.exclusionSet = exclusionSet;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer source = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			TokenStream sink = new SetKeywordMarkerFilter(source, exclusionSet);
+			return new TokenStreamComponents(source, new FrenchMinimalStemFilter(sink));
+		  }
+	  }
+
+	  /// <summary>
+	  /// Test against a vocabulary from the reference impl </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testVocabulary() throws java.io.IOException
+	  public virtual void testVocabulary()
+	  {
+		assertVocabulary(analyzer, getDataFile("frminimaltestdata.zip"), "frminimal.txt");
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), analyzer, 1000 * RANDOM_MULTIPLIER);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper3(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper3 : Analyzer
+	  {
+		  private readonly TestFrenchMinimalStemFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper3(TestFrenchMinimalStemFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new FrenchMinimalStemFilter(tokenizer));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fr/TestFrenchMinimalStemFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fr/TestFrenchMinimalStemFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fr/TestFrenchMinimalStemFilterFactory.cs
new file mode 100644
index 0000000..576cf9a
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Fr/TestFrenchMinimalStemFilterFactory.cs
@@ -0,0 +1,57 @@
+namespace org.apache.lucene.analysis.fr
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the French minimal stem factory is working.
+	/// </summary>
+	public class TestFrenchMinimalStemFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStemming() throws Exception
+	  public virtual void testStemming()
+	  {
+		Reader reader = new StringReader("chevaux");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("FrenchMinimalStem").create(stream);
+		assertTokenStreamContents(stream, new string[] {"cheval"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("FrenchMinimalStem", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ga/TestIrishAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ga/TestIrishAnalyzer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ga/TestIrishAnalyzer.cs
new file mode 100644
index 0000000..25ad5db
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ga/TestIrishAnalyzer.cs
@@ -0,0 +1,90 @@
+namespace org.apache.lucene.analysis.ga
+{
+
+	/*
+	 * 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 CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+
+	public class TestIrishAnalyzer : BaseTokenStreamTestCase
+	{
+	  /// <summary>
+	  /// This test fails with NPE when the 
+	  /// stopwords file is missing in classpath 
+	  /// </summary>
+	  public virtual void testResourcesAvailable()
+	  {
+		new IrishAnalyzer(TEST_VERSION_CURRENT);
+	  }
+
+	  /// <summary>
+	  /// test stopwords and stemming </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBasics() throws java.io.IOException
+	  public virtual void testBasics()
+	  {
+		Analyzer a = new IrishAnalyzer(TEST_VERSION_CURRENT);
+		// stemming
+		checkOneTerm(a, "siopadóireacht", "siopadóir");
+		checkOneTerm(a, "síceapatacha", "síceapaite");
+		// stopword
+		assertAnalyzesTo(a, "le", new string[] { });
+	  }
+
+	  /// <summary>
+	  /// test use of elisionfilter </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testContractions() throws java.io.IOException
+	  public virtual void testContractions()
+	  {
+		Analyzer a = new IrishAnalyzer(TEST_VERSION_CURRENT);
+		assertAnalyzesTo(a, "b'fhearr m'athair", new string[] {"fearr", "athair"});
+	  }
+
+	  /// <summary>
+	  /// test use of exclusion set </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testExclude() throws java.io.IOException
+	  public virtual void testExclude()
+	  {
+		CharArraySet exclusionSet = new CharArraySet(TEST_VERSION_CURRENT, asSet("feirmeoireacht"), false);
+		Analyzer a = new IrishAnalyzer(TEST_VERSION_CURRENT, IrishAnalyzer.DefaultStopSet, exclusionSet);
+		checkOneTerm(a, "feirmeoireacht", "feirmeoireacht");
+		checkOneTerm(a, "siopadóireacht", "siopadóir");
+	  }
+
+	  /// <summary>
+	  /// test special hyphen handling </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testHyphens() throws java.io.IOException
+	  public virtual void testHyphens()
+	  {
+		Analyzer a = new IrishAnalyzer(TEST_VERSION_CURRENT);
+		assertAnalyzesTo(a, "n-athair", new string[] {"athair"}, new int[] {2});
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), new IrishAnalyzer(TEST_VERSION_CURRENT), 1000 * RANDOM_MULTIPLIER);
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ga/TestIrishLowerCaseFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ga/TestIrishLowerCaseFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ga/TestIrishLowerCaseFilter.cs
new file mode 100644
index 0000000..acfc6c5
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ga/TestIrishLowerCaseFilter.cs
@@ -0,0 +1,67 @@
+namespace org.apache.lucene.analysis.ga
+{
+
+	/*
+	 * 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 KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+
+	/// <summary>
+	/// Test the Irish lowercase filter.
+	/// </summary>
+	public class TestIrishLowerCaseFilter : BaseTokenStreamTestCase
+	{
+
+	  /// <summary>
+	  /// Test lowercase
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testIrishLowerCaseFilter() throws Exception
+	  public virtual void testIrishLowerCaseFilter()
+	  {
+		TokenStream stream = new MockTokenizer(new StringReader("nAthair tUISCE hARD"), MockTokenizer.WHITESPACE, false);
+		IrishLowerCaseFilter filter = new IrishLowerCaseFilter(stream);
+		assertTokenStreamContents(filter, new string[] {"n-athair", "t-uisce", "hard"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestIrishLowerCaseFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestIrishLowerCaseFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new IrishLowerCaseFilter(tokenizer));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ga/TestIrishLowerCaseFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ga/TestIrishLowerCaseFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ga/TestIrishLowerCaseFilterFactory.cs
new file mode 100644
index 0000000..3409ff3
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ga/TestIrishLowerCaseFilterFactory.cs
@@ -0,0 +1,57 @@
+namespace org.apache.lucene.analysis.ga
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the Irish lowercase filter factory is working.
+	/// </summary>
+	public class TestIrishLowerCaseFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCasing() throws Exception
+	  public virtual void testCasing()
+	  {
+		Reader reader = new StringReader("nAthair tUISCE hARD");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("IrishLowerCase").create(stream);
+		assertTokenStreamContents(stream, new string[] {"n-athair", "t-uisce", "hard"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("IrishLowerCase", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Gl/TestGalicianAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Gl/TestGalicianAnalyzer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Gl/TestGalicianAnalyzer.cs
new file mode 100644
index 0000000..8c97d02
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Gl/TestGalicianAnalyzer.cs
@@ -0,0 +1,70 @@
+namespace org.apache.lucene.analysis.gl
+{
+
+	/*
+	 * 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 CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+
+	public class TestGalicianAnalyzer : BaseTokenStreamTestCase
+	{
+	  /// <summary>
+	  /// This test fails with NPE when the 
+	  /// stopwords file is missing in classpath 
+	  /// </summary>
+	  public virtual void testResourcesAvailable()
+	  {
+		new GalicianAnalyzer(TEST_VERSION_CURRENT);
+	  }
+
+	  /// <summary>
+	  /// test stopwords and stemming </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBasics() throws java.io.IOException
+	  public virtual void testBasics()
+	  {
+		Analyzer a = new GalicianAnalyzer(TEST_VERSION_CURRENT);
+		// stemming
+		checkOneTerm(a, "correspondente", "correspond");
+		checkOneTerm(a, "corresponderá", "correspond");
+		// stopword
+		assertAnalyzesTo(a, "e", new string[] {});
+	  }
+
+	  /// <summary>
+	  /// test use of exclusion set </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testExclude() throws java.io.IOException
+	  public virtual void testExclude()
+	  {
+		CharArraySet exclusionSet = new CharArraySet(TEST_VERSION_CURRENT, asSet("correspondente"), false);
+		Analyzer a = new GalicianAnalyzer(TEST_VERSION_CURRENT, GalicianAnalyzer.DefaultStopSet, exclusionSet);
+		checkOneTerm(a, "correspondente", "correspondente");
+		checkOneTerm(a, "corresponderá", "correspond");
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), new GalicianAnalyzer(TEST_VERSION_CURRENT), 1000 * RANDOM_MULTIPLIER);
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Gl/TestGalicianMinimalStemFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Gl/TestGalicianMinimalStemFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Gl/TestGalicianMinimalStemFilter.cs
new file mode 100644
index 0000000..78429dc
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Gl/TestGalicianMinimalStemFilter.cs
@@ -0,0 +1,129 @@
+namespace org.apache.lucene.analysis.gl
+{
+
+	/*
+	 * 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 KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+	using SetKeywordMarkerFilter = org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter;
+	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+
+	/// <summary>
+	/// Simple tests for <seealso cref="GalicianMinimalStemmer"/>
+	/// </summary>
+	public class TestGalicianMinimalStemFilter : BaseTokenStreamTestCase
+	{
+	  internal Analyzer a = new AnalyzerAnonymousInnerClassHelper();
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  public AnalyzerAnonymousInnerClassHelper()
+		  {
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(tokenizer, new GalicianMinimalStemFilter(tokenizer));
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testPlural() throws Exception
+	  public virtual void testPlural()
+	  {
+		checkOneTerm(a, "elefantes", "elefante");
+		checkOneTerm(a, "elefante", "elefante");
+		checkOneTerm(a, "kalóres", "kalór");
+		checkOneTerm(a, "kalór", "kalór");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testExceptions() throws Exception
+	  public virtual void testExceptions()
+	  {
+		checkOneTerm(a, "mas", "mas");
+		checkOneTerm(a, "barcelonês", "barcelonês");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testKeyword() throws java.io.IOException
+	  public virtual void testKeyword()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.util.CharArraySet exclusionSet = new org.apache.lucene.analysis.util.CharArraySet(TEST_VERSION_CURRENT, asSet("elefantes"), false);
+		CharArraySet exclusionSet = new CharArraySet(TEST_VERSION_CURRENT, asSet("elefantes"), false);
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper2(this, exclusionSet);
+		checkOneTerm(a, "elefantes", "elefantes");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestGalicianMinimalStemFilter outerInstance;
+
+		  private CharArraySet exclusionSet;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestGalicianMinimalStemFilter outerInstance, CharArraySet exclusionSet)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.exclusionSet = exclusionSet;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer source = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			TokenStream sink = new SetKeywordMarkerFilter(source, exclusionSet);
+			return new TokenStreamComponents(source, new GalicianMinimalStemFilter(sink));
+		  }
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), a, 1000 * RANDOM_MULTIPLIER);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper3(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper3 : Analyzer
+	  {
+		  private readonly TestGalicianMinimalStemFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper3(TestGalicianMinimalStemFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new GalicianMinimalStemFilter(tokenizer));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Gl/TestGalicianMinimalStemFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Gl/TestGalicianMinimalStemFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Gl/TestGalicianMinimalStemFilterFactory.cs
new file mode 100644
index 0000000..91205aa
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Gl/TestGalicianMinimalStemFilterFactory.cs
@@ -0,0 +1,57 @@
+namespace org.apache.lucene.analysis.gl
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the Galician plural stem factory is working.
+	/// </summary>
+	public class TestGalicianMinimalStemFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStemming() throws Exception
+	  public virtual void testStemming()
+	  {
+		Reader reader = new StringReader("elefantes");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("GalicianMinimalStem").create(stream);
+		assertTokenStreamContents(stream, new string[] {"elefante"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("GalicianMinimalStem", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Gl/TestGalicianStemFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Gl/TestGalicianStemFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Gl/TestGalicianStemFilter.cs
new file mode 100644
index 0000000..e9f481b
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Gl/TestGalicianStemFilter.cs
@@ -0,0 +1,85 @@
+namespace org.apache.lucene.analysis.gl
+{
+
+	/*
+	 * 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.
+	 */
+
+//JAVA TO C# CONVERTER TODO TASK: This Java 'import static' statement cannot be converted to C#:
+//	import static org.apache.lucene.analysis.VocabularyAssert.assertVocabulary;
+
+
+	using KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+	using LowerCaseFilter = org.apache.lucene.analysis.core.LowerCaseFilter;
+	using StandardTokenizer = org.apache.lucene.analysis.standard.StandardTokenizer;
+
+	/// <summary>
+	/// Simple tests for <seealso cref="GalicianStemFilter"/>
+	/// </summary>
+	public class TestGalicianStemFilter : BaseTokenStreamTestCase
+	{
+	  private Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper();
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  public AnalyzerAnonymousInnerClassHelper()
+		  {
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer source = new StandardTokenizer(TEST_VERSION_CURRENT, reader);
+			TokenStream result = new LowerCaseFilter(TEST_VERSION_CURRENT, source);
+			return new TokenStreamComponents(source, new GalicianStemFilter(result));
+		  }
+	  }
+
+
+	  /// <summary>
+	  /// Test against a vocabulary from the reference impl </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testVocabulary() throws java.io.IOException
+	  public virtual void testVocabulary()
+	  {
+		assertVocabulary(analyzer, getDataFile("gltestdata.zip"), "gl.txt");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper2(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestGalicianStemFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestGalicianStemFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new GalicianStemFilter(tokenizer));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Gl/TestGalicianStemFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Gl/TestGalicianStemFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Gl/TestGalicianStemFilterFactory.cs
new file mode 100644
index 0000000..2df33cd
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Gl/TestGalicianStemFilterFactory.cs
@@ -0,0 +1,57 @@
+namespace org.apache.lucene.analysis.gl
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the Galician stem factory is working.
+	/// </summary>
+	public class TestGalicianStemFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStemming() throws Exception
+	  public virtual void testStemming()
+	  {
+		Reader reader = new StringReader("cariñosa");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("GalicianStem").create(stream);
+		assertTokenStreamContents(stream, new string[] {"cariñ"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("GalicianStem", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hi/TestHindiAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hi/TestHindiAnalyzer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hi/TestHindiAnalyzer.cs
new file mode 100644
index 0000000..effd583
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hi/TestHindiAnalyzer.cs
@@ -0,0 +1,66 @@
+namespace org.apache.lucene.analysis.hi
+{
+
+	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+
+	/*
+	 * 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>
+	/// Tests the HindiAnalyzer
+	/// </summary>
+	public class TestHindiAnalyzer : BaseTokenStreamTestCase
+	{
+	  /// <summary>
+	  /// This test fails with NPE when the 
+	  /// stopwords file is missing in classpath 
+	  /// </summary>
+	  public virtual void testResourcesAvailable()
+	  {
+		new HindiAnalyzer(TEST_VERSION_CURRENT);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBasics() throws Exception
+	  public virtual void testBasics()
+	  {
+		Analyzer a = new HindiAnalyzer(TEST_VERSION_CURRENT);
+		// two ways to write 'hindi' itself.
+		checkOneTerm(a, "हिन्दी", "हिंद");
+		checkOneTerm(a, "हिंदी", "हिंद");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testExclusionSet() throws Exception
+	  public virtual void testExclusionSet()
+	  {
+		CharArraySet exclusionSet = new CharArraySet(TEST_VERSION_CURRENT, asSet("हिंदी"), false);
+		Analyzer a = new HindiAnalyzer(TEST_VERSION_CURRENT, HindiAnalyzer.DefaultStopSet, exclusionSet);
+		checkOneTerm(a, "हिंदी", "हिंदी");
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), new HindiAnalyzer(TEST_VERSION_CURRENT), 1000 * RANDOM_MULTIPLIER);
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hi/TestHindiFilters.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hi/TestHindiFilters.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hi/TestHindiFilters.cs
new file mode 100644
index 0000000..f6341ec
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hi/TestHindiFilters.cs
@@ -0,0 +1,109 @@
+namespace org.apache.lucene.analysis.hi
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the Hindi filter Factories are working.
+	/// </summary>
+	public class TestHindiFilters : BaseTokenStreamFactoryTestCase
+	{
+	  /// <summary>
+	  /// Test IndicNormalizationFilterFactory
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testIndicNormalizer() throws Exception
+	  public virtual void testIndicNormalizer()
+	  {
+		Reader reader = new StringReader("ত্‍ अाैर");
+		TokenStream stream = tokenizerFactory("Standard").create(reader);
+		stream = tokenFilterFactory("IndicNormalization").create(stream);
+		assertTokenStreamContents(stream, new string[] {"ৎ", "और"});
+	  }
+
+	  /// <summary>
+	  /// Test HindiNormalizationFilterFactory
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testHindiNormalizer() throws Exception
+	  public virtual void testHindiNormalizer()
+	  {
+		Reader reader = new StringReader("क़िताब");
+		TokenStream stream = tokenizerFactory("Standard").create(reader);
+		stream = tokenFilterFactory("IndicNormalization").create(stream);
+		stream = tokenFilterFactory("HindiNormalization").create(stream);
+		assertTokenStreamContents(stream, new string[] {"किताब"});
+	  }
+
+	  /// <summary>
+	  /// Test HindiStemFilterFactory
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStemmer() throws Exception
+	  public virtual void testStemmer()
+	  {
+		Reader reader = new StringReader("किताबें");
+		TokenStream stream = tokenizerFactory("Standard").create(reader);
+		stream = tokenFilterFactory("IndicNormalization").create(stream);
+		stream = tokenFilterFactory("HindiNormalization").create(stream);
+		stream = tokenFilterFactory("HindiStem").create(stream);
+		assertTokenStreamContents(stream, new string[] {"किताब"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("IndicNormalization", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+
+		try
+		{
+		  tokenFilterFactory("HindiNormalization", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+
+		try
+		{
+		  tokenFilterFactory("HindiStem", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hi/TestHindiNormalizer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hi/TestHindiNormalizer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hi/TestHindiNormalizer.cs
new file mode 100644
index 0000000..6be2282
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hi/TestHindiNormalizer.cs
@@ -0,0 +1,98 @@
+namespace org.apache.lucene.analysis.hi
+{
+
+	/*
+	 * 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 KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+
+	/// <summary>
+	/// Test HindiNormalizer
+	/// </summary>
+	public class TestHindiNormalizer : BaseTokenStreamTestCase
+	{
+	  /// <summary>
+	  /// Test some basic normalization, with an example from the paper.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBasics() throws java.io.IOException
+	  public virtual void testBasics()
+	  {
+		check("अँगरेज़ी", "अंगरेजि");
+		check("अँगरेजी", "अंगरेजि");
+		check("अँग्रेज़ी", "अंगरेजि");
+		check("अँग्रेजी", "अंगरेजि");
+		check("अंगरेज़ी", "अंगरेजि");
+		check("अंगरेजी", "अंगरेजि");
+		check("अंग्रेज़ी", "अंगरेजि");
+		check("अंग्रेजी", "अंगरेजि");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testDecompositions() throws java.io.IOException
+	  public virtual void testDecompositions()
+	  {
+		// removing nukta dot
+		check("क़िताब", "किताब");
+		check("फ़र्ज़", "फरज");
+		check("क़र्ज़", "करज");
+		// some other composed nukta forms
+		check("ऱऴख़ग़ड़ढ़य़", "रळखगडढय");
+		// removal of format (ZWJ/ZWNJ)
+		check("शार्‍मा", "शारमा");
+		check("शार्‌मा", "शारमा");
+		// removal of chandra
+		check("ॅॆॉॊऍऎऑऒ\u0972", "ेेोोएएओओअ");
+		// vowel shortening
+		check("आईऊॠॡऐऔीूॄॣैौ", "अइउऋऌएओिुृॢेो");
+	  }
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: private void check(String input, String output) throws java.io.IOException
+	  private void check(string input, string output)
+	  {
+		Tokenizer tokenizer = new MockTokenizer(new StringReader(input), MockTokenizer.WHITESPACE, false);
+		TokenFilter tf = new HindiNormalizationFilter(tokenizer);
+		assertTokenStreamContents(tf, new string[] {output});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestHindiNormalizer outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestHindiNormalizer outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new HindiNormalizationFilter(tokenizer));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hi/TestHindiStemmer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hi/TestHindiStemmer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hi/TestHindiStemmer.cs
new file mode 100644
index 0000000..c81c70d
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hi/TestHindiStemmer.cs
@@ -0,0 +1,126 @@
+namespace org.apache.lucene.analysis.hi
+{
+
+	/*
+	 * 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 KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+
+	/// <summary>
+	/// Test HindiStemmer
+	/// </summary>
+	public class TestHindiStemmer : BaseTokenStreamTestCase
+	{
+	  /// <summary>
+	  /// Test masc noun inflections
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMasculineNouns() throws java.io.IOException
+	  public virtual void testMasculineNouns()
+	  {
+		check("लडका", "लडक");
+		check("लडके", "लडक");
+		check("लडकों", "लडक");
+
+		check("गुरु", "गुर");
+		check("गुरुओं", "गुर");
+
+		check("दोस्त", "दोस्त");
+		check("दोस्तों", "दोस्त");
+	  }
+
+	  /// <summary>
+	  /// Test feminine noun inflections
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFeminineNouns() throws java.io.IOException
+	  public virtual void testFeminineNouns()
+	  {
+		check("लडकी", "लडक");
+		check("लडकियों", "लडक");
+
+		check("किताब", "किताब");
+		check("किताबें", "किताब");
+		check("किताबों", "किताब");
+
+		check("आध्यापीका", "आध्यापीक");
+		check("आध्यापीकाएं", "आध्यापीक");
+		check("आध्यापीकाओं", "आध्यापीक");
+	  }
+
+	  /// <summary>
+	  /// Test some verb forms
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testVerbs() throws java.io.IOException
+	  public virtual void testVerbs()
+	  {
+		check("खाना", "खा");
+		check("खाता", "खा");
+		check("खाती", "खा");
+		check("खा", "खा");
+	  }
+
+	  /// <summary>
+	  /// From the paper: since the suffix list for verbs includes AI, awA and anI,
+	  /// additional suffixes had to be added to the list for noun/adjectives
+	  /// ending with these endings.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testExceptions() throws java.io.IOException
+	  public virtual void testExceptions()
+	  {
+		check("कठिनाइयां", "कठिन");
+		check("कठिन", "कठिन");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: private void check(String input, String output) throws java.io.IOException
+	  private void check(string input, string output)
+	  {
+		Tokenizer tokenizer = new MockTokenizer(new StringReader(input), MockTokenizer.WHITESPACE, false);
+		TokenFilter tf = new HindiStemFilter(tokenizer);
+		assertTokenStreamContents(tf, new string[] {output});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestHindiStemmer outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestHindiStemmer outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new HindiStemFilter(tokenizer));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hu/TestHungarianAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hu/TestHungarianAnalyzer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hu/TestHungarianAnalyzer.cs
new file mode 100644
index 0000000..7ab11b2
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hu/TestHungarianAnalyzer.cs
@@ -0,0 +1,70 @@
+namespace org.apache.lucene.analysis.hu
+{
+
+	/*
+	 * 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 CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+
+	public class TestHungarianAnalyzer : BaseTokenStreamTestCase
+	{
+	  /// <summary>
+	  /// This test fails with NPE when the 
+	  /// stopwords file is missing in classpath 
+	  /// </summary>
+	  public virtual void testResourcesAvailable()
+	  {
+		new HungarianAnalyzer(TEST_VERSION_CURRENT);
+	  }
+
+	  /// <summary>
+	  /// test stopwords and stemming </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBasics() throws java.io.IOException
+	  public virtual void testBasics()
+	  {
+		Analyzer a = new HungarianAnalyzer(TEST_VERSION_CURRENT);
+		// stemming
+		checkOneTerm(a, "babakocsi", "babakocs");
+		checkOneTerm(a, "babakocsijáért", "babakocs");
+		// stopword
+		assertAnalyzesTo(a, "által", new string[] {});
+	  }
+
+	  /// <summary>
+	  /// test use of exclusion set </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testExclude() throws java.io.IOException
+	  public virtual void testExclude()
+	  {
+		CharArraySet exclusionSet = new CharArraySet(TEST_VERSION_CURRENT, asSet("babakocsi"), false);
+		Analyzer a = new HungarianAnalyzer(TEST_VERSION_CURRENT, HungarianAnalyzer.DefaultStopSet, exclusionSet);
+		checkOneTerm(a, "babakocsi", "babakocsi");
+		checkOneTerm(a, "babakocsijáért", "babakocs");
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), new HungarianAnalyzer(TEST_VERSION_CURRENT), 1000 * RANDOM_MULTIPLIER);
+	  }
+	}
+
+}
\ No newline at end of file


[23/27] lucenenet git commit: adding converted analysis common tests

Posted by sy...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Commongrams/CommonGramsFilterTest.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Commongrams/CommonGramsFilterTest.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Commongrams/CommonGramsFilterTest.cs
new file mode 100644
index 0000000..fcc15c5
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Commongrams/CommonGramsFilterTest.cs
@@ -0,0 +1,346 @@
+/*
+ * 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 org.apache.lucene.analysis.commongrams
+{
+
+
+	using org.apache.lucene.analysis;
+	using WhitespaceTokenizer = org.apache.lucene.analysis.core.WhitespaceTokenizer;
+	using CharTermAttribute = org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
+	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+
+	/// <summary>
+	/// Tests CommonGrams(Query)Filter
+	/// </summary>
+	public class CommonGramsFilterTest : BaseTokenStreamTestCase
+	{
+	  private static readonly CharArraySet commonWords = new CharArraySet(TEST_VERSION_CURRENT, Arrays.asList("s", "a", "b", "c", "d", "the", "of"), false);
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testReset() throws Exception
+	  public virtual void testReset()
+	  {
+		const string input = "How the s a brown s cow d like A B thing?";
+		WhitespaceTokenizer wt = new WhitespaceTokenizer(TEST_VERSION_CURRENT, new StringReader(input));
+		CommonGramsFilter cgf = new CommonGramsFilter(TEST_VERSION_CURRENT, wt, commonWords);
+
+		CharTermAttribute term = cgf.addAttribute(typeof(CharTermAttribute));
+		cgf.reset();
+		assertTrue(cgf.incrementToken());
+		assertEquals("How", term.ToString());
+		assertTrue(cgf.incrementToken());
+		assertEquals("How_the", term.ToString());
+		assertTrue(cgf.incrementToken());
+		assertEquals("the", term.ToString());
+		assertTrue(cgf.incrementToken());
+		assertEquals("the_s", term.ToString());
+		cgf.close();
+
+		wt.Reader = new StringReader(input);
+		cgf.reset();
+		assertTrue(cgf.incrementToken());
+		assertEquals("How", term.ToString());
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testQueryReset() throws Exception
+	  public virtual void testQueryReset()
+	  {
+		const string input = "How the s a brown s cow d like A B thing?";
+		WhitespaceTokenizer wt = new WhitespaceTokenizer(TEST_VERSION_CURRENT, new StringReader(input));
+		CommonGramsFilter cgf = new CommonGramsFilter(TEST_VERSION_CURRENT, wt, commonWords);
+		CommonGramsQueryFilter nsf = new CommonGramsQueryFilter(cgf);
+
+		CharTermAttribute term = wt.addAttribute(typeof(CharTermAttribute));
+		nsf.reset();
+		assertTrue(nsf.incrementToken());
+		assertEquals("How_the", term.ToString());
+		assertTrue(nsf.incrementToken());
+		assertEquals("the_s", term.ToString());
+		nsf.close();
+
+		wt.Reader = new StringReader(input);
+		nsf.reset();
+		assertTrue(nsf.incrementToken());
+		assertEquals("How_the", term.ToString());
+	  }
+
+	  /// <summary>
+	  /// This is for testing CommonGramsQueryFilter which outputs a set of tokens
+	  /// optimized for querying with only one token at each position, either a
+	  /// unigram or a bigram It also will not return a token for the final position
+	  /// if the final word is already in the preceding bigram Example:(three
+	  /// tokens/positions in)
+	  /// "foo bar the"=>"foo:1|bar:2,bar-the:2|the:3=> "foo" "bar-the" (2 tokens
+	  /// out)
+	  /// 
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCommonGramsQueryFilter() throws Exception
+	  public virtual void testCommonGramsQueryFilter()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper(this);
+
+		// Stop words used below are "of" "the" and "s"
+
+		// two word queries
+		assertAnalyzesTo(a, "brown fox", new string[] {"brown", "fox"});
+		assertAnalyzesTo(a, "the fox", new string[] {"the_fox"});
+		assertAnalyzesTo(a, "fox of", new string[] {"fox_of"});
+		assertAnalyzesTo(a, "of the", new string[] {"of_the"});
+
+		// one word queries
+		assertAnalyzesTo(a, "the", new string[] {"the"});
+		assertAnalyzesTo(a, "foo", new string[] {"foo"});
+
+		// 3 word combinations s=stopword/common word n=not a stop word
+		assertAnalyzesTo(a, "n n n", new string[] {"n", "n", "n"});
+		assertAnalyzesTo(a, "quick brown fox", new string[] {"quick", "brown", "fox"});
+
+		assertAnalyzesTo(a, "n n s", new string[] {"n", "n_s"});
+		assertAnalyzesTo(a, "quick brown the", new string[] {"quick", "brown_the"});
+
+		assertAnalyzesTo(a, "n s n", new string[] {"n_s", "s_n"});
+		assertAnalyzesTo(a, "quick the brown", new string[] {"quick_the", "the_brown"});
+
+		assertAnalyzesTo(a, "n s s", new string[] {"n_s", "s_s"});
+		assertAnalyzesTo(a, "fox of the", new string[] {"fox_of", "of_the"});
+
+		assertAnalyzesTo(a, "s n n", new string[] {"s_n", "n", "n"});
+		assertAnalyzesTo(a, "the quick brown", new string[] {"the_quick", "quick", "brown"});
+
+		assertAnalyzesTo(a, "s n s", new string[] {"s_n", "n_s"});
+		assertAnalyzesTo(a, "the fox of", new string[] {"the_fox", "fox_of"});
+
+		assertAnalyzesTo(a, "s s n", new string[] {"s_s", "s_n"});
+		assertAnalyzesTo(a, "of the fox", new string[] {"of_the", "the_fox"});
+
+		assertAnalyzesTo(a, "s s s", new string[] {"s_s", "s_s"});
+		assertAnalyzesTo(a, "of the of", new string[] {"of_the", "the_of"});
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly CommonGramsFilterTest outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper(CommonGramsFilterTest outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  public override TokenStreamComponents createComponents(string field, Reader @in)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(@in, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(tokenizer, new CommonGramsQueryFilter(new CommonGramsFilter(TEST_VERSION_CURRENT, tokenizer, commonWords)));
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCommonGramsFilter() throws Exception
+	  public virtual void testCommonGramsFilter()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper2(this);
+
+		// Stop words used below are "of" "the" and "s"
+		// one word queries
+		assertAnalyzesTo(a, "the", new string[] {"the"});
+		assertAnalyzesTo(a, "foo", new string[] {"foo"});
+
+		// two word queries
+		assertAnalyzesTo(a, "brown fox", new string[] {"brown", "fox"}, new int[] {1, 1});
+		assertAnalyzesTo(a, "the fox", new string[] {"the", "the_fox", "fox"}, new int[] {1, 0, 1});
+		assertAnalyzesTo(a, "fox of", new string[] {"fox", "fox_of", "of"}, new int[] {1, 0, 1});
+		assertAnalyzesTo(a, "of the", new string[] {"of", "of_the", "the"}, new int[] {1, 0, 1});
+
+		// 3 word combinations s=stopword/common word n=not a stop word
+		assertAnalyzesTo(a, "n n n", new string[] {"n", "n", "n"}, new int[] {1, 1, 1});
+		assertAnalyzesTo(a, "quick brown fox", new string[] {"quick", "brown", "fox"}, new int[] {1, 1, 1});
+
+		assertAnalyzesTo(a, "n n s", new string[] {"n", "n", "n_s", "s"}, new int[] {1, 1, 0, 1});
+		assertAnalyzesTo(a, "quick brown the", new string[] {"quick", "brown", "brown_the", "the"}, new int[] {1, 1, 0, 1});
+
+		assertAnalyzesTo(a, "n s n", new string[] {"n", "n_s", "s", "s_n", "n"}, new int[] {1, 0, 1, 0, 1});
+		assertAnalyzesTo(a, "quick the fox", new string[] {"quick", "quick_the", "the", "the_fox", "fox"}, new int[] {1, 0, 1, 0, 1});
+
+		assertAnalyzesTo(a, "n s s", new string[] {"n", "n_s", "s", "s_s", "s"}, new int[] {1, 0, 1, 0, 1});
+		assertAnalyzesTo(a, "fox of the", new string[] {"fox", "fox_of", "of", "of_the", "the"}, new int[] {1, 0, 1, 0, 1});
+
+		assertAnalyzesTo(a, "s n n", new string[] {"s", "s_n", "n", "n"}, new int[] {1, 0, 1, 1});
+		assertAnalyzesTo(a, "the quick brown", new string[] {"the", "the_quick", "quick", "brown"}, new int[] {1, 0, 1, 1});
+
+		assertAnalyzesTo(a, "s n s", new string[] {"s", "s_n", "n", "n_s", "s"}, new int[] {1, 0, 1, 0, 1});
+		assertAnalyzesTo(a, "the fox of", new string[] {"the", "the_fox", "fox", "fox_of", "of"}, new int[] {1, 0, 1, 0, 1});
+
+		assertAnalyzesTo(a, "s s n", new string[] {"s", "s_s", "s", "s_n", "n"}, new int[] {1, 0, 1, 0, 1});
+		assertAnalyzesTo(a, "of the fox", new string[] {"of", "of_the", "the", "the_fox", "fox"}, new int[] {1, 0, 1, 0, 1});
+
+		assertAnalyzesTo(a, "s s s", new string[] {"s", "s_s", "s", "s_s", "s"}, new int[] {1, 0, 1, 0, 1});
+		assertAnalyzesTo(a, "of the of", new string[] {"of", "of_the", "the", "the_of", "of"}, new int[] {1, 0, 1, 0, 1});
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly CommonGramsFilterTest outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper2(CommonGramsFilterTest outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  public override TokenStreamComponents createComponents(string field, Reader @in)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(@in, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(tokenizer, new CommonGramsFilter(TEST_VERSION_CURRENT, tokenizer, commonWords));
+		  }
+	  }
+
+	  /// <summary>
+	  /// Test that CommonGramsFilter works correctly in case-insensitive mode
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCaseSensitive() throws Exception
+	  public virtual void testCaseSensitive()
+	  {
+		const string input = "How The s a brown s cow d like A B thing?";
+		MockTokenizer wt = new MockTokenizer(new StringReader(input), MockTokenizer.WHITESPACE, false);
+		TokenFilter cgf = new CommonGramsFilter(TEST_VERSION_CURRENT, wt, commonWords);
+		assertTokenStreamContents(cgf, new string[] {"How", "The", "The_s", "s", "s_a", "a", "a_brown", "brown", "brown_s", "s", "s_cow", "cow", "cow_d", "d", "d_like", "like", "A", "B", "thing?"});
+	  }
+
+	  /// <summary>
+	  /// Test CommonGramsQueryFilter in the case that the last word is a stopword
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testLastWordisStopWord() throws Exception
+	  public virtual void testLastWordisStopWord()
+	  {
+		const string input = "dog the";
+		MockTokenizer wt = new MockTokenizer(new StringReader(input), MockTokenizer.WHITESPACE, false);
+		CommonGramsFilter cgf = new CommonGramsFilter(TEST_VERSION_CURRENT, wt, commonWords);
+		TokenFilter nsf = new CommonGramsQueryFilter(cgf);
+		assertTokenStreamContents(nsf, new string[] {"dog_the"});
+	  }
+
+	  /// <summary>
+	  /// Test CommonGramsQueryFilter in the case that the first word is a stopword
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFirstWordisStopWord() throws Exception
+	  public virtual void testFirstWordisStopWord()
+	  {
+		const string input = "the dog";
+		MockTokenizer wt = new MockTokenizer(new StringReader(input), MockTokenizer.WHITESPACE, false);
+		CommonGramsFilter cgf = new CommonGramsFilter(TEST_VERSION_CURRENT, wt, commonWords);
+		TokenFilter nsf = new CommonGramsQueryFilter(cgf);
+		assertTokenStreamContents(nsf, new string[] {"the_dog"});
+	  }
+
+	  /// <summary>
+	  /// Test CommonGramsQueryFilter in the case of a single (stop)word query
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testOneWordQueryStopWord() throws Exception
+	  public virtual void testOneWordQueryStopWord()
+	  {
+		const string input = "the";
+		MockTokenizer wt = new MockTokenizer(new StringReader(input), MockTokenizer.WHITESPACE, false);
+		CommonGramsFilter cgf = new CommonGramsFilter(TEST_VERSION_CURRENT, wt, commonWords);
+		TokenFilter nsf = new CommonGramsQueryFilter(cgf);
+		assertTokenStreamContents(nsf, new string[] {"the"});
+	  }
+
+	  /// <summary>
+	  /// Test CommonGramsQueryFilter in the case of a single word query
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testOneWordQuery() throws Exception
+	  public virtual void testOneWordQuery()
+	  {
+		const string input = "monster";
+		MockTokenizer wt = new MockTokenizer(new StringReader(input), MockTokenizer.WHITESPACE, false);
+		CommonGramsFilter cgf = new CommonGramsFilter(TEST_VERSION_CURRENT, wt, commonWords);
+		TokenFilter nsf = new CommonGramsQueryFilter(cgf);
+		assertTokenStreamContents(nsf, new string[] {"monster"});
+	  }
+
+	  /// <summary>
+	  /// Test CommonGramsQueryFilter when first and last words are stopwords.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void TestFirstAndLastStopWord() throws Exception
+	  public virtual void TestFirstAndLastStopWord()
+	  {
+		const string input = "the of";
+		MockTokenizer wt = new MockTokenizer(new StringReader(input), MockTokenizer.WHITESPACE, false);
+		CommonGramsFilter cgf = new CommonGramsFilter(TEST_VERSION_CURRENT, wt, commonWords);
+		TokenFilter nsf = new CommonGramsQueryFilter(cgf);
+		assertTokenStreamContents(nsf, new string[] {"the_of"});
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper3(this);
+
+		checkRandomData(random(), a, 1000 * RANDOM_MULTIPLIER);
+
+		Analyzer b = new AnalyzerAnonymousInnerClassHelper4(this);
+
+		checkRandomData(random(), b, 1000 * RANDOM_MULTIPLIER);
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper3 : Analyzer
+	  {
+		  private readonly CommonGramsFilterTest outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper3(CommonGramsFilterTest outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer t = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			CommonGramsFilter cgf = new CommonGramsFilter(TEST_VERSION_CURRENT, t, commonWords);
+			return new TokenStreamComponents(t, cgf);
+		  }
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper4 : Analyzer
+	  {
+		  private readonly CommonGramsFilterTest outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper4(CommonGramsFilterTest outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer t = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			CommonGramsFilter cgf = new CommonGramsFilter(TEST_VERSION_CURRENT, t, commonWords);
+			return new TokenStreamComponents(t, new CommonGramsQueryFilter(cgf));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Commongrams/TestCommonGramsFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Commongrams/TestCommonGramsFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Commongrams/TestCommonGramsFilterFactory.cs
new file mode 100644
index 0000000..858f851
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Commongrams/TestCommonGramsFilterFactory.cs
@@ -0,0 +1,101 @@
+namespace org.apache.lucene.analysis.commongrams
+{
+
+	/*
+	 * 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 TestStopFilter = org.apache.lucene.analysis.core.TestStopFilter;
+	using BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+	using ClasspathResourceLoader = org.apache.lucene.analysis.util.ClasspathResourceLoader;
+	using ResourceLoader = org.apache.lucene.analysis.util.ResourceLoader;
+
+	/// <summary>
+	/// Tests pretty much copied from StopFilterFactoryTest We use the test files
+	/// used by the StopFilterFactoryTest TODO: consider creating separate test files
+	/// so this won't break if stop filter test files change
+	/// 
+	/// </summary>
+	public class TestCommonGramsFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testInform() throws Exception
+	  public virtual void testInform()
+	  {
+		ResourceLoader loader = new ClasspathResourceLoader(typeof(TestStopFilter));
+		assertTrue("loader is null and it shouldn't be", loader != null);
+		CommonGramsFilterFactory factory = (CommonGramsFilterFactory) tokenFilterFactory("CommonGrams", TEST_VERSION_CURRENT, loader, "words", "stop-1.txt", "ignoreCase", "true");
+		CharArraySet words = factory.CommonWords;
+		assertTrue("words is null and it shouldn't be", words != null);
+		assertTrue("words Size: " + words.size() + " is not: " + 2, words.size() == 2);
+		assertTrue(factory.IgnoreCase + " does not equal: " + true, factory.IgnoreCase == true);
+
+		factory = (CommonGramsFilterFactory) tokenFilterFactory("CommonGrams", TEST_VERSION_CURRENT, loader, "words", "stop-1.txt, stop-2.txt", "ignoreCase", "true");
+		words = factory.CommonWords;
+		assertTrue("words is null and it shouldn't be", words != null);
+		assertTrue("words Size: " + words.size() + " is not: " + 4, words.size() == 4);
+		assertTrue(factory.IgnoreCase + " does not equal: " + true, factory.IgnoreCase == true);
+
+		factory = (CommonGramsFilterFactory) tokenFilterFactory("CommonGrams", TEST_VERSION_CURRENT, loader, "words", "stop-snowball.txt", "format", "snowball", "ignoreCase", "true");
+		words = factory.CommonWords;
+		assertEquals(8, words.size());
+		assertTrue(words.contains("he"));
+		assertTrue(words.contains("him"));
+		assertTrue(words.contains("his"));
+		assertTrue(words.contains("himself"));
+		assertTrue(words.contains("she"));
+		assertTrue(words.contains("her"));
+		assertTrue(words.contains("hers"));
+		assertTrue(words.contains("herself"));
+	  }
+
+	  /// <summary>
+	  /// If no words are provided, then a set of english default stopwords is used.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testDefaults() throws Exception
+	  public virtual void testDefaults()
+	  {
+		CommonGramsFilterFactory factory = (CommonGramsFilterFactory) tokenFilterFactory("CommonGrams");
+		CharArraySet words = factory.CommonWords;
+		assertTrue("words is null and it shouldn't be", words != null);
+		assertTrue(words.contains("the"));
+		Tokenizer tokenizer = new MockTokenizer(new StringReader("testing the factory"), MockTokenizer.WHITESPACE, false);
+		TokenStream stream = factory.create(tokenizer);
+		assertTokenStreamContents(stream, new string[] {"testing", "testing_the", "the", "the_factory", "factory"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("CommonGrams", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Commongrams/TestCommonGramsQueryFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Commongrams/TestCommonGramsQueryFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Commongrams/TestCommonGramsQueryFilterFactory.cs
new file mode 100644
index 0000000..64b4f93
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Commongrams/TestCommonGramsQueryFilterFactory.cs
@@ -0,0 +1,101 @@
+namespace org.apache.lucene.analysis.commongrams
+{
+
+	/*
+	 * 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 TestStopFilter = org.apache.lucene.analysis.core.TestStopFilter;
+	using BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+	using ClasspathResourceLoader = org.apache.lucene.analysis.util.ClasspathResourceLoader;
+	using ResourceLoader = org.apache.lucene.analysis.util.ResourceLoader;
+
+	/// <summary>
+	/// Tests pretty much copied from StopFilterFactoryTest We use the test files
+	/// used by the StopFilterFactoryTest TODO: consider creating separate test files
+	/// so this won't break if stop filter test files change
+	/// 
+	/// </summary>
+	public class TestCommonGramsQueryFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testInform() throws Exception
+	  public virtual void testInform()
+	  {
+		ResourceLoader loader = new ClasspathResourceLoader(typeof(TestStopFilter));
+		assertTrue("loader is null and it shouldn't be", loader != null);
+		CommonGramsQueryFilterFactory factory = (CommonGramsQueryFilterFactory) tokenFilterFactory("CommonGramsQuery", TEST_VERSION_CURRENT, loader, "words", "stop-1.txt", "ignoreCase", "true");
+		CharArraySet words = factory.CommonWords;
+		assertTrue("words is null and it shouldn't be", words != null);
+		assertTrue("words Size: " + words.size() + " is not: " + 2, words.size() == 2);
+		assertTrue(factory.IgnoreCase + " does not equal: " + true, factory.IgnoreCase == true);
+
+		factory = (CommonGramsQueryFilterFactory) tokenFilterFactory("CommonGramsQuery", TEST_VERSION_CURRENT, loader, "words", "stop-1.txt, stop-2.txt", "ignoreCase", "true");
+		words = factory.CommonWords;
+		assertTrue("words is null and it shouldn't be", words != null);
+		assertTrue("words Size: " + words.size() + " is not: " + 4, words.size() == 4);
+		assertTrue(factory.IgnoreCase + " does not equal: " + true, factory.IgnoreCase == true);
+
+		factory = (CommonGramsQueryFilterFactory) tokenFilterFactory("CommonGramsQuery", TEST_VERSION_CURRENT, loader, "words", "stop-snowball.txt", "format", "snowball", "ignoreCase", "true");
+		words = factory.CommonWords;
+		assertEquals(8, words.size());
+		assertTrue(words.contains("he"));
+		assertTrue(words.contains("him"));
+		assertTrue(words.contains("his"));
+		assertTrue(words.contains("himself"));
+		assertTrue(words.contains("she"));
+		assertTrue(words.contains("her"));
+		assertTrue(words.contains("hers"));
+		assertTrue(words.contains("herself"));
+	  }
+
+	  /// <summary>
+	  /// If no words are provided, then a set of english default stopwords is used.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testDefaults() throws Exception
+	  public virtual void testDefaults()
+	  {
+		CommonGramsQueryFilterFactory factory = (CommonGramsQueryFilterFactory) tokenFilterFactory("CommonGramsQuery");
+		CharArraySet words = factory.CommonWords;
+		assertTrue("words is null and it shouldn't be", words != null);
+		assertTrue(words.contains("the"));
+		Tokenizer tokenizer = new MockTokenizer(new StringReader("testing the factory"), MockTokenizer.WHITESPACE, false);
+		TokenStream stream = factory.create(tokenizer);
+		assertTokenStreamContents(stream, new string[] {"testing_the", "the_factory"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("CommonGramsQuery", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Compound/TestCompoundWordTokenFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Compound/TestCompoundWordTokenFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Compound/TestCompoundWordTokenFilter.cs
new file mode 100644
index 0000000..7aa8a77
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Compound/TestCompoundWordTokenFilter.cs
@@ -0,0 +1,412 @@
+namespace org.apache.lucene.analysis.compound
+{
+
+	/*
+	 * 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 MappingCharFilter = org.apache.lucene.analysis.charfilter.MappingCharFilter;
+	using NormalizeCharMap = org.apache.lucene.analysis.charfilter.NormalizeCharMap;
+	using HyphenationTree = org.apache.lucene.analysis.compound.hyphenation.HyphenationTree;
+	using KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+	using WhitespaceTokenizer = org.apache.lucene.analysis.core.WhitespaceTokenizer;
+	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+	using CharTermAttribute = org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
+	using Attribute = org.apache.lucene.util.Attribute;
+	using AttributeImpl = org.apache.lucene.util.AttributeImpl;
+	using InputSource = org.xml.sax.InputSource;
+
+	public class TestCompoundWordTokenFilter : BaseTokenStreamTestCase
+	{
+
+	  private static CharArraySet makeDictionary(params string[] dictionary)
+	  {
+		return new CharArraySet(TEST_VERSION_CURRENT, Arrays.asList(dictionary), true);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testHyphenationCompoundWordsDA() throws Exception
+	  public virtual void testHyphenationCompoundWordsDA()
+	  {
+		CharArraySet dict = makeDictionary("læse", "hest");
+
+		InputSource @is = new InputSource(this.GetType().getResource("da_UTF8.xml").toExternalForm());
+		HyphenationTree hyphenator = HyphenationCompoundWordTokenFilter.getHyphenationTree(@is);
+
+		HyphenationCompoundWordTokenFilter tf = new HyphenationCompoundWordTokenFilter(TEST_VERSION_CURRENT, new MockTokenizer(new StringReader("min veninde som er lidt af en læsehest"), MockTokenizer.WHITESPACE, false), hyphenator, dict, CompoundWordTokenFilterBase.DEFAULT_MIN_WORD_SIZE, CompoundWordTokenFilterBase.DEFAULT_MIN_SUBWORD_SIZE, CompoundWordTokenFilterBase.DEFAULT_MAX_SUBWORD_SIZE, false);
+		assertTokenStreamContents(tf, new string[] {"min", "veninde", "som", "er", "lidt", "af", "en", "læsehest", "læse", "hest"}, new int[] {1, 1, 1, 1, 1, 1, 1, 1, 0, 0});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testHyphenationCompoundWordsDELongestMatch() throws Exception
+	  public virtual void testHyphenationCompoundWordsDELongestMatch()
+	  {
+		CharArraySet dict = makeDictionary("basketball", "basket", "ball", "kurv");
+
+		InputSource @is = new InputSource(this.GetType().getResource("da_UTF8.xml").toExternalForm());
+		HyphenationTree hyphenator = HyphenationCompoundWordTokenFilter.getHyphenationTree(@is);
+
+		// the word basket will not be added due to the longest match option
+		HyphenationCompoundWordTokenFilter tf = new HyphenationCompoundWordTokenFilter(TEST_VERSION_CURRENT, new MockTokenizer(new StringReader("basketballkurv"), MockTokenizer.WHITESPACE, false), hyphenator, dict, CompoundWordTokenFilterBase.DEFAULT_MIN_WORD_SIZE, CompoundWordTokenFilterBase.DEFAULT_MIN_SUBWORD_SIZE, 40, true);
+		assertTokenStreamContents(tf, new string[] {"basketballkurv", "basketball", "ball", "kurv"}, new int[] {1, 0, 0, 0});
+
+	  }
+
+	  /// <summary>
+	  /// With hyphenation-only, you can get a lot of nonsense tokens.
+	  /// This can be controlled with the min/max subword size.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testHyphenationOnly() throws Exception
+	  public virtual void testHyphenationOnly()
+	  {
+		InputSource @is = new InputSource(this.GetType().getResource("da_UTF8.xml").toExternalForm());
+		HyphenationTree hyphenator = HyphenationCompoundWordTokenFilter.getHyphenationTree(@is);
+
+		HyphenationCompoundWordTokenFilter tf = new HyphenationCompoundWordTokenFilter(TEST_VERSION_CURRENT, new MockTokenizer(new StringReader("basketballkurv"), MockTokenizer.WHITESPACE, false), hyphenator, CompoundWordTokenFilterBase.DEFAULT_MIN_WORD_SIZE, 2, 4);
+
+		// min=2, max=4
+		assertTokenStreamContents(tf, new string[] {"basketballkurv", "ba", "sket", "bal", "ball", "kurv"});
+
+		tf = new HyphenationCompoundWordTokenFilter(TEST_VERSION_CURRENT, new MockTokenizer(new StringReader("basketballkurv"), MockTokenizer.WHITESPACE, false), hyphenator, CompoundWordTokenFilterBase.DEFAULT_MIN_WORD_SIZE, 4, 6);
+
+		// min=4, max=6
+		assertTokenStreamContents(tf, new string[] {"basketballkurv", "basket", "sket", "ball", "lkurv", "kurv"});
+
+		tf = new HyphenationCompoundWordTokenFilter(TEST_VERSION_CURRENT, new MockTokenizer(new StringReader("basketballkurv"), MockTokenizer.WHITESPACE, false), hyphenator, CompoundWordTokenFilterBase.DEFAULT_MIN_WORD_SIZE, 4, 10);
+
+		// min=4, max=10
+		assertTokenStreamContents(tf, new string[] {"basketballkurv", "basket", "basketbal", "basketball", "sket", "sketbal", "sketball", "ball", "ballkurv", "lkurv", "kurv"});
+
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testDumbCompoundWordsSE() throws Exception
+	  public virtual void testDumbCompoundWordsSE()
+	  {
+		CharArraySet dict = makeDictionary("Bil", "Dörr", "Motor", "Tak", "Borr", "Slag", "Hammar", "Pelar", "Glas", "Ögon", "Fodral", "Bas", "Fiol", "Makare", "Gesäll", "Sko", "Vind", "Rute", "Torkare", "Blad");
+
+		DictionaryCompoundWordTokenFilter tf = new DictionaryCompoundWordTokenFilter(TEST_VERSION_CURRENT, new MockTokenizer(new StringReader("Bildörr Bilmotor Biltak Slagborr Hammarborr Pelarborr Glasögonfodral Basfiolsfodral Basfiolsfodralmakaregesäll Skomakare Vindrutetorkare Vindrutetorkarblad abba"), MockTokenizer.WHITESPACE, false), dict);
+
+		assertTokenStreamContents(tf, new string[] {"Bildörr", "Bil", "dörr", "Bilmotor", "Bil", "motor", "Biltak", "Bil", "tak", "Slagborr", "Slag", "borr", "Hammarborr", "Hammar", "borr", "Pelarborr", "Pelar", "borr", "Glasögonfodral", "Glas", "ögon", "fodral", "Basfiolsfodral", "Bas", "fiol", "fodral", "Basfiolsfodralmakaregesäll", "Bas", "fiol", "fodral", "makare", "gesäll", "Skomakare", "Sko", "makare", "Vindrutetorkare", "Vind", "rute", "torkare", "Vindrutetorkarblad", "Vind", "rute", "blad", "abba"}, new int[] {0, 0, 0, 8, 8, 8, 17, 17, 17, 24, 24, 24, 33, 33, 33, 44, 44, 44, 54, 54, 54, 54, 69, 69, 69, 69, 84, 84, 84, 84, 84, 84, 111, 111, 111, 121, 121, 121, 121, 137, 137, 137, 137, 156}, new int[] {7, 7, 7, 16, 16, 16, 23, 23, 23, 32, 32, 32, 43, 43, 43, 53, 53, 53, 68, 68, 68, 68, 83, 83, 83, 83, 110, 110, 110, 110, 110, 110, 120, 120, 120, 136, 136, 136, 136, 155, 155, 155, 155, 160}, new int[] {1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0
 , 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testDumbCompoundWordsSELongestMatch() throws Exception
+	  public virtual void testDumbCompoundWordsSELongestMatch()
+	  {
+		CharArraySet dict = makeDictionary("Bil", "Dörr", "Motor", "Tak", "Borr", "Slag", "Hammar", "Pelar", "Glas", "Ögon", "Fodral", "Bas", "Fiols", "Makare", "Gesäll", "Sko", "Vind", "Rute", "Torkare", "Blad", "Fiolsfodral");
+
+		DictionaryCompoundWordTokenFilter tf = new DictionaryCompoundWordTokenFilter(TEST_VERSION_CURRENT, new MockTokenizer(new StringReader("Basfiolsfodralmakaregesäll"), MockTokenizer.WHITESPACE, false), dict, CompoundWordTokenFilterBase.DEFAULT_MIN_WORD_SIZE, CompoundWordTokenFilterBase.DEFAULT_MIN_SUBWORD_SIZE, CompoundWordTokenFilterBase.DEFAULT_MAX_SUBWORD_SIZE, true);
+
+		assertTokenStreamContents(tf, new string[] {"Basfiolsfodralmakaregesäll", "Bas", "fiolsfodral", "fodral", "makare", "gesäll"}, new int[] {0, 0, 0, 0, 0, 0}, new int[] {26, 26, 26, 26, 26, 26}, new int[] {1, 0, 0, 0, 0, 0});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTokenEndingWithWordComponentOfMinimumLength() throws Exception
+	  public virtual void testTokenEndingWithWordComponentOfMinimumLength()
+	  {
+		CharArraySet dict = makeDictionary("ab", "cd", "ef");
+
+		DictionaryCompoundWordTokenFilter tf = new DictionaryCompoundWordTokenFilter(TEST_VERSION_CURRENT, new WhitespaceTokenizer(TEST_VERSION_CURRENT, new StringReader("abcdef")
+		   ), dict, CompoundWordTokenFilterBase.DEFAULT_MIN_WORD_SIZE, CompoundWordTokenFilterBase.DEFAULT_MIN_SUBWORD_SIZE, CompoundWordTokenFilterBase.DEFAULT_MAX_SUBWORD_SIZE, false);
+
+		assertTokenStreamContents(tf, new string[] {"abcdef", "ab", "cd", "ef"}, new int[] {0, 0, 0, 0}, new int[] {6, 6, 6, 6}, new int[] {1, 0, 0, 0});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testWordComponentWithLessThanMinimumLength() throws Exception
+	  public virtual void testWordComponentWithLessThanMinimumLength()
+	  {
+		CharArraySet dict = makeDictionary("abc", "d", "efg");
+
+		DictionaryCompoundWordTokenFilter tf = new DictionaryCompoundWordTokenFilter(TEST_VERSION_CURRENT, new WhitespaceTokenizer(TEST_VERSION_CURRENT, new StringReader("abcdefg")
+		   ), dict, CompoundWordTokenFilterBase.DEFAULT_MIN_WORD_SIZE, CompoundWordTokenFilterBase.DEFAULT_MIN_SUBWORD_SIZE, CompoundWordTokenFilterBase.DEFAULT_MAX_SUBWORD_SIZE, false);
+
+	  // since "d" is shorter than the minimum subword size, it should not be added to the token stream
+		assertTokenStreamContents(tf, new string[] {"abcdefg", "abc", "efg"}, new int[] {0, 0, 0}, new int[] {7, 7, 7}, new int[] {1, 0, 0});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testReset() throws Exception
+	  public virtual void testReset()
+	  {
+		CharArraySet dict = makeDictionary("Rind", "Fleisch", "Draht", "Schere", "Gesetz", "Aufgabe", "Überwachung");
+
+		Tokenizer wsTokenizer = new WhitespaceTokenizer(TEST_VERSION_CURRENT, new StringReader("Rindfleischüberwachungsgesetz"));
+		DictionaryCompoundWordTokenFilter tf = new DictionaryCompoundWordTokenFilter(TEST_VERSION_CURRENT, wsTokenizer, dict, CompoundWordTokenFilterBase.DEFAULT_MIN_WORD_SIZE, CompoundWordTokenFilterBase.DEFAULT_MIN_SUBWORD_SIZE, CompoundWordTokenFilterBase.DEFAULT_MAX_SUBWORD_SIZE, false);
+
+		CharTermAttribute termAtt = tf.getAttribute(typeof(CharTermAttribute));
+		tf.reset();
+		assertTrue(tf.incrementToken());
+		assertEquals("Rindfleischüberwachungsgesetz", termAtt.ToString());
+		assertTrue(tf.incrementToken());
+		assertEquals("Rind", termAtt.ToString());
+		tf.end();
+		tf.close();
+		wsTokenizer.Reader = new StringReader("Rindfleischüberwachungsgesetz");
+		tf.reset();
+		assertTrue(tf.incrementToken());
+		assertEquals("Rindfleischüberwachungsgesetz", termAtt.ToString());
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRetainMockAttribute() throws Exception
+	  public virtual void testRetainMockAttribute()
+	  {
+		CharArraySet dict = makeDictionary("abc", "d", "efg");
+		Tokenizer tokenizer = new WhitespaceTokenizer(TEST_VERSION_CURRENT, new StringReader("abcdefg"));
+		TokenStream stream = new MockRetainAttributeFilter(tokenizer);
+		stream = new DictionaryCompoundWordTokenFilter(TEST_VERSION_CURRENT, stream, dict, CompoundWordTokenFilterBase.DEFAULT_MIN_WORD_SIZE, CompoundWordTokenFilterBase.DEFAULT_MIN_SUBWORD_SIZE, CompoundWordTokenFilterBase.DEFAULT_MAX_SUBWORD_SIZE, false);
+		MockRetainAttribute retAtt = stream.addAttribute(typeof(MockRetainAttribute));
+		stream.reset();
+		while (stream.incrementToken())
+		{
+		  assertTrue("Custom attribute value was lost", retAtt.Retain);
+		}
+
+	  }
+
+	  public interface MockRetainAttribute : Attribute
+	  {
+		bool Retain {set;get;}
+	  }
+
+	  public sealed class MockRetainAttributeImpl : AttributeImpl, MockRetainAttribute
+	  {
+		internal bool retain = false;
+		public override void clear()
+		{
+		  retain = false;
+		}
+		public bool Retain
+		{
+			get
+			{
+			  return retain;
+			}
+			set
+			{
+			  this.retain = value;
+			}
+		}
+		public override void copyTo(AttributeImpl target)
+		{
+		  MockRetainAttribute t = (MockRetainAttribute) target;
+		  t.Retain = retain;
+		}
+	  }
+
+	  private class MockRetainAttributeFilter : TokenFilter
+	  {
+
+		internal MockRetainAttribute retainAtt = addAttribute(typeof(MockRetainAttribute));
+
+		internal MockRetainAttributeFilter(TokenStream input) : base(input)
+		{
+		}
+
+//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())
+		  {
+			retainAtt.Retain = true;
+			return true;
+		  }
+		  else
+		  {
+		  return false;
+		  }
+		}
+	  }
+
+	  // SOLR-2891
+	  // *CompoundWordTokenFilter blindly adds term length to offset, but this can take things out of bounds
+	  // wrt original text if a previous filter increases the length of the word (in this case ü -> ue)
+	  // so in this case we behave like WDF, and preserve any modified offsets
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testInvalidOffsets() throws Exception
+	  public virtual void testInvalidOffsets()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.util.CharArraySet dict = makeDictionary("fall");
+		CharArraySet dict = makeDictionary("fall");
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.charfilter.NormalizeCharMap.Builder builder = new org.apache.lucene.analysis.charfilter.NormalizeCharMap.Builder();
+		NormalizeCharMap.Builder builder = new NormalizeCharMap.Builder();
+		builder.add("ü", "ue");
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.charfilter.NormalizeCharMap normMap = builder.build();
+		NormalizeCharMap normMap = builder.build();
+
+		Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper(this, dict, normMap);
+
+		assertAnalyzesTo(analyzer, "banküberfall", new string[] {"bankueberfall", "fall"}, new int[] {0, 0}, new int[] {12, 12});
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestCompoundWordTokenFilter outerInstance;
+
+		  private CharArraySet dict;
+		  private NormalizeCharMap normMap;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestCompoundWordTokenFilter outerInstance, CharArraySet dict, NormalizeCharMap normMap)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.dict = dict;
+			  this.normMap = normMap;
+		  }
+
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			TokenFilter filter = new DictionaryCompoundWordTokenFilter(TEST_VERSION_CURRENT, tokenizer, dict);
+			return new TokenStreamComponents(tokenizer, filter);
+		  }
+
+		  protected internal override Reader initReader(string fieldName, Reader reader)
+		  {
+			return new MappingCharFilter(normMap, reader);
+		  }
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.util.CharArraySet dict = makeDictionary("a", "e", "i", "o", "u", "y", "bc", "def");
+		CharArraySet dict = makeDictionary("a", "e", "i", "o", "u", "y", "bc", "def");
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper2(this, dict);
+		checkRandomData(random(), a, 1000 * RANDOM_MULTIPLIER);
+
+		InputSource @is = new InputSource(this.GetType().getResource("da_UTF8.xml").toExternalForm());
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.compound.hyphenation.HyphenationTree hyphenator = HyphenationCompoundWordTokenFilter.getHyphenationTree(is);
+		HyphenationTree hyphenator = HyphenationCompoundWordTokenFilter.getHyphenationTree(@is);
+		Analyzer b = new AnalyzerAnonymousInnerClassHelper3(this, hyphenator);
+		checkRandomData(random(), b, 1000 * RANDOM_MULTIPLIER);
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestCompoundWordTokenFilter outerInstance;
+
+		  private CharArraySet dict;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestCompoundWordTokenFilter outerInstance, CharArraySet dict)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.dict = dict;
+		  }
+
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(tokenizer, new DictionaryCompoundWordTokenFilter(TEST_VERSION_CURRENT, tokenizer, dict));
+		  }
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper3 : Analyzer
+	  {
+		  private readonly TestCompoundWordTokenFilter outerInstance;
+
+		  private HyphenationTree hyphenator;
+
+		  public AnalyzerAnonymousInnerClassHelper3(TestCompoundWordTokenFilter outerInstance, HyphenationTree hyphenator)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.hyphenator = hyphenator;
+		  }
+
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			TokenFilter filter = new HyphenationCompoundWordTokenFilter(TEST_VERSION_CURRENT, tokenizer, hyphenator);
+			return new TokenStreamComponents(tokenizer, filter);
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws Exception
+	  public virtual void testEmptyTerm()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.util.CharArraySet dict = makeDictionary("a", "e", "i", "o", "u", "y", "bc", "def");
+		CharArraySet dict = makeDictionary("a", "e", "i", "o", "u", "y", "bc", "def");
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper4(this, dict);
+		checkOneTerm(a, "", "");
+
+		InputSource @is = new InputSource(this.GetType().getResource("da_UTF8.xml").toExternalForm());
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.compound.hyphenation.HyphenationTree hyphenator = HyphenationCompoundWordTokenFilter.getHyphenationTree(is);
+		HyphenationTree hyphenator = HyphenationCompoundWordTokenFilter.getHyphenationTree(@is);
+		Analyzer b = new AnalyzerAnonymousInnerClassHelper5(this, hyphenator);
+		checkOneTerm(b, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper4 : Analyzer
+	  {
+		  private readonly TestCompoundWordTokenFilter outerInstance;
+
+		  private CharArraySet dict;
+
+		  public AnalyzerAnonymousInnerClassHelper4(TestCompoundWordTokenFilter outerInstance, CharArraySet dict)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.dict = dict;
+		  }
+
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new DictionaryCompoundWordTokenFilter(TEST_VERSION_CURRENT, tokenizer, dict));
+		  }
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper5 : Analyzer
+	  {
+		  private readonly TestCompoundWordTokenFilter outerInstance;
+
+		  private HyphenationTree hyphenator;
+
+		  public AnalyzerAnonymousInnerClassHelper5(TestCompoundWordTokenFilter outerInstance, HyphenationTree hyphenator)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.hyphenator = hyphenator;
+		  }
+
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			TokenFilter filter = new HyphenationCompoundWordTokenFilter(TEST_VERSION_CURRENT, tokenizer, hyphenator);
+			return new TokenStreamComponents(tokenizer, filter);
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Compound/TestDictionaryCompoundWordTokenFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Compound/TestDictionaryCompoundWordTokenFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Compound/TestDictionaryCompoundWordTokenFilterFactory.cs
new file mode 100644
index 0000000..dd219c0
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Compound/TestDictionaryCompoundWordTokenFilterFactory.cs
@@ -0,0 +1,60 @@
+namespace org.apache.lucene.analysis.compound
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the Dictionary compound filter factory is working.
+	/// </summary>
+	public class TestDictionaryCompoundWordTokenFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+	  /// <summary>
+	  /// Ensure the filter actually decompounds text.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testDecompounding() throws Exception
+	  public virtual void testDecompounding()
+	  {
+		Reader reader = new StringReader("I like to play softball");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("DictionaryCompoundWord", "dictionary", "compoundDictionary.txt").create(stream);
+		assertTokenStreamContents(stream, new string[] {"I", "like", "to", "play", "softball", "soft", "ball"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("DictionaryCompoundWord", "dictionary", "compoundDictionary.txt", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Compound/TestHyphenationCompoundWordTokenFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Compound/TestHyphenationCompoundWordTokenFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Compound/TestHyphenationCompoundWordTokenFilterFactory.cs
new file mode 100644
index 0000000..f195618
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Compound/TestHyphenationCompoundWordTokenFilterFactory.cs
@@ -0,0 +1,77 @@
+namespace org.apache.lucene.analysis.compound
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the Hyphenation compound filter factory is working.
+	/// </summary>
+	public class TestHyphenationCompoundWordTokenFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+	  /// <summary>
+	  /// Ensure the factory works with hyphenation grammar+dictionary: using default options.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testHyphenationWithDictionary() throws Exception
+	  public virtual void testHyphenationWithDictionary()
+	  {
+		Reader reader = new StringReader("min veninde som er lidt af en læsehest");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("HyphenationCompoundWord", "hyphenator", "da_UTF8.xml", "dictionary", "da_compoundDictionary.txt").create(stream);
+
+		assertTokenStreamContents(stream, new string[] {"min", "veninde", "som", "er", "lidt", "af", "en", "læsehest", "læse", "hest"}, new int[] {1, 1, 1, 1, 1, 1, 1, 1, 0, 0});
+	  }
+
+	  /// <summary>
+	  /// Ensure the factory works with no dictionary: using hyphenation grammar only.
+	  /// Also change the min/max subword sizes from the default. When using no dictionary,
+	  /// its generally necessary to tweak these, or you get lots of expansions.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testHyphenationOnly() throws Exception
+	  public virtual void testHyphenationOnly()
+	  {
+		Reader reader = new StringReader("basketballkurv");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("HyphenationCompoundWord", "hyphenator", "da_UTF8.xml", "minSubwordSize", "2", "maxSubwordSize", "4").create(stream);
+
+		assertTokenStreamContents(stream, new string[] {"basketballkurv", "ba", "sket", "bal", "ball", "kurv"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("HyphenationCompoundWord", "hyphenator", "da_UTF8.xml", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestAllAnalyzersHaveFactories.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestAllAnalyzersHaveFactories.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestAllAnalyzersHaveFactories.cs
new file mode 100644
index 0000000..0c6a4ca
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestAllAnalyzersHaveFactories.cs
@@ -0,0 +1,193 @@
+using System;
+using System.Collections.Generic;
+
+namespace org.apache.lucene.analysis.core
+{
+
+	/*
+	 * 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 PatternKeywordMarkerFilter = org.apache.lucene.analysis.miscellaneous.PatternKeywordMarkerFilter;
+	using SetKeywordMarkerFilter = org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter;
+	using FrenchStemFilter = org.apache.lucene.analysis.fr.FrenchStemFilter;
+	using IndicTokenizer = org.apache.lucene.analysis.@in.IndicTokenizer;
+	using DutchStemFilter = org.apache.lucene.analysis.nl.DutchStemFilter;
+	using ReversePathHierarchyTokenizer = org.apache.lucene.analysis.path.ReversePathHierarchyTokenizer;
+	using TeeSinkTokenFilter = org.apache.lucene.analysis.sinks.TeeSinkTokenFilter;
+	using SnowballFilter = org.apache.lucene.analysis.snowball.SnowballFilter;
+	using CharFilterFactory = org.apache.lucene.analysis.util.CharFilterFactory;
+	using ResourceLoader = org.apache.lucene.analysis.util.ResourceLoader;
+	using ResourceLoaderAware = org.apache.lucene.analysis.util.ResourceLoaderAware;
+	using StringMockResourceLoader = org.apache.lucene.analysis.util.StringMockResourceLoader;
+	using TokenFilterFactory = org.apache.lucene.analysis.util.TokenFilterFactory;
+	using TokenizerFactory = org.apache.lucene.analysis.util.TokenizerFactory;
+	using LuceneTestCase = org.apache.lucene.util.LuceneTestCase;
+
+	/// <summary>
+	/// Tests that any newly added Tokenizers/TokenFilters/CharFilters have a
+	/// corresponding factory (and that the SPI configuration is correct)
+	/// </summary>
+	public class TestAllAnalyzersHaveFactories : LuceneTestCase
+	{
+
+	  // these are test-only components (e.g. test-framework)
+	  private static readonly ISet<Type> testComponents = Collections.newSetFromMap(new IdentityHashMap<Type, bool?>());
+	  static TestAllAnalyzersHaveFactories()
+	  {
+		Collections.addAll<Type>(testComponents, typeof(MockTokenizer), typeof(MockCharFilter), typeof(MockFixedLengthPayloadFilter), typeof(MockGraphTokenFilter), typeof(MockHoleInjectingTokenFilter), typeof(MockRandomLookaheadTokenFilter), typeof(MockTokenFilter), typeof(MockVariableLengthPayloadFilter), typeof(ValidatingTokenFilter), typeof(CrankyTokenFilter));
+		Collections.addAll<Type>(crazyComponents, typeof(CachingTokenFilter), typeof(TeeSinkTokenFilter));
+		Collections.addAll<Type>(deprecatedDuplicatedComponents, typeof(DutchStemFilter), typeof(FrenchStemFilter), typeof(IndicTokenizer));
+		Collections.addAll<Type>(oddlyNamedComponents, typeof(ReversePathHierarchyTokenizer), typeof(SnowballFilter), typeof(PatternKeywordMarkerFilter), typeof(SetKeywordMarkerFilter)); // this is called SnowballPorterFilterFactory -  this is supported via an option to PathHierarchyTokenizer's factory
+	  }
+
+	  // these are 'crazy' components like cachingtokenfilter. does it make sense to add factories for these?
+	  private static readonly ISet<Type> crazyComponents = Collections.newSetFromMap(new IdentityHashMap<Type, bool?>());
+
+	  // these are deprecated components that are just exact dups of other functionality: they dont need factories
+	  // (they never had them)
+	  private static readonly ISet<Type> deprecatedDuplicatedComponents = Collections.newSetFromMap(new IdentityHashMap<Type, bool?>());
+
+	  // these are oddly-named (either the actual analyzer, or its factory)
+	  // they do actually have factories.
+	  // TODO: clean this up!
+	  private static readonly ISet<Type> oddlyNamedComponents = Collections.newSetFromMap(new IdentityHashMap<Type, bool?>());
+
+	  private static readonly ResourceLoader loader = new StringMockResourceLoader("");
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void test() throws Exception
+	  public virtual void test()
+	  {
+		IList<Type> analysisClasses = new List<Type>();
+		((List<Type>)analysisClasses).AddRange(TestRandomChains.getClassesForPackage("org.apache.lucene.analysis"));
+		((List<Type>)analysisClasses).AddRange(TestRandomChains.getClassesForPackage("org.apache.lucene.collation"));
+
+		foreach (Class c in analysisClasses)
+		{
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int modifiers = c.getModifiers();
+		  int modifiers = c.Modifiers;
+		  if (Modifier.isAbstract(modifiers) || !Modifier.isPublic(modifiers) || c.Synthetic || c.AnonymousClass || c.MemberClass || c.Interface || testComponents.Contains(c) || crazyComponents.Contains(c) || oddlyNamedComponents.Contains(c) || deprecatedDuplicatedComponents.Contains(c) || c.isAnnotationPresent(typeof(Deprecated)) || !(c.IsSubclassOf(typeof(Tokenizer)) || c.IsSubclassOf(typeof(TokenFilter)) || c.IsSubclassOf(typeof(CharFilter))))
+		  { // deprecated ones are typically back compat hacks
+			// don't waste time with abstract classes
+			continue;
+		  }
+
+		  IDictionary<string, string> args = new Dictionary<string, string>();
+		  args["luceneMatchVersion"] = TEST_VERSION_CURRENT.ToString();
+
+		  if (c.IsSubclassOf(typeof(Tokenizer)))
+		  {
+			string clazzName = c.SimpleName;
+			assertTrue(clazzName.EndsWith("Tokenizer", StringComparison.Ordinal));
+			string simpleName = clazzName.Substring(0, clazzName.Length - 9);
+			assertNotNull(TokenizerFactory.lookupClass(simpleName));
+			TokenizerFactory instance = null;
+			try
+			{
+			  instance = TokenizerFactory.forName(simpleName, args);
+			  assertNotNull(instance);
+			  if (instance is ResourceLoaderAware)
+			  {
+				((ResourceLoaderAware) instance).inform(loader);
+			  }
+			  assertSame(c, instance.create(new StringReader("")).GetType());
+			}
+			catch (System.ArgumentException e)
+			{
+			  if (e.InnerException is NoSuchMethodException)
+			  {
+				// there is no corresponding ctor available
+				throw e;
+			  }
+			  // TODO: For now pass because some factories have not yet a default config that always works
+			}
+		  }
+		  else if (c.IsSubclassOf(typeof(TokenFilter)))
+		  {
+			string clazzName = c.SimpleName;
+			assertTrue(clazzName.EndsWith("Filter", StringComparison.Ordinal));
+			string simpleName = clazzName.Substring(0, clazzName.Length - (clazzName.EndsWith("TokenFilter", StringComparison.Ordinal) ? 11 : 6));
+			assertNotNull(TokenFilterFactory.lookupClass(simpleName));
+			TokenFilterFactory instance = null;
+			try
+			{
+			  instance = TokenFilterFactory.forName(simpleName, args);
+			  assertNotNull(instance);
+			  if (instance is ResourceLoaderAware)
+			  {
+				((ResourceLoaderAware) instance).inform(loader);
+			  }
+//JAVA TO C# CONVERTER TODO TASK: Java wildcard generics are not converted to .NET:
+//ORIGINAL LINE: Class<? extends org.apache.lucene.analysis.TokenStream> createdClazz = instance.create(new KeywordTokenizer(new java.io.StringReader(""))).getClass();
+			  Type<?> createdClazz = instance.create(new KeywordTokenizer(new StringReader(""))).GetType();
+			  // only check instance if factory have wrapped at all!
+			  if (typeof(KeywordTokenizer) != createdClazz)
+			  {
+				assertSame(c, createdClazz);
+			  }
+			}
+			catch (System.ArgumentException e)
+			{
+			  if (e.InnerException is NoSuchMethodException)
+			  {
+				// there is no corresponding ctor available
+				throw e;
+			  }
+			  // TODO: For now pass because some factories have not yet a default config that always works
+			}
+		  }
+		  else if (c.IsSubclassOf(typeof(CharFilter)))
+		  {
+			string clazzName = c.SimpleName;
+			assertTrue(clazzName.EndsWith("CharFilter", StringComparison.Ordinal));
+			string simpleName = clazzName.Substring(0, clazzName.Length - 10);
+			assertNotNull(CharFilterFactory.lookupClass(simpleName));
+			CharFilterFactory instance = null;
+			try
+			{
+			  instance = CharFilterFactory.forName(simpleName, args);
+			  assertNotNull(instance);
+			  if (instance is ResourceLoaderAware)
+			  {
+				((ResourceLoaderAware) instance).inform(loader);
+			  }
+//JAVA TO C# CONVERTER TODO TASK: Java wildcard generics are not converted to .NET:
+//ORIGINAL LINE: Class<? extends java.io.Reader> createdClazz = instance.create(new java.io.StringReader("")).getClass();
+			  Type<?> createdClazz = instance.create(new StringReader("")).GetType();
+			  // only check instance if factory have wrapped at all!
+			  if (typeof(StringReader) != createdClazz)
+			  {
+				assertSame(c, createdClazz);
+			  }
+			}
+			catch (System.ArgumentException e)
+			{
+			  if (e.InnerException is NoSuchMethodException)
+			  {
+				// there is no corresponding ctor available
+				throw e;
+			  }
+			  // TODO: For now pass because some factories have not yet a default config that always works
+			}
+		  }
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestAnalyzers.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestAnalyzers.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestAnalyzers.cs
new file mode 100644
index 0000000..46680f4
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestAnalyzers.cs
@@ -0,0 +1,314 @@
+using System;
+
+namespace org.apache.lucene.analysis.core
+{
+
+	/*
+	 * 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 org.apache.lucene.analysis;
+	using StandardTokenizer = org.apache.lucene.analysis.standard.StandardTokenizer;
+	using CharTermAttribute = org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
+	using PayloadAttribute = org.apache.lucene.analysis.tokenattributes.PayloadAttribute;
+	using BytesRef = org.apache.lucene.util.BytesRef;
+	using Version = org.apache.lucene.util.Version;
+
+	public class TestAnalyzers : BaseTokenStreamTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testSimple() throws Exception
+	  public virtual void testSimple()
+	  {
+		Analyzer a = new SimpleAnalyzer(TEST_VERSION_CURRENT);
+		assertAnalyzesTo(a, "foo bar FOO BAR", new string[] {"foo", "bar", "foo", "bar"});
+		assertAnalyzesTo(a, "foo      bar .  FOO <> BAR", new string[] {"foo", "bar", "foo", "bar"});
+		assertAnalyzesTo(a, "foo.bar.FOO.BAR", new string[] {"foo", "bar", "foo", "bar"});
+		assertAnalyzesTo(a, "U.S.A.", new string[] {"u", "s", "a"});
+		assertAnalyzesTo(a, "C++", new string[] {"c"});
+		assertAnalyzesTo(a, "B2B", new string[] {"b", "b"});
+		assertAnalyzesTo(a, "2B", new string[] {"b"});
+		assertAnalyzesTo(a, "\"QUOTED\" word", new string[] {"quoted", "word"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNull() throws Exception
+	  public virtual void testNull()
+	  {
+		Analyzer a = new WhitespaceAnalyzer(TEST_VERSION_CURRENT);
+		assertAnalyzesTo(a, "foo bar FOO BAR", new string[] {"foo", "bar", "FOO", "BAR"});
+		assertAnalyzesTo(a, "foo      bar .  FOO <> BAR", new string[] {"foo", "bar", ".", "FOO", "<>", "BAR"});
+		assertAnalyzesTo(a, "foo.bar.FOO.BAR", new string[] {"foo.bar.FOO.BAR"});
+		assertAnalyzesTo(a, "U.S.A.", new string[] {"U.S.A."});
+		assertAnalyzesTo(a, "C++", new string[] {"C++"});
+		assertAnalyzesTo(a, "B2B", new string[] {"B2B"});
+		assertAnalyzesTo(a, "2B", new string[] {"2B"});
+		assertAnalyzesTo(a, "\"QUOTED\" word", new string[] {"\"QUOTED\"", "word"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStop() throws Exception
+	  public virtual void testStop()
+	  {
+		Analyzer a = new StopAnalyzer(TEST_VERSION_CURRENT);
+		assertAnalyzesTo(a, "foo bar FOO BAR", new string[] {"foo", "bar", "foo", "bar"});
+		assertAnalyzesTo(a, "foo a bar such FOO THESE BAR", new string[] {"foo", "bar", "foo", "bar"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: void verifyPayload(TokenStream ts) throws java.io.IOException
+	  internal virtual void verifyPayload(TokenStream ts)
+	  {
+		PayloadAttribute payloadAtt = ts.getAttribute(typeof(PayloadAttribute));
+		ts.reset();
+		for (sbyte b = 1;;b++)
+		{
+		  bool hasNext = ts.incrementToken();
+		  if (!hasNext)
+		  {
+			  break;
+		  }
+		  // System.out.println("id="+System.identityHashCode(nextToken) + " " + t);
+		  // System.out.println("payload=" + (int)nextToken.getPayload().toByteArray()[0]);
+		  assertEquals(b, payloadAtt.Payload.bytes[0]);
+		}
+	  }
+
+	  // Make sure old style next() calls result in a new copy of payloads
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testPayloadCopy() throws java.io.IOException
+	  public virtual void testPayloadCopy()
+	  {
+		string s = "how now brown cow";
+		TokenStream ts;
+		ts = new WhitespaceTokenizer(TEST_VERSION_CURRENT, new StringReader(s));
+		ts = new PayloadSetter(ts);
+		verifyPayload(ts);
+
+		ts = new WhitespaceTokenizer(TEST_VERSION_CURRENT, new StringReader(s));
+		ts = new PayloadSetter(ts);
+		verifyPayload(ts);
+	  }
+
+	  // LUCENE-1150: Just a compile time test, to ensure the
+	  // StandardAnalyzer constants remain publicly accessible
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @SuppressWarnings("unused") public void _testStandardConstants()
+	  public virtual void _testStandardConstants()
+	  {
+		int x = StandardTokenizer.ALPHANUM;
+		x = StandardTokenizer.APOSTROPHE;
+		x = StandardTokenizer.ACRONYM;
+		x = StandardTokenizer.COMPANY;
+		x = StandardTokenizer.EMAIL;
+		x = StandardTokenizer.HOST;
+		x = StandardTokenizer.NUM;
+		x = StandardTokenizer.CJ;
+		string[] y = StandardTokenizer.TOKEN_TYPES;
+	  }
+
+	  private class LowerCaseWhitespaceAnalyzer : Analyzer
+	  {
+
+		public override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		{
+		  Tokenizer tokenizer = new WhitespaceTokenizer(TEST_VERSION_CURRENT, reader);
+		  return new TokenStreamComponents(tokenizer, new LowerCaseFilter(TEST_VERSION_CURRENT, tokenizer));
+		}
+
+	  }
+
+	  private class UpperCaseWhitespaceAnalyzer : Analyzer
+	  {
+
+		public override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		{
+		  Tokenizer tokenizer = new WhitespaceTokenizer(TEST_VERSION_CURRENT, reader);
+		  return new TokenStreamComponents(tokenizer, new UpperCaseFilter(TEST_VERSION_CURRENT, tokenizer));
+		}
+
+	  }
+
+
+	  /// <summary>
+	  /// Test that LowercaseFilter handles entire unicode range correctly
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testLowerCaseFilter() throws java.io.IOException
+	  public virtual void testLowerCaseFilter()
+	  {
+		Analyzer a = new LowerCaseWhitespaceAnalyzer();
+		// BMP
+		assertAnalyzesTo(a, "AbaCaDabA", new string[] {"abacadaba"});
+		// supplementary
+		assertAnalyzesTo(a, "\ud801\udc16\ud801\udc16\ud801\udc16\ud801\udc16", new string[] {"\ud801\udc3e\ud801\udc3e\ud801\udc3e\ud801\udc3e"});
+		assertAnalyzesTo(a, "AbaCa\ud801\udc16DabA", new string[] {"abaca\ud801\udc3edaba"});
+		// unpaired lead surrogate
+		assertAnalyzesTo(a, "AbaC\uD801AdaBa", new string [] {"abac\uD801adaba"});
+		// unpaired trail surrogate
+		assertAnalyzesTo(a, "AbaC\uDC16AdaBa", new string [] {"abac\uDC16adaba"});
+	  }
+
+	  /// <summary>
+	  /// Test that LowercaseFilter handles entire unicode range correctly
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testUpperCaseFilter() throws java.io.IOException
+	  public virtual void testUpperCaseFilter()
+	  {
+		Analyzer a = new UpperCaseWhitespaceAnalyzer();
+		// BMP
+		assertAnalyzesTo(a, "AbaCaDabA", new string[] {"ABACADABA"});
+		// supplementary
+		assertAnalyzesTo(a, "\ud801\udc3e\ud801\udc3e\ud801\udc3e\ud801\udc3e", new string[] {"\ud801\udc16\ud801\udc16\ud801\udc16\ud801\udc16"});
+		assertAnalyzesTo(a, "AbaCa\ud801\udc3eDabA", new string[] {"ABACA\ud801\udc16DABA"});
+		// unpaired lead surrogate
+		assertAnalyzesTo(a, "AbaC\uD801AdaBa", new string [] {"ABAC\uD801ADABA"});
+		// unpaired trail surrogate
+		assertAnalyzesTo(a, "AbaC\uDC16AdaBa", new string [] {"ABAC\uDC16ADABA"});
+	  }
+
+
+	  /// <summary>
+	  /// Test that LowercaseFilter handles the lowercasing correctly if the term
+	  /// buffer has a trailing surrogate character leftover and the current term in
+	  /// the buffer ends with a corresponding leading surrogate.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testLowerCaseFilterLowSurrogateLeftover() throws java.io.IOException
+	  public virtual void testLowerCaseFilterLowSurrogateLeftover()
+	  {
+		// test if the limit of the termbuffer is correctly used with supplementary
+		// chars
+		WhitespaceTokenizer tokenizer = new WhitespaceTokenizer(TEST_VERSION_CURRENT, new StringReader("BogustermBogusterm\udc16"));
+		LowerCaseFilter filter = new LowerCaseFilter(TEST_VERSION_CURRENT, tokenizer);
+		assertTokenStreamContents(filter, new string[] {"bogustermbogusterm\udc16"});
+		filter.reset();
+		string highSurEndingUpper = "BogustermBoguster\ud801";
+		string highSurEndingLower = "bogustermboguster\ud801";
+		tokenizer.Reader = new StringReader(highSurEndingUpper);
+		assertTokenStreamContents(filter, new string[] {highSurEndingLower});
+		assertTrue(filter.hasAttribute(typeof(CharTermAttribute)));
+		char[] termBuffer = filter.getAttribute(typeof(CharTermAttribute)).buffer();
+		int length = highSurEndingLower.Length;
+		assertEquals('\ud801', termBuffer[length - 1]);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testLowerCaseTokenizer() throws java.io.IOException
+	  public virtual void testLowerCaseTokenizer()
+	  {
+		StringReader reader = new StringReader("Tokenizer \ud801\udc1ctest");
+		LowerCaseTokenizer tokenizer = new LowerCaseTokenizer(TEST_VERSION_CURRENT, reader);
+		assertTokenStreamContents(tokenizer, new string[] {"tokenizer", "\ud801\udc44test"});
+	  }
+
+	  /// @deprecated (3.1) 
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Deprecated("(3.1)") public void testLowerCaseTokenizerBWCompat() throws java.io.IOException
+	  [Obsolete("(3.1)")]
+	  public virtual void testLowerCaseTokenizerBWCompat()
+	  {
+		StringReader reader = new StringReader("Tokenizer \ud801\udc1ctest");
+		LowerCaseTokenizer tokenizer = new LowerCaseTokenizer(Version.LUCENE_30, reader);
+		assertTokenStreamContents(tokenizer, new string[] {"tokenizer", "test"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testWhitespaceTokenizer() throws java.io.IOException
+	  public virtual void testWhitespaceTokenizer()
+	  {
+		StringReader reader = new StringReader("Tokenizer \ud801\udc1ctest");
+		WhitespaceTokenizer tokenizer = new WhitespaceTokenizer(TEST_VERSION_CURRENT, reader);
+		assertTokenStreamContents(tokenizer, new string[] {"Tokenizer", "\ud801\udc1ctest"});
+	  }
+
+	  /// @deprecated (3.1) 
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Deprecated("(3.1)") public void testWhitespaceTokenizerBWCompat() throws java.io.IOException
+	  [Obsolete("(3.1)")]
+	  public virtual void testWhitespaceTokenizerBWCompat()
+	  {
+		StringReader reader = new StringReader("Tokenizer \ud801\udc1ctest");
+		WhitespaceTokenizer tokenizer = new WhitespaceTokenizer(Version.LUCENE_30, reader);
+		assertTokenStreamContents(tokenizer, new string[] {"Tokenizer", "\ud801\udc1ctest"});
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), new WhitespaceAnalyzer(TEST_VERSION_CURRENT), 1000 * RANDOM_MULTIPLIER);
+		checkRandomData(random(), new SimpleAnalyzer(TEST_VERSION_CURRENT), 1000 * RANDOM_MULTIPLIER);
+		checkRandomData(random(), new StopAnalyzer(TEST_VERSION_CURRENT), 1000 * RANDOM_MULTIPLIER);
+	  }
+
+	  /// <summary>
+	  /// blast some random large strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomHugeStrings() throws Exception
+	  public virtual void testRandomHugeStrings()
+	  {
+		Random random = random();
+		checkRandomData(random, new WhitespaceAnalyzer(TEST_VERSION_CURRENT), 100 * RANDOM_MULTIPLIER, 8192);
+		checkRandomData(random, new SimpleAnalyzer(TEST_VERSION_CURRENT), 100 * RANDOM_MULTIPLIER, 8192);
+		checkRandomData(random, new StopAnalyzer(TEST_VERSION_CURRENT), 100 * RANDOM_MULTIPLIER, 8192);
+	  }
+	}
+
+	internal sealed class PayloadSetter : TokenFilter
+	{
+		private bool InstanceFieldsInitialized = false;
+
+		private void InitializeInstanceFields()
+		{
+			p = new BytesRef(data,0,1);
+		}
+
+	  internal PayloadAttribute payloadAtt;
+	  public PayloadSetter(TokenStream input) : base(input)
+	  {
+		  if (!InstanceFieldsInitialized)
+		  {
+			  InitializeInstanceFields();
+			  InstanceFieldsInitialized = true;
+		  }
+		payloadAtt = addAttribute(typeof(PayloadAttribute));
+	  }
+
+	  internal sbyte[] data = new sbyte[1];
+	  internal BytesRef p;
+
+//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()
+	  {
+		bool hasNext = input.incrementToken();
+		if (!hasNext)
+		{
+			return false;
+		}
+		payloadAtt.Payload = p; // reuse the payload / byte[]
+		data[0]++;
+		return true;
+	  }
+	}
+
+}
\ No newline at end of file


[13/27] lucenenet git commit: adding converted analysis common tests

Posted by sy...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestASCIIFoldingFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestASCIIFoldingFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestASCIIFoldingFilter.cs
new file mode 100644
index 0000000..66607a8
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestASCIIFoldingFilter.cs
@@ -0,0 +1,284 @@
+using System.Collections.Generic;
+using System.Text;
+
+namespace org.apache.lucene.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 KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+	using CharTermAttribute = org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
+
+
+	public class TestASCIIFoldingFilter : BaseTokenStreamTestCase
+	{
+	  /// <summary>
+	  /// Pop one input token's worth of tokens off the filter and verify that they are as expected.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: void assertNextTerms(String expectedUnfolded, String expectedFolded, ASCIIFoldingFilter filter, org.apache.lucene.analysis.tokenattributes.CharTermAttribute termAtt) throws Exception
+	  internal virtual void assertNextTerms(string expectedUnfolded, string expectedFolded, ASCIIFoldingFilter filter, CharTermAttribute termAtt)
+	  {
+		assertTrue(filter.incrementToken());
+		assertEquals(expectedFolded, termAtt.ToString());
+		if (filter.PreserveOriginal && !expectedUnfolded.Equals(expectedFolded))
+		{
+		  assertTrue(filter.incrementToken());
+		  assertEquals(expectedUnfolded, termAtt.ToString());
+		}
+	  }
+
+	  // testLain1Accents() is a copy of TestLatin1AccentFilter.testU().
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testLatin1Accents() throws Exception
+	  public virtual void testLatin1Accents()
+	  {
+		TokenStream stream = new MockTokenizer(new StringReader("Des mot clés À LA CHAÎNE À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï IJ Ð Ñ" + " Ò Ó Ô Õ Ö Ø Œ Þ Ù Ú Û Ü Ý Ÿ à á â ã ä å æ ç è é ê ë ì í î ï ij" + " ð ñ ò ó ô õ ö ø œ ß þ ù ú û ü ý ÿ fi fl"), MockTokenizer.WHITESPACE, false);
+		ASCIIFoldingFilter filter = new ASCIIFoldingFilter(stream, random().nextBoolean());
+
+		CharTermAttribute termAtt = filter.getAttribute(typeof(CharTermAttribute));
+		filter.reset();
+		assertNextTerms("Des", "Des", filter, termAtt);
+		assertNextTerms("mot", "mot", filter, termAtt);
+		assertNextTerms("clés", "cles", filter, termAtt);
+		assertNextTerms("À", "A", filter, termAtt);
+		assertNextTerms("LA", "LA", filter, termAtt);
+		assertNextTerms("CHAÎNE", "CHAINE", filter, termAtt);
+		assertNextTerms("À", "A", filter, termAtt);
+		assertNextTerms("Á", "A", filter, termAtt);
+		assertNextTerms("Â", "A", filter, termAtt);
+		assertNextTerms("Ã", "A", filter, termAtt);
+		assertNextTerms("Ä", "A", filter, termAtt);
+		assertNextTerms("Å", "A", filter, termAtt);
+		assertNextTerms("Æ", "AE", filter, termAtt);
+		assertNextTerms("Ç", "C", filter, termAtt);
+		assertNextTerms("È", "E", filter, termAtt);
+		assertNextTerms("É", "E", filter, termAtt);
+		assertNextTerms("Ê", "E", filter, termAtt);
+		assertNextTerms("Ë", "E", filter, termAtt);
+		assertNextTerms("Ì", "I", filter, termAtt);
+		assertNextTerms("Í", "I", filter, termAtt);
+		assertNextTerms("Î", "I", filter, termAtt);
+		assertNextTerms("Ï", "I", filter, termAtt);
+		assertNextTerms("IJ", "IJ", filter, termAtt);
+		assertNextTerms("Ð", "D", filter, termAtt);
+		assertNextTerms("Ñ", "N", filter, termAtt);
+		assertNextTerms("Ò", "O", filter, termAtt);
+		assertNextTerms("Ó", "O", filter, termAtt);
+		assertNextTerms("Ô", "O", filter, termAtt);
+		assertNextTerms("Õ", "O", filter, termAtt);
+		assertNextTerms("Ö", "O", filter, termAtt);
+		assertNextTerms("Ø", "O", filter, termAtt);
+		assertNextTerms("Œ", "OE", filter, termAtt);
+		assertNextTerms("Þ", "TH", filter, termAtt);
+		assertNextTerms("Ù", "U", filter, termAtt);
+		assertNextTerms("Ú", "U", filter, termAtt);
+		assertNextTerms("Û", "U", filter, termAtt);
+		assertNextTerms("Ü", "U", filter, termAtt);
+		assertNextTerms("Ý", "Y", filter, termAtt);
+		assertNextTerms("Ÿ", "Y", filter, termAtt);
+		assertNextTerms("à", "a", filter, termAtt);
+		assertNextTerms("á", "a", filter, termAtt);
+		assertNextTerms("â", "a", filter, termAtt);
+		assertNextTerms("ã", "a", filter, termAtt);
+		assertNextTerms("ä", "a", filter, termAtt);
+		assertNextTerms("å", "a", filter, termAtt);
+		assertNextTerms("æ", "ae", filter, termAtt);
+		assertNextTerms("ç", "c", filter, termAtt);
+		assertNextTerms("è", "e", filter, termAtt);
+		assertNextTerms("é", "e", filter, termAtt);
+		assertNextTerms("ê", "e", filter, termAtt);
+		assertNextTerms("ë", "e", filter, termAtt);
+		assertNextTerms("ì", "i", filter, termAtt);
+		assertNextTerms("í", "i", filter, termAtt);
+		assertNextTerms("î", "i", filter, termAtt);
+		assertNextTerms("ï", "i", filter, termAtt);
+		assertNextTerms("ij", "ij", filter, termAtt);
+		assertNextTerms("ð", "d", filter, termAtt);
+		assertNextTerms("ñ", "n", filter, termAtt);
+		assertNextTerms("ò", "o", filter, termAtt);
+		assertNextTerms("ó", "o", filter, termAtt);
+		assertNextTerms("ô", "o", filter, termAtt);
+		assertNextTerms("õ", "o", filter, termAtt);
+		assertNextTerms("ö", "o", filter, termAtt);
+		assertNextTerms("ø", "o", filter, termAtt);
+		assertNextTerms("œ", "oe", filter, termAtt);
+		assertNextTerms("ß", "ss", filter, termAtt);
+		assertNextTerms("þ", "th", filter, termAtt);
+		assertNextTerms("ù", "u", filter, termAtt);
+		assertNextTerms("ú", "u", filter, termAtt);
+		assertNextTerms("û", "u", filter, termAtt);
+		assertNextTerms("ü", "u", filter, termAtt);
+		assertNextTerms("ý", "y", filter, termAtt);
+		assertNextTerms("ÿ", "y", filter, termAtt);
+		assertNextTerms("fi", "fi", filter, termAtt);
+		assertNextTerms("fl", "fl", filter, termAtt);
+		assertFalse(filter.incrementToken());
+	  }
+
+
+	  // The following Perl script generated the foldings[] array automatically
+	  // from ASCIIFoldingFilter.java:
+	  //
+	  //    ============== begin get.test.cases.pl ==============
+	  //
+	  //    use strict;
+	  //    use warnings;
+	  //
+	  //    my $file = "ASCIIFoldingFilter.java";
+	  //    my $output = "testcases.txt";
+	  //    my %codes = ();
+	  //    my $folded = '';
+	  //
+	  //    open IN, "<:utf8", $file || die "Error opening input file '$file': $!";
+	  //    open OUT, ">:utf8", $output || die "Error opening output file '$output': $!";
+	  //
+	  //    while (my $line = <IN>) {
+	  //      chomp($line);
+	  //      # case '\u0133': // <char> <maybe URL> [ description ]
+	  //      if ($line =~ /case\s+'\\u(....)':.*\[([^\]]+)\]/) {
+	  //        my $code = $1;
+	  //        my $desc = $2;
+	  //        $codes{$code} = $desc;
+	  //      }
+	  //      # output[outputPos++] = 'A';
+	  //      elsif ($line =~ /output\[outputPos\+\+\] = '(.+)';/) {
+	  //        my $output_char = $1;
+	  //        $folded .= $output_char;
+	  //      }
+	  //      elsif ($line =~ /break;/ && length($folded) > 0) {
+	  //        my $first = 1;
+	  //        for my $code (sort { hex($a) <=> hex($b) } keys %codes) {
+	  //          my $desc = $codes{$code};
+	  //          print OUT '      ';
+	  //          print OUT '+ ' if (not $first);
+	  //          $first = 0;
+	  //          print OUT '"', chr(hex($code)), qq!"  // U+$code: $desc\n!;
+	  //        }
+	  //        print OUT qq!      ,"$folded", // Folded result\n\n!;
+	  //        %codes = ();
+	  //        $folded = '';
+	  //      }
+	  //    }
+	  //    close OUT;
+	  //
+	  //    ============== end get.test.cases.pl ==============
+	  //
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testAllFoldings() throws Exception
+	  public virtual void testAllFoldings()
+	  {
+		// Alternating strings of:
+		//   1. All non-ASCII characters to be folded, concatenated together as a
+		//      single string.
+		//   2. The string of ASCII characters to which each of the above
+		//      characters should be folded.
+		string[] foldings = new string[] {"À" + "Á" + "Â" + "Ã" + "Ä" + "Å" + "Ā" + "Ă" + "Ą" + "Ə" + "Ǎ" + "Ǟ" + "Ǡ" + "Ǻ" + "Ȁ" + "Ȃ" + "Ȧ" + "Ⱥ" + "ᴀ" + "Ḁ" + "Ạ" + "Ả" + "Ấ" + "Ầ" + "Ẩ" + "Ẫ" + "Ậ" + "Ắ" + "Ằ" + "Ẳ" + "Ẵ" + "Ặ" + "Ⓐ" + "A","A", "à" + "á" + "â" + "ã" + "ä" + "å" + "ā" + "ă" + "ą" + "ǎ" + "ǟ" + "ǡ" + "ǻ" + "ȁ" + "ȃ" + "ȧ" + "ɐ" + "ə" + "ɚ" + "ᶏ" + "ḁ" + "ᶕ" + "ẚ" + "ạ" + "ả" + "ấ" + "ầ" + "ẩ" + "ẫ" + "ậ" + "ắ" + "ằ" + "ẳ" + "ẵ" + "ặ" + "ₐ" + "ₔ" + "ⓐ" + "ⱥ" + "Ɐ" + "a","a", "Ꜳ","AA", "Æ" + "Ǣ" + "Ǽ" + "ᴁ","AE", "Ꜵ","AO", "Ꜷ","AU", "Ꜹ" + "Ꜻ","AV", "Ꜽ","AY", "⒜","(a)", "ꜳ","aa", "æ" + "ǣ" + "ǽ" + "ᴂ","ae", "ꜵ","ao", "ꜷ","au", "ꜹ" + "ꜻ","av", "ꜽ","ay", "Ɓ" + "Ƃ" + "Ƀ" + "ʙ" + "ᴃ" + "Ḃ" + "Ḅ" + "Ḇ" + "Ⓑ" + "B","B", "ƀ" + "ƃ" + "ɓ" + "ᵬ" + "ᶀ" + "ḃ" + "ḅ" + "ḇ" + "ⓑ" + "b","b", "⒝","(b)", "Ç" 
 + "Ć" + "Ĉ" + "Ċ" + "Č" + "Ƈ" + "Ȼ" + "ʗ" + "ᴄ" + "Ḉ" + "Ⓒ" + "C","C", "ç" + "ć" + "ĉ" + "ċ" + "č" + "ƈ" + "ȼ" + "ɕ" + "ḉ" + "ↄ" + "ⓒ" + "Ꜿ" + "ꜿ" + "c","c", "⒞","(c)", "Ð" + "Ď" + "Đ" + "Ɖ" + "Ɗ" + "Ƌ" + "ᴅ" + "ᴆ" + "Ḋ" + "Ḍ" + "Ḏ" + "Ḑ" + "Ḓ" + "Ⓓ" + "Ꝺ" + "D","D", "ð" + "ď" + "đ" + "ƌ" + "ȡ" + "ɖ" + "ɗ" + "ᵭ" + "ᶁ" + "ᶑ" + "ḋ" + "ḍ" + "ḏ" + "ḑ" + "ḓ" + "ⓓ" + "ꝺ" + "d","d", "DŽ" + "DZ","DZ", "Dž" + "Dz","Dz", "⒟","(d)", "ȸ","db", "dž" + "dz" + "ʣ" + "ʥ","dz", "È" + "É" + "Ê" + "Ë" + "Ē" + "Ĕ" + "Ė" + "Ę" + "Ě" + "Ǝ" + "Ɛ" + "Ȅ" + "Ȇ" + "Ȩ" + "Ɇ" + "ᴇ" + "Ḕ" + "Ḗ" + "Ḙ" + "Ḛ" + "Ḝ" + "Ẹ" + "Ẻ" + "Ẽ" + "Ế" + "Ề" + "Ể" + "Ễ" + "Ệ" + "Ⓔ" + "ⱻ" + "E","E", "è" + "é" + "ê" + "ë" + "ē" + "ĕ" + "ė" + "ę" + "ě" + "ǝ" + "ȅ" + "ȇ" + "ȩ" + "ɇ" + "ɘ" + "ɛ" + "ɜ" + "ɝ" + "ɞ" + "ʚ" + "ᴈ" + "ᶒ" + "ᶓ" + "ᶔ" + "ḕ" + "ḗ" + "�
 ��" + "ḛ" + "ḝ" + "ẹ" + "ẻ" + "ẽ" + "ế" + "ề" + "ể" + "ễ" + "ệ" + "ₑ" + "ⓔ" + "ⱸ" + "e","e", "⒠","(e)", "Ƒ" + "Ḟ" + "Ⓕ" + "ꜰ" + "Ꝼ" + "ꟻ" + "F","F", "ƒ" + "ᵮ" + "ᶂ" + "ḟ" + "ẛ" + "ⓕ" + "ꝼ" + "f","f", "⒡","(f)", "ff","ff", "ffi","ffi", "ffl","ffl", "fi","fi", "fl","fl", "Ĝ" + "Ğ" + "Ġ" + "Ģ" + "Ɠ" + "Ǥ" + "ǥ" + "Ǧ" + "ǧ" + "Ǵ" + "ɢ" + "ʛ" + "Ḡ" + "Ⓖ" + "Ᵹ" + "Ꝿ" + "G","G", "ĝ" + "ğ" + "ġ" + "ģ" + "ǵ" + "ɠ" + "ɡ" + "ᵷ" + "ᵹ" + "ᶃ" + "ḡ" + "ⓖ" + "ꝿ" + "g","g", "⒢","(g)", "Ĥ" + "Ħ" + "Ȟ" + "ʜ" + "Ḣ" + "Ḥ" + "Ḧ" + "Ḩ" + "Ḫ" + "Ⓗ" + "Ⱨ" + "Ⱶ" + "H","H", "ĥ" + "ħ" + "ȟ" + "ɥ" + "ɦ" + "ʮ" + "ʯ" + "ḣ" + "ḥ" + "ḧ" + "ḩ" + "ḫ" + "ẖ" + "ⓗ" + "ⱨ" + "ⱶ" + "h","h", "Ƕ","HV", "⒣","(h)", "ƕ","hv", "Ì" + "Í" + "Î" + "Ï" + "Ĩ" + "Ī" + "Ĭ" + "Į" + "İ" + "Ɩ" + "Ɨ" + "Ǐ" + "Ȉ" + "Ȋ" + "ɪ" + "ᵻ" + "Ḭ" + "Ḯ" + "Ỉ" + "Ị" + "
 Ⓘ" + "ꟾ" + "I","I", "ì" + "í" + "î" + "ï" + "ĩ" + "ī" + "ĭ" + "į" + "ı" + "ǐ" + "ȉ" + "ȋ" + "ɨ" + "ᴉ" + "ᵢ" + "ᵼ" + "ᶖ" + "ḭ" + "ḯ" + "ỉ" + "ị" + "ⁱ" + "ⓘ" + "i","i", "IJ","IJ", "⒤","(i)", "ij","ij", "Ĵ" + "Ɉ" + "ᴊ" + "Ⓙ" + "J","J", "ĵ" + "ǰ" + "ȷ" + "ɉ" + "ɟ" + "ʄ" + "ʝ" + "ⓙ" + "ⱼ" + "j","j", "⒥","(j)", "Ķ" + "Ƙ" + "Ǩ" + "ᴋ" + "Ḱ" + "Ḳ" + "Ḵ" + "Ⓚ" + "Ⱪ" + "Ꝁ" + "Ꝃ" + "Ꝅ" + "K","K", "ķ" + "ƙ" + "ǩ" + "ʞ" + "ᶄ" + "ḱ" + "ḳ" + "ḵ" + "ⓚ" + "ⱪ" + "ꝁ" + "ꝃ" + "ꝅ" + "k","k", "⒦","(k)", "Ĺ" + "Ļ" + "Ľ" + "Ŀ" + "Ł" + "Ƚ" + "ʟ" + "ᴌ" + "Ḷ" + "Ḹ" + "Ḻ" + "Ḽ" + "Ⓛ" + "Ⱡ" + "Ɫ" + "Ꝇ" + "Ꝉ" + "Ꞁ" + "L","L", "ĺ" + "ļ" + "ľ" + "ŀ" + "ł" + "ƚ" + "ȴ" + "ɫ" + "ɬ" + "ɭ" + "ᶅ" + "ḷ" + "ḹ" + "ḻ" + "ḽ" + "ⓛ" + "ⱡ" + "ꝇ" + "ꝉ" + "ꞁ" + "l","l", "LJ","LJ", "Ỻ","LL", "Lj","Lj", "⒧","(l)", "lj","lj", "ỻ","ll", "ʪ","ls", "ʫ","
 lz", "Ɯ" + "ᴍ" + "Ḿ" + "Ṁ" + "Ṃ" + "Ⓜ" + "Ɱ" + "ꟽ" + "ꟿ" + "M","M", "ɯ" + "ɰ" + "ɱ" + "ᵯ" + "ᶆ" + "ḿ" + "ṁ" + "ṃ" + "ⓜ" + "m","m", "⒨","(m)", "Ñ" + "Ń" + "Ņ" + "Ň" + "Ŋ" + "Ɲ" + "Ǹ" + "Ƞ" + "ɴ" + "ᴎ" + "Ṅ" + "Ṇ" + "Ṉ" + "Ṋ" + "Ⓝ" + "N","N", "ñ" + "ń" + "ņ" + "ň" + "ʼn" + "ŋ" + "ƞ" + "ǹ" + "ȵ" + "ɲ" + "ɳ" + "ᵰ" + "ᶇ" + "ṅ" + "ṇ" + "ṉ" + "ṋ" + "ⁿ" + "ⓝ" + "n","n", "NJ","NJ", "Nj","Nj", "⒩","(n)", "nj","nj", "Ò" + "Ó" + "Ô" + "Õ" + "Ö" + "Ø" + "Ō" + "Ŏ" + "Ő" + "Ɔ" + "Ɵ" + "Ơ" + "Ǒ" + "Ǫ" + "Ǭ" + "Ǿ" + "Ȍ" + "Ȏ" + "Ȫ" + "Ȭ" + "Ȯ" + "Ȱ" + "ᴏ" + "ᴐ" + "Ṍ" + "Ṏ" + "Ṑ" + "Ṓ" + "Ọ" + "Ỏ" + "Ố" + "Ồ" + "Ổ" + "Ỗ" + "Ộ" + "Ớ" + "Ờ" + "Ở" + "Ỡ" + "Ợ" + "Ⓞ" + "Ꝋ" + "Ꝍ" + "O","O", "ò" + "ó" + "ô" + "õ" + "ö" + "ø" + "ō" + "ŏ" + "ő" + "ơ" + "ǒ" + "ǫ" + "ǭ" + "ǿ" + "ȍ" + "ȏ" + "ȫ" + "ȭ" + "ȯ" + "ȱ" + "ɔ" + "ɵ" + "ᴖ" + "�
 ��" + "ᶗ" + "ṍ" + "ṏ" + "ṑ" + "ṓ" + "ọ" + "ỏ" + "ố" + "ồ" + "ổ" + "ỗ" + "ộ" + "ớ" + "ờ" + "ở" + "ỡ" + "ợ" + "ₒ" + "ⓞ" + "ⱺ" + "ꝋ" + "ꝍ" + "o","o", "Œ" + "ɶ","OE", "Ꝏ","OO", "Ȣ" + "ᴕ","OU", "⒪","(o)", "œ" + "ᴔ","oe", "ꝏ","oo", "ȣ","ou", "Ƥ" + "ᴘ" + "Ṕ" + "Ṗ" + "Ⓟ" + "Ᵽ" + "Ꝑ" + "Ꝓ" + "Ꝕ" + "P","P", "ƥ" + "ᵱ" + "ᵽ" + "ᶈ" + "ṕ" + "ṗ" + "ⓟ" + "ꝑ" + "ꝓ" + "ꝕ" + "ꟼ" + "p","p", "⒫","(p)", "Ɋ" + "Ⓠ" + "Ꝗ" + "Ꝙ" + "Q","Q", "ĸ" + "ɋ" + "ʠ" + "ⓠ" + "ꝗ" + "ꝙ" + "q","q", "⒬","(q)", "ȹ","qp", "Ŕ" + "Ŗ" + "Ř" + "Ȑ" + "Ȓ" + "Ɍ" + "ʀ" + "ʁ" + "ᴙ" + "ᴚ" + "Ṙ" + "Ṛ" + "Ṝ" + "Ṟ" + "Ⓡ" + "Ɽ" + "Ꝛ" + "Ꞃ" + "R","R", "ŕ" + "ŗ" + "ř" + "ȑ" + "ȓ" + "ɍ" + "ɼ" + "ɽ" + "ɾ" + "ɿ" + "ᵣ" + "ᵲ" + "ᵳ" + "ᶉ" + "ṙ" + "ṛ" + "ṝ" + "ṟ" + "ⓡ" + "ꝛ" + "ꞃ" + "r","r", "⒭","(r)", "Ś" + "Ŝ" + "Ş" + "Š" + "Ș" + "Ṡ" + "Ṣ" + "Ṥ"
  + "Ṧ" + "Ṩ" + "Ⓢ" + "ꜱ" + "ꞅ" + "S","S", "ś" + "ŝ" + "ş" + "š" + "ſ" + "ș" + "ȿ" + "ʂ" + "ᵴ" + "ᶊ" + "ṡ" + "ṣ" + "ṥ" + "ṧ" + "ṩ" + "ẜ" + "ẝ" + "ⓢ" + "Ꞅ" + "s","s", "ẞ","SS", "⒮","(s)", "ß","ss", "st","st", "Ţ" + "Ť" + "Ŧ" + "Ƭ" + "Ʈ" + "Ț" + "Ⱦ" + "ᴛ" + "Ṫ" + "Ṭ" + "Ṯ" + "Ṱ" + "Ⓣ" + "Ꞇ" + "T","T", "ţ" + "ť" + "ŧ" + "ƫ" + "ƭ" + "ț" + "ȶ" + "ʇ" + "ʈ" + "ᵵ" + "ṫ" + "ṭ" + "ṯ" + "ṱ" + "ẗ" + "ⓣ" + "ⱦ" + "t","t", "Þ" + "Ꝧ","TH", "Ꜩ","TZ", "⒯","(t)", "ʨ","tc", "þ" + "ᵺ" + "ꝧ","th", "ʦ","ts", "ꜩ","tz", "Ù" + "Ú" + "Û" + "Ü" + "Ũ" + "Ū" + "Ŭ" + "Ů" + "Ű" + "Ų" + "Ư" + "Ǔ" + "Ǖ" + "Ǘ" + "Ǚ" + "Ǜ" + "Ȕ" + "Ȗ" + "Ʉ" + "ᴜ" + "ᵾ" + "Ṳ" + "Ṵ" + "Ṷ" + "Ṹ" + "Ṻ" + "Ụ" + "Ủ" + "Ứ" + "Ừ" + "Ử" + "Ữ" + "Ự" + "Ⓤ" + "U","U", "ù" + "ú" + "û" + "ü" + "ũ" + "ū" + "ŭ" + "ů" + "ű" + "ų" + "ư" + "ǔ" + "ǖ" + "ǘ" + "ǚ" + "ǜ" + "ȕ" 
 + "ȗ" + "ʉ" + "ᵤ" + "ᶙ" + "ṳ" + "ṵ" + "ṷ" + "ṹ" + "ṻ" + "ụ" + "ủ" + "ứ" + "ừ" + "ử" + "ữ" + "ự" + "ⓤ" + "u","u", "⒰","(u)", "ᵫ","ue", "Ʋ" + "Ʌ" + "ᴠ" + "Ṽ" + "Ṿ" + "Ỽ" + "Ⓥ" + "Ꝟ" + "Ꝩ" + "V","V", "ʋ" + "ʌ" + "ᵥ" + "ᶌ" + "ṽ" + "ṿ" + "ⓥ" + "ⱱ" + "ⱴ" + "ꝟ" + "v","v", "Ꝡ","VY", "⒱","(v)", "ꝡ","vy", "Ŵ" + "Ƿ" + "ᴡ" + "Ẁ" + "Ẃ" + "Ẅ" + "Ẇ" + "Ẉ" + "Ⓦ" + "Ⱳ" + "W","W", "ŵ" + "ƿ" + "ʍ" + "ẁ" + "ẃ" + "ẅ" + "ẇ" + "ẉ" + "ẘ" + "ⓦ" + "ⱳ" + "w","w", "⒲","(w)", "Ẋ" + "Ẍ" + "Ⓧ" + "X","X", "ᶍ" + "ẋ" + "ẍ" + "ₓ" + "ⓧ" + "x","x", "⒳","(x)", "Ý" + "Ŷ" + "Ÿ" + "Ƴ" + "Ȳ" + "Ɏ" + "ʏ" + "Ẏ" + "Ỳ" + "Ỵ" + "Ỷ" + "Ỹ" + "Ỿ" + "Ⓨ" + "Y","Y", "ý" + "ÿ" + "ŷ" + "ƴ" + "ȳ" + "ɏ" + "ʎ" + "ẏ" + "ẙ" + "ỳ" + "ỵ" + "ỷ" + "ỹ" + "ỿ" + "ⓨ" + "y","y", "⒴","(y)", "Ź" + "Ż" + "Ž" + "Ƶ" + "Ȝ" + "Ȥ" + "ᴢ" + "Ẑ" + "Ẓ" + "�
 ��" + "Ⓩ" + "Ⱬ" + "Ꝣ" + "Z","Z", "ź" + "ż" + "ž" + "ƶ" + "ȝ" + "ȥ" + "ɀ" + "ʐ" + "ʑ" + "ᵶ" + "ᶎ" + "ẑ" + "ẓ" + "ẕ" + "ⓩ" + "ⱬ" + "ꝣ" + "z","z", "⒵","(z)", "⁰" + "₀" + "⓪" + "⓿" + "0","0", "¹" + "₁" + "①" + "⓵" + "❶" + "➀" + "➊" + "1","1", "⒈","1.", "⑴","(1)", "²" + "₂" + "②" + "⓶" + "❷" + "➁" + "➋" + "2","2", "⒉","2.", "⑵","(2)", "³" + "₃" + "③" + "⓷" + "❸" + "➂" + "➌" + "3","3", "⒊","3.", "⑶","(3)", "⁴" + "₄" + "④" + "⓸" + "❹" + "➃" + "➍" + "4","4", "⒋","4.", "⑷","(4)", "⁵" + "₅" + "⑤" + "⓹" + "❺" + "➄" + "➎" + "5","5", "⒌","5.", "⑸","(5)", "⁶" + "₆" + "⑥" + "⓺" + "❻" + "➅" + "➏" + "6","6", "⒍","6.", "⑹","(6)", "⁷" + "₇" + "⑦" + "⓻" + "❼" + "➆" + "➐" + "7","7", "⒎","7.", "⑺","(7)", "⁸" + "₈" + "⑧" + "⓼" + "❽" + "➇" + "➑" + "8","8", "⒏","8.", "⑻","(8)", "⁹" + "₉" + "⑨" + "⓽"
  + "❾" + "➈" + "➒" + "9","9", "⒐","9.", "⑼","(9)", "⑩" + "⓾" + "❿" + "➉" + "➓","10", "⒑","10.", "⑽","(10)", "⑪" + "⓫","11", "⒒","11.", "⑾","(11)", "⑫" + "⓬","12", "⒓","12.", "⑿","(12)", "⑬" + "⓭","13", "⒔","13.", "⒀","(13)", "⑭" + "⓮","14", "⒕","14.", "⒁","(14)", "⑮" + "⓯","15", "⒖","15.", "⒂","(15)", "⑯" + "⓰","16", "⒗","16.", "⒃","(16)", "⑰" + "⓱","17", "⒘","17.", "⒄","(17)", "⑱" + "⓲","18", "⒙","18.", "⒅","(18)", "⑲" + "⓳","19", "⒚","19.", "⒆","(19)", "⑳" + "⓴","20", "⒛","20.", "⒇","(20)", "«" + "»" + "“" + "”" + "„" + "″" + "‶" + "❝" + "❞" + "❮" + "❯" + ""","\"", "‘" + "’" + "‚" + "‛" + "′" + "‵" + "‹" + "›" + "❛" + "❜" + "'","'", "‐" + "‑" + "‒" + "–" + "—" + "⁻" + "₋" + "-","-", "⁅" + "❲" + "[","[", "⁆" + "❳" + "]","]", "⁽" + "₍" + "❨" + "❪" + "(","(", "⸨","((", "⁾" + "₎" + "❩" + "❫
 " + ")",")", "⸩","))", "❬" + "❰" + "<","<", "❭" + "❱" + ">",">", "❴" + "{","{", "❵" + "}","}", "⁺" + "₊" + "+","+", "⁼" + "₌" + "=","=", "!","!", "‼","!!", "⁉","!?", "#","#", "$","$", "⁒" + "%","%", "&","&", "⁎" + "*","*", ",",",", ".",".", "⁄" + "/","/", ":",":", "⁏" + ";",";", "?","?", "⁇","??", "⁈","?!", "@","@", "\","\\", "‸" + "^","^", "_","_", "⁓" + "~","~"};
+
+		// Construct input text and expected output tokens
+		IList<string> expectedUnfoldedTokens = new List<string>();
+		IList<string> expectedFoldedTokens = new List<string>();
+		StringBuilder inputText = new StringBuilder();
+		for (int n = 0 ; n < foldings.Length ; n += 2)
+		{
+		  if (n > 0)
+		  {
+			inputText.Append(' '); // Space between tokens
+		  }
+		  inputText.Append(foldings[n]);
+
+		  // Construct the expected output tokens: both the unfolded and folded string,
+		  // with the folded duplicated as many times as the number of characters in
+		  // the input text.
+		  StringBuilder expected = new StringBuilder();
+		  int numChars = foldings[n].Length;
+		  for (int m = 0 ; m < numChars; ++m)
+		  {
+			expected.Append(foldings[n + 1]);
+		  }
+		  expectedUnfoldedTokens.Add(foldings[n]);
+		  expectedFoldedTokens.Add(expected.ToString());
+		}
+
+		TokenStream stream = new MockTokenizer(new StringReader(inputText.ToString()), MockTokenizer.WHITESPACE, false);
+		ASCIIFoldingFilter filter = new ASCIIFoldingFilter(stream, random().nextBoolean());
+		CharTermAttribute termAtt = filter.getAttribute(typeof(CharTermAttribute));
+		IEnumerator<string> unfoldedIter = expectedUnfoldedTokens.GetEnumerator();
+		IEnumerator<string> foldedIter = expectedFoldedTokens.GetEnumerator();
+		filter.reset();
+		while (foldedIter.MoveNext())
+		{
+//JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops:
+		  assertNextTerms(unfoldedIter.next(), foldedIter.Current, filter, termAtt);
+		}
+		assertFalse(filter.incrementToken());
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper(this);
+		checkRandomData(random(), a, 1000 * RANDOM_MULTIPLIER);
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestASCIIFoldingFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestASCIIFoldingFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(tokenizer, new ASCIIFoldingFilter(tokenizer, random().nextBoolean()));
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper2(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestASCIIFoldingFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestASCIIFoldingFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new ASCIIFoldingFilter(tokenizer, random().nextBoolean()));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestCapitalizationFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestCapitalizationFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestCapitalizationFilter.cs
new file mode 100644
index 0000000..0dba4df
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestCapitalizationFilter.cs
@@ -0,0 +1,177 @@
+using System.Collections.Generic;
+
+/*
+ * 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 org.apache.lucene.analysis.miscellaneous
+{
+
+
+	using KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+	using Test = org.junit.Test;
+
+//JAVA TO C# CONVERTER TODO TASK: This Java 'import static' statement cannot be converted to C#:
+//	import static org.apache.lucene.analysis.miscellaneous.CapitalizationFilter.*;
+
+	/// <summary>
+	/// Tests <seealso cref="CapitalizationFilter"/> </summary>
+	public class TestCapitalizationFilter : BaseTokenStreamTestCase
+	{
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCapitalization() throws Exception
+	  public virtual void testCapitalization()
+	  {
+		CharArraySet keep = new CharArraySet(TEST_VERSION_CURRENT, Arrays.asList("and", "the", "it", "BIG"), false);
+
+		assertCapitalizesTo("kiTTEN", new string[] {"Kitten"}, true, keep, true, null, 0, DEFAULT_MAX_WORD_COUNT, DEFAULT_MAX_TOKEN_LENGTH);
+
+		assertCapitalizesTo("and", new string[] {"And"}, true, keep, true, null, 0, DEFAULT_MAX_WORD_COUNT, DEFAULT_MAX_TOKEN_LENGTH);
+
+		assertCapitalizesTo("AnD", new string[] {"And"}, true, keep, true, null, 0, DEFAULT_MAX_WORD_COUNT, DEFAULT_MAX_TOKEN_LENGTH);
+
+		//first is not forced, but it's not a keep word, either
+		assertCapitalizesTo("AnD", new string[] {"And"}, true, keep, false, null, 0, DEFAULT_MAX_WORD_COUNT, DEFAULT_MAX_TOKEN_LENGTH);
+
+		assertCapitalizesTo("big", new string[] {"Big"}, true, keep, true, null, 0, DEFAULT_MAX_WORD_COUNT, DEFAULT_MAX_TOKEN_LENGTH);
+
+		assertCapitalizesTo("BIG", new string[] {"BIG"}, true, keep, true, null, 0, DEFAULT_MAX_WORD_COUNT, DEFAULT_MAX_TOKEN_LENGTH);
+
+		assertCapitalizesToKeyword("Hello thEre my Name is Ryan", "Hello there my name is ryan", true, keep, true, null, 0, DEFAULT_MAX_WORD_COUNT, DEFAULT_MAX_TOKEN_LENGTH);
+
+		// now each token
+		assertCapitalizesTo("Hello thEre my Name is Ryan", new string[] {"Hello", "There", "My", "Name", "Is", "Ryan"}, false, keep, true, null, 0, DEFAULT_MAX_WORD_COUNT, DEFAULT_MAX_TOKEN_LENGTH);
+
+		// now only the long words
+		assertCapitalizesTo("Hello thEre my Name is Ryan", new string[] {"Hello", "There", "my", "Name", "is", "Ryan"}, false, keep, true, null, 3, DEFAULT_MAX_WORD_COUNT, DEFAULT_MAX_TOKEN_LENGTH);
+
+		// without prefix
+		assertCapitalizesTo("McKinley", new string[] {"Mckinley"}, true, keep, true, null, 0, DEFAULT_MAX_WORD_COUNT, DEFAULT_MAX_TOKEN_LENGTH);
+
+		// Now try some prefixes
+		IList<char[]> okPrefix = new List<char[]>();
+		okPrefix.Add("McK".ToCharArray());
+
+		assertCapitalizesTo("McKinley", new string[] {"McKinley"}, true, keep, true, okPrefix, 0, DEFAULT_MAX_WORD_COUNT, DEFAULT_MAX_TOKEN_LENGTH);
+
+		// now try some stuff with numbers
+		assertCapitalizesTo("1st 2nd third", new string[] {"1st", "2nd", "Third"}, false, keep, false, null, 0, DEFAULT_MAX_WORD_COUNT, DEFAULT_MAX_TOKEN_LENGTH);
+
+		assertCapitalizesToKeyword("the The the", "The The the", false, keep, true, null, 0, DEFAULT_MAX_WORD_COUNT, DEFAULT_MAX_TOKEN_LENGTH);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: static void assertCapitalizesTo(org.apache.lucene.analysis.Tokenizer tokenizer, String expected[], boolean onlyFirstWord, org.apache.lucene.analysis.util.CharArraySet keep, boolean forceFirstLetter, java.util.Collection<char[]> okPrefix, int minWordLength, int maxWordCount, int maxTokenLength) throws java.io.IOException
+	  internal static void assertCapitalizesTo(Tokenizer tokenizer, string[] expected, bool onlyFirstWord, CharArraySet keep, bool forceFirstLetter, ICollection<char[]> okPrefix, int minWordLength, int maxWordCount, int maxTokenLength)
+	  {
+		CapitalizationFilter filter = new CapitalizationFilter(tokenizer, onlyFirstWord, keep, forceFirstLetter, okPrefix, minWordLength, maxWordCount, maxTokenLength);
+		assertTokenStreamContents(filter, expected);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: static void assertCapitalizesTo(String input, String expected[], boolean onlyFirstWord, org.apache.lucene.analysis.util.CharArraySet keep, boolean forceFirstLetter, java.util.Collection<char[]> okPrefix, int minWordLength, int maxWordCount, int maxTokenLength) throws java.io.IOException
+	  internal static void assertCapitalizesTo(string input, string[] expected, bool onlyFirstWord, CharArraySet keep, bool forceFirstLetter, ICollection<char[]> okPrefix, int minWordLength, int maxWordCount, int maxTokenLength)
+	  {
+		assertCapitalizesTo(new MockTokenizer(new StringReader(input), MockTokenizer.WHITESPACE, false), expected, onlyFirstWord, keep, forceFirstLetter, okPrefix, minWordLength, maxWordCount, maxTokenLength);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: static void assertCapitalizesToKeyword(String input, String expected, boolean onlyFirstWord, org.apache.lucene.analysis.util.CharArraySet keep, boolean forceFirstLetter, java.util.Collection<char[]> okPrefix, int minWordLength, int maxWordCount, int maxTokenLength) throws java.io.IOException
+	  internal static void assertCapitalizesToKeyword(string input, string expected, bool onlyFirstWord, CharArraySet keep, bool forceFirstLetter, ICollection<char[]> okPrefix, int minWordLength, int maxWordCount, int maxTokenLength)
+	  {
+		assertCapitalizesTo(new MockTokenizer(new StringReader(input), MockTokenizer.KEYWORD, false), new string[] {expected}, onlyFirstWord, keep, forceFirstLetter, okPrefix, minWordLength, maxWordCount, maxTokenLength);
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomString() throws Exception
+	  public virtual void testRandomString()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper(this);
+
+		checkRandomData(random(), a, 1000 * RANDOM_MULTIPLIER);
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestCapitalizationFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestCapitalizationFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(tokenizer, new CapitalizationFilter(tokenizer));
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper2(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestCapitalizationFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestCapitalizationFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new CapitalizationFilter(tokenizer));
+		  }
+	  }
+
+	  /// <summary>
+	  /// checking the validity of constructor arguments
+	  /// </summary>
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @Test(expected = IllegalArgumentException.class) public void testIllegalArguments() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public virtual void testIllegalArguments()
+	  {
+		new CapitalizationFilter(new MockTokenizer(new StringReader("accept only valid arguments"), MockTokenizer.WHITESPACE, false),true, null, true, null, -1, DEFAULT_MAX_WORD_COUNT, DEFAULT_MAX_TOKEN_LENGTH);
+	  }
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @Test(expected = IllegalArgumentException.class) public void testIllegalArguments1() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public virtual void testIllegalArguments1()
+	  {
+		new CapitalizationFilter(new MockTokenizer(new StringReader("accept only valid arguments"), MockTokenizer.WHITESPACE, false),true, null, true, null, 0, -10, DEFAULT_MAX_TOKEN_LENGTH);
+	  }
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @Test(expected = IllegalArgumentException.class) public void testIllegalArguments2() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public virtual void testIllegalArguments2()
+	  {
+		new CapitalizationFilter(new MockTokenizer(new StringReader("accept only valid arguments"), MockTokenizer.WHITESPACE, false),true, null, true, null, 0, DEFAULT_MAX_WORD_COUNT, -50);
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestCapitalizationFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestCapitalizationFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestCapitalizationFilterFactory.cs
new file mode 100644
index 0000000..7c56cb4
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestCapitalizationFilterFactory.cs
@@ -0,0 +1,308 @@
+namespace org.apache.lucene.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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	public class TestCapitalizationFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCapitalization() throws Exception
+	  public virtual void testCapitalization()
+	  {
+		Reader reader = new StringReader("kiTTEN");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("Capitalization", "keep", "and the it BIG", "onlyFirstWord", "true").create(stream);
+		assertTokenStreamContents(stream, new string[] {"Kitten"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCapitalization2() throws Exception
+	  public virtual void testCapitalization2()
+	  {
+		Reader reader = new StringReader("and");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("Capitalization", "keep", "and the it BIG", "onlyFirstWord", "true", "forceFirstLetter", "true").create(stream);
+		assertTokenStreamContents(stream, new string[] {"And"});
+	  }
+
+	  /// <summary>
+	  /// first is forced, but it's not a keep word, either </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCapitalization3() throws Exception
+	  public virtual void testCapitalization3()
+	  {
+		Reader reader = new StringReader("AnD");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("Capitalization", "keep", "and the it BIG", "onlyFirstWord", "true", "forceFirstLetter", "true").create(stream);
+		assertTokenStreamContents(stream, new string[] {"And"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCapitalization4() throws Exception
+	  public virtual void testCapitalization4()
+	  {
+		Reader reader = new StringReader("AnD");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("Capitalization", "keep", "and the it BIG", "onlyFirstWord", "true", "forceFirstLetter", "false").create(stream);
+		assertTokenStreamContents(stream, new string[] {"And"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCapitalization5() throws Exception
+	  public virtual void testCapitalization5()
+	  {
+		Reader reader = new StringReader("big");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("Capitalization", "keep", "and the it BIG", "onlyFirstWord", "true", "forceFirstLetter", "true").create(stream);
+		assertTokenStreamContents(stream, new string[] {"Big"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCapitalization6() throws Exception
+	  public virtual void testCapitalization6()
+	  {
+		Reader reader = new StringReader("BIG");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("Capitalization", "keep", "and the it BIG", "onlyFirstWord", "true", "forceFirstLetter", "true").create(stream);
+		assertTokenStreamContents(stream, new string[] {"BIG"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCapitalization7() throws Exception
+	  public virtual void testCapitalization7()
+	  {
+		Reader reader = new StringReader("Hello thEre my Name is Ryan");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.KEYWORD, false);
+		stream = tokenFilterFactory("Capitalization", "keep", "and the it BIG", "onlyFirstWord", "true", "forceFirstLetter", "true").create(stream);
+		assertTokenStreamContents(stream, new string[] {"Hello there my name is ryan"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCapitalization8() throws Exception
+	  public virtual void testCapitalization8()
+	  {
+		Reader reader = new StringReader("Hello thEre my Name is Ryan");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("Capitalization", "keep", "and the it BIG", "onlyFirstWord", "false", "forceFirstLetter", "true").create(stream);
+		assertTokenStreamContents(stream, new string[] {"Hello", "There", "My", "Name", "Is", "Ryan"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCapitalization9() throws Exception
+	  public virtual void testCapitalization9()
+	  {
+		Reader reader = new StringReader("Hello thEre my Name is Ryan");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("Capitalization", "keep", "and the it BIG", "onlyFirstWord", "false", "minWordLength", "3", "forceFirstLetter", "true").create(stream);
+		assertTokenStreamContents(stream, new string[] {"Hello", "There", "my", "Name", "is", "Ryan"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCapitalization10() throws Exception
+	  public virtual void testCapitalization10()
+	  {
+		Reader reader = new StringReader("McKinley");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("Capitalization", "keep", "and the it BIG", "onlyFirstWord", "false", "minWordLength", "3", "forceFirstLetter", "true").create(stream);
+		assertTokenStreamContents(stream, new string[] {"Mckinley"});
+	  }
+
+	  /// <summary>
+	  /// using "McK" as okPrefix </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCapitalization11() throws Exception
+	  public virtual void testCapitalization11()
+	  {
+		Reader reader = new StringReader("McKinley");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("Capitalization", "keep", "and the it BIG", "onlyFirstWord", "false", "minWordLength", "3", "okPrefix", "McK", "forceFirstLetter", "true").create(stream);
+		assertTokenStreamContents(stream, new string[] {"McKinley"});
+	  }
+
+	  /// <summary>
+	  /// test with numbers </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCapitalization12() throws Exception
+	  public virtual void testCapitalization12()
+	  {
+		Reader reader = new StringReader("1st 2nd third");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("Capitalization", "keep", "and the it BIG", "onlyFirstWord", "false", "minWordLength", "3", "okPrefix", "McK", "forceFirstLetter", "false").create(stream);
+		assertTokenStreamContents(stream, new string[] {"1st", "2nd", "Third"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCapitalization13() throws Exception
+	  public virtual void testCapitalization13()
+	  {
+		Reader reader = new StringReader("the The the");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.KEYWORD, false);
+		stream = tokenFilterFactory("Capitalization", "keep", "and the it BIG", "onlyFirstWord", "false", "minWordLength", "3", "okPrefix", "McK", "forceFirstLetter", "true").create(stream);
+		assertTokenStreamContents(stream, new string[] {"The The the"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testKeepIgnoreCase() throws Exception
+	  public virtual void testKeepIgnoreCase()
+	  {
+		Reader reader = new StringReader("kiTTEN");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.KEYWORD, false);
+		stream = tokenFilterFactory("Capitalization", "keep", "kitten", "keepIgnoreCase", "true", "onlyFirstWord", "true", "forceFirstLetter", "true").create(stream);
+
+		assertTokenStreamContents(stream, new string[] {"KiTTEN"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testKeepIgnoreCase2() throws Exception
+	  public virtual void testKeepIgnoreCase2()
+	  {
+		Reader reader = new StringReader("kiTTEN");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.KEYWORD, false);
+		stream = tokenFilterFactory("Capitalization", "keep", "kitten", "keepIgnoreCase", "true", "onlyFirstWord", "true", "forceFirstLetter", "false").create(stream);
+
+		assertTokenStreamContents(stream, new string[] {"kiTTEN"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testKeepIgnoreCase3() throws Exception
+	  public virtual void testKeepIgnoreCase3()
+	  {
+		Reader reader = new StringReader("kiTTEN");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.KEYWORD, false);
+		stream = tokenFilterFactory("Capitalization", "keepIgnoreCase", "true", "onlyFirstWord", "true", "forceFirstLetter", "false").create(stream);
+
+		assertTokenStreamContents(stream, new string[] {"Kitten"});
+	  }
+
+	  /// <summary>
+	  /// Test CapitalizationFilterFactory's minWordLength option.
+	  /// 
+	  /// This is very weird when combined with ONLY_FIRST_WORD!!!
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMinWordLength() throws Exception
+	  public virtual void testMinWordLength()
+	  {
+		Reader reader = new StringReader("helo testing");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("Capitalization", "onlyFirstWord", "true", "minWordLength", "5").create(stream);
+		assertTokenStreamContents(stream, new string[] {"helo", "Testing"});
+	  }
+
+	  /// <summary>
+	  /// Test CapitalizationFilterFactory's maxWordCount option with only words of 1
+	  /// in each token (it should do nothing)
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMaxWordCount() throws Exception
+	  public virtual void testMaxWordCount()
+	  {
+		Reader reader = new StringReader("one two three four");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("Capitalization", "maxWordCount", "2").create(stream);
+		assertTokenStreamContents(stream, new string[] {"One", "Two", "Three", "Four"});
+	  }
+
+	  /// <summary>
+	  /// Test CapitalizationFilterFactory's maxWordCount option when exceeded
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMaxWordCount2() throws Exception
+	  public virtual void testMaxWordCount2()
+	  {
+		Reader reader = new StringReader("one two three four");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.KEYWORD, false);
+		stream = tokenFilterFactory("Capitalization", "maxWordCount", "2").create(stream);
+		assertTokenStreamContents(stream, new string[] {"one two three four"});
+	  }
+
+	  /// <summary>
+	  /// Test CapitalizationFilterFactory's maxTokenLength option when exceeded
+	  /// 
+	  /// This is weird, it is not really a max, but inclusive (look at 'is')
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMaxTokenLength() throws Exception
+	  public virtual void testMaxTokenLength()
+	  {
+		Reader reader = new StringReader("this is a test");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("Capitalization", "maxTokenLength", "2").create(stream);
+		assertTokenStreamContents(stream, new string[] {"this", "is", "A", "test"});
+	  }
+
+	  /// <summary>
+	  /// Test CapitalizationFilterFactory's forceFirstLetter option
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testForceFirstLetterWithKeep() throws Exception
+	  public virtual void testForceFirstLetterWithKeep()
+	  {
+		Reader reader = new StringReader("kitten");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("Capitalization", "keep", "kitten", "forceFirstLetter", "true").create(stream);
+		assertTokenStreamContents(stream, new string[] {"Kitten"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("Capitalization", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+
+	  /// <summary>
+	  /// Test that invalid arguments result in exception
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testInvalidArguments() throws Exception
+	  public virtual void testInvalidArguments()
+	  {
+		foreach (String arg in new String[]{"minWordLength", "maxTokenLength", "maxWordCount"})
+		{
+		  try
+		  {
+			Reader reader = new StringReader("foo foobar super-duper-trooper");
+			TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+
+			tokenFilterFactory("Capitalization", "keep", "and the it BIG", "onlyFirstWord", "false", arg, "-3", "okPrefix", "McK", "forceFirstLetter", "true").create(stream);
+			fail();
+		  }
+		  catch (System.ArgumentException expected)
+		  {
+			assertTrue(expected.Message.contains(arg + " must be greater than or equal to zero") || expected.Message.contains(arg + " must be greater than zero"));
+		  }
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestCodepointCountFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestCodepointCountFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestCodepointCountFilter.cs
new file mode 100644
index 0000000..8aab70d
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestCodepointCountFilter.cs
@@ -0,0 +1,99 @@
+namespace org.apache.lucene.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 KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+	using TestUtil = org.apache.lucene.util.TestUtil;
+	using Test = org.junit.Test;
+
+	public class TestCodepointCountFilter : BaseTokenStreamTestCase
+	{
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFilterWithPosIncr() throws Exception
+	  public virtual void testFilterWithPosIncr()
+	  {
+		TokenStream stream = new MockTokenizer(new StringReader("short toolong evenmuchlongertext a ab toolong foo"), MockTokenizer.WHITESPACE, false);
+		CodepointCountFilter filter = new CodepointCountFilter(TEST_VERSION_CURRENT, stream, 2, 6);
+		assertTokenStreamContents(filter, new string[]{"short", "ab", "foo"}, new int[]{1, 4, 2});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestCodepointCountFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestCodepointCountFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new CodepointCountFilter(TEST_VERSION_CURRENT, tokenizer, 0, 5));
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws java.io.IOException
+	  public virtual void testRandomStrings()
+	  {
+		for (int i = 0; i < 10000; i++)
+		{
+		  string text = TestUtil.randomUnicodeString(random(), 100);
+		  int min = TestUtil.Next(random(), 0, 100);
+		  int max = TestUtil.Next(random(), 0, 100);
+		  int count = text.codePointCount(0, text.Length);
+		  if (min > max)
+		  {
+			int temp = min;
+			min = max;
+			max = temp;
+		  }
+		  bool expected = count >= min && count <= max;
+		  TokenStream stream = new KeywordTokenizer(new StringReader(text));
+		  stream = new CodepointCountFilter(TEST_VERSION_CURRENT, stream, min, max);
+		  stream.reset();
+		  assertEquals(expected, stream.incrementToken());
+		  stream.end();
+		  stream.close();
+		}
+	  }
+
+	  /// <summary>
+	  /// checking the validity of constructor arguments
+	  /// </summary>
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @Test(expected = IllegalArgumentException.class) public void testIllegalArguments() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public virtual void testIllegalArguments()
+	  {
+		new CodepointCountFilter(TEST_VERSION_CURRENT, new MockTokenizer(new StringReader("accept only valid arguments"), MockTokenizer.WHITESPACE, false), 4, 1);
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestCodepointCountFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestCodepointCountFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestCodepointCountFilterFactory.cs
new file mode 100644
index 0000000..8605885
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestCodepointCountFilterFactory.cs
@@ -0,0 +1,73 @@
+namespace org.apache.lucene.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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	public class TestCodepointCountFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testPositionIncrements() throws Exception
+	  public virtual void testPositionIncrements()
+	  {
+		Reader reader = new StringReader("foo foobar super-duper-trooper");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("CodepointCount", "min", "4", "max", "10").create(stream);
+		assertTokenStreamContents(stream, new string[] {"foobar"}, new int[] {2});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("CodepointCount", "min", "4", "max", "5", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+
+	  /// <summary>
+	  /// Test that invalid arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testInvalidArguments() throws Exception
+	  public virtual void testInvalidArguments()
+	  {
+		try
+		{
+		  Reader reader = new StringReader("foo foobar super-duper-trooper");
+		  TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		  tokenFilterFactory("CodepointCount", CodepointCountFilterFactory.MIN_KEY, "5", CodepointCountFilterFactory.MAX_KEY, "4").create(stream);
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("maximum length must not be greater than minimum length"));
+		}
+	  }
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestEmptyTokenStream.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestEmptyTokenStream.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestEmptyTokenStream.cs
new file mode 100644
index 0000000..0bad941
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestEmptyTokenStream.cs
@@ -0,0 +1,82 @@
+namespace org.apache.lucene.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 LuceneTestCase = org.apache.lucene.util.LuceneTestCase;
+	using TermToBytesRefAttribute = org.apache.lucene.analysis.tokenattributes.TermToBytesRefAttribute;
+	using Document = org.apache.lucene.document.Document;
+	using Field = org.apache.lucene.document.Field;
+	using StringField = org.apache.lucene.document.StringField;
+	using TextField = org.apache.lucene.document.TextField;
+	using IndexWriter = org.apache.lucene.index.IndexWriter;
+	using IndexWriterConfig = org.apache.lucene.index.IndexWriterConfig;
+	using Directory = org.apache.lucene.store.Directory;
+
+	public class TestEmptyTokenStream : BaseTokenStreamTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testConsume() throws java.io.IOException
+	  public virtual void testConsume()
+	  {
+		TokenStream ts = new EmptyTokenStream();
+		ts.reset();
+		assertFalse(ts.incrementToken());
+		ts.end();
+		ts.close();
+		// try again with reuse:
+		ts.reset();
+		assertFalse(ts.incrementToken());
+		ts.end();
+		ts.close();
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testConsume2() throws java.io.IOException
+	  public virtual void testConsume2()
+	  {
+		BaseTokenStreamTestCase.assertTokenStreamContents(new EmptyTokenStream(), new string[0]);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testIndexWriter_LUCENE4656() throws java.io.IOException
+	  public virtual void testIndexWriter_LUCENE4656()
+	  {
+		Directory directory = newDirectory();
+		IndexWriter writer = new IndexWriter(directory, newIndexWriterConfig(TEST_VERSION_CURRENT, null));
+
+		TokenStream ts = new EmptyTokenStream();
+		assertFalse(ts.hasAttribute(typeof(TermToBytesRefAttribute)));
+
+		Document doc = new Document();
+		doc.add(new StringField("id", "0", Field.Store.YES));
+		doc.add(new TextField("description", ts));
+
+		// this should not fail because we have no TermToBytesRefAttribute
+		writer.addDocument(doc);
+
+		assertEquals(1, writer.numDocs());
+
+		writer.close();
+		directory.close();
+	  }
+
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestHyphenatedWordsFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestHyphenatedWordsFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestHyphenatedWordsFilter.cs
new file mode 100644
index 0000000..bb5483d
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestHyphenatedWordsFilter.cs
@@ -0,0 +1,117 @@
+/*
+ * 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 org.apache.lucene.analysis.miscellaneous
+{
+
+
+	using KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+
+	/// <summary>
+	/// HyphenatedWordsFilter test
+	/// </summary>
+	public class TestHyphenatedWordsFilter : BaseTokenStreamTestCase
+	{
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testHyphenatedWords() throws Exception
+	  public virtual void testHyphenatedWords()
+	  {
+		string input = "ecologi-\r\ncal devel-\r\n\r\nop compre-\u0009hensive-hands-on and ecologi-\ncal";
+		// first test
+		TokenStream ts = new MockTokenizer(new StringReader(input), MockTokenizer.WHITESPACE, false);
+		ts = new HyphenatedWordsFilter(ts);
+		assertTokenStreamContents(ts, new string[] {"ecological", "develop", "comprehensive-hands-on", "and", "ecological"});
+	  }
+
+	  /// <summary>
+	  /// Test that HyphenatedWordsFilter behaves correctly with a final hyphen
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testHyphenAtEnd() throws Exception
+	  public virtual void testHyphenAtEnd()
+	  {
+		  string input = "ecologi-\r\ncal devel-\r\n\r\nop compre-\u0009hensive-hands-on and ecology-";
+		  // first test
+		  TokenStream ts = new MockTokenizer(new StringReader(input), MockTokenizer.WHITESPACE, false);
+		  ts = new HyphenatedWordsFilter(ts);
+		  assertTokenStreamContents(ts, new string[] {"ecological", "develop", "comprehensive-hands-on", "and", "ecology-"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testOffsets() throws Exception
+	  public virtual void testOffsets()
+	  {
+		string input = "abc- def geh 1234- 5678-";
+		TokenStream ts = new MockTokenizer(new StringReader(input), MockTokenizer.WHITESPACE, false);
+		ts = new HyphenatedWordsFilter(ts);
+		assertTokenStreamContents(ts, new string[] {"abcdef", "geh", "12345678-"}, new int[] {0, 9, 13}, new int[] {8, 12, 24});
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomString() throws Exception
+	  public virtual void testRandomString()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper(this);
+
+		checkRandomData(random(), a, 1000 * RANDOM_MULTIPLIER);
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestHyphenatedWordsFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestHyphenatedWordsFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(tokenizer, new HyphenatedWordsFilter(tokenizer));
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper2(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestHyphenatedWordsFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestHyphenatedWordsFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new HyphenatedWordsFilter(tokenizer));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestKeepFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestKeepFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestKeepFilterFactory.cs
new file mode 100644
index 0000000..41c40c7
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestKeepFilterFactory.cs
@@ -0,0 +1,63 @@
+namespace org.apache.lucene.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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+	using ClasspathResourceLoader = org.apache.lucene.analysis.util.ClasspathResourceLoader;
+	using ResourceLoader = org.apache.lucene.analysis.util.ResourceLoader;
+
+	public class TestKeepFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testInform() throws Exception
+	  public virtual void testInform()
+	  {
+		ResourceLoader loader = new ClasspathResourceLoader(this.GetType());
+		assertTrue("loader is null and it shouldn't be", loader != null);
+		KeepWordFilterFactory factory = (KeepWordFilterFactory) tokenFilterFactory("KeepWord", "words", "keep-1.txt", "ignoreCase", "true");
+		CharArraySet words = factory.Words;
+		assertTrue("words is null and it shouldn't be", words != null);
+		assertTrue("words Size: " + words.size() + " is not: " + 2, words.size() == 2);
+
+		factory = (KeepWordFilterFactory) tokenFilterFactory("KeepWord", "words", "keep-1.txt, keep-2.txt", "ignoreCase", "true");
+		words = factory.Words;
+		assertTrue("words is null and it shouldn't be", words != null);
+		assertTrue("words Size: " + words.size() + " is not: " + 4, words.size() == 4);
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("KeepWord", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestKeepWordFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestKeepWordFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestKeepWordFilter.cs
new file mode 100644
index 0000000..123e974
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestKeepWordFilter.cs
@@ -0,0 +1,102 @@
+using System.Collections.Generic;
+
+/*
+ * 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 org.apache.lucene.analysis.miscellaneous
+{
+
+
+	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+	using Version = org.apache.lucene.util.Version;
+
+	/// <summary>
+	/// Test <seealso cref="KeepWordFilter"/> </summary>
+	public class TestKeepWordFilter : BaseTokenStreamTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStopAndGo() throws Exception
+	  public virtual void testStopAndGo()
+	  {
+		ISet<string> words = new HashSet<string>();
+		words.Add("aaa");
+		words.Add("bbb");
+
+		string input = "xxx yyy aaa zzz BBB ccc ddd EEE";
+
+		// Test Stopwords
+		TokenStream stream = new MockTokenizer(new StringReader(input), MockTokenizer.WHITESPACE, false);
+		stream = new KeepWordFilter(TEST_VERSION_CURRENT, stream, new CharArraySet(TEST_VERSION_CURRENT, words, true));
+		assertTokenStreamContents(stream, new string[] {"aaa", "BBB"}, new int[] {3, 2});
+
+		// Now force case
+		stream = new MockTokenizer(new StringReader(input), MockTokenizer.WHITESPACE, false);
+		stream = new KeepWordFilter(TEST_VERSION_CURRENT, stream, new CharArraySet(TEST_VERSION_CURRENT,words, false));
+		assertTokenStreamContents(stream, new string[] {"aaa"}, new int[] {3});
+
+		// Test Stopwords
+		stream = new MockTokenizer(new StringReader(input), MockTokenizer.WHITESPACE, false);
+		stream = new KeepWordFilter(Version.LUCENE_43, false, stream, new CharArraySet(TEST_VERSION_CURRENT, words, true));
+		assertTokenStreamContents(stream, new string[] {"aaa", "BBB"}, new int[] {1, 1});
+
+		// Now force case
+		stream = new MockTokenizer(new StringReader(input), MockTokenizer.WHITESPACE, false);
+		stream = new KeepWordFilter(Version.LUCENE_43, false, stream, new CharArraySet(TEST_VERSION_CURRENT,words, false));
+		assertTokenStreamContents(stream, new string[] {"aaa"}, new int[] {1});
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final java.util.Set<String> words = new java.util.HashSet<>();
+		ISet<string> words = new HashSet<string>();
+		words.Add("a");
+		words.Add("b");
+
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper(this, words);
+
+		checkRandomData(random(), a, 1000 * RANDOM_MULTIPLIER);
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestKeepWordFilter outerInstance;
+
+		  private ISet<string> words;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestKeepWordFilter outerInstance, ISet<string> words)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.words = words;
+		  }
+
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			TokenStream stream = new KeepWordFilter(TEST_VERSION_CURRENT, tokenizer, new CharArraySet(TEST_VERSION_CURRENT, words, true));
+			return new TokenStreamComponents(tokenizer, stream);
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestKeywordMarkerFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestKeywordMarkerFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestKeywordMarkerFilter.cs
new file mode 100644
index 0000000..2442539
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestKeywordMarkerFilter.cs
@@ -0,0 +1,110 @@
+namespace org.apache.lucene.analysis.miscellaneous
+{
+
+
+	using KeywordAttribute = org.apache.lucene.analysis.tokenattributes.KeywordAttribute;
+	using CharTermAttribute = org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
+	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+	using Test = org.junit.Test;
+
+	/*
+	 * 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>
+	/// Testcase for <seealso cref="KeywordMarkerFilter"/>
+	/// </summary>
+	public class TestKeywordMarkerFilter : BaseTokenStreamTestCase
+	{
+
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @Test public void testSetFilterIncrementToken() throws java.io.IOException
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public virtual void testSetFilterIncrementToken()
+	  {
+		CharArraySet set = new CharArraySet(TEST_VERSION_CURRENT, 5, true);
+		set.add("lucenefox");
+		string[] output = new string[] {"the", "quick", "brown", "LuceneFox", "jumps"};
+		assertTokenStreamContents(new LowerCaseFilterMock(new SetKeywordMarkerFilter(new MockTokenizer(new StringReader("The quIck browN LuceneFox Jumps"), MockTokenizer.WHITESPACE, false), set)), output);
+		CharArraySet mixedCaseSet = new CharArraySet(TEST_VERSION_CURRENT, asSet("LuceneFox"), false);
+		assertTokenStreamContents(new LowerCaseFilterMock(new SetKeywordMarkerFilter(new MockTokenizer(new StringReader("The quIck browN LuceneFox Jumps"), MockTokenizer.WHITESPACE, false), mixedCaseSet)), output);
+		CharArraySet set2 = set;
+		assertTokenStreamContents(new LowerCaseFilterMock(new SetKeywordMarkerFilter(new MockTokenizer(new StringReader("The quIck browN LuceneFox Jumps"), MockTokenizer.WHITESPACE, false), set2)), output);
+	  }
+
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @Test public void testPatternFilterIncrementToken() throws java.io.IOException
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public virtual void testPatternFilterIncrementToken()
+	  {
+		string[] output = new string[] {"the", "quick", "brown", "LuceneFox", "jumps"};
+		assertTokenStreamContents(new LowerCaseFilterMock(new PatternKeywordMarkerFilter(new MockTokenizer(new StringReader("The quIck browN LuceneFox Jumps"), MockTokenizer.WHITESPACE, false), Pattern.compile("[a-zA-Z]+[fF]ox"))), output);
+
+		output = new string[] {"the", "quick", "brown", "lucenefox", "jumps"};
+
+		assertTokenStreamContents(new LowerCaseFilterMock(new PatternKeywordMarkerFilter(new MockTokenizer(new StringReader("The quIck browN LuceneFox Jumps"), MockTokenizer.WHITESPACE, false), Pattern.compile("[a-zA-Z]+[f]ox"))), output);
+	  }
+
+	  // LUCENE-2901
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testComposition() throws Exception
+	  public virtual void testComposition()
+	  {
+		TokenStream ts = new LowerCaseFilterMock(new SetKeywordMarkerFilter(new SetKeywordMarkerFilter(new MockTokenizer(new StringReader("Dogs Trees Birds Houses"), MockTokenizer.WHITESPACE, false), new CharArraySet(TEST_VERSION_CURRENT, asSet("Birds", "Houses"), false)), new CharArraySet(TEST_VERSION_CURRENT, asSet("Dogs", "Trees"), false)));
+
+		assertTokenStreamContents(ts, new string[] {"Dogs", "Trees", "Birds", "Houses"});
+
+		ts = new LowerCaseFilterMock(new PatternKeywordMarkerFilter(new PatternKeywordMarkerFilter(new MockTokenizer(new StringReader("Dogs Trees Birds Houses"), MockTokenizer.WHITESPACE, false), Pattern.compile("Birds|Houses")), Pattern.compile("Dogs|Trees")));
+
+		assertTokenStreamContents(ts, new string[] {"Dogs", "Trees", "Birds", "Houses"});
+
+		ts = new LowerCaseFilterMock(new SetKeywordMarkerFilter(new PatternKeywordMarkerFilter(new MockTokenizer(new StringReader("Dogs Trees Birds Houses"), MockTokenizer.WHITESPACE, false), Pattern.compile("Birds|Houses")), new CharArraySet(TEST_VERSION_CURRENT, asSet("Dogs", "Trees"), false)));
+
+		assertTokenStreamContents(ts, new string[] {"Dogs", "Trees", "Birds", "Houses"});
+	  }
+
+	  public sealed class LowerCaseFilterMock : TokenFilter
+	  {
+
+		internal readonly CharTermAttribute termAtt = addAttribute(typeof(CharTermAttribute));
+		internal readonly KeywordAttribute keywordAttr = addAttribute(typeof(KeywordAttribute));
+
+		public LowerCaseFilterMock(TokenStream @in) : base(@in)
+		{
+		}
+
+//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())
+		  {
+			if (!keywordAttr.Keyword)
+			{
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final String term = termAtt.toString().toLowerCase(java.util.Locale.ROOT);
+			  string term = termAtt.ToString().ToLower(Locale.ROOT);
+			  termAtt.setEmpty().append(term);
+			}
+			return true;
+		  }
+		  return false;
+		}
+
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestKeywordMarkerFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestKeywordMarkerFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestKeywordMarkerFilterFactory.cs
new file mode 100644
index 0000000..4fd71ee
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestKeywordMarkerFilterFactory.cs
@@ -0,0 +1,115 @@
+namespace org.apache.lucene.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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+	using StringMockResourceLoader = org.apache.lucene.analysis.util.StringMockResourceLoader;
+
+	/// <summary>
+	/// Simple tests to ensure the keyword marker filter factory is working.
+	/// </summary>
+	public class TestKeywordMarkerFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testKeywords() throws Exception
+	  public virtual void testKeywords()
+	  {
+		Reader reader = new StringReader("dogs cats");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("KeywordMarker", TEST_VERSION_CURRENT, new StringMockResourceLoader("cats"), "protected", "protwords.txt").create(stream);
+		stream = tokenFilterFactory("PorterStem").create(stream);
+		assertTokenStreamContents(stream, new string[] {"dog", "cats"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testKeywords2() throws Exception
+	  public virtual void testKeywords2()
+	  {
+		Reader reader = new StringReader("dogs cats");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("KeywordMarker", "pattern", "cats|Dogs").create(stream);
+		stream = tokenFilterFactory("PorterStem").create(stream);
+		assertTokenStreamContents(stream, new string[] {"dog", "cats"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testKeywordsMixed() throws Exception
+	  public virtual void testKeywordsMixed()
+	  {
+		Reader reader = new StringReader("dogs cats birds");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("KeywordMarker", TEST_VERSION_CURRENT, new StringMockResourceLoader("cats"), "protected", "protwords.txt", "pattern", "birds|Dogs").create(stream);
+		stream = tokenFilterFactory("PorterStem").create(stream);
+		assertTokenStreamContents(stream, new string[] {"dog", "cats", "birds"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testKeywordsCaseInsensitive() throws Exception
+	  public virtual void testKeywordsCaseInsensitive()
+	  {
+		Reader reader = new StringReader("dogs cats Cats");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("KeywordMarker", TEST_VERSION_CURRENT, new StringMockResourceLoader("cats"), "protected", "protwords.txt", "ignoreCase", "true").create(stream);
+		stream = tokenFilterFactory("PorterStem").create(stream);
+		assertTokenStreamContents(stream, new string[] {"dog", "cats", "Cats"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testKeywordsCaseInsensitive2() throws Exception
+	  public virtual void testKeywordsCaseInsensitive2()
+	  {
+		Reader reader = new StringReader("dogs cats Cats");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("KeywordMarker", "pattern", "Cats", "ignoreCase", "true").create(stream);
+		stream = tokenFilterFactory("PorterStem").create(stream);
+		assertTokenStreamContents(stream, new string[] {"dog", "cats", "Cats"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testKeywordsCaseInsensitiveMixed() throws Exception
+	  public virtual void testKeywordsCaseInsensitiveMixed()
+	  {
+		Reader reader = new StringReader("dogs cats Cats Birds birds");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("KeywordMarker", TEST_VERSION_CURRENT, new StringMockResourceLoader("cats"), "protected", "protwords.txt", "pattern", "birds", "ignoreCase", "true").create(stream);
+		stream = tokenFilterFactory("PorterStem").create(stream);
+		assertTokenStreamContents(stream, new string[] {"dog", "cats", "Cats", "Birds", "birds"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("KeywordMarker", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file


[20/27] lucenenet git commit: adding converted analysis common tests

Posted by sy...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestStopFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestStopFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestStopFilterFactory.cs
new file mode 100644
index 0000000..9b204a9
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestStopFilterFactory.cs
@@ -0,0 +1,116 @@
+namespace org.apache.lucene.analysis.core
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+	using ClasspathResourceLoader = org.apache.lucene.analysis.util.ClasspathResourceLoader;
+	using ResourceLoader = org.apache.lucene.analysis.util.ResourceLoader;
+
+	public class TestStopFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testInform() throws Exception
+	  public virtual void testInform()
+	  {
+		ResourceLoader loader = new ClasspathResourceLoader(this.GetType());
+		assertTrue("loader is null and it shouldn't be", loader != null);
+		StopFilterFactory factory = (StopFilterFactory) tokenFilterFactory("Stop", "words", "stop-1.txt", "ignoreCase", "true");
+		CharArraySet words = factory.StopWords;
+		assertTrue("words is null and it shouldn't be", words != null);
+		assertTrue("words Size: " + words.size() + " is not: " + 2, words.size() == 2);
+		assertTrue(factory.IgnoreCase + " does not equal: " + true, factory.IgnoreCase == true);
+
+		factory = (StopFilterFactory) tokenFilterFactory("Stop", "words", "stop-1.txt, stop-2.txt", "ignoreCase", "true");
+		words = factory.StopWords;
+		assertTrue("words is null and it shouldn't be", words != null);
+		assertTrue("words Size: " + words.size() + " is not: " + 4, words.size() == 4);
+		assertTrue(factory.IgnoreCase + " does not equal: " + true, factory.IgnoreCase == true);
+
+		factory = (StopFilterFactory) tokenFilterFactory("Stop", "words", "stop-snowball.txt", "format", "snowball", "ignoreCase", "true");
+		words = factory.StopWords;
+		assertEquals(8, words.size());
+		assertTrue(words.contains("he"));
+		assertTrue(words.contains("him"));
+		assertTrue(words.contains("his"));
+		assertTrue(words.contains("himself"));
+		assertTrue(words.contains("she"));
+		assertTrue(words.contains("her"));
+		assertTrue(words.contains("hers"));
+		assertTrue(words.contains("herself"));
+
+		// defaults
+		factory = (StopFilterFactory) tokenFilterFactory("Stop");
+		assertEquals(StopAnalyzer.ENGLISH_STOP_WORDS_SET, factory.StopWords);
+		assertEquals(false, factory.IgnoreCase);
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("Stop", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusFormats() throws Exception
+	  public virtual void testBogusFormats()
+	  {
+		try
+		{
+		  tokenFilterFactory("Stop", "words", "stop-snowball.txt", "format", "bogus");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  string msg = expected.Message;
+		  assertTrue(msg, msg.Contains("Unknown"));
+		  assertTrue(msg, msg.Contains("format"));
+		  assertTrue(msg, msg.Contains("bogus"));
+		}
+		try
+		{
+		  tokenFilterFactory("Stop", "format", "bogus");
+							 // implicit default words file
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  string msg = expected.Message;
+		  assertTrue(msg, msg.Contains("can not be specified"));
+		  assertTrue(msg, msg.Contains("format"));
+		  assertTrue(msg, msg.Contains("bogus"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestTypeTokenFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestTypeTokenFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestTypeTokenFilter.cs
new file mode 100644
index 0000000..793da91
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestTypeTokenFilter.cs
@@ -0,0 +1,121 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace org.apache.lucene.analysis.core
+{
+
+	/*
+	 * 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 StandardTokenizer = org.apache.lucene.analysis.standard.StandardTokenizer;
+	using CharTermAttribute = org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
+	using PositionIncrementAttribute = org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
+	using TypeAttribute = org.apache.lucene.analysis.tokenattributes.TypeAttribute;
+	using English = org.apache.lucene.util.English;
+	using Version = org.apache.lucene.util.Version;
+
+
+
+	public class TestTypeTokenFilter : BaseTokenStreamTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTypeFilter() throws java.io.IOException
+	  public virtual void testTypeFilter()
+	  {
+		StringReader reader = new StringReader("121 is palindrome, while 123 is not");
+		ISet<string> stopTypes = asSet("<NUM>");
+		TokenStream stream = new TypeTokenFilter(TEST_VERSION_CURRENT, true, new StandardTokenizer(TEST_VERSION_CURRENT, reader), stopTypes);
+		assertTokenStreamContents(stream, new string[]{"is", "palindrome", "while", "is", "not"});
+	  }
+
+	  /// <summary>
+	  /// Test Position increments applied by TypeTokenFilter with and without enabling this option.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStopPositons() throws java.io.IOException
+	  public virtual void testStopPositons()
+	  {
+		StringBuilder sb = new StringBuilder();
+		for (int i = 10; i < 20; i++)
+		{
+		  if (i % 3 != 0)
+		  {
+			sb.Append(i).Append(" ");
+		  }
+		  else
+		  {
+			string w = English.intToEnglish(i).trim();
+			sb.Append(w).Append(" ");
+		  }
+		}
+		log(sb.ToString());
+		string[] stopTypes = new string[]{"<NUM>"};
+		ISet<string> stopSet = asSet(stopTypes);
+
+		// with increments
+		StringReader reader = new StringReader(sb.ToString());
+		TypeTokenFilter typeTokenFilter = new TypeTokenFilter(TEST_VERSION_CURRENT, new StandardTokenizer(TEST_VERSION_CURRENT, reader), stopSet);
+		testPositons(typeTokenFilter);
+
+		// without increments
+		reader = new StringReader(sb.ToString());
+		typeTokenFilter = new TypeTokenFilter(Version.LUCENE_43, false, new StandardTokenizer(TEST_VERSION_CURRENT, reader), stopSet);
+		testPositons(typeTokenFilter);
+
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: private void testPositons(TypeTokenFilter stpf) throws java.io.IOException
+	  private void testPositons(TypeTokenFilter stpf)
+	  {
+		TypeAttribute typeAtt = stpf.getAttribute(typeof(TypeAttribute));
+		CharTermAttribute termAttribute = stpf.getAttribute(typeof(CharTermAttribute));
+		PositionIncrementAttribute posIncrAtt = stpf.getAttribute(typeof(PositionIncrementAttribute));
+		stpf.reset();
+		bool enablePositionIncrements = stpf.EnablePositionIncrements;
+		while (stpf.incrementToken())
+		{
+		  log("Token: " + termAttribute.ToString() + ": " + typeAtt.type() + " - " + posIncrAtt.PositionIncrement);
+		  assertEquals("if position increment is enabled the positionIncrementAttribute value should be 3, otherwise 1", posIncrAtt.PositionIncrement, enablePositionIncrements ? 3 : 1);
+		}
+		stpf.end();
+		stpf.close();
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTypeFilterWhitelist() throws java.io.IOException
+	  public virtual void testTypeFilterWhitelist()
+	  {
+		StringReader reader = new StringReader("121 is palindrome, while 123 is not");
+		ISet<string> stopTypes = Collections.singleton("<NUM>");
+		TokenStream stream = new TypeTokenFilter(TEST_VERSION_CURRENT, new StandardTokenizer(TEST_VERSION_CURRENT, reader), stopTypes, true);
+		assertTokenStreamContents(stream, new string[]{"121", "123"});
+	  }
+
+	  // print debug info depending on VERBOSE
+	  private static void log(string s)
+	  {
+		if (VERBOSE)
+		{
+		  Console.WriteLine(s);
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestTypeTokenFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestTypeTokenFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestTypeTokenFilterFactory.cs
new file mode 100644
index 0000000..f298e33
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestTypeTokenFilterFactory.cs
@@ -0,0 +1,102 @@
+using System.Collections.Generic;
+
+namespace org.apache.lucene.analysis.core
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+	using TokenFilterFactory = org.apache.lucene.analysis.util.TokenFilterFactory;
+
+	/// <summary>
+	/// Testcase for <seealso cref="TypeTokenFilterFactory"/>
+	/// </summary>
+	public class TestTypeTokenFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testInform() throws Exception
+	  public virtual void testInform()
+	  {
+		TypeTokenFilterFactory factory = (TypeTokenFilterFactory) tokenFilterFactory("Type", "types", "stoptypes-1.txt", "enablePositionIncrements", "true");
+		ISet<string> types = factory.StopTypes;
+		assertTrue("types is null and it shouldn't be", types != null);
+		assertTrue("types Size: " + types.Count + " is not: " + 2, types.Count == 2);
+		assertTrue("enablePositionIncrements was set to true but not correctly parsed", factory.EnablePositionIncrements);
+
+		factory = (TypeTokenFilterFactory) tokenFilterFactory("Type", "types", "stoptypes-1.txt, stoptypes-2.txt", "enablePositionIncrements", "false", "useWhitelist", "true");
+		types = factory.StopTypes;
+		assertTrue("types is null and it shouldn't be", types != null);
+		assertTrue("types Size: " + types.Count + " is not: " + 4, types.Count == 4);
+		assertTrue("enablePositionIncrements was set to false but not correctly parsed", !factory.EnablePositionIncrements);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCreationWithBlackList() throws Exception
+	  public virtual void testCreationWithBlackList()
+	  {
+		TokenFilterFactory factory = tokenFilterFactory("Type", "types", "stoptypes-1.txt, stoptypes-2.txt", "enablePositionIncrements", "true");
+		NumericTokenStream input = new NumericTokenStream();
+		input.IntValue = 123;
+		factory.create(input);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCreationWithWhiteList() throws Exception
+	  public virtual void testCreationWithWhiteList()
+	  {
+		TokenFilterFactory factory = tokenFilterFactory("Type", "types", "stoptypes-1.txt, stoptypes-2.txt", "enablePositionIncrements", "true", "useWhitelist", "true");
+		NumericTokenStream input = new NumericTokenStream();
+		input.IntValue = 123;
+		factory.create(input);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMissingTypesParameter() throws Exception
+	  public virtual void testMissingTypesParameter()
+	  {
+		try
+		{
+		  tokenFilterFactory("Type", "enablePositionIncrements", "false");
+		  fail("not supplying 'types' parameter should cause an IllegalArgumentException");
+		}
+		catch (System.ArgumentException)
+		{
+		  // everything ok
+		}
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("Type", "types", "stoptypes-1.txt", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestUAX29URLEmailAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestUAX29URLEmailAnalyzer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestUAX29URLEmailAnalyzer.cs
new file mode 100644
index 0000000..debb86f
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestUAX29URLEmailAnalyzer.cs
@@ -0,0 +1,361 @@
+using System;
+using System.Text;
+
+namespace org.apache.lucene.analysis.core
+{
+
+	/*
+	 * 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 UAX29URLEmailAnalyzer = org.apache.lucene.analysis.standard.UAX29URLEmailAnalyzer;
+	using Version = org.apache.lucene.util.Version;
+
+
+	public class TestUAX29URLEmailAnalyzer : BaseTokenStreamTestCase
+	{
+
+	  private Analyzer a = new UAX29URLEmailAnalyzer(TEST_VERSION_CURRENT);
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testHugeDoc() throws java.io.IOException
+	  public virtual void testHugeDoc()
+	  {
+		StringBuilder sb = new StringBuilder();
+		char[] whitespace = new char[4094];
+		Arrays.fill(whitespace, ' ');
+		sb.Append(whitespace);
+		sb.Append("testing 1234");
+		string input = sb.ToString();
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, input, new string[]{"testing", "1234"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testArmenian() throws Exception
+	  public virtual void testArmenian()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "Վիքիպեդիայի 13 միլիոն հոդվածները (4,600` հայերեն վիքիպեդիայում) գրվել են կամավորների կողմից ու համարյա բոլոր հոդվածները կարող է խմբագրել ցանկաց մարդ ով կարող է բացել Վիքիպեդիայի կայքը։", new string[] {"վիքիպեդիայի", "13", "միլիոն", "հոդվածները", "4,600", "հայերեն", "վիքիպեդիայում", "գրվել", "են", "կամավորների", "կողմից", "ու", "համարյա", "բոլոր", "հոդվածները", "կարող", "է", "խմբագրել", "ցանկաց", "մարդ", "ով", "կարող", "է", "բացել", "վիքիպեդիայի", "կայքը"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testAmharic() throws Exception
+	  public virtual void testAmharic()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "ዊኪፔድያ የባለ ብዙ ቋንቋ የተሟላ ትክክለኛና ነጻ መዝገበ ዕውቀት (ኢንሳይክሎፒዲያ) ነው። ማንኛውም", new string[] {"ዊኪፔድያ", "የባለ", "ብዙ", "ቋንቋ", "የተሟላ", "ትክክለኛና", "ነጻ", "መዝገበ", "ዕውቀት", "ኢንሳይክሎፒዲያ", "ነው", "ማንኛውም"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testArabic() throws Exception
+	  public virtual void testArabic()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "الفيلم الوثائقي الأول عن ويكيبيديا يسمى \"الحقيقة بالأرقام: قصة ويكيبيديا\" (بالإنجليزية: Truth in Numbers: The Wikipedia Story)، سيتم إطلاقه في 2008.", new string[] {"الفيلم", "الوثائقي", "الأول", "عن", "ويكيبيديا", "يسمى", "الحقيقة", "بالأرقام", "قصة", "ويكيبيديا", "بالإنجليزية", "truth", "numbers", "wikipedia", "story", "سيتم", "إطلاقه", "في", "2008"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testAramaic() throws Exception
+	  public virtual void testAramaic()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "ܘܝܩܝܦܕܝܐ (ܐܢܓܠܝܐ: Wikipedia) ܗܘ ܐܝܢܣܩܠܘܦܕܝܐ ܚܐܪܬܐ ܕܐܢܛܪܢܛ ܒܠܫܢ̈ܐ ܣܓܝܐ̈ܐ܂ ܫܡܗ ܐܬܐ ܡܢ ܡ̈ܠܬܐ ܕ\"ܘܝܩܝ\" ܘ\"ܐܝܢܣܩܠܘܦܕܝܐ\"܀", new string[] {"ܘܝܩܝܦܕܝܐ", "ܐܢܓܠܝܐ", "wikipedia", "ܗܘ", "ܐܝܢܣܩܠܘܦܕܝܐ", "ܚܐܪܬܐ", "ܕܐܢܛܪܢܛ", "ܒܠܫܢ̈ܐ", "ܣܓܝܐ̈ܐ", "ܫܡܗ", "ܐܬܐ", "ܡܢ", "ܡ̈ܠܬܐ", "ܕ", "ܘܝܩܝ", "ܘ", "ܐܝܢܣܩܠܘܦܕܝܐ"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBengali() throws Exception
+	  public virtual void testBengali()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "এই বিশ্বকোষ পরিচালনা করে উইকিমিডিয়া ফাউন্ডেশন (একটি অলাভজনক সংস্থা)। উইকিপিডিয়ার শুরু ১৫ জানুয়ারি, ২০০১ সালে। এখন পর্যন্ত ২০০টিরও বেশী ভাষায় উইকিপিডিয়া রয়েছে।", new string[] {"এই", "বিশ্বকোষ", "পরিচালনা", "করে", "উইকিমিডিয়া", "ফাউন্ডেশন", "একটি", "অলাভজনক", "সংস্থা", "উইকিপিডিয়ার", "শুরু", "১৫", "জানুয়ারি", "২০০১", "সালে", "এখন", "পর্যন্ত", "২০০টিরও", "বেশী", "ভাষায়", "উইকিপিডিয়া", "রয়�
 �ছে"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFarsi() throws Exception
+	  public virtual void testFarsi()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "ویکی پدیای انگلیسی در تاریخ ۲۵ دی ۱۳۷۹ به صورت مکملی برای دانشنامهٔ تخصصی نوپدیا نوشته شد.", new string[] {"ویکی", "پدیای", "انگلیسی", "در", "تاریخ", "۲۵", "دی", "۱۳۷۹", "به", "صورت", "مکملی", "برای", "دانشنامهٔ", "تخصصی", "نوپدیا", "نوشته", "شد"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testGreek() throws Exception
+	  public virtual void testGreek()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "Γράφεται σε συνεργασία από εθελοντές με το λογισμικό wiki, κάτι που σημαίνει ότι άρθρα μπορεί να προστεθούν ή να αλλάξουν από τον καθένα.", new string[] {"γράφεται", "σε", "συνεργασία", "από", "εθελοντές", "με", "το", "λογισμικό", "wiki", "κάτι", "που", "σημαίνει", "ότι", "άρθρα", "μπορεί", "να", "προστεθούν", "ή", "να", "αλλάξουν", "από", "τον", "καθένα"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testThai() throws Exception
+	  public virtual void testThai()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "การที่ได้ต้องแสดงว่างานดี. แล้วเธอจะไปไหน? ๑๒๓๔", new string[] {"การที่ได้ต้องแสดงว่างานดี", "แล้วเธอจะไปไหน", "๑๒๓๔"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testLao() throws Exception
+	  public virtual void testLao()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "ສາທາລະນະລັດ ປະຊາທິປະໄຕ ປະຊາຊົນລາວ", new string[] {"ສາທາລະນະລັດ", "ປະຊາທິປະໄຕ", "ປະຊາຊົນລາວ"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTibetan() throws Exception
+	  public virtual void testTibetan()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "སྣོན་མཛོད་དང་ལས་འདིས་བོད་ཡིག་མི་ཉམས་གོང་འཕེལ་དུ་གཏོང་བར་ཧ་ཅང་དགེ་མཚན་མཆིས་སོ། །", new string[] {"སྣོན", "མཛོད", "དང", "ལས", "འདིས", "བོད", "ཡིག", "མི", "ཉམས", "གོང", "འཕེལ", "དུ", "གཏོང", "བར", "ཧ", "ཅང", "དགེ", "མཚན", "མཆིས", "སོ"});
+	  }
+
+	  /*
+	   * For chinese, tokenize as char (these can later form bigrams or whatever)
+	   */
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testChinese() throws Exception
+	  public virtual void testChinese()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "我是中国人。 1234 Tests ", new string[] {"我", "是", "中", "国", "人", "1234", "tests"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmpty() throws Exception
+	  public virtual void testEmpty()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "", new string[] {});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, ".", new string[] {});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, " ", new string[] {});
+	  }
+
+	  /* test various jira issues this analyzer is related to */
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testLUCENE1545() throws Exception
+	  public virtual void testLUCENE1545()
+	  {
+		/*
+		 * Standard analyzer does not correctly tokenize combining character U+0364 COMBINING LATIN SMALL LETTER E.
+		 * The word "moͤchte" is incorrectly tokenized into "mo" "chte", the combining character is lost.
+		 * Expected result is only one token "moͤchte".
+		 */
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "moͤchte", new string[] {"moͤchte"});
+	  }
+
+	  /* Tests from StandardAnalyzer, just to show behavior is similar */
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testAlphanumericSA() throws Exception
+	  public virtual void testAlphanumericSA()
+	  {
+		// alphanumeric tokens
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "B2B", new string[]{"b2b"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "2B", new string[]{"2b"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testDelimitersSA() throws Exception
+	  public virtual void testDelimitersSA()
+	  {
+		// other delimiters: "-", "/", ","
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "some-dashed-phrase", new string[]{"some", "dashed", "phrase"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "dogs,chase,cats", new string[]{"dogs", "chase", "cats"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "ac/dc", new string[]{"ac", "dc"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testApostrophesSA() throws Exception
+	  public virtual void testApostrophesSA()
+	  {
+		// internal apostrophes: O'Reilly, you're, O'Reilly's
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "O'Reilly", new string[]{"o'reilly"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "you're", new string[]{"you're"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "she's", new string[]{"she's"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "Jim's", new string[]{"jim's"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "don't", new string[]{"don't"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "O'Reilly's", new string[]{"o'reilly's"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNumericSA() throws Exception
+	  public virtual void testNumericSA()
+	  {
+		// floating point, serial, model numbers, ip addresses, etc.
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "21.35", new string[]{"21.35"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "R2D2 C3PO", new string[]{"r2d2", "c3po"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "216.239.63.104", new string[]{"216.239.63.104"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "216.239.63.104", new string[]{"216.239.63.104"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTextWithNumbersSA() throws Exception
+	  public virtual void testTextWithNumbersSA()
+	  {
+		// numbers
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "David has 5000 bones", new string[]{"david", "has", "5000", "bones"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testVariousTextSA() throws Exception
+	  public virtual void testVariousTextSA()
+	  {
+		// various
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "C embedded developers wanted", new string[]{"c", "embedded", "developers", "wanted"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "foo bar FOO BAR", new string[]{"foo", "bar", "foo", "bar"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "foo      bar .  FOO <> BAR", new string[]{"foo", "bar", "foo", "bar"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "\"QUOTED\" word", new string[]{"quoted", "word"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testKoreanSA() throws Exception
+	  public virtual void testKoreanSA()
+	  {
+		// Korean words
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "안녕하세요 한글입니다", new string[]{"안녕하세요", "한글입니다"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testOffsets() throws Exception
+	  public virtual void testOffsets()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "David has 5000 bones", new string[] {"david", "has", "5000", "bones"}, new int[] {0, 6, 10, 15}, new int[] {5, 9, 14, 20});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTypes() throws Exception
+	  public virtual void testTypes()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "david has 5000 bones", new string[] {"david", "has", "5000", "bones"}, new string[] {"<ALPHANUM>", "<ALPHANUM>", "<NUM>", "<ALPHANUM>"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testSupplementary() throws Exception
+	  public virtual void testSupplementary()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "𩬅艱鍟䇹愯瀛", new string[] {"𩬅", "艱", "鍟", "䇹", "愯", "瀛"}, new string[] {"<IDEOGRAPHIC>", "<IDEOGRAPHIC>", "<IDEOGRAPHIC>", "<IDEOGRAPHIC>", "<IDEOGRAPHIC>", "<IDEOGRAPHIC>"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testKorean() throws Exception
+	  public virtual void testKorean()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "훈민정음", new string[] {"훈민정음"}, new string[] {"<HANGUL>"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testJapanese() throws Exception
+	  public virtual void testJapanese()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "仮名遣い カタカナ", new string[] {"仮", "名", "遣", "い", "カタカナ"}, new string[] {"<IDEOGRAPHIC>", "<IDEOGRAPHIC>", "<IDEOGRAPHIC>", "<HIRAGANA>", "<KATAKANA>"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCombiningMarks() throws Exception
+	  public virtual void testCombiningMarks()
+	  {
+		checkOneTerm(a, "ざ", "ざ"); // hiragana
+		checkOneTerm(a, "ザ", "ザ"); // katakana
+		checkOneTerm(a, "壹゙", "壹゙"); // ideographic
+		checkOneTerm(a, "아゙", "아゙"); // hangul
+	  }
+
+	  /// @deprecated remove this and sophisticated backwards layer in 5.0 
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Deprecated("remove this and sophisticated backwards layer in 5.0") public void testCombiningMarksBackwards() throws Exception
+	  [Obsolete("remove this and sophisticated backwards layer in 5.0")]
+	  public virtual void testCombiningMarksBackwards()
+	  {
+		Analyzer a = new UAX29URLEmailAnalyzer(Version.LUCENE_33);
+		checkOneTerm(a, "ざ", "さ"); // hiragana Bug
+		checkOneTerm(a, "ザ", "ザ"); // katakana Works
+		checkOneTerm(a, "壹゙", "壹"); // ideographic Bug
+		checkOneTerm(a, "아゙", "아゙"); // hangul Works
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBasicEmails() throws Exception
+	  public virtual void testBasicEmails()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "one test@example.com two three [A@example.CO.UK] \"ArakaBanassaMassanaBakarA\" <in...@Info.info>", new string[] {"one", "test@example.com", "two", "three", "a@example.co.uk", "arakabanassamassanabakara", "info@info.info"}, new string[] {"<ALPHANUM>", "<EMAIL>", "<ALPHANUM>", "<ALPHANUM>", "<EMAIL>", "<ALPHANUM>", "<EMAIL>"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMailtoSchemeEmails() throws Exception
+	  public virtual void testMailtoSchemeEmails()
+	  {
+		// See LUCENE-3880
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "MAILTO:Test@Example.ORG", new string[] {"mailto", "test@example.org"}, new string[] {"<ALPHANUM>", "<EMAIL>"});
+
+		// TODO: Support full mailto: scheme URIs. See RFC 6068: http://tools.ietf.org/html/rfc6068
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "mailto:personA@example.com,personB@example.com?cc=personC@example.com" + "&subject=Subjectivity&body=Corpusivity%20or%20something%20like%20that", new string[] {"mailto", "persona@example.com", ",personb@example.com", "?cc=personc@example.com", "subject", "subjectivity", "body", "corpusivity", "20or", "20something","20like", "20that"}, new string[] {"<ALPHANUM>", "<EMAIL>", "<EMAIL>", "<EMAIL>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>"}); // TODO: Hex decoding + re-tokenization -  TODO: split field keys/values
+					// TODO: recognize ',' address delimiter. Also, see examples of ';' delimiter use at: http://www.mailto.co.uk/
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBasicURLs() throws Exception
+	  public virtual void testBasicURLs()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "a <HTTPs://example.net/omg/isnt/that/NICE?no=its&n%30t#mntl-E>b-D ftp://www.example.com/ABC.txt file:///C:/path/to/a/FILE.txt C", new string[] {"https://example.net/omg/isnt/that/nice?no=its&n%30t#mntl-e", "b", "d", "ftp://www.example.com/abc.txt", "file:///c:/path/to/a/file.txt", "c"}, new string[] {"<URL>", "<ALPHANUM>", "<ALPHANUM>", "<URL>", "<URL>", "<ALPHANUM>"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNoSchemeURLs() throws Exception
+	  public virtual void testNoSchemeURLs()
+	  {
+		// ".ph" is a Top Level Domain
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "<index.ph>", new string[]{"index.ph"}, new string[]{"<URL>"});
+
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "index.ph", new string[]{"index.ph"}, new string[]{"<URL>"});
+
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "index.php", new string[]{"index.php"}, new string[]{"<ALPHANUM>"});
+
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "index.phα", new string[]{"index.phα"}, new string[]{"<ALPHANUM>"});
+
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "index-h.php", new string[] {"index", "h.php"}, new string[] {"<ALPHANUM>","<ALPHANUM>"});
+
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "index2.php", new string[] {"index2", "php"}, new string[] {"<ALPHANUM>", "<ALPHANUM>"});
+
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "index2.ph9,", new string[] {"index2", "ph9"}, new string[] {"<ALPHANUM>", "<ALPHANUM>"});
+
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "example.com,example.ph,index.php,index2.php,example2.ph", new string[] {"example.com", "example.ph", "index.php", "index2", "php", "example2.ph"}, new string[] {"<URL>", "<URL>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<URL>"});
+
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "example.com:8080 example.com/path/here example.com?query=something example.com#fragment", new string[] {"example.com:8080", "example.com/path/here", "example.com?query=something", "example.com#fragment"}, new string[] {"<URL>", "<URL>", "<URL>", "<URL>"});
+
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "example.com:8080/path/here?query=something#fragment", new string[] {"example.com:8080/path/here?query=something#fragment"}, new string[] {"<URL>"});
+
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "example.com:8080/path/here?query=something", new string[] {"example.com:8080/path/here?query=something"}, new string[] {"<URL>"});
+
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "example.com:8080/path/here#fragment", new string[] {"example.com:8080/path/here#fragment"}, new string[] {"<URL>"});
+
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "example.com:8080/path/here", new string[] {"example.com:8080/path/here"}, new string[] {"<URL>"});
+
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "example.com:8080?query=something#fragment", new string[] {"example.com:8080?query=something#fragment"}, new string[] {"<URL>"});
+
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "example.com:8080?query=something", new string[] {"example.com:8080?query=something"}, new string[] {"<URL>"});
+
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "example.com:8080#fragment", new string[] {"example.com:8080#fragment"}, new string[] {"<URL>"});
+
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "example.com/path/here?query=something#fragment", new string[] {"example.com/path/here?query=something#fragment"}, new string[] {"<URL>"});
+
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "example.com/path/here?query=something", new string[] {"example.com/path/here?query=something"}, new string[] {"<URL>"});
+
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "example.com/path/here#fragment", new string[] {"example.com/path/here#fragment"}, new string[] {"<URL>"});
+
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "example.com?query=something#fragment", new string[] {"example.com?query=something#fragment"}, new string[] {"<URL>"});
+	  }
+
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), new UAX29URLEmailAnalyzer(TEST_VERSION_CURRENT), 1000 * RANDOM_MULTIPLIER);
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestUAX29URLEmailTokenizer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestUAX29URLEmailTokenizer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestUAX29URLEmailTokenizer.cs
new file mode 100644
index 0000000..d8ccc13
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Core/TestUAX29URLEmailTokenizer.cs
@@ -0,0 +1,737 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace org.apache.lucene.analysis.core
+{
+
+	using StandardAnalyzer = org.apache.lucene.analysis.standard.StandardAnalyzer;
+	using UAX29URLEmailTokenizer = org.apache.lucene.analysis.standard.UAX29URLEmailTokenizer;
+	using TypeAttribute = org.apache.lucene.analysis.tokenattributes.TypeAttribute;
+	using Version = org.apache.lucene.util.Version;
+
+
+	/*
+	 * 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.
+	 */
+
+	public class TestUAX29URLEmailTokenizer : BaseTokenStreamTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testHugeDoc() throws java.io.IOException
+	  public virtual void testHugeDoc()
+	  {
+		StringBuilder sb = new StringBuilder();
+		char[] whitespace = new char[4094];
+		Arrays.fill(whitespace, ' ');
+		sb.Append(whitespace);
+		sb.Append("testing 1234");
+		string input = sb.ToString();
+		UAX29URLEmailTokenizer tokenizer = new UAX29URLEmailTokenizer(TEST_VERSION_CURRENT, new StringReader(input));
+		BaseTokenStreamTestCase.assertTokenStreamContents(tokenizer, new string[] {"testing", "1234"});
+	  }
+
+	  private Analyzer a = new AnalyzerAnonymousInnerClassHelper();
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  public AnalyzerAnonymousInnerClassHelper()
+		  {
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+
+			Tokenizer tokenizer = new UAX29URLEmailTokenizer(TEST_VERSION_CURRENT, reader);
+			return new TokenStreamComponents(tokenizer);
+		  }
+	  }
+
+
+	  /// <summary>
+	  /// Passes through tokens with type "<URL>" and blocks all other types. </summary>
+	  private class URLFilter : TokenFilter
+	  {
+		  private readonly TestUAX29URLEmailTokenizer outerInstance;
+
+		internal readonly TypeAttribute typeAtt = addAttribute(typeof(TypeAttribute));
+		public URLFilter(TestUAX29URLEmailTokenizer outerInstance, TokenStream @in) : base(@in)
+		{
+			this.outerInstance = outerInstance;
+		}
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Override public final boolean incrementToken() throws java.io.IOException
+		public override bool incrementToken()
+		{
+		  bool isTokenAvailable = false;
+		  while (input.incrementToken())
+		  {
+			if (typeAtt.type() == UAX29URLEmailTokenizer.TOKEN_TYPES[UAX29URLEmailTokenizer.URL])
+			{
+			  isTokenAvailable = true;
+			  break;
+			}
+		  }
+		  return isTokenAvailable;
+		}
+	  }
+
+	  /// <summary>
+	  /// Passes through tokens with type "<EMAIL>" and blocks all other types. </summary>
+	  private class EmailFilter : TokenFilter
+	  {
+		  private readonly TestUAX29URLEmailTokenizer outerInstance;
+
+		internal readonly TypeAttribute typeAtt = addAttribute(typeof(TypeAttribute));
+		public EmailFilter(TestUAX29URLEmailTokenizer outerInstance, TokenStream @in) : base(@in)
+		{
+			this.outerInstance = outerInstance;
+		}
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Override public final boolean incrementToken() throws java.io.IOException
+		public override bool incrementToken()
+		{
+		  bool isTokenAvailable = false;
+		  while (input.incrementToken())
+		  {
+			if (typeAtt.type() == UAX29URLEmailTokenizer.TOKEN_TYPES[UAX29URLEmailTokenizer.EMAIL])
+			{
+			  isTokenAvailable = true;
+			  break;
+			}
+		  }
+		  return isTokenAvailable;
+		}
+	  }
+
+	  private Analyzer urlAnalyzer = new AnalyzerAnonymousInnerClassHelper();
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  public AnalyzerAnonymousInnerClassHelper()
+		  {
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			UAX29URLEmailTokenizer tokenizer = new UAX29URLEmailTokenizer(TEST_VERSION_CURRENT, reader);
+			tokenizer.MaxTokenLength = int.MaxValue; // Tokenize arbitrary length URLs
+			TokenFilter filter = new URLFilter(tokenizer);
+			return new TokenStreamComponents(tokenizer, filter);
+		  }
+	  }
+
+	  private Analyzer emailAnalyzer = new AnalyzerAnonymousInnerClassHelper2();
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  public AnalyzerAnonymousInnerClassHelper2()
+		  {
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			UAX29URLEmailTokenizer tokenizer = new UAX29URLEmailTokenizer(TEST_VERSION_CURRENT, reader);
+			TokenFilter filter = new EmailFilter(tokenizer);
+			return new TokenStreamComponents(tokenizer, filter);
+		  }
+	  }
+
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testArmenian() throws Exception
+	  public virtual void testArmenian()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "Վիքիպեդիայի 13 միլիոն հոդվածները (4,600` հայերեն վիքիպեդիայում) գրվել են կամավորների կողմից ու համարյա բոլոր հոդվածները կարող է խմբագրել ցանկաց մարդ ով կարող է բացել Վիքիպեդիայի կայքը։", new string[] {"Վիքիպեդիայի", "13", "միլիոն", "հոդվածները", "4,600", "հայերեն", "վիքիպեդիայում", "գրվել", "են", "կամավորների", "կողմից", "ու", "համարյա", "բոլոր", "հոդվածները", "կարող", "է", "խմբագրել", "ցանկաց", "մարդ", "ով", "կարող", "է", "բացել", "Վիքիպեդիայի", "կայքը"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testAmharic() throws Exception
+	  public virtual void testAmharic()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "ዊኪፔድያ የባለ ብዙ ቋንቋ የተሟላ ትክክለኛና ነጻ መዝገበ ዕውቀት (ኢንሳይክሎፒዲያ) ነው። ማንኛውም", new string[] {"ዊኪፔድያ", "የባለ", "ብዙ", "ቋንቋ", "የተሟላ", "ትክክለኛና", "ነጻ", "መዝገበ", "ዕውቀት", "ኢንሳይክሎፒዲያ", "ነው", "ማንኛውም"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testArabic() throws Exception
+	  public virtual void testArabic()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "الفيلم الوثائقي الأول عن ويكيبيديا يسمى \"الحقيقة بالأرقام: قصة ويكيبيديا\" (بالإنجليزية: Truth in Numbers: The Wikipedia Story)، سيتم إطلاقه في 2008.", new string[] {"الفيلم", "الوثائقي", "الأول", "عن", "ويكيبيديا", "يسمى", "الحقيقة", "بالأرقام", "قصة", "ويكيبيديا", "بالإنجليزية", "Truth", "in", "Numbers", "The", "Wikipedia", "Story", "سيتم", "إطلاقه", "في", "2008"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testAramaic() throws Exception
+	  public virtual void testAramaic()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "ܘܝܩܝܦܕܝܐ (ܐܢܓܠܝܐ: Wikipedia) ܗܘ ܐܝܢܣܩܠܘܦܕܝܐ ܚܐܪܬܐ ܕܐܢܛܪܢܛ ܒܠܫܢ̈ܐ ܣܓܝܐ̈ܐ܂ ܫܡܗ ܐܬܐ ܡܢ ܡ̈ܠܬܐ ܕ\"ܘܝܩܝ\" ܘ\"ܐܝܢܣܩܠܘܦܕܝܐ\"܀", new string[] {"ܘܝܩܝܦܕܝܐ", "ܐܢܓܠܝܐ", "Wikipedia", "ܗܘ", "ܐܝܢܣܩܠܘܦܕܝܐ", "ܚܐܪܬܐ", "ܕܐܢܛܪܢܛ", "ܒܠܫܢ̈ܐ", "ܣܓܝܐ̈ܐ", "ܫܡܗ", "ܐܬܐ", "ܡܢ", "ܡ̈ܠܬܐ", "ܕ", "ܘܝܩܝ", "ܘ", "ܐܝܢܣܩܠܘܦܕܝܐ"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBengali() throws Exception
+	  public virtual void testBengali()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "এই বিশ্বকোষ পরিচালনা করে উইকিমিডিয়া ফাউন্ডেশন (একটি অলাভজনক সংস্থা)। উইকিপিডিয়ার শুরু ১৫ জানুয়ারি, ২০০১ সালে। এখন পর্যন্ত ২০০টিরও বেশী ভাষায় উইকিপিডিয়া রয়েছে।", new string[] {"এই", "বিশ্বকোষ", "পরিচালনা", "করে", "উইকিমিডিয়া", "ফাউন্ডেশন", "একটি", "অলাভজনক", "সংস্থা", "উইকিপিডিয়ার", "শুরু", "১৫", "জানুয়ারি", "২০০১", "সালে", "এখন", "পর্যন্ত", "২০০টিরও", "বেশী", "ভাষায়", "উইকিপিডিয়া", "রয়�
 �ছে"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFarsi() throws Exception
+	  public virtual void testFarsi()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "ویکی پدیای انگلیسی در تاریخ ۲۵ دی ۱۳۷۹ به صورت مکملی برای دانشنامهٔ تخصصی نوپدیا نوشته شد.", new string[] {"ویکی", "پدیای", "انگلیسی", "در", "تاریخ", "۲۵", "دی", "۱۳۷۹", "به", "صورت", "مکملی", "برای", "دانشنامهٔ", "تخصصی", "نوپدیا", "نوشته", "شد"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testGreek() throws Exception
+	  public virtual void testGreek()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "Γράφεται σε συνεργασία από εθελοντές με το λογισμικό wiki, κάτι που σημαίνει ότι άρθρα μπορεί να προστεθούν ή να αλλάξουν από τον καθένα.", new string[] {"Γράφεται", "σε", "συνεργασία", "από", "εθελοντές", "με", "το", "λογισμικό", "wiki", "κάτι", "που", "σημαίνει", "ότι", "άρθρα", "μπορεί", "να", "προστεθούν", "ή", "να", "αλλάξουν", "από", "τον", "καθένα"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testThai() throws Exception
+	  public virtual void testThai()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "การที่ได้ต้องแสดงว่างานดี. แล้วเธอจะไปไหน? ๑๒๓๔", new string[] {"การที่ได้ต้องแสดงว่างานดี", "แล้วเธอจะไปไหน", "๑๒๓๔"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testLao() throws Exception
+	  public virtual void testLao()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "ສາທາລະນະລັດ ປະຊາທິປະໄຕ ປະຊາຊົນລາວ", new string[] {"ສາທາລະນະລັດ", "ປະຊາທິປະໄຕ", "ປະຊາຊົນລາວ"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTibetan() throws Exception
+	  public virtual void testTibetan()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "སྣོན་མཛོད་དང་ལས་འདིས་བོད་ཡིག་མི་ཉམས་གོང་འཕེལ་དུ་གཏོང་བར་ཧ་ཅང་དགེ་མཚན་མཆིས་སོ། །", new string[] {"སྣོན", "མཛོད", "དང", "ལས", "འདིས", "བོད", "ཡིག", "མི", "ཉམས", "གོང", "འཕེལ", "དུ", "གཏོང", "བར", "ཧ", "ཅང", "དགེ", "མཚན", "མཆིས", "སོ"});
+	  }
+
+	  /*
+	   * For chinese, tokenize as char (these can later form bigrams or whatever)
+	   */
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testChinese() throws Exception
+	  public virtual void testChinese()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "我是中国人。 1234 Tests ", new string[] {"我", "是", "中", "国", "人", "1234", "Tests"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmpty() throws Exception
+	  public virtual void testEmpty()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "", new string[] {});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, ".", new string[] {});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, " ", new string[] {});
+	  }
+
+	  /* test various jira issues this analyzer is related to */
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testLUCENE1545() throws Exception
+	  public virtual void testLUCENE1545()
+	  {
+		/*
+		 * Standard analyzer does not correctly tokenize combining character U+0364 COMBINING LATIN SMALL LETTRE E.
+		 * The word "moͤchte" is incorrectly tokenized into "mo" "chte", the combining character is lost.
+		 * Expected result is only on token "moͤchte".
+		 */
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "moͤchte", new string[] {"moͤchte"});
+	  }
+
+	  /* Tests from StandardAnalyzer, just to show behavior is similar */
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testAlphanumericSA() throws Exception
+	  public virtual void testAlphanumericSA()
+	  {
+		// alphanumeric tokens
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "B2B", new string[]{"B2B"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "2B", new string[]{"2B"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testDelimitersSA() throws Exception
+	  public virtual void testDelimitersSA()
+	  {
+		// other delimiters: "-", "/", ","
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "some-dashed-phrase", new string[]{"some", "dashed", "phrase"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "dogs,chase,cats", new string[]{"dogs", "chase", "cats"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "ac/dc", new string[]{"ac", "dc"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testApostrophesSA() throws Exception
+	  public virtual void testApostrophesSA()
+	  {
+		// internal apostrophes: O'Reilly, you're, O'Reilly's
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "O'Reilly", new string[]{"O'Reilly"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "you're", new string[]{"you're"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "she's", new string[]{"she's"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "Jim's", new string[]{"Jim's"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "don't", new string[]{"don't"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "O'Reilly's", new string[]{"O'Reilly's"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNumericSA() throws Exception
+	  public virtual void testNumericSA()
+	  {
+		// floating point, serial, model numbers, ip addresses, etc.
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "21.35", new string[]{"21.35"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "R2D2 C3PO", new string[]{"R2D2", "C3PO"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "216.239.63.104", new string[]{"216.239.63.104"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTextWithNumbersSA() throws Exception
+	  public virtual void testTextWithNumbersSA()
+	  {
+		// numbers
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "David has 5000 bones", new string[]{"David", "has", "5000", "bones"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testVariousTextSA() throws Exception
+	  public virtual void testVariousTextSA()
+	  {
+		// various
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "C embedded developers wanted", new string[]{"C", "embedded", "developers", "wanted"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "foo bar FOO BAR", new string[]{"foo", "bar", "FOO", "BAR"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "foo      bar .  FOO <> BAR", new string[]{"foo", "bar", "FOO", "BAR"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "\"QUOTED\" word", new string[]{"QUOTED", "word"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testKoreanSA() throws Exception
+	  public virtual void testKoreanSA()
+	  {
+		// Korean words
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "안녕하세요 한글입니다", new string[]{"안녕하세요", "한글입니다"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testOffsets() throws Exception
+	  public virtual void testOffsets()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "David has 5000 bones", new string[] {"David", "has", "5000", "bones"}, new int[] {0, 6, 10, 15}, new int[] {5, 9, 14, 20});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTypes() throws Exception
+	  public virtual void testTypes()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "David has 5000 bones", new string[] {"David", "has", "5000", "bones"}, new string[] {"<ALPHANUM>", "<ALPHANUM>", "<NUM>", "<ALPHANUM>"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testWikiURLs() throws Exception
+	  public virtual void testWikiURLs()
+	  {
+		Reader reader = null;
+		string luceneResourcesWikiPage;
+		try
+		{
+		  reader = new System.IO.StreamReader(this.GetType().getResourceAsStream("LuceneResourcesWikiPage.html"), Encoding.UTF8);
+		  StringBuilder builder = new StringBuilder();
+		  char[] buffer = new char[1024];
+		  int numCharsRead;
+		  while (-1 != (numCharsRead = reader.read(buffer)))
+		  {
+			builder.Append(buffer, 0, numCharsRead);
+		  }
+		  luceneResourcesWikiPage = builder.ToString();
+		}
+		finally
+		{
+		  if (null != reader)
+		  {
+			reader.close();
+		  }
+		}
+		assertTrue(null != luceneResourcesWikiPage && luceneResourcesWikiPage.Length > 0);
+		System.IO.StreamReader bufferedReader = null;
+		string[] urls;
+		try
+		{
+		  IList<string> urlList = new List<string>();
+		  bufferedReader = new System.IO.StreamReader(this.GetType().getResourceAsStream("LuceneResourcesWikiPageURLs.txt"), Encoding.UTF8);
+		  string line;
+		  while (null != (line = bufferedReader.ReadLine()))
+		  {
+			line = line.Trim();
+			if (line.Length > 0)
+			{
+			  urlList.Add(line);
+			}
+		  }
+		  urls = urlList.ToArray();
+		}
+		finally
+		{
+		  if (null != bufferedReader)
+		  {
+			bufferedReader.Close();
+		  }
+		}
+		assertTrue(null != urls && urls.Length > 0);
+		BaseTokenStreamTestCase.assertAnalyzesTo(urlAnalyzer, luceneResourcesWikiPage, urls);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmails() throws Exception
+	  public virtual void testEmails()
+	  {
+		Reader reader = null;
+		string randomTextWithEmails;
+		try
+		{
+		  reader = new System.IO.StreamReader(this.GetType().getResourceAsStream("random.text.with.email.addresses.txt"), Encoding.UTF8);
+		  StringBuilder builder = new StringBuilder();
+		  char[] buffer = new char[1024];
+		  int numCharsRead;
+		  while (-1 != (numCharsRead = reader.read(buffer)))
+		  {
+			builder.Append(buffer, 0, numCharsRead);
+		  }
+		  randomTextWithEmails = builder.ToString();
+		}
+		finally
+		{
+		  if (null != reader)
+		  {
+			reader.close();
+		  }
+		}
+		assertTrue(null != randomTextWithEmails && randomTextWithEmails.Length > 0);
+		System.IO.StreamReader bufferedReader = null;
+		string[] emails;
+		try
+		{
+		  IList<string> emailList = new List<string>();
+		  bufferedReader = new System.IO.StreamReader(this.GetType().getResourceAsStream("email.addresses.from.random.text.with.email.addresses.txt"), Encoding.UTF8);
+		  string line;
+		  while (null != (line = bufferedReader.ReadLine()))
+		  {
+			line = line.Trim();
+			if (line.Length > 0)
+			{
+			  emailList.Add(line);
+			}
+		  }
+		  emails = emailList.ToArray();
+		}
+		finally
+		{
+		  if (null != bufferedReader)
+		  {
+			bufferedReader.Close();
+		  }
+		}
+		assertTrue(null != emails && emails.Length > 0);
+		BaseTokenStreamTestCase.assertAnalyzesTo(emailAnalyzer, randomTextWithEmails, emails);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMailtoSchemeEmails() throws Exception
+	  public virtual void testMailtoSchemeEmails()
+	  {
+		// See LUCENE-3880
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "mailto:test@example.org", new string[] {"mailto", "test@example.org"}, new string[] {"<ALPHANUM>", "<EMAIL>"});
+
+		// TODO: Support full mailto: scheme URIs. See RFC 6068: http://tools.ietf.org/html/rfc6068
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "mailto:personA@example.com,personB@example.com?cc=personC@example.com" + "&subject=Subjectivity&body=Corpusivity%20or%20something%20like%20that", new string[] {"mailto", "personA@example.com", ",personB@example.com", "?cc=personC@example.com", "subject", "Subjectivity", "body", "Corpusivity", "20or", "20something","20like", "20that"}, new string[] {"<ALPHANUM>", "<EMAIL>", "<EMAIL>", "<EMAIL>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>", "<ALPHANUM>"}); // TODO: Hex decoding + re-tokenization -  TODO: split field keys/values
+							// TODO: recognize ',' address delimiter. Also, see examples of ';' delimiter use at: http://www.mailto.co.uk/
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testURLs() throws Exception
+	  public virtual void testURLs()
+	  {
+		Reader reader = null;
+		string randomTextWithURLs;
+		try
+		{
+		  reader = new System.IO.StreamReader(this.GetType().getResourceAsStream("random.text.with.urls.txt"), Encoding.UTF8);
+		  StringBuilder builder = new StringBuilder();
+		  char[] buffer = new char[1024];
+		  int numCharsRead;
+		  while (-1 != (numCharsRead = reader.read(buffer)))
+		  {
+			builder.Append(buffer, 0, numCharsRead);
+		  }
+		  randomTextWithURLs = builder.ToString();
+		}
+		finally
+		{
+		  if (null != reader)
+		  {
+			reader.close();
+		  }
+		}
+		assertTrue(null != randomTextWithURLs && randomTextWithURLs.Length > 0);
+		System.IO.StreamReader bufferedReader = null;
+		string[] urls;
+		try
+		{
+		  IList<string> urlList = new List<string>();
+		  bufferedReader = new System.IO.StreamReader(this.GetType().getResourceAsStream("urls.from.random.text.with.urls.txt"), Encoding.UTF8);
+		  string line;
+		  while (null != (line = bufferedReader.ReadLine()))
+		  {
+			line = line.Trim();
+			if (line.Length > 0)
+			{
+			  urlList.Add(line);
+			}
+		  }
+		  urls = urlList.ToArray();
+		}
+		finally
+		{
+		  if (null != bufferedReader)
+		  {
+			bufferedReader.Close();
+		  }
+		}
+		assertTrue(null != urls && urls.Length > 0);
+		BaseTokenStreamTestCase.assertAnalyzesTo(urlAnalyzer, randomTextWithURLs, urls);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testUnicodeWordBreaks() throws Exception
+	  public virtual void testUnicodeWordBreaks()
+	  {
+		WordBreakTestUnicode_6_3_0 wordBreakTest = new WordBreakTestUnicode_6_3_0();
+		wordBreakTest.test(a);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testSupplementary() throws Exception
+	  public virtual void testSupplementary()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "𩬅艱鍟䇹愯瀛", new string[] {"𩬅", "艱", "鍟", "䇹", "愯", "瀛"}, new string[] {"<IDEOGRAPHIC>", "<IDEOGRAPHIC>", "<IDEOGRAPHIC>", "<IDEOGRAPHIC>", "<IDEOGRAPHIC>", "<IDEOGRAPHIC>"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testKorean() throws Exception
+	  public virtual void testKorean()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "훈민정음", new string[] {"훈민정음"}, new string[] {"<HANGUL>"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testJapanese() throws Exception
+	  public virtual void testJapanese()
+	  {
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "仮名遣い カタカナ", new string[] {"仮", "名", "遣", "い", "カタカナ"}, new string[] {"<IDEOGRAPHIC>", "<IDEOGRAPHIC>", "<IDEOGRAPHIC>", "<HIRAGANA>", "<KATAKANA>"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCombiningMarks() throws Exception
+	  public virtual void testCombiningMarks()
+	  {
+		checkOneTerm(a, "ざ", "ざ"); // hiragana
+		checkOneTerm(a, "ザ", "ザ"); // katakana
+		checkOneTerm(a, "壹゙", "壹゙"); // ideographic
+		checkOneTerm(a, "아゙", "아゙"); // hangul
+	  }
+
+	  /// <summary>
+	  /// Multiple consecutive chars in \p{Word_Break = MidLetter},
+	  /// \p{Word_Break = MidNumLet}, and/or \p{Word_Break = MidNum}
+	  /// should trigger a token split.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testMid() throws Exception
+	  public virtual void testMid()
+	  {
+		// ':' is in \p{WB:MidLetter}, which should trigger a split unless there is a Letter char on both sides
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "A:B", new string[] {"A:B"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "A::B", new string[] {"A", "B"});
+
+		// '.' is in \p{WB:MidNumLet}, which should trigger a split unless there is a Letter or Numeric char on both sides
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "1.2", new string[] {"1.2"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "A.B", new string[] {"A.B"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "1..2", new string[] {"1", "2"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "A..B", new string[] {"A", "B"});
+
+		// ',' is in \p{WB:MidNum}, which should trigger a split unless there is a Numeric char on both sides
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "1,2", new string[] {"1,2"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "1,,2", new string[] {"1", "2"});
+
+		// Mixed consecutive \p{WB:MidLetter} and \p{WB:MidNumLet} should trigger a split
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "A.:B", new string[] {"A", "B"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "A:.B", new string[] {"A", "B"});
+
+		// Mixed consecutive \p{WB:MidNum} and \p{WB:MidNumLet} should trigger a split
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "1,.2", new string[] {"1", "2"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "1.,2", new string[] {"1", "2"});
+
+		// '_' is in \p{WB:ExtendNumLet}
+
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "A:B_A:B", new string[] {"A:B_A:B"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "A:B_A::B", new string[] {"A:B_A", "B"});
+
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "1.2_1.2", new string[] {"1.2_1.2"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "A.B_A.B", new string[] {"A.B_A.B"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "1.2_1..2", new string[] {"1.2_1", "2"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "A.B_A..B", new string[] {"A.B_A", "B"});
+
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "1,2_1,2", new string[] {"1,2_1,2"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "1,2_1,,2", new string[] {"1,2_1", "2"});
+
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "C_A.:B", new string[] {"C_A", "B"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "C_A:.B", new string[] {"C_A", "B"});
+
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "3_1,.2", new string[] {"3_1", "2"});
+		BaseTokenStreamTestCase.assertAnalyzesTo(a, "3_1.,2", new string[] {"3_1", "2"});
+	  }
+
+	  /// @deprecated remove this and sophisticated backwards layer in 5.0 
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Deprecated("remove this and sophisticated backwards layer in 5.0") public void testCombiningMarksBackwards() throws Exception
+	  [Obsolete("remove this and sophisticated backwards layer in 5.0")]
+	  public virtual void testCombiningMarksBackwards()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper3(this);
+		checkOneTerm(a, "ざ", "さ"); // hiragana Bug
+		checkOneTerm(a, "ザ", "ザ"); // katakana Works
+		checkOneTerm(a, "壹゙", "壹"); // ideographic Bug
+		checkOneTerm(a, "아゙", "아゙"); // hangul Works
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper3 : Analyzer
+	  {
+		  private readonly TestUAX29URLEmailTokenizer outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper3(TestUAX29URLEmailTokenizer outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+
+			Tokenizer tokenizer = new UAX29URLEmailTokenizer(Version.LUCENE_31, reader);
+			return new TokenStreamComponents(tokenizer);
+		  }
+	  }
+
+	  // LUCENE-3880
+	  /// @deprecated remove this and sophisticated backwards layer in 5.0 
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Deprecated("remove this and sophisticated backwards layer in 5.0") public void testMailtoBackwards() throws Exception
+	  [Obsolete("remove this and sophisticated backwards layer in 5.0")]
+	  public virtual void testMailtoBackwards()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper4(this);
+		assertAnalyzesTo(a, "mailto:test@example.org", new string[] {"mailto:test", "example.org"});
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper4 : Analyzer
+	  {
+		  private readonly TestUAX29URLEmailTokenizer outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper4(TestUAX29URLEmailTokenizer outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new UAX29URLEmailTokenizer(Version.LUCENE_34, reader);
+			return new TokenStreamComponents(tokenizer);
+		  }
+	  }
+
+	  /// @deprecated uses older unicode (6.0). simple test to make sure its basically working 
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Deprecated("uses older unicode (6.0). simple test to make sure its basically working") public void testVersion36() throws Exception
+	  [Obsolete("uses older unicode (6.0). simple test to make sure its basically working")]
+	  public virtual void testVersion36()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper5(this);
+		assertAnalyzesTo(a, "this is just a t\u08E6st lucene@apache.org", new string[] {"this", "is", "just", "a", "t", "st", "lucene@apache.org"}); // new combining mark in 6.1
+	  };
+
+	  private class AnalyzerAnonymousInnerClassHelper5 : Analyzer
+	  {
+		  private readonly TestUAX29URLEmailTokenizer outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper5(TestUAX29URLEmailTokenizer outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new UAX29URLEmailTokenizer(Version.LUCENE_36, reader);
+			return new TokenStreamComponents(tokenizer);
+		  }
+	  }
+
+	  /// @deprecated uses older unicode (6.1). simple test to make sure its basically working 
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Deprecated("uses older unicode (6.1). simple test to make sure its basically working") public void testVersion40() throws Exception
+	  [Obsolete("uses older unicode (6.1). simple test to make sure its basically working")]
+	  public virtual void testVersion40()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper6(this);
+		// U+061C is a new combining mark in 6.3, found using "[[\p{WB:Format}\p{WB:Extend}]&[^\p{Age:6.2}]]"
+		// on the online UnicodeSet utility: <http://unicode.org/cldr/utility/list-unicodeset.jsp>
+		assertAnalyzesTo(a, "this is just a t\u061Cst lucene@apache.org", new string[] {"this", "is", "just", "a", "t", "st", "lucene@apache.org"});
+	  };
+
+	  private class AnalyzerAnonymousInnerClassHelper6 : Analyzer
+	  {
+		  private readonly TestUAX29URLEmailTokenizer outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper6(TestUAX29URLEmailTokenizer outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new UAX29URLEmailTokenizer(Version.LUCENE_40, reader);
+			return new TokenStreamComponents(tokenizer);
+		  }
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), a, 1000 * RANDOM_MULTIPLIER);
+	  }
+
+	  /// <summary>
+	  /// blast some random large strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomHugeStrings() throws Exception
+	  public virtual void testRandomHugeStrings()
+	  {
+		Random random = random();
+		checkRandomData(random, a, 100 * RANDOM_MULTIPLIER, 8192);
+	  }
+	}
+
+}
\ No newline at end of file


[10/27] lucenenet git commit: adding converted analysis common tests

Posted by sy...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ngram/EdgeNGramTokenizerTest.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ngram/EdgeNGramTokenizerTest.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ngram/EdgeNGramTokenizerTest.cs
new file mode 100644
index 0000000..d633096
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ngram/EdgeNGramTokenizerTest.cs
@@ -0,0 +1,329 @@
+namespace org.apache.lucene.analysis.ngram
+{
+
+	/*
+	 * 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 Version = org.apache.lucene.util.Version;
+	using TestUtil = org.apache.lucene.util.TestUtil;
+
+	using RandomStrings = com.carrotsearch.randomizedtesting.generators.RandomStrings;
+
+	/// <summary>
+	/// Tests <seealso cref="EdgeNGramTokenizer"/> for correctness.
+	/// </summary>
+	public class EdgeNGramTokenizerTest : BaseTokenStreamTestCase
+	{
+	  private StringReader input;
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Override public void setUp() throws Exception
+	  public override void setUp()
+	  {
+		base.setUp();
+		input = new StringReader("abcde");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testInvalidInput() throws Exception
+	  public virtual void testInvalidInput()
+	  {
+		bool gotException = false;
+		try
+		{
+		  new EdgeNGramTokenizer(TEST_VERSION_CURRENT, input, 0, 0);
+		}
+		catch (System.ArgumentException)
+		{
+		  gotException = true;
+		}
+		assertTrue(gotException);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testInvalidInput2() throws Exception
+	  public virtual void testInvalidInput2()
+	  {
+		bool gotException = false;
+		try
+		{
+		  new EdgeNGramTokenizer(TEST_VERSION_CURRENT, input, 2, 1);
+		}
+		catch (System.ArgumentException)
+		{
+		  gotException = true;
+		}
+		assertTrue(gotException);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testInvalidInput3() throws Exception
+	  public virtual void testInvalidInput3()
+	  {
+		bool gotException = false;
+		try
+		{
+		  new EdgeNGramTokenizer(TEST_VERSION_CURRENT, input, -1, 2);
+		}
+		catch (System.ArgumentException)
+		{
+		  gotException = true;
+		}
+		assertTrue(gotException);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFrontUnigram() throws Exception
+	  public virtual void testFrontUnigram()
+	  {
+		EdgeNGramTokenizer tokenizer = new EdgeNGramTokenizer(TEST_VERSION_CURRENT, input, 1, 1);
+		assertTokenStreamContents(tokenizer, new string[]{"a"}, new int[]{0}, new int[]{1}, 5); // abcde
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBackUnigram() throws Exception
+	  public virtual void testBackUnigram()
+	  {
+		Tokenizer tokenizer = new Lucene43EdgeNGramTokenizer(Version.LUCENE_43, input, Lucene43EdgeNGramTokenizer.Side.BACK, 1, 1);
+		assertTokenStreamContents(tokenizer, new string[]{"e"}, new int[]{4}, new int[]{5}, 5); // abcde
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testOversizedNgrams() throws Exception
+	  public virtual void testOversizedNgrams()
+	  {
+		EdgeNGramTokenizer tokenizer = new EdgeNGramTokenizer(TEST_VERSION_CURRENT, input, 6, 6);
+		assertTokenStreamContents(tokenizer, new string[0], new int[0], new int[0], 5); // abcde
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFrontRangeOfNgrams() throws Exception
+	  public virtual void testFrontRangeOfNgrams()
+	  {
+		EdgeNGramTokenizer tokenizer = new EdgeNGramTokenizer(TEST_VERSION_CURRENT, input, 1, 3);
+		assertTokenStreamContents(tokenizer, new string[]{"a","ab","abc"}, new int[]{0,0,0}, new int[]{1,2,3}, 5); // abcde
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBackRangeOfNgrams() throws Exception
+	  public virtual void testBackRangeOfNgrams()
+	  {
+		Tokenizer tokenizer = new Lucene43EdgeNGramTokenizer(Version.LUCENE_43, input, Lucene43EdgeNGramTokenizer.Side.BACK, 1, 3);
+		assertTokenStreamContents(tokenizer, new string[]{"e","de","cde"}, new int[]{4,3,2}, new int[]{5,5,5}, null, null, null, 5, false); // abcde
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testReset() throws Exception
+	  public virtual void testReset()
+	  {
+		EdgeNGramTokenizer tokenizer = new EdgeNGramTokenizer(TEST_VERSION_CURRENT, input, 1, 3);
+		assertTokenStreamContents(tokenizer, new string[]{"a","ab","abc"}, new int[]{0,0,0}, new int[]{1,2,3}, 5); // abcde
+		tokenizer.Reader = new StringReader("abcde");
+		assertTokenStreamContents(tokenizer, new string[]{"a","ab","abc"}, new int[]{0,0,0}, new int[]{1,2,3}, 5); // abcde
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		for (int i = 0; i < 10; i++)
+		{
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int min = org.apache.lucene.util.TestUtil.nextInt(random(), 2, 10);
+		  int min = TestUtil.Next(random(), 2, 10);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int max = org.apache.lucene.util.TestUtil.nextInt(random(), min, 20);
+		  int max = TestUtil.Next(random(), min, 20);
+
+		  Analyzer a = new AnalyzerAnonymousInnerClassHelper(this, min, max);
+		  checkRandomData(random(), a, 100 * RANDOM_MULTIPLIER, 20);
+		  checkRandomData(random(), a, 10 * RANDOM_MULTIPLIER, 8192);
+		}
+
+		Analyzer b = new AnalyzerAnonymousInnerClassHelper2(this);
+		checkRandomData(random(), b, 1000 * RANDOM_MULTIPLIER, 20, false, false);
+		checkRandomData(random(), b, 100 * RANDOM_MULTIPLIER, 8192, false, false);
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly EdgeNGramTokenizerTest outerInstance;
+
+		  private int min;
+		  private int max;
+
+		  public AnalyzerAnonymousInnerClassHelper(EdgeNGramTokenizerTest outerInstance, int min, int max)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.min = min;
+			  this.max = max;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new EdgeNGramTokenizer(TEST_VERSION_CURRENT, reader, min, max);
+			return new TokenStreamComponents(tokenizer, tokenizer);
+		  }
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly EdgeNGramTokenizerTest outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper2(EdgeNGramTokenizerTest outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new Lucene43EdgeNGramTokenizer(Version.LUCENE_43, reader, Lucene43EdgeNGramTokenizer.Side.BACK, 2, 4);
+			return new TokenStreamComponents(tokenizer, tokenizer);
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTokenizerPositions() throws Exception
+	  public virtual void testTokenizerPositions()
+	  {
+		Tokenizer tokenizer = new Lucene43EdgeNGramTokenizer(Version.LUCENE_43, input, Lucene43EdgeNGramTokenizer.Side.FRONT, 1, 3);
+		assertTokenStreamContents(tokenizer, new string[]{"a","ab","abc"}, new int[]{0,0,0}, new int[]{1,2,3}, null, new int[] {1,0,0}, null, null, false);
+
+		tokenizer = new EdgeNGramTokenizer(TEST_VERSION_CURRENT, new StringReader("abcde"), 1, 3);
+		assertTokenStreamContents(tokenizer, new string[]{"a","ab","abc"}, new int[]{0,0,0}, new int[]{1,2,3}, null, new int[]{1,1,1}, null, null, false);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: private static void testNGrams(int minGram, int maxGram, int length, final String nonTokenChars) throws java.io.IOException
+//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
+	  private static void testNGrams(int minGram, int maxGram, int length, string nonTokenChars)
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final String s = com.carrotsearch.randomizedtesting.generators.RandomStrings.randomAsciiOfLength(random(), length);
+		string s = RandomStrings.randomAsciiOfLength(random(), length);
+		testNGrams(minGram, maxGram, s, nonTokenChars);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: private static void testNGrams(int minGram, int maxGram, String s, String nonTokenChars) throws java.io.IOException
+	  private static void testNGrams(int minGram, int maxGram, string s, string nonTokenChars)
+	  {
+		NGramTokenizerTest.testNGrams(minGram, maxGram, s, nonTokenChars, true);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testLargeInput() throws java.io.IOException
+	  public virtual void testLargeInput()
+	  {
+		// test sliding
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int minGram = org.apache.lucene.util.TestUtil.nextInt(random(), 1, 100);
+		int minGram = TestUtil.Next(random(), 1, 100);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int maxGram = org.apache.lucene.util.TestUtil.nextInt(random(), minGram, 100);
+		int maxGram = TestUtil.Next(random(), minGram, 100);
+		testNGrams(minGram, maxGram, TestUtil.Next(random(), 3 * 1024, 4 * 1024), "");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testLargeMaxGram() throws java.io.IOException
+	  public virtual void testLargeMaxGram()
+	  {
+		// test sliding with maxGram > 1024
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int minGram = org.apache.lucene.util.TestUtil.nextInt(random(), 1290, 1300);
+		int minGram = TestUtil.Next(random(), 1290, 1300);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int maxGram = org.apache.lucene.util.TestUtil.nextInt(random(), minGram, 1300);
+		int maxGram = TestUtil.Next(random(), minGram, 1300);
+		testNGrams(minGram, maxGram, TestUtil.Next(random(), 3 * 1024, 4 * 1024), "");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testPreTokenization() throws java.io.IOException
+	  public virtual void testPreTokenization()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int minGram = org.apache.lucene.util.TestUtil.nextInt(random(), 1, 100);
+		int minGram = TestUtil.Next(random(), 1, 100);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int maxGram = org.apache.lucene.util.TestUtil.nextInt(random(), minGram, 100);
+		int maxGram = TestUtil.Next(random(), minGram, 100);
+		testNGrams(minGram, maxGram, TestUtil.Next(random(), 0, 4 * 1024), "a");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testHeavyPreTokenization() throws java.io.IOException
+	  public virtual void testHeavyPreTokenization()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int minGram = org.apache.lucene.util.TestUtil.nextInt(random(), 1, 100);
+		int minGram = TestUtil.Next(random(), 1, 100);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int maxGram = org.apache.lucene.util.TestUtil.nextInt(random(), minGram, 100);
+		int maxGram = TestUtil.Next(random(), minGram, 100);
+		testNGrams(minGram, maxGram, TestUtil.Next(random(), 0, 4 * 1024), "abcdef");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFewTokenChars() throws java.io.IOException
+	  public virtual void testFewTokenChars()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final char[] chrs = new char[org.apache.lucene.util.TestUtil.nextInt(random(), 4000, 5000)];
+		char[] chrs = new char[TestUtil.Next(random(), 4000, 5000)];
+		Arrays.fill(chrs, ' ');
+		for (int i = 0; i < chrs.Length; ++i)
+		{
+		  if (random().nextFloat() < 0.1)
+		  {
+			chrs[i] = 'a';
+		  }
+		}
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int minGram = org.apache.lucene.util.TestUtil.nextInt(random(), 1, 2);
+		int minGram = TestUtil.Next(random(), 1, 2);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int maxGram = org.apache.lucene.util.TestUtil.nextInt(random(), minGram, 2);
+		int maxGram = TestUtil.Next(random(), minGram, 2);
+		testNGrams(minGram, maxGram, new string(chrs), " ");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFullUTF8Range() throws java.io.IOException
+	  public virtual void testFullUTF8Range()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int minGram = org.apache.lucene.util.TestUtil.nextInt(random(), 1, 100);
+		int minGram = TestUtil.Next(random(), 1, 100);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int maxGram = org.apache.lucene.util.TestUtil.nextInt(random(), minGram, 100);
+		int maxGram = TestUtil.Next(random(), minGram, 100);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final String s = org.apache.lucene.util.TestUtil.randomUnicodeString(random(), 4 * 1024);
+		string s = TestUtil.randomUnicodeString(random(), 4 * 1024);
+		testNGrams(minGram, maxGram, s, "");
+		testNGrams(minGram, maxGram, s, "abcdef");
+	  }
+
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ngram/NGramTokenFilterTest.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ngram/NGramTokenFilterTest.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ngram/NGramTokenFilterTest.cs
new file mode 100644
index 0000000..0c9fa9a
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ngram/NGramTokenFilterTest.cs
@@ -0,0 +1,288 @@
+using System;
+
+namespace org.apache.lucene.analysis.ngram
+{
+
+	/*
+	 * 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 KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+	using WhitespaceTokenizer = org.apache.lucene.analysis.core.WhitespaceTokenizer;
+	using ASCIIFoldingFilter = org.apache.lucene.analysis.miscellaneous.ASCIIFoldingFilter;
+	using CharTermAttribute = org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
+	using OffsetAttribute = org.apache.lucene.analysis.tokenattributes.OffsetAttribute;
+	using TestUtil = org.apache.lucene.util.TestUtil;
+	using Version = org.apache.lucene.util.Version;
+
+
+	/// <summary>
+	/// Tests <seealso cref="NGramTokenFilter"/> for correctness.
+	/// </summary>
+	public class NGramTokenFilterTest : BaseTokenStreamTestCase
+	{
+	  private TokenStream input;
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Override public void setUp() throws Exception
+	  public override void setUp()
+	  {
+		base.setUp();
+		input = new MockTokenizer(new StringReader("abcde"), MockTokenizer.WHITESPACE, false);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testInvalidInput() throws Exception
+	  public virtual void testInvalidInput()
+	  {
+		bool gotException = false;
+		try
+		{
+		  new NGramTokenFilter(TEST_VERSION_CURRENT, input, 2, 1);
+		}
+		catch (System.ArgumentException)
+		{
+		  gotException = true;
+		}
+		assertTrue(gotException);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testInvalidInput2() throws Exception
+	  public virtual void testInvalidInput2()
+	  {
+		bool gotException = false;
+		try
+		{
+		  new NGramTokenFilter(TEST_VERSION_CURRENT, input, 0, 1);
+		}
+		catch (System.ArgumentException)
+		{
+		  gotException = true;
+		}
+		assertTrue(gotException);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testUnigrams() throws Exception
+	  public virtual void testUnigrams()
+	  {
+		NGramTokenFilter filter = new NGramTokenFilter(TEST_VERSION_CURRENT, input, 1, 1);
+		assertTokenStreamContents(filter, new string[]{"a","b","c","d","e"}, new int[]{0,0,0,0,0}, new int[]{5,5,5,5,5}, new int[]{1,0,0,0,0});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBigrams() throws Exception
+	  public virtual void testBigrams()
+	  {
+		NGramTokenFilter filter = new NGramTokenFilter(TEST_VERSION_CURRENT, input, 2, 2);
+		assertTokenStreamContents(filter, new string[]{"ab","bc","cd","de"}, new int[]{0,0,0,0}, new int[]{5,5,5,5}, new int[]{1,0,0,0});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNgrams() throws Exception
+	  public virtual void testNgrams()
+	  {
+		NGramTokenFilter filter = new NGramTokenFilter(TEST_VERSION_CURRENT, input, 1, 3);
+		assertTokenStreamContents(filter, new string[]{"a","ab","abc","b","bc","bcd","c","cd","cde","d","de","e"}, new int[]{0,0,0,0,0,0,0,0,0,0,0,0}, new int[]{5,5,5,5,5,5,5,5,5,5,5,5}, null, new int[]{1,0,0,0,0,0,0,0,0,0,0,0}, null, null, false);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNgramsNoIncrement() throws Exception
+	  public virtual void testNgramsNoIncrement()
+	  {
+		NGramTokenFilter filter = new NGramTokenFilter(TEST_VERSION_CURRENT, input, 1, 3);
+		assertTokenStreamContents(filter, new string[]{"a","ab","abc","b","bc","bcd","c","cd","cde","d","de","e"}, new int[]{0,0,0,0,0,0,0,0,0,0,0,0}, new int[]{5,5,5,5,5,5,5,5,5,5,5,5}, null, new int[]{1,0,0,0,0,0,0,0,0,0,0,0}, null, null, false);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testOversizedNgrams() throws Exception
+	  public virtual void testOversizedNgrams()
+	  {
+		NGramTokenFilter filter = new NGramTokenFilter(TEST_VERSION_CURRENT, input, 6, 7);
+		assertTokenStreamContents(filter, new string[0], new int[0], new int[0]);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testSmallTokenInStream() throws Exception
+	  public virtual void testSmallTokenInStream()
+	  {
+		input = new MockTokenizer(new StringReader("abc de fgh"), MockTokenizer.WHITESPACE, false);
+		NGramTokenFilter filter = new NGramTokenFilter(TEST_VERSION_CURRENT, input, 3, 3);
+		assertTokenStreamContents(filter, new string[]{"abc","fgh"}, new int[]{0,7}, new int[]{3,10}, new int[] {1, 2});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testReset() throws Exception
+	  public virtual void testReset()
+	  {
+		WhitespaceTokenizer tokenizer = new WhitespaceTokenizer(TEST_VERSION_CURRENT, new StringReader("abcde"));
+		NGramTokenFilter filter = new NGramTokenFilter(TEST_VERSION_CURRENT, tokenizer, 1, 1);
+		assertTokenStreamContents(filter, new string[]{"a","b","c","d","e"}, new int[]{0,0,0,0,0}, new int[]{5,5,5,5,5}, new int[]{1,0,0,0,0});
+		tokenizer.Reader = new StringReader("abcde");
+		assertTokenStreamContents(filter, new string[]{"a","b","c","d","e"}, new int[]{0,0,0,0,0}, new int[]{5,5,5,5,5}, new int[]{1,0,0,0,0});
+	  }
+
+	  // LUCENE-3642
+	  // EdgeNgram blindly adds term length to offset, but this can take things out of bounds
+	  // wrt original text if a previous filter increases the length of the word (in this case æ -> ae)
+	  // so in this case we behave like WDF, and preserve any modified offsets
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testInvalidOffsets() throws Exception
+	  public virtual void testInvalidOffsets()
+	  {
+		Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper(this);
+		assertAnalyzesTo(analyzer, "mosfellsbær", new string[] {"mo", "os", "sf", "fe", "el", "ll", "ls", "sb", "ba", "ae", "er"}, new int[] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, new int[] {11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11}, new int[] {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0});
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly NGramTokenFilterTest outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper(NGramTokenFilterTest outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			TokenFilter filters = new ASCIIFoldingFilter(tokenizer);
+			filters = new NGramTokenFilter(TEST_VERSION_CURRENT, filters, 2, 2);
+			return new TokenStreamComponents(tokenizer, filters);
+		  }
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		for (int i = 0; i < 10; i++)
+		{
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int min = org.apache.lucene.util.TestUtil.nextInt(random(), 2, 10);
+		  int min = TestUtil.Next(random(), 2, 10);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int max = org.apache.lucene.util.TestUtil.nextInt(random(), min, 20);
+		  int max = TestUtil.Next(random(), min, 20);
+		  Analyzer a = new AnalyzerAnonymousInnerClassHelper2(this, min, max);
+		  checkRandomData(random(), a, 200 * RANDOM_MULTIPLIER, 20);
+		}
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly NGramTokenFilterTest outerInstance;
+
+		  private int min;
+		  private int max;
+
+		  public AnalyzerAnonymousInnerClassHelper2(NGramTokenFilterTest outerInstance, int min, int max)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.min = min;
+			  this.max = max;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(tokenizer, new NGramTokenFilter(TEST_VERSION_CURRENT, tokenizer, min, max));
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws Exception
+	  public virtual void testEmptyTerm()
+	  {
+		Random random = random();
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper3(this);
+		checkAnalysisConsistency(random, a, random.nextBoolean(), "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper3 : Analyzer
+	  {
+		  private readonly NGramTokenFilterTest outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper3(NGramTokenFilterTest outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new NGramTokenFilter(TEST_VERSION_CURRENT, tokenizer, 2, 15));
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testLucene43() throws java.io.IOException
+	  public virtual void testLucene43()
+	  {
+		NGramTokenFilter filter = new NGramTokenFilter(Version.LUCENE_43, input, 2, 3);
+		assertTokenStreamContents(filter, new string[]{"ab","bc","cd","de","abc","bcd","cde"}, new int[]{0,1,2,3,0,1,2}, new int[]{2,3,4,5,3,4,5}, null, new int[]{1,1,1,1,1,1,1}, null, null, false);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testSupplementaryCharacters() throws java.io.IOException
+	  public virtual void testSupplementaryCharacters()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final String s = org.apache.lucene.util.TestUtil.randomUnicodeString(random(), 10);
+		string s = TestUtil.randomUnicodeString(random(), 10);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int codePointCount = s.codePointCount(0, s.length());
+		int codePointCount = s.codePointCount(0, s.Length);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int minGram = org.apache.lucene.util.TestUtil.nextInt(random(), 1, 3);
+		int minGram = TestUtil.Next(random(), 1, 3);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int maxGram = org.apache.lucene.util.TestUtil.nextInt(random(), minGram, 10);
+		int maxGram = TestUtil.Next(random(), minGram, 10);
+		TokenStream tk = new KeywordTokenizer(new StringReader(s));
+		tk = new NGramTokenFilter(TEST_VERSION_CURRENT, tk, minGram, maxGram);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.tokenattributes.CharTermAttribute termAtt = tk.addAttribute(org.apache.lucene.analysis.tokenattributes.CharTermAttribute.class);
+		CharTermAttribute termAtt = tk.addAttribute(typeof(CharTermAttribute));
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.tokenattributes.OffsetAttribute offsetAtt = tk.addAttribute(org.apache.lucene.analysis.tokenattributes.OffsetAttribute.class);
+		OffsetAttribute offsetAtt = tk.addAttribute(typeof(OffsetAttribute));
+		tk.reset();
+		for (int start = 0; start < codePointCount; ++start)
+		{
+		  for (int end = start + minGram; end <= Math.Min(codePointCount, start + maxGram); ++end)
+		  {
+			assertTrue(tk.incrementToken());
+			assertEquals(0, offsetAtt.startOffset());
+			assertEquals(s.Length, offsetAtt.endOffset());
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int startIndex = Character.offsetByCodePoints(s, 0, start);
+			int startIndex = char.offsetByCodePoints(s, 0, start);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int endIndex = Character.offsetByCodePoints(s, 0, end);
+			int endIndex = char.offsetByCodePoints(s, 0, end);
+			assertEquals(s.Substring(startIndex, endIndex - startIndex), termAtt.ToString());
+		  }
+		}
+		assertFalse(tk.incrementToken());
+	  }
+
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ngram/NGramTokenizerTest.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ngram/NGramTokenizerTest.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ngram/NGramTokenizerTest.cs
new file mode 100644
index 0000000..15167bb
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ngram/NGramTokenizerTest.cs
@@ -0,0 +1,386 @@
+namespace org.apache.lucene.analysis.ngram
+{
+
+	/*
+	 * 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.
+	 */
+
+//JAVA TO C# CONVERTER TODO TASK: This Java 'import static' statement cannot be converted to C#:
+//	import static org.apache.lucene.analysis.ngram.NGramTokenizerTest.isTokenChar;
+
+
+	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 TestUtil = org.apache.lucene.util.TestUtil;
+
+	using RandomStrings = com.carrotsearch.randomizedtesting.generators.RandomStrings;
+
+	/// <summary>
+	/// Tests <seealso cref="NGramTokenizer"/> for correctness.
+	/// </summary>
+	public class NGramTokenizerTest : BaseTokenStreamTestCase
+	{
+	  private StringReader input;
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Override public void setUp() throws Exception
+	  public override void setUp()
+	  {
+		base.setUp();
+		input = new StringReader("abcde");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testInvalidInput() throws Exception
+	  public virtual void testInvalidInput()
+	  {
+		bool gotException = false;
+		try
+		{
+		  new NGramTokenizer(TEST_VERSION_CURRENT, input, 2, 1);
+		}
+		catch (System.ArgumentException)
+		{
+		  gotException = true;
+		}
+		assertTrue(gotException);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testInvalidInput2() throws Exception
+	  public virtual void testInvalidInput2()
+	  {
+		bool gotException = false;
+		try
+		{
+		  new NGramTokenizer(TEST_VERSION_CURRENT, input, 0, 1);
+		}
+		catch (System.ArgumentException)
+		{
+		  gotException = true;
+		}
+		assertTrue(gotException);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testUnigrams() throws Exception
+	  public virtual void testUnigrams()
+	  {
+		NGramTokenizer tokenizer = new NGramTokenizer(TEST_VERSION_CURRENT, input, 1, 1);
+		assertTokenStreamContents(tokenizer, new string[]{"a","b","c","d","e"}, new int[]{0,1,2,3,4}, new int[]{1,2,3,4,5}, 5); // abcde
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBigrams() throws Exception
+	  public virtual void testBigrams()
+	  {
+		NGramTokenizer tokenizer = new NGramTokenizer(TEST_VERSION_CURRENT, input, 2, 2);
+		assertTokenStreamContents(tokenizer, new string[]{"ab","bc","cd","de"}, new int[]{0,1,2,3}, new int[]{2,3,4,5}, 5); // abcde
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNgrams() throws Exception
+	  public virtual void testNgrams()
+	  {
+		NGramTokenizer tokenizer = new NGramTokenizer(TEST_VERSION_CURRENT, input, 1, 3);
+		assertTokenStreamContents(tokenizer, new string[]{"a","ab", "abc", "b", "bc", "bcd", "c", "cd", "cde", "d", "de", "e"}, new int[]{0,0,0,1,1,1,2,2,2,3,3,4}, new int[]{1,2,3,2,3,4,3,4,5,4,5,5}, null, null, null, 5, false); // abcde
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testOversizedNgrams() throws Exception
+	  public virtual void testOversizedNgrams()
+	  {
+		NGramTokenizer tokenizer = new NGramTokenizer(TEST_VERSION_CURRENT, input, 6, 7);
+		assertTokenStreamContents(tokenizer, new string[0], new int[0], new int[0], 5); // abcde
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testReset() throws Exception
+	  public virtual void testReset()
+	  {
+		NGramTokenizer tokenizer = new NGramTokenizer(TEST_VERSION_CURRENT, input, 1, 1);
+		assertTokenStreamContents(tokenizer, new string[]{"a","b","c","d","e"}, new int[]{0,1,2,3,4}, new int[]{1,2,3,4,5}, 5); // abcde
+		tokenizer.Reader = new StringReader("abcde");
+		assertTokenStreamContents(tokenizer, new string[]{"a","b","c","d","e"}, new int[]{0,1,2,3,4}, new int[]{1,2,3,4,5}, 5); // abcde
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		for (int i = 0; i < 10; i++)
+		{
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int min = org.apache.lucene.util.TestUtil.nextInt(random(), 2, 10);
+		  int min = TestUtil.Next(random(), 2, 10);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int max = org.apache.lucene.util.TestUtil.nextInt(random(), min, 20);
+		  int max = TestUtil.Next(random(), min, 20);
+		  Analyzer a = new AnalyzerAnonymousInnerClassHelper(this, min, max);
+		  checkRandomData(random(), a, 200 * RANDOM_MULTIPLIER, 20);
+		  checkRandomData(random(), a, 10 * RANDOM_MULTIPLIER, 1027);
+		}
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly NGramTokenizerTest outerInstance;
+
+		  private int min;
+		  private int max;
+
+		  public AnalyzerAnonymousInnerClassHelper(NGramTokenizerTest outerInstance, int min, int max)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.min = min;
+			  this.max = max;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new NGramTokenizer(TEST_VERSION_CURRENT, reader, min, max);
+			return new TokenStreamComponents(tokenizer, tokenizer);
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: private static void testNGrams(int minGram, int maxGram, int length, final String nonTokenChars) throws java.io.IOException
+//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
+	  private static void testNGrams(int minGram, int maxGram, int length, string nonTokenChars)
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final String s = com.carrotsearch.randomizedtesting.generators.RandomStrings.randomAsciiOfLength(random(), length);
+		string s = RandomStrings.randomAsciiOfLength(random(), length);
+		testNGrams(minGram, maxGram, s, nonTokenChars);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: private static void testNGrams(int minGram, int maxGram, String s, String nonTokenChars) throws java.io.IOException
+	  private static void testNGrams(int minGram, int maxGram, string s, string nonTokenChars)
+	  {
+		testNGrams(minGram, maxGram, s, nonTokenChars, false);
+	  }
+
+	  internal static int[] toCodePoints(CharSequence s)
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int[] codePoints = new int[Character.codePointCount(s, 0, s.length())];
+		int[] codePoints = new int[char.codePointCount(s, 0, s.length())];
+		for (int i = 0, j = 0; i < s.length(); ++j)
+		{
+		  codePoints[j] = char.codePointAt(s, i);
+		  i += char.charCount(codePoints[j]);
+		}
+		return codePoints;
+	  }
+
+	  internal static bool isTokenChar(string nonTokenChars, int codePoint)
+	  {
+		for (int i = 0; i < nonTokenChars.Length;)
+		{
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int cp = nonTokenChars.codePointAt(i);
+		  int cp = char.ConvertToUtf32(nonTokenChars, i);
+		  if (cp == codePoint)
+		  {
+			return false;
+		  }
+		  i += char.charCount(cp);
+		}
+		return true;
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: static void testNGrams(int minGram, int maxGram, String s, final String nonTokenChars, boolean edgesOnly) throws java.io.IOException
+//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
+	  internal static void testNGrams(int minGram, int maxGram, string s, string nonTokenChars, bool edgesOnly)
+	  {
+		// convert the string to code points
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int[] codePoints = toCodePoints(s);
+		int[] codePoints = toCodePoints(s);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int[] offsets = new int[codePoints.length + 1];
+		int[] offsets = new int[codePoints.Length + 1];
+		for (int i = 0; i < codePoints.Length; ++i)
+		{
+		  offsets[i + 1] = offsets[i] + char.charCount(codePoints[i]);
+		}
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.TokenStream grams = new NGramTokenizer(TEST_VERSION_CURRENT, new java.io.StringReader(s), minGram, maxGram, edgesOnly)
+		TokenStream grams = new NGramTokenizerAnonymousInnerClassHelper(TEST_VERSION_CURRENT, new StringReader(s), minGram, maxGram, edgesOnly, nonTokenChars);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.tokenattributes.CharTermAttribute termAtt = grams.addAttribute(org.apache.lucene.analysis.tokenattributes.CharTermAttribute.class);
+		CharTermAttribute termAtt = grams.addAttribute(typeof(CharTermAttribute));
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute posIncAtt = grams.addAttribute(org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute.class);
+		PositionIncrementAttribute posIncAtt = grams.addAttribute(typeof(PositionIncrementAttribute));
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.tokenattributes.PositionLengthAttribute posLenAtt = grams.addAttribute(org.apache.lucene.analysis.tokenattributes.PositionLengthAttribute.class);
+		PositionLengthAttribute posLenAtt = grams.addAttribute(typeof(PositionLengthAttribute));
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.tokenattributes.OffsetAttribute offsetAtt = grams.addAttribute(org.apache.lucene.analysis.tokenattributes.OffsetAttribute.class);
+		OffsetAttribute offsetAtt = grams.addAttribute(typeof(OffsetAttribute));
+		grams.reset();
+		for (int start = 0; start < codePoints.Length; ++start)
+		{
+		  for (int end = start + minGram; end <= start + maxGram && end <= codePoints.Length; ++end)
+		  {
+			if (edgesOnly && start > 0 && isTokenChar(nonTokenChars, codePoints[start - 1]))
+			{
+			  // not on an edge
+			  goto nextGramContinue;
+			}
+			for (int j = start; j < end; ++j)
+			{
+			  if (!isTokenChar(nonTokenChars, codePoints[j]))
+			  {
+				goto nextGramContinue;
+			  }
+			}
+			assertTrue(grams.incrementToken());
+			assertArrayEquals(Arrays.copyOfRange(codePoints, start, end), toCodePoints(termAtt));
+			assertEquals(1, posIncAtt.PositionIncrement);
+			assertEquals(1, posLenAtt.PositionLength);
+			assertEquals(offsets[start], offsetAtt.startOffset());
+			assertEquals(offsets[end], offsetAtt.endOffset());
+			  nextGramContinue:;
+		  }
+		  nextGramBreak:;
+		}
+		assertFalse(grams.incrementToken());
+		grams.end();
+		assertEquals(s.Length, offsetAtt.startOffset());
+		assertEquals(s.Length, offsetAtt.endOffset());
+	  }
+
+	  private class NGramTokenizerAnonymousInnerClassHelper : NGramTokenizer
+	  {
+		  private string nonTokenChars;
+
+		  public NGramTokenizerAnonymousInnerClassHelper(UnknownType TEST_VERSION_CURRENT, StringReader java, int minGram, int maxGram, bool edgesOnly, string nonTokenChars) : base(TEST_VERSION_CURRENT, StringReader, minGram, maxGram, edgesOnly)
+		  {
+			  this.nonTokenChars = nonTokenChars;
+		  }
+
+		  protected internal override bool isTokenChar(int chr)
+		  {
+			return nonTokenChars.IndexOf(chr) < 0;
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testLargeInput() throws java.io.IOException
+	  public virtual void testLargeInput()
+	  {
+		// test sliding
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int minGram = org.apache.lucene.util.TestUtil.nextInt(random(), 1, 100);
+		int minGram = TestUtil.Next(random(), 1, 100);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int maxGram = org.apache.lucene.util.TestUtil.nextInt(random(), minGram, 100);
+		int maxGram = TestUtil.Next(random(), minGram, 100);
+		testNGrams(minGram, maxGram, TestUtil.Next(random(), 3 * 1024, 4 * 1024), "");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testLargeMaxGram() throws java.io.IOException
+	  public virtual void testLargeMaxGram()
+	  {
+		// test sliding with maxGram > 1024
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int minGram = org.apache.lucene.util.TestUtil.nextInt(random(), 1290, 1300);
+		int minGram = TestUtil.Next(random(), 1290, 1300);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int maxGram = org.apache.lucene.util.TestUtil.nextInt(random(), minGram, 1300);
+		int maxGram = TestUtil.Next(random(), minGram, 1300);
+		testNGrams(minGram, maxGram, TestUtil.Next(random(), 3 * 1024, 4 * 1024), "");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testPreTokenization() throws java.io.IOException
+	  public virtual void testPreTokenization()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int minGram = org.apache.lucene.util.TestUtil.nextInt(random(), 1, 100);
+		int minGram = TestUtil.Next(random(), 1, 100);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int maxGram = org.apache.lucene.util.TestUtil.nextInt(random(), minGram, 100);
+		int maxGram = TestUtil.Next(random(), minGram, 100);
+		testNGrams(minGram, maxGram, TestUtil.Next(random(), 0, 4 * 1024), "a");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testHeavyPreTokenization() throws java.io.IOException
+	  public virtual void testHeavyPreTokenization()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int minGram = org.apache.lucene.util.TestUtil.nextInt(random(), 1, 100);
+		int minGram = TestUtil.Next(random(), 1, 100);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int maxGram = org.apache.lucene.util.TestUtil.nextInt(random(), minGram, 100);
+		int maxGram = TestUtil.Next(random(), minGram, 100);
+		testNGrams(minGram, maxGram, TestUtil.Next(random(), 0, 4 * 1024), "abcdef");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFewTokenChars() throws java.io.IOException
+	  public virtual void testFewTokenChars()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final char[] chrs = new char[org.apache.lucene.util.TestUtil.nextInt(random(), 4000, 5000)];
+		char[] chrs = new char[TestUtil.Next(random(), 4000, 5000)];
+		Arrays.fill(chrs, ' ');
+		for (int i = 0; i < chrs.Length; ++i)
+		{
+		  if (random().nextFloat() < 0.1)
+		  {
+			chrs[i] = 'a';
+		  }
+		}
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int minGram = org.apache.lucene.util.TestUtil.nextInt(random(), 1, 2);
+		int minGram = TestUtil.Next(random(), 1, 2);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int maxGram = org.apache.lucene.util.TestUtil.nextInt(random(), minGram, 2);
+		int maxGram = TestUtil.Next(random(), minGram, 2);
+		testNGrams(minGram, maxGram, new string(chrs), " ");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFullUTF8Range() throws java.io.IOException
+	  public virtual void testFullUTF8Range()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int minGram = org.apache.lucene.util.TestUtil.nextInt(random(), 1, 100);
+		int minGram = TestUtil.Next(random(), 1, 100);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int maxGram = org.apache.lucene.util.TestUtil.nextInt(random(), minGram, 100);
+		int maxGram = TestUtil.Next(random(), minGram, 100);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final String s = org.apache.lucene.util.TestUtil.randomUnicodeString(random(), 4 * 1024);
+		string s = TestUtil.randomUnicodeString(random(), 4 * 1024);
+		testNGrams(minGram, maxGram, s, "");
+		testNGrams(minGram, maxGram, s, "abcdef");
+	  }
+
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ngram/TestNGramFilters.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ngram/TestNGramFilters.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ngram/TestNGramFilters.cs
new file mode 100644
index 0000000..5674622
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ngram/TestNGramFilters.cs
@@ -0,0 +1,203 @@
+namespace org.apache.lucene.analysis.ngram
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+	using Version = org.apache.lucene.util.Version;
+
+	/// <summary>
+	/// Simple tests to ensure the NGram filter factories are working.
+	/// </summary>
+	public class TestNGramFilters : BaseTokenStreamFactoryTestCase
+	{
+	  /// <summary>
+	  /// Test NGramTokenizerFactory
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNGramTokenizer() throws Exception
+	  public virtual void testNGramTokenizer()
+	  {
+		Reader reader = new StringReader("test");
+		TokenStream stream = tokenizerFactory("NGram").create(reader);
+		assertTokenStreamContents(stream, new string[] {"t", "te", "e", "es", "s", "st", "t"});
+	  }
+
+	  /// <summary>
+	  /// Test NGramTokenizerFactory with min and max gram options
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNGramTokenizer2() throws Exception
+	  public virtual void testNGramTokenizer2()
+	  {
+		Reader reader = new StringReader("test");
+		TokenStream stream = tokenizerFactory("NGram", "minGramSize", "2", "maxGramSize", "3").create(reader);
+		assertTokenStreamContents(stream, new string[] {"te", "tes", "es", "est", "st"});
+	  }
+
+	  /// <summary>
+	  /// Test the NGramFilterFactory
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNGramFilter() throws Exception
+	  public virtual void testNGramFilter()
+	  {
+		Reader reader = new StringReader("test");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("NGram").create(stream);
+		assertTokenStreamContents(stream, new string[] {"t", "te", "e", "es", "s", "st", "t"});
+	  }
+
+	  /// <summary>
+	  /// Test the NGramFilterFactory with min and max gram options
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNGramFilter2() throws Exception
+	  public virtual void testNGramFilter2()
+	  {
+		Reader reader = new StringReader("test");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("NGram", "minGramSize", "2", "maxGramSize", "3").create(stream);
+		assertTokenStreamContents(stream, new string[] {"te", "tes", "es", "est", "st"});
+	  }
+
+	  /// <summary>
+	  /// Test EdgeNGramTokenizerFactory
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEdgeNGramTokenizer() throws Exception
+	  public virtual void testEdgeNGramTokenizer()
+	  {
+		Reader reader = new StringReader("test");
+		TokenStream stream = tokenizerFactory("EdgeNGram").create(reader);
+		assertTokenStreamContents(stream, new string[] {"t"});
+	  }
+
+	  /// <summary>
+	  /// Test EdgeNGramTokenizerFactory with min and max gram size
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEdgeNGramTokenizer2() throws Exception
+	  public virtual void testEdgeNGramTokenizer2()
+	  {
+		Reader reader = new StringReader("test");
+		TokenStream stream = tokenizerFactory("EdgeNGram", "minGramSize", "1", "maxGramSize", "2").create(reader);
+		assertTokenStreamContents(stream, new string[] {"t", "te"});
+	  }
+
+	  /// <summary>
+	  /// Test EdgeNGramTokenizerFactory with side option
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEdgeNGramTokenizer3() throws Exception
+	  public virtual void testEdgeNGramTokenizer3()
+	  {
+		Reader reader = new StringReader("ready");
+		TokenStream stream = tokenizerFactory("EdgeNGram", Version.LUCENE_43, "side", "back").create(reader);
+		assertTokenStreamContents(stream, new string[] {"y"});
+	  }
+
+	  /// <summary>
+	  /// Test EdgeNGramFilterFactory
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEdgeNGramFilter() throws Exception
+	  public virtual void testEdgeNGramFilter()
+	  {
+		Reader reader = new StringReader("test");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("EdgeNGram").create(stream);
+		assertTokenStreamContents(stream, new string[] {"t"});
+	  }
+
+	  /// <summary>
+	  /// Test EdgeNGramFilterFactory with min and max gram size
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEdgeNGramFilter2() throws Exception
+	  public virtual void testEdgeNGramFilter2()
+	  {
+		Reader reader = new StringReader("test");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("EdgeNGram", "minGramSize", "1", "maxGramSize", "2").create(stream);
+		assertTokenStreamContents(stream, new string[] {"t", "te"});
+	  }
+
+	  /// <summary>
+	  /// Test EdgeNGramFilterFactory with side option
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEdgeNGramFilter3() throws Exception
+	  public virtual void testEdgeNGramFilter3()
+	  {
+		Reader reader = new StringReader("ready");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("EdgeNGram", Version.LUCENE_43, "side", "back").create(stream);
+		assertTokenStreamContents(stream, new string[] {"y"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenizerFactory("NGram", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+
+		try
+		{
+		  tokenizerFactory("EdgeNGram", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+
+		try
+		{
+		  tokenFilterFactory("NGram", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+
+		try
+		{
+		  tokenFilterFactory("EdgeNGram", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Nl/TestDutchStemmer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Nl/TestDutchStemmer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Nl/TestDutchStemmer.cs
new file mode 100644
index 0000000..351b21f
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Nl/TestDutchStemmer.cs
@@ -0,0 +1,255 @@
+using System;
+
+namespace org.apache.lucene.analysis.nl
+{
+
+	/*
+	 * 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 CharArrayMap = org.apache.lucene.analysis.util.CharArrayMap;
+	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+	using Version = org.apache.lucene.util.Version;
+
+	/// <summary>
+	/// Test the Dutch Stem Filter, which only modifies the term text.
+	/// 
+	/// The code states that it uses the snowball algorithm, but tests reveal some differences.
+	/// 
+	/// </summary>
+	public class TestDutchStemmer : BaseTokenStreamTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testWithSnowballExamples() throws Exception
+	  public virtual void testWithSnowballExamples()
+	  {
+	   check("lichaamsziek", "lichaamsziek");
+	   check("lichamelijk", "licham");
+	   check("lichamelijke", "licham");
+	   check("lichamelijkheden", "licham");
+	   check("lichamen", "licham");
+	   check("lichere", "licher");
+	   check("licht", "licht");
+	   check("lichtbeeld", "lichtbeeld");
+	   check("lichtbruin", "lichtbruin");
+	   check("lichtdoorlatende", "lichtdoorlat");
+	   check("lichte", "licht");
+	   check("lichten", "licht");
+	   check("lichtende", "lichtend");
+	   check("lichtenvoorde", "lichtenvoord");
+	   check("lichter", "lichter");
+	   check("lichtere", "lichter");
+	   check("lichters", "lichter");
+	   check("lichtgevoeligheid", "lichtgevoel");
+	   check("lichtgewicht", "lichtgewicht");
+	   check("lichtgrijs", "lichtgrijs");
+	   check("lichthoeveelheid", "lichthoevel");
+	   check("lichtintensiteit", "lichtintensiteit");
+	   check("lichtje", "lichtj");
+	   check("lichtjes", "lichtjes");
+	   check("lichtkranten", "lichtkrant");
+	   check("lichtkring", "lichtkring");
+	   check("lichtkringen", "lichtkring");
+	   check("lichtregelsystemen", "lichtregelsystem");
+	   check("lichtste", "lichtst");
+	   check("lichtstromende", "lichtstrom");
+	   check("lichtte", "licht");
+	   check("lichtten", "licht");
+	   check("lichttoetreding", "lichttoetred");
+	   check("lichtverontreinigde", "lichtverontreinigd");
+	   check("lichtzinnige", "lichtzinn");
+	   check("lid", "lid");
+	   check("lidia", "lidia");
+	   check("lidmaatschap", "lidmaatschap");
+	   check("lidstaten", "lidstat");
+	   check("lidvereniging", "lidveren");
+	   check("opgingen", "opging");
+	   check("opglanzing", "opglanz");
+	   check("opglanzingen", "opglanz");
+	   check("opglimlachten", "opglimlacht");
+	   check("opglimpen", "opglimp");
+	   check("opglimpende", "opglimp");
+	   check("opglimping", "opglimp");
+	   check("opglimpingen", "opglimp");
+	   check("opgraven", "opgrav");
+	   check("opgrijnzen", "opgrijnz");
+	   check("opgrijzende", "opgrijz");
+	   check("opgroeien", "opgroei");
+	   check("opgroeiende", "opgroei");
+	   check("opgroeiplaats", "opgroeiplat");
+	   check("ophaal", "ophal");
+	   check("ophaaldienst", "ophaaldienst");
+	   check("ophaalkosten", "ophaalkost");
+	   check("ophaalsystemen", "ophaalsystem");
+	   check("ophaalt", "ophaalt");
+	   check("ophaaltruck", "ophaaltruck");
+	   check("ophalen", "ophal");
+	   check("ophalend", "ophal");
+	   check("ophalers", "ophaler");
+	   check("ophef", "ophef");
+	   check("opheldering", "ophelder");
+	   check("ophemelde", "ophemeld");
+	   check("ophemelen", "ophemel");
+	   check("opheusden", "opheusd");
+	   check("ophief", "ophief");
+	   check("ophield", "ophield");
+	   check("ophieven", "ophiev");
+	   check("ophoepelt", "ophoepelt");
+	   check("ophoog", "ophog");
+	   check("ophoogzand", "ophoogzand");
+	   check("ophopen", "ophop");
+	   check("ophoping", "ophop");
+	   check("ophouden", "ophoud");
+	  }
+
+	  /// @deprecated (3.1) remove this test in Lucene 5.0 
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Deprecated("(3.1) remove this test in Lucene 5.0") public void testOldBuggyStemmer() throws Exception
+	  [Obsolete("(3.1) remove this test in Lucene 5.0")]
+	  public virtual void testOldBuggyStemmer()
+	  {
+		Analyzer a = new DutchAnalyzer(Version.LUCENE_30);
+		checkOneTerm(a, "opheffen", "ophef"); // versus snowball 'opheff'
+		checkOneTerm(a, "opheffende", "ophef"); // versus snowball 'opheff'
+		checkOneTerm(a, "opheffing", "ophef"); // versus snowball 'opheff'
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testSnowballCorrectness() throws Exception
+	  public virtual void testSnowballCorrectness()
+	  {
+		Analyzer a = new DutchAnalyzer(TEST_VERSION_CURRENT);
+		checkOneTerm(a, "opheffen", "opheff");
+		checkOneTerm(a, "opheffende", "opheff");
+		checkOneTerm(a, "opheffing", "opheff");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testReusableTokenStream() throws Exception
+	  public virtual void testReusableTokenStream()
+	  {
+		Analyzer a = new DutchAnalyzer(TEST_VERSION_CURRENT);
+		checkOneTerm(a, "lichaamsziek", "lichaamsziek");
+		checkOneTerm(a, "lichamelijk", "licham");
+		checkOneTerm(a, "lichamelijke", "licham");
+		checkOneTerm(a, "lichamelijkheden", "licham");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testExclusionTableViaCtor() throws java.io.IOException
+	  public virtual void testExclusionTableViaCtor()
+	  {
+		CharArraySet set = new CharArraySet(Version.LUCENE_30, 1, true);
+		set.add("lichamelijk");
+		DutchAnalyzer a = new DutchAnalyzer(TEST_VERSION_CURRENT, CharArraySet.EMPTY_SET, set);
+		assertAnalyzesTo(a, "lichamelijk lichamelijke", new string[] {"lichamelijk", "licham"});
+
+		a = new DutchAnalyzer(TEST_VERSION_CURRENT, CharArraySet.EMPTY_SET, set);
+		assertAnalyzesTo(a, "lichamelijk lichamelijke", new string[] {"lichamelijk", "licham"});
+
+	  }
+
+	  /// <summary>
+	  /// check that the default stem overrides are used
+	  /// even if you use a non-default ctor.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStemOverrides() throws java.io.IOException
+	  public virtual void testStemOverrides()
+	  {
+		DutchAnalyzer a = new DutchAnalyzer(TEST_VERSION_CURRENT, CharArraySet.EMPTY_SET);
+		checkOneTerm(a, "fiets", "fiets");
+	  }
+	  /// <summary>
+	  /// 3.0 still uses the chararraymap internally check if that works as well </summary>
+	  /// @deprecated (4.3) remove this test in Lucene 5.0 
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Deprecated("(4.3) remove this test in Lucene 5.0") public void test30StemOverrides() throws java.io.IOException
+	  [Obsolete("(4.3) remove this test in Lucene 5.0")]
+	  public virtual void test30StemOverrides()
+	  {
+		DutchAnalyzer a = new DutchAnalyzer(Version.LUCENE_30);
+		checkOneTerm(a, "fiets", "fiets");
+		a = new DutchAnalyzer(Version.LUCENE_30, CharArraySet.EMPTY_SET);
+		checkOneTerm(a, "fiets", "fiet"); // only the default ctor populates the dict
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyStemDictionary() throws java.io.IOException
+	  public virtual void testEmptyStemDictionary()
+	  {
+		DutchAnalyzer a = new DutchAnalyzer(TEST_VERSION_CURRENT, CharArraySet.EMPTY_SET, CharArraySet.EMPTY_SET, CharArrayMap.emptyMap<string>());
+		checkOneTerm(a, "fiets", "fiet");
+	  }
+
+	  /// <summary>
+	  /// prior to 3.6, this confusingly did not happen if 
+	  /// you specified your own stoplist!!!! </summary>
+	  /// @deprecated (3.6) Remove this test in Lucene 5.0 
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Deprecated("(3.6) Remove this test in Lucene 5.0") public void testBuggyStemOverrides() throws java.io.IOException
+	  [Obsolete("(3.6) Remove this test in Lucene 5.0")]
+	  public virtual void testBuggyStemOverrides()
+	  {
+		DutchAnalyzer a = new DutchAnalyzer(Version.LUCENE_35, CharArraySet.EMPTY_SET);
+		checkOneTerm(a, "fiets", "fiet");
+	  }
+
+	  /// <summary>
+	  /// Prior to 3.1, this analyzer had no lowercase filter.
+	  /// stopwords were case sensitive. Preserve this for back compat. </summary>
+	  /// @deprecated (3.1) Remove this test in Lucene 5.0 
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Deprecated("(3.1) Remove this test in Lucene 5.0") public void testBuggyStopwordsCasing() throws java.io.IOException
+	  [Obsolete("(3.1) Remove this test in Lucene 5.0")]
+	  public virtual void testBuggyStopwordsCasing()
+	  {
+		DutchAnalyzer a = new DutchAnalyzer(Version.LUCENE_30);
+		assertAnalyzesTo(a, "Zelf", new string[] {"zelf"});
+	  }
+
+	  /// <summary>
+	  /// Test that stopwords are not case sensitive
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStopwordsCasing() throws java.io.IOException
+	  public virtual void testStopwordsCasing()
+	  {
+		DutchAnalyzer a = new DutchAnalyzer(Version.LUCENE_31);
+		assertAnalyzesTo(a, "Zelf", new string[] { });
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: private void check(final String input, final String expected) throws Exception
+//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
+	  private void check(string input, string expected)
+	  {
+		checkOneTerm(new DutchAnalyzer(TEST_VERSION_CURRENT), input, expected);
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), new DutchAnalyzer(TEST_VERSION_CURRENT), 1000 * RANDOM_MULTIPLIER);
+	  }
+
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/No/TestNorwegianAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/No/TestNorwegianAnalyzer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/No/TestNorwegianAnalyzer.cs
new file mode 100644
index 0000000..136ec1f
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/No/TestNorwegianAnalyzer.cs
@@ -0,0 +1,70 @@
+namespace org.apache.lucene.analysis.no
+{
+
+	/*
+	 * 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 CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+
+	public class TestNorwegianAnalyzer : BaseTokenStreamTestCase
+	{
+	  /// <summary>
+	  /// This test fails with NPE when the 
+	  /// stopwords file is missing in classpath 
+	  /// </summary>
+	  public virtual void testResourcesAvailable()
+	  {
+		new NorwegianAnalyzer(TEST_VERSION_CURRENT);
+	  }
+
+	  /// <summary>
+	  /// test stopwords and stemming </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBasics() throws java.io.IOException
+	  public virtual void testBasics()
+	  {
+		Analyzer a = new NorwegianAnalyzer(TEST_VERSION_CURRENT);
+		// stemming
+		checkOneTerm(a, "havnedistriktene", "havnedistrikt");
+		checkOneTerm(a, "havnedistrikter", "havnedistrikt");
+		// stopword
+		assertAnalyzesTo(a, "det", new string[] {});
+	  }
+
+	  /// <summary>
+	  /// test use of exclusion set </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testExclude() throws java.io.IOException
+	  public virtual void testExclude()
+	  {
+		CharArraySet exclusionSet = new CharArraySet(TEST_VERSION_CURRENT, asSet("havnedistriktene"), false);
+		Analyzer a = new NorwegianAnalyzer(TEST_VERSION_CURRENT, NorwegianAnalyzer.DefaultStopSet, exclusionSet);
+		checkOneTerm(a, "havnedistriktene", "havnedistriktene");
+		checkOneTerm(a, "havnedistrikter", "havnedistrikt");
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), new NorwegianAnalyzer(TEST_VERSION_CURRENT), 1000 * RANDOM_MULTIPLIER);
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/No/TestNorwegianLightStemFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/No/TestNorwegianLightStemFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/No/TestNorwegianLightStemFilter.cs
new file mode 100644
index 0000000..edbbf53
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/No/TestNorwegianLightStemFilter.cs
@@ -0,0 +1,157 @@
+using System;
+
+namespace org.apache.lucene.analysis.no
+{
+
+	/*
+	 * 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 KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+	using SetKeywordMarkerFilter = org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter;
+	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+
+//JAVA TO C# CONVERTER TODO TASK: This Java 'import static' statement cannot be converted to C#:
+//	import static org.apache.lucene.analysis.VocabularyAssert.*;
+//JAVA TO C# CONVERTER TODO TASK: This Java 'import static' statement cannot be converted to C#:
+//	import static org.apache.lucene.analysis.no.NorwegianLightStemmer.BOKMAAL;
+//JAVA TO C# CONVERTER TODO TASK: This Java 'import static' statement cannot be converted to C#:
+//	import static org.apache.lucene.analysis.no.NorwegianLightStemmer.NYNORSK;
+
+
+	/// <summary>
+	/// Simple tests for <seealso cref="NorwegianLightStemFilter"/>
+	/// </summary>
+	public class TestNorwegianLightStemFilter : BaseTokenStreamTestCase
+	{
+	  private Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper();
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  public AnalyzerAnonymousInnerClassHelper()
+		  {
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer source = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(source, new NorwegianLightStemFilter(source, BOKMAAL));
+		  }
+	  }
+
+	  /// <summary>
+	  /// Test against a vocabulary file </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testVocabulary() throws java.io.IOException
+	  public virtual void testVocabulary()
+	  {
+		assertVocabulary(analyzer, new System.IO.FileStream(getDataFile("nb_light.txt"), System.IO.FileMode.Open, System.IO.FileAccess.Read));
+	  }
+
+	  /// <summary>
+	  /// Test against a Nynorsk vocabulary file </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNynorskVocabulary() throws java.io.IOException
+	  public virtual void testNynorskVocabulary()
+	  {
+		Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper2(this);
+		assertVocabulary(analyzer, new System.IO.FileStream(getDataFile("nn_light.txt"), System.IO.FileMode.Open, System.IO.FileAccess.Read));
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestNorwegianLightStemFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestNorwegianLightStemFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer source = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(source, new NorwegianLightStemFilter(source, NYNORSK));
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testKeyword() throws java.io.IOException
+	  public virtual void testKeyword()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.util.CharArraySet exclusionSet = new org.apache.lucene.analysis.util.CharArraySet(TEST_VERSION_CURRENT, asSet("sekretæren"), false);
+		CharArraySet exclusionSet = new CharArraySet(TEST_VERSION_CURRENT, asSet("sekretæren"), false);
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper3(this, exclusionSet);
+		checkOneTerm(a, "sekretæren", "sekretæren");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper3 : Analyzer
+	  {
+		  private readonly TestNorwegianLightStemFilter outerInstance;
+
+		  private CharArraySet exclusionSet;
+
+		  public AnalyzerAnonymousInnerClassHelper3(TestNorwegianLightStemFilter outerInstance, CharArraySet exclusionSet)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.exclusionSet = exclusionSet;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer source = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			TokenStream sink = new SetKeywordMarkerFilter(source, exclusionSet);
+			return new TokenStreamComponents(source, new NorwegianLightStemFilter(sink));
+		  }
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		Random random = random();
+		checkRandomData(random, analyzer, 1000 * RANDOM_MULTIPLIER);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper4(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper4 : Analyzer
+	  {
+		  private readonly TestNorwegianLightStemFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper4(TestNorwegianLightStemFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new NorwegianLightStemFilter(tokenizer));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/No/TestNorwegianLightStemFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/No/TestNorwegianLightStemFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/No/TestNorwegianLightStemFilterFactory.cs
new file mode 100644
index 0000000..a4fa114
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/No/TestNorwegianLightStemFilterFactory.cs
@@ -0,0 +1,81 @@
+namespace org.apache.lucene.analysis.no
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the Norwegian Light stem factory is working.
+	/// </summary>
+	public class TestNorwegianLightStemFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStemming() throws Exception
+	  public virtual void testStemming()
+	  {
+		Reader reader = new StringReader("epler eple");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("NorwegianLightStem").create(stream);
+		assertTokenStreamContents(stream, new string[] {"epl", "epl"});
+	  }
+
+	  /// <summary>
+	  /// Test stemming with variant set explicitly to Bokmål </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBokmaalStemming() throws Exception
+	  public virtual void testBokmaalStemming()
+	  {
+		Reader reader = new StringReader("epler eple");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("NorwegianLightStem", "variant", "nb").create(stream);
+		assertTokenStreamContents(stream, new string[] {"epl", "epl"});
+	  }
+
+	  /// <summary>
+	  /// Test stemming with variant set explicitly to Nynorsk </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNynorskStemming() throws Exception
+	  public virtual void testNynorskStemming()
+	  {
+		Reader reader = new StringReader("gutar gutane");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("NorwegianLightStem", "variant", "nn").create(stream);
+		assertTokenStreamContents(stream, new string[] {"gut", "gut"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("NorwegianLightStem", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file


[07/27] lucenenet git commit: adding converted analysis common tests

Posted by sy...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ru/TestRussianAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ru/TestRussianAnalyzer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ru/TestRussianAnalyzer.cs
new file mode 100644
index 0000000..e3cc75f
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ru/TestRussianAnalyzer.cs
@@ -0,0 +1,85 @@
+using System;
+
+namespace org.apache.lucene.analysis.ru
+{
+
+	/*
+	 * 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 CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+	using Version = org.apache.lucene.util.Version;
+
+	/// <summary>
+	/// Test case for RussianAnalyzer.
+	/// </summary>
+
+	public class TestRussianAnalyzer : BaseTokenStreamTestCase
+	{
+
+		 /// <summary>
+		 /// Check that RussianAnalyzer doesnt discard any numbers </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testDigitsInRussianCharset() throws java.io.IOException
+		public virtual void testDigitsInRussianCharset()
+		{
+		  RussianAnalyzer ra = new RussianAnalyzer(TEST_VERSION_CURRENT);
+		  assertAnalyzesTo(ra, "text 1000", new string[] {"text", "1000"});
+		}
+
+		/// @deprecated (3.1) remove this test in Lucene 5.0: stopwords changed 
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Deprecated("(3.1) remove this test in Lucene 5.0: stopwords changed") public void testReusableTokenStream30() throws Exception
+		[Obsolete("(3.1) remove this test in Lucene 5.0: stopwords changed")]
+		public virtual void testReusableTokenStream30()
+		{
+		  Analyzer a = new RussianAnalyzer(Version.LUCENE_30);
+		  assertAnalyzesTo(a, "Вместе с тем о силе электромагнитной энергии имели представление еще", new string[] {"вмест", "сил", "электромагнитн", "энерг", "имел", "представлен"});
+		  assertAnalyzesTo(a, "Но знание это хранилось в тайне", new string[] {"знан", "хран", "тайн"});
+		}
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testReusableTokenStream() throws Exception
+		public virtual void testReusableTokenStream()
+		{
+		  Analyzer a = new RussianAnalyzer(TEST_VERSION_CURRENT);
+		  assertAnalyzesTo(a, "Вместе с тем о силе электромагнитной энергии имели представление еще", new string[] {"вмест", "сил", "электромагнитн", "энерг", "имел", "представлен"});
+		  assertAnalyzesTo(a, "Но знание это хранилось в тайне", new string[] {"знан", "эт", "хран", "тайн"});
+		}
+
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testWithStemExclusionSet() throws Exception
+		public virtual void testWithStemExclusionSet()
+		{
+		  CharArraySet set = new CharArraySet(TEST_VERSION_CURRENT, 1, true);
+		  set.add("представление");
+		  Analyzer a = new RussianAnalyzer(TEST_VERSION_CURRENT, RussianAnalyzer.DefaultStopSet, set);
+		  assertAnalyzesTo(a, "Вместе с тем о силе электромагнитной энергии имели представление еще", new string[] {"вмест", "сил", "электромагнитн", "энерг", "имел", "представление"});
+
+		}
+
+		/// <summary>
+		/// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+		public virtual void testRandomStrings()
+		{
+		  checkRandomData(random(), new RussianAnalyzer(TEST_VERSION_CURRENT), 1000 * RANDOM_MULTIPLIER);
+		}
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ru/TestRussianFilters.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ru/TestRussianFilters.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ru/TestRussianFilters.cs
new file mode 100644
index 0000000..dc788b7
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ru/TestRussianFilters.cs
@@ -0,0 +1,59 @@
+namespace org.apache.lucene.analysis.ru
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the Russian filter factories are working.
+	/// </summary>
+	public class TestRussianFilters : BaseTokenStreamFactoryTestCase
+	{
+	  /// <summary>
+	  /// Test RussianLetterTokenizerFactory
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTokenizer() throws Exception
+	  public virtual void testTokenizer()
+	  {
+		Reader reader = new StringReader("Вместе с тем о силе электромагнитной 100");
+		TokenStream stream = tokenizerFactory("RussianLetter").create(reader);
+		assertTokenStreamContents(stream, new string[] {"Вместе", "с", "тем", "о", "силе", "электромагнитной", "100"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenizerFactory("RussianLetter", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ru/TestRussianLetterTokenizer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ru/TestRussianLetterTokenizer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ru/TestRussianLetterTokenizer.cs
new file mode 100644
index 0000000..ae81f29
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ru/TestRussianLetterTokenizer.cs
@@ -0,0 +1,52 @@
+using System;
+
+namespace org.apache.lucene.analysis.ru
+{
+
+	/*
+	 * 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 Version = org.apache.lucene.util.Version;
+
+	/// <summary>
+	/// Testcase for <seealso cref="RussianLetterTokenizer"/> </summary>
+	/// @deprecated (3.1) Remove this test class in Lucene 5.0 
+	[Obsolete("(3.1) Remove this test class in Lucene 5.0")]
+	public class TestRussianLetterTokenizer : BaseTokenStreamTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRussianLetterTokenizer() throws java.io.IOException
+	  public virtual void testRussianLetterTokenizer()
+	  {
+		StringReader reader = new StringReader("1234567890 Вместе \ud801\udc1ctest");
+		RussianLetterTokenizer tokenizer = new RussianLetterTokenizer(Version.LUCENE_CURRENT, reader);
+		assertTokenStreamContents(tokenizer, new string[] {"1234567890", "Вместе", "\ud801\udc1ctest"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRussianLetterTokenizerBWCompat() throws java.io.IOException
+	  public virtual void testRussianLetterTokenizerBWCompat()
+	  {
+		StringReader reader = new StringReader("1234567890 Вместе \ud801\udc1ctest");
+		RussianLetterTokenizer tokenizer = new RussianLetterTokenizer(Version.LUCENE_30, reader);
+		assertTokenStreamContents(tokenizer, new string[] {"1234567890", "Вместе", "test"});
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ru/TestRussianLightStemFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ru/TestRussianLightStemFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ru/TestRussianLightStemFilter.cs
new file mode 100644
index 0000000..df370f1
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ru/TestRussianLightStemFilter.cs
@@ -0,0 +1,123 @@
+namespace org.apache.lucene.analysis.ru
+{
+
+	/*
+	 * 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 KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+	using SetKeywordMarkerFilter = org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter;
+	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+
+//JAVA TO C# CONVERTER TODO TASK: This Java 'import static' statement cannot be converted to C#:
+//	import static org.apache.lucene.analysis.VocabularyAssert.*;
+
+	/// <summary>
+	/// Simple tests for <seealso cref="RussianLightStemFilter"/>
+	/// </summary>
+	public class TestRussianLightStemFilter : BaseTokenStreamTestCase
+	{
+	  private Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper();
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  public AnalyzerAnonymousInnerClassHelper()
+		  {
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer source = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(source, new RussianLightStemFilter(source));
+		  }
+	  }
+
+	  /// <summary>
+	  /// Test against a vocabulary from the reference impl </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testVocabulary() throws java.io.IOException
+	  public virtual void testVocabulary()
+	  {
+		assertVocabulary(analyzer, getDataFile("rulighttestdata.zip"), "rulight.txt");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testKeyword() throws java.io.IOException
+	  public virtual void testKeyword()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.util.CharArraySet exclusionSet = new org.apache.lucene.analysis.util.CharArraySet(TEST_VERSION_CURRENT, asSet("энергии"), false);
+		CharArraySet exclusionSet = new CharArraySet(TEST_VERSION_CURRENT, asSet("энергии"), false);
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper2(this, exclusionSet);
+		checkOneTerm(a, "энергии", "энергии");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestRussianLightStemFilter outerInstance;
+
+		  private CharArraySet exclusionSet;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestRussianLightStemFilter outerInstance, CharArraySet exclusionSet)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.exclusionSet = exclusionSet;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer source = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			TokenStream sink = new SetKeywordMarkerFilter(source, exclusionSet);
+			return new TokenStreamComponents(source, new RussianLightStemFilter(sink));
+		  }
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		checkRandomData(random(), analyzer, 1000 * RANDOM_MULTIPLIER);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper3(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper3 : Analyzer
+	  {
+		  private readonly TestRussianLightStemFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper3(TestRussianLightStemFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new RussianLightStemFilter(tokenizer));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ru/TestRussianLightStemFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ru/TestRussianLightStemFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ru/TestRussianLightStemFilterFactory.cs
new file mode 100644
index 0000000..1d68918
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ru/TestRussianLightStemFilterFactory.cs
@@ -0,0 +1,57 @@
+namespace org.apache.lucene.analysis.ru
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the Russian light stem factory is working.
+	/// </summary>
+	public class TestRussianLightStemFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStemming() throws Exception
+	  public virtual void testStemming()
+	  {
+		Reader reader = new StringReader("журналы");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("RussianLightStem").create(stream);
+		assertTokenStreamContents(stream, new string[] {"журнал"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("RussianLightStem", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Shingle/ShingleAnalyzerWrapperTest.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Shingle/ShingleAnalyzerWrapperTest.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Shingle/ShingleAnalyzerWrapperTest.cs
new file mode 100644
index 0000000..4724d4c
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Shingle/ShingleAnalyzerWrapperTest.cs
@@ -0,0 +1,276 @@
+namespace org.apache.lucene.analysis.shingle
+{
+
+	/*
+	 * Licensed to the Apache Software Foundation (ASF) under one or more
+	 * contributor license agreements.  See the NOTICE file distributed with
+	 * this work for additional information regarding copyright ownership.
+	 * The ASF licenses this file to You under the Apache License, Version 2.0
+	 * (the "License"); you may not use this file except in compliance with
+	 * the License.  You may obtain a copy of the License at
+	 *
+	 *     http://www.apache.org/licenses/LICENSE-2.0
+	 *
+	 * Unless required by applicable law or agreed to in writing, software
+	 * distributed under the License is distributed on an "AS IS" BASIS,
+	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+	 * See the License for the specific language governing permissions and
+	 * limitations under the License.
+	 */
+
+	using StopFilter = org.apache.lucene.analysis.core.StopFilter;
+	using CharTermAttribute = org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
+	using PositionIncrementAttribute = org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
+	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+	using Document = org.apache.lucene.document.Document;
+	using Field = org.apache.lucene.document.Field;
+	using TextField = org.apache.lucene.document.TextField;
+	using DirectoryReader = org.apache.lucene.index.DirectoryReader;
+	using IndexReader = org.apache.lucene.index.IndexReader;
+	using IndexWriter = org.apache.lucene.index.IndexWriter;
+	using IndexWriterConfig = org.apache.lucene.index.IndexWriterConfig;
+	using Term = org.apache.lucene.index.Term;
+	using org.apache.lucene.search;
+	using Directory = org.apache.lucene.store.Directory;
+	using IOUtils = org.apache.lucene.util.IOUtils;
+
+	/// <summary>
+	/// A test class for ShingleAnalyzerWrapper as regards queries and scoring.
+	/// </summary>
+	public class ShingleAnalyzerWrapperTest : BaseTokenStreamTestCase
+	{
+	  private Analyzer analyzer;
+	  private IndexSearcher searcher;
+	  private IndexReader reader;
+	  private Directory directory;
+
+	  /// <summary>
+	  /// Set up a new index in RAM with three test phrases and the supplied Analyzer.
+	  /// </summary>
+	  /// <exception cref="Exception"> if an error occurs with index writer or searcher </exception>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Override public void setUp() throws Exception
+	  public override void setUp()
+	  {
+		base.setUp();
+		analyzer = new ShingleAnalyzerWrapper(new MockAnalyzer(random(), MockTokenizer.WHITESPACE, false), 2);
+		directory = newDirectory();
+		IndexWriter writer = new IndexWriter(directory, new IndexWriterConfig(TEST_VERSION_CURRENT, analyzer));
+
+		Document doc;
+		doc = new Document();
+		doc.add(new TextField("content", "please divide this sentence into shingles", Field.Store.YES));
+		writer.addDocument(doc);
+
+		doc = new Document();
+		doc.add(new TextField("content", "just another test sentence", Field.Store.YES));
+		writer.addDocument(doc);
+
+		doc = new Document();
+		doc.add(new TextField("content", "a sentence which contains no test", Field.Store.YES));
+		writer.addDocument(doc);
+
+		writer.close();
+
+		reader = DirectoryReader.open(directory);
+		searcher = newSearcher(reader);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Override public void tearDown() throws Exception
+	  public override void tearDown()
+	  {
+		reader.close();
+		directory.close();
+		base.tearDown();
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: protected void compareRanks(ScoreDoc[] hits, int[] ranks) throws Exception
+	  protected internal virtual void compareRanks(ScoreDoc[] hits, int[] ranks)
+	  {
+		assertEquals(ranks.Length, hits.Length);
+		for (int i = 0; i < ranks.Length; i++)
+		{
+		  assertEquals(ranks[i], hits[i].doc);
+		}
+	  }
+
+	  /*
+	   * This shows how to construct a phrase query containing shingles.
+	   */
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testShingleAnalyzerWrapperPhraseQuery() throws Exception
+	  public virtual void testShingleAnalyzerWrapperPhraseQuery()
+	  {
+		PhraseQuery q = new PhraseQuery();
+
+		TokenStream ts = analyzer.tokenStream("content", "this sentence");
+		try
+		{
+		  int j = -1;
+
+		  PositionIncrementAttribute posIncrAtt = ts.addAttribute(typeof(PositionIncrementAttribute));
+		  CharTermAttribute termAtt = ts.addAttribute(typeof(CharTermAttribute));
+
+		  ts.reset();
+		  while (ts.incrementToken())
+		  {
+			j += posIncrAtt.PositionIncrement;
+			string termText = termAtt.ToString();
+			q.add(new Term("content", termText), j);
+		  }
+		  ts.end();
+		}
+		finally
+		{
+		  IOUtils.closeWhileHandlingException(ts);
+		}
+
+		ScoreDoc[] hits = searcher.search(q, null, 1000).scoreDocs;
+		int[] ranks = new int[] {0};
+		compareRanks(hits, ranks);
+	  }
+
+	  /*
+	   * How to construct a boolean query with shingles. A query like this will
+	   * implicitly score those documents higher that contain the words in the query
+	   * in the right order and adjacent to each other.
+	   */
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testShingleAnalyzerWrapperBooleanQuery() throws Exception
+	  public virtual void testShingleAnalyzerWrapperBooleanQuery()
+	  {
+		BooleanQuery q = new BooleanQuery();
+
+		TokenStream ts = analyzer.tokenStream("content", "test sentence");
+		try
+		{
+		  CharTermAttribute termAtt = ts.addAttribute(typeof(CharTermAttribute));
+
+		  ts.reset();
+		  while (ts.incrementToken())
+		  {
+			string termText = termAtt.ToString();
+			q.add(new TermQuery(new Term("content", termText)), BooleanClause.Occur.SHOULD);
+		  }
+		  ts.end();
+		}
+		finally
+		{
+		  IOUtils.closeWhileHandlingException(ts);
+		}
+
+		ScoreDoc[] hits = searcher.search(q, null, 1000).scoreDocs;
+		int[] ranks = new int[] {1, 2, 0};
+		compareRanks(hits, ranks);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testReusableTokenStream() throws Exception
+	  public virtual void testReusableTokenStream()
+	  {
+		Analyzer a = new ShingleAnalyzerWrapper(new MockAnalyzer(random(), MockTokenizer.WHITESPACE, false), 2);
+		assertAnalyzesTo(a, "please divide into shingles", new string[] {"please", "please divide", "divide", "divide into", "into", "into shingles", "shingles"}, new int[] {0, 0, 7, 7, 14, 14, 19}, new int[] {6, 13, 13, 18, 18, 27, 27}, new int[] {1, 0, 1, 0, 1, 0, 1});
+		assertAnalyzesTo(a, "divide me up again", new string[] {"divide", "divide me", "me", "me up", "up", "up again", "again"}, new int[] {0, 0, 7, 7, 10, 10, 13}, new int[] {6, 9, 9, 12, 12, 18, 18}, new int[] {1, 0, 1, 0, 1, 0, 1});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNonDefaultMinShingleSize() throws Exception
+	  public virtual void testNonDefaultMinShingleSize()
+	  {
+		ShingleAnalyzerWrapper analyzer = new ShingleAnalyzerWrapper(new MockAnalyzer(random(), MockTokenizer.WHITESPACE, false), 3, 4);
+		assertAnalyzesTo(analyzer, "please divide this sentence into shingles", new string[] {"please", "please divide this", "please divide this sentence", "divide", "divide this sentence", "divide this sentence into", "this", "this sentence into", "this sentence into shingles", "sentence", "sentence into shingles", "into", "shingles"}, new int[] {0, 0, 0, 7, 7, 7, 14, 14, 14, 19, 19, 28, 33}, new int[] {6, 18, 27, 13, 27, 32, 18, 32, 41, 27, 41, 32, 41}, new int[] {1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1});
+
+		analyzer = new ShingleAnalyzerWrapper(new MockAnalyzer(random(), MockTokenizer.WHITESPACE, false), 3, 4, ShingleFilter.DEFAULT_TOKEN_SEPARATOR, false, false, ShingleFilter.DEFAULT_FILLER_TOKEN);
+		assertAnalyzesTo(analyzer, "please divide this sentence into shingles", new string[] {"please divide this", "please divide this sentence", "divide this sentence", "divide this sentence into", "this sentence into", "this sentence into shingles", "sentence into shingles"}, new int[] {0, 0, 7, 7, 14, 14, 19}, new int[] {18, 27, 27, 32, 32, 41, 41}, new int[] {1, 0, 1, 0, 1, 0, 1});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNonDefaultMinAndSameMaxShingleSize() throws Exception
+	  public virtual void testNonDefaultMinAndSameMaxShingleSize()
+	  {
+		ShingleAnalyzerWrapper analyzer = new ShingleAnalyzerWrapper(new MockAnalyzer(random(), MockTokenizer.WHITESPACE, false), 3, 3);
+		assertAnalyzesTo(analyzer, "please divide this sentence into shingles", new string[] {"please", "please divide this", "divide", "divide this sentence", "this", "this sentence into", "sentence", "sentence into shingles", "into", "shingles"}, new int[] {0, 0, 7, 7, 14, 14, 19, 19, 28, 33}, new int[] {6, 18, 13, 27, 18, 32, 27, 41, 32, 41}, new int[] {1, 0, 1, 0, 1, 0, 1, 0, 1, 1});
+
+		analyzer = new ShingleAnalyzerWrapper(new MockAnalyzer(random(), MockTokenizer.WHITESPACE, false), 3, 3, ShingleFilter.DEFAULT_TOKEN_SEPARATOR, false, false, ShingleFilter.DEFAULT_FILLER_TOKEN);
+		assertAnalyzesTo(analyzer, "please divide this sentence into shingles", new string[] {"please divide this", "divide this sentence", "this sentence into", "sentence into shingles"}, new int[] {0, 7, 14, 19}, new int[] {18, 27, 32, 41}, new int[] {1, 1, 1, 1});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNoTokenSeparator() throws Exception
+	  public virtual void testNoTokenSeparator()
+	  {
+		ShingleAnalyzerWrapper analyzer = new ShingleAnalyzerWrapper(new MockAnalyzer(random(), MockTokenizer.WHITESPACE, false), ShingleFilter.DEFAULT_MIN_SHINGLE_SIZE, ShingleFilter.DEFAULT_MAX_SHINGLE_SIZE, "", true, false, ShingleFilter.DEFAULT_FILLER_TOKEN);
+		assertAnalyzesTo(analyzer, "please divide into shingles", new string[] {"please", "pleasedivide", "divide", "divideinto", "into", "intoshingles", "shingles"}, new int[] {0, 0, 7, 7, 14, 14, 19}, new int[] {6, 13, 13, 18, 18, 27, 27}, new int[] {1, 0, 1, 0, 1, 0, 1});
+
+		analyzer = new ShingleAnalyzerWrapper(new MockAnalyzer(random(), MockTokenizer.WHITESPACE, false), ShingleFilter.DEFAULT_MIN_SHINGLE_SIZE, ShingleFilter.DEFAULT_MAX_SHINGLE_SIZE, "", false, false, ShingleFilter.DEFAULT_FILLER_TOKEN);
+		assertAnalyzesTo(analyzer, "please divide into shingles", new string[] {"pleasedivide", "divideinto", "intoshingles"}, new int[] {0, 7, 14}, new int[] {13, 18, 27}, new int[] {1, 1, 1});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNullTokenSeparator() throws Exception
+	  public virtual void testNullTokenSeparator()
+	  {
+		ShingleAnalyzerWrapper analyzer = new ShingleAnalyzerWrapper(new MockAnalyzer(random(), MockTokenizer.WHITESPACE, false), ShingleFilter.DEFAULT_MIN_SHINGLE_SIZE, ShingleFilter.DEFAULT_MAX_SHINGLE_SIZE, null, true, false, ShingleFilter.DEFAULT_FILLER_TOKEN);
+		assertAnalyzesTo(analyzer, "please divide into shingles", new string[] {"please", "pleasedivide", "divide", "divideinto", "into", "intoshingles", "shingles"}, new int[] {0, 0, 7, 7, 14, 14, 19}, new int[] {6, 13, 13, 18, 18, 27, 27}, new int[] {1, 0, 1, 0, 1, 0, 1});
+
+		analyzer = new ShingleAnalyzerWrapper(new MockAnalyzer(random(), MockTokenizer.WHITESPACE, false), ShingleFilter.DEFAULT_MIN_SHINGLE_SIZE, ShingleFilter.DEFAULT_MAX_SHINGLE_SIZE, "", false, false, ShingleFilter.DEFAULT_FILLER_TOKEN);
+		assertAnalyzesTo(analyzer, "please divide into shingles", new string[] {"pleasedivide", "divideinto", "intoshingles"}, new int[] {0, 7, 14}, new int[] {13, 18, 27}, new int[] {1, 1, 1});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testAltTokenSeparator() throws Exception
+	  public virtual void testAltTokenSeparator()
+	  {
+		ShingleAnalyzerWrapper analyzer = new ShingleAnalyzerWrapper(new MockAnalyzer(random(), MockTokenizer.WHITESPACE, false), ShingleFilter.DEFAULT_MIN_SHINGLE_SIZE, ShingleFilter.DEFAULT_MAX_SHINGLE_SIZE, "<SEP>", true, false, ShingleFilter.DEFAULT_FILLER_TOKEN);
+		assertAnalyzesTo(analyzer, "please divide into shingles", new string[] {"please", "please<SEP>divide", "divide", "divide<SEP>into", "into", "into<SEP>shingles", "shingles"}, new int[] {0, 0, 7, 7, 14, 14, 19}, new int[] {6, 13, 13, 18, 18, 27, 27}, new int[] {1, 0, 1, 0, 1, 0, 1});
+
+		analyzer = new ShingleAnalyzerWrapper(new MockAnalyzer(random(), MockTokenizer.WHITESPACE, false), ShingleFilter.DEFAULT_MIN_SHINGLE_SIZE, ShingleFilter.DEFAULT_MAX_SHINGLE_SIZE, "<SEP>", false, false, ShingleFilter.DEFAULT_FILLER_TOKEN);
+		assertAnalyzesTo(analyzer, "please divide into shingles", new string[] {"please<SEP>divide", "divide<SEP>into", "into<SEP>shingles"}, new int[] {0, 7, 14}, new int[] {13, 18, 27}, new int[] {1, 1, 1});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testAltFillerToken() throws Exception
+	  public virtual void testAltFillerToken()
+	  {
+		Analyzer @delegate = new AnalyzerAnonymousInnerClassHelper(this);
+
+		ShingleAnalyzerWrapper analyzer = new ShingleAnalyzerWrapper(@delegate, ShingleFilter.DEFAULT_MIN_SHINGLE_SIZE, ShingleFilter.DEFAULT_MAX_SHINGLE_SIZE, ShingleFilter.DEFAULT_TOKEN_SEPARATOR, true, false, "--");
+		assertAnalyzesTo(analyzer, "please divide into shingles", new string[] {"please", "please divide", "divide", "divide --", "-- shingles", "shingles"}, new int[] {0, 0, 7, 7, 19, 19}, new int[] {6, 13, 13, 19, 27, 27}, new int[] {1, 0, 1, 0, 1, 1});
+
+		analyzer = new ShingleAnalyzerWrapper(@delegate, ShingleFilter.DEFAULT_MIN_SHINGLE_SIZE, ShingleFilter.DEFAULT_MAX_SHINGLE_SIZE, ShingleFilter.DEFAULT_TOKEN_SEPARATOR, false, false, null);
+		assertAnalyzesTo(analyzer, "please divide into shingles", new string[] {"please divide", "divide ", " shingles"}, new int[] {0, 7, 19}, new int[] {13, 19, 27}, new int[] {1, 1, 1});
+
+		analyzer = new ShingleAnalyzerWrapper(@delegate, ShingleFilter.DEFAULT_MIN_SHINGLE_SIZE, ShingleFilter.DEFAULT_MAX_SHINGLE_SIZE, ShingleFilter.DEFAULT_TOKEN_SEPARATOR, false, false, "");
+		assertAnalyzesTo(analyzer, "please divide into shingles", new string[] {"please divide", "divide ", " shingles"}, new int[] {0, 7, 19}, new int[] {13, 19, 27}, new int[] {1, 1, 1});
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly ShingleAnalyzerWrapperTest outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper(ShingleAnalyzerWrapperTest outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			CharArraySet stopSet = StopFilter.makeStopSet(TEST_VERSION_CURRENT, "into");
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			TokenFilter filter = new StopFilter(TEST_VERSION_CURRENT, tokenizer, stopSet);
+			return new TokenStreamComponents(tokenizer, filter);
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testOutputUnigramsIfNoShinglesSingleToken() throws Exception
+	  public virtual void testOutputUnigramsIfNoShinglesSingleToken()
+	  {
+		ShingleAnalyzerWrapper analyzer = new ShingleAnalyzerWrapper(new MockAnalyzer(random(), MockTokenizer.WHITESPACE, false), ShingleFilter.DEFAULT_MIN_SHINGLE_SIZE, ShingleFilter.DEFAULT_MAX_SHINGLE_SIZE, "", false, true, ShingleFilter.DEFAULT_FILLER_TOKEN);
+		assertAnalyzesTo(analyzer, "please", new string[] {"please"}, new int[] {0}, new int[] {6}, new int[] {1});
+	  }
+	}
+
+}
\ No newline at end of file


[11/27] lucenenet git commit: adding converted analysis common tests

Posted by sy...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestScandinavianNormalizationFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestScandinavianNormalizationFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestScandinavianNormalizationFilter.cs
new file mode 100644
index 0000000..57a264b
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestScandinavianNormalizationFilter.cs
@@ -0,0 +1,154 @@
+namespace org.apache.lucene.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 KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+
+
+	public class TestScandinavianNormalizationFilter : BaseTokenStreamTestCase
+	{
+
+
+	  private Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper();
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  public AnalyzerAnonymousInnerClassHelper()
+		  {
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string field, Reader reader)
+		  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.Tokenizer tokenizer = new org.apache.lucene.analysis.MockTokenizer(reader, org.apache.lucene.analysis.MockTokenizer.WHITESPACE, false);
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.TokenStream stream = new ScandinavianNormalizationFilter(tokenizer);
+			TokenStream stream = new ScandinavianNormalizationFilter(tokenizer);
+			return new TokenStreamComponents(tokenizer, stream);
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void test() throws Exception
+	  public virtual void test()
+	  {
+
+		checkOneTerm(analyzer, "aeäaeeea", "æææeea"); // should not cause ArrayIndexOutOfBoundsException
+
+		checkOneTerm(analyzer, "aeäaeeeae", "æææeeæ");
+		checkOneTerm(analyzer, "aeaeeeae", "ææeeæ");
+
+		checkOneTerm(analyzer, "bøen", "bøen");
+		checkOneTerm(analyzer, "bOEen", "bØen");
+		checkOneTerm(analyzer, "åene", "åene");
+
+
+		checkOneTerm(analyzer, "blåbærsyltetøj", "blåbærsyltetøj");
+		checkOneTerm(analyzer, "blaabaersyltetöj", "blåbærsyltetøj");
+		checkOneTerm(analyzer, "räksmörgås", "ræksmørgås");
+		checkOneTerm(analyzer, "raeksmörgaos", "ræksmørgås");
+		checkOneTerm(analyzer, "raeksmörgaas", "ræksmørgås");
+		checkOneTerm(analyzer, "raeksmoergås", "ræksmørgås");
+
+
+		checkOneTerm(analyzer, "ab", "ab");
+		checkOneTerm(analyzer, "ob", "ob");
+		checkOneTerm(analyzer, "Ab", "Ab");
+		checkOneTerm(analyzer, "Ob", "Ob");
+
+		checkOneTerm(analyzer, "å", "å");
+
+		checkOneTerm(analyzer, "aa", "å");
+		checkOneTerm(analyzer, "aA", "å");
+		checkOneTerm(analyzer, "ao", "å");
+		checkOneTerm(analyzer, "aO", "å");
+
+		checkOneTerm(analyzer, "AA", "Å");
+		checkOneTerm(analyzer, "Aa", "Å");
+		checkOneTerm(analyzer, "Ao", "Å");
+		checkOneTerm(analyzer, "AO", "Å");
+
+		checkOneTerm(analyzer, "æ", "æ");
+		checkOneTerm(analyzer, "ä", "æ");
+
+		checkOneTerm(analyzer, "Æ", "Æ");
+		checkOneTerm(analyzer, "Ä", "Æ");
+
+		checkOneTerm(analyzer, "ae", "æ");
+		checkOneTerm(analyzer, "aE", "æ");
+
+		checkOneTerm(analyzer, "Ae", "Æ");
+		checkOneTerm(analyzer, "AE", "Æ");
+
+
+		checkOneTerm(analyzer, "ö", "ø");
+		checkOneTerm(analyzer, "ø", "ø");
+		checkOneTerm(analyzer, "Ö", "Ø");
+		checkOneTerm(analyzer, "Ø", "Ø");
+
+
+		checkOneTerm(analyzer, "oo", "ø");
+		checkOneTerm(analyzer, "oe", "ø");
+		checkOneTerm(analyzer, "oO", "ø");
+		checkOneTerm(analyzer, "oE", "ø");
+
+		checkOneTerm(analyzer, "Oo", "Ø");
+		checkOneTerm(analyzer, "Oe", "Ø");
+		checkOneTerm(analyzer, "OO", "Ø");
+		checkOneTerm(analyzer, "OE", "Ø");
+	  }
+
+	  /// <summary>
+	  /// check that the empty string doesn't cause issues </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws Exception
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper2(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestScandinavianNormalizationFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestScandinavianNormalizationFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new ScandinavianNormalizationFilter(tokenizer));
+		  }
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomData() throws Exception
+	  public virtual void testRandomData()
+	  {
+		checkRandomData(random(), analyzer, 1000 * RANDOM_MULTIPLIER);
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestScandinavianNormalizationFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestScandinavianNormalizationFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestScandinavianNormalizationFilterFactory.cs
new file mode 100644
index 0000000..e4a1b09
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestScandinavianNormalizationFilterFactory.cs
@@ -0,0 +1,53 @@
+namespace org.apache.lucene.analysis.miscellaneous
+{
+
+	/// <summary>
+	/// Copyright 2004 The Apache Software Foundation
+	/// 
+	/// Licensed 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>
+
+	using BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+
+	public class TestScandinavianNormalizationFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStemming() throws Exception
+	  public virtual void testStemming()
+	  {
+		Reader reader = new StringReader("räksmörgås");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("ScandinavianNormalization").create(stream);
+		assertTokenStreamContents(stream, new string[] {"ræksmørgås"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("ScandinavianNormalization", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestSingleTokenTokenFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestSingleTokenTokenFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestSingleTokenTokenFilter.cs
new file mode 100644
index 0000000..7781dc4
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestSingleTokenTokenFilter.cs
@@ -0,0 +1,52 @@
+namespace org.apache.lucene.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 LuceneTestCase = org.apache.lucene.util.LuceneTestCase;
+	using AttributeImpl = org.apache.lucene.util.AttributeImpl;
+	using CharTermAttribute = org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
+
+	public class TestSingleTokenTokenFilter : LuceneTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void test() throws java.io.IOException
+	  public virtual void test()
+	  {
+		Token token = new Token();
+		SingleTokenTokenStream ts = new SingleTokenTokenStream(token);
+		AttributeImpl tokenAtt = (AttributeImpl) ts.addAttribute(typeof(CharTermAttribute));
+		assertTrue(tokenAtt is Token);
+		ts.reset();
+
+		assertTrue(ts.incrementToken());
+		assertEquals(token, tokenAtt);
+		assertFalse(ts.incrementToken());
+
+		token = new Token("hallo", 10, 20, "someType");
+		ts.Token = token;
+		ts.reset();
+
+		assertTrue(ts.incrementToken());
+		assertEquals(token, tokenAtt);
+		assertFalse(ts.incrementToken());
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestStemmerOverrideFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestStemmerOverrideFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestStemmerOverrideFilter.cs
new file mode 100644
index 0000000..d28bfae
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestStemmerOverrideFilter.cs
@@ -0,0 +1,157 @@
+using System.Collections.Generic;
+using System.Text;
+
+namespace org.apache.lucene.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 KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+	using WhitespaceTokenizer = org.apache.lucene.analysis.core.WhitespaceTokenizer;
+	using PorterStemFilter = org.apache.lucene.analysis.en.PorterStemFilter;
+	using StemmerOverrideMap = org.apache.lucene.analysis.miscellaneous.StemmerOverrideFilter.StemmerOverrideMap;
+	using TestUtil = org.apache.lucene.util.TestUtil;
+
+	/// 
+	public class TestStemmerOverrideFilter : BaseTokenStreamTestCase
+	{
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testOverride() throws java.io.IOException
+	  public virtual void testOverride()
+	  {
+		// lets make booked stem to books
+		// the override filter will convert "booked" to "books",
+		// but also mark it with KeywordAttribute so Porter will not change it.
+		StemmerOverrideFilter.Builder builder = new StemmerOverrideFilter.Builder();
+		builder.add("booked", "books");
+		Tokenizer tokenizer = new KeywordTokenizer(new StringReader("booked"));
+		TokenStream stream = new PorterStemFilter(new StemmerOverrideFilter(tokenizer, builder.build()));
+		assertTokenStreamContents(stream, new string[] {"books"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testIgnoreCase() throws java.io.IOException
+	  public virtual void testIgnoreCase()
+	  {
+		// lets make booked stem to books
+		// the override filter will convert "booked" to "books",
+		// but also mark it with KeywordAttribute so Porter will not change it.
+		StemmerOverrideFilter.Builder builder = new StemmerOverrideFilter.Builder(true);
+		builder.add("boOkEd", "books");
+		Tokenizer tokenizer = new KeywordTokenizer(new StringReader("BooKeD"));
+		TokenStream stream = new PorterStemFilter(new StemmerOverrideFilter(tokenizer, builder.build()));
+		assertTokenStreamContents(stream, new string[] {"books"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNoOverrides() throws java.io.IOException
+	  public virtual void testNoOverrides()
+	  {
+		StemmerOverrideFilter.Builder builder = new StemmerOverrideFilter.Builder(true);
+		Tokenizer tokenizer = new KeywordTokenizer(new StringReader("book"));
+		TokenStream stream = new PorterStemFilter(new StemmerOverrideFilter(tokenizer, builder.build()));
+		assertTokenStreamContents(stream, new string[] {"book"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomRealisticWhiteSpace() throws java.io.IOException
+	  public virtual void testRandomRealisticWhiteSpace()
+	  {
+		IDictionary<string, string> map = new Dictionary<string, string>();
+		int numTerms = atLeast(50);
+		for (int i = 0; i < numTerms; i++)
+		{
+		  string randomRealisticUnicodeString = TestUtil.randomRealisticUnicodeString(random());
+		  char[] charArray = randomRealisticUnicodeString.ToCharArray();
+		  StringBuilder builder = new StringBuilder();
+		  for (int j = 0; j < charArray.Length;)
+		  {
+			int cp = char.codePointAt(charArray, j, charArray.Length);
+			if (!char.IsWhiteSpace(cp))
+			{
+			  builder.appendCodePoint(cp);
+			}
+			j += char.charCount(cp);
+		  }
+		  if (builder.Length > 0)
+		  {
+			string value = TestUtil.randomSimpleString(random());
+			map[builder.ToString()] = value.Length == 0 ? "a" : value;
+
+		  }
+		}
+		if (map.Count == 0)
+		{
+		  map["booked"] = "books";
+		}
+		StemmerOverrideFilter.Builder builder = new StemmerOverrideFilter.Builder(random().nextBoolean());
+		ISet<KeyValuePair<string, string>> entrySet = map.SetOfKeyValuePairs();
+		StringBuilder input = new StringBuilder();
+		IList<string> output = new List<string>();
+		foreach (KeyValuePair<string, string> entry in entrySet)
+		{
+		  builder.add(entry.Key, entry.Value);
+		  if (random().nextBoolean() || output.Count == 0)
+		  {
+			input.Append(entry.Key).Append(" ");
+			output.Add(entry.Value);
+		  }
+		}
+		Tokenizer tokenizer = new WhitespaceTokenizer(TEST_VERSION_CURRENT, new StringReader(input.ToString()));
+		TokenStream stream = new PorterStemFilter(new StemmerOverrideFilter(tokenizer, builder.build()));
+		assertTokenStreamContents(stream, output.ToArray());
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomRealisticKeyword() throws java.io.IOException
+	  public virtual void testRandomRealisticKeyword()
+	  {
+		IDictionary<string, string> map = new Dictionary<string, string>();
+		int numTerms = atLeast(50);
+		for (int i = 0; i < numTerms; i++)
+		{
+		  string randomRealisticUnicodeString = TestUtil.randomRealisticUnicodeString(random());
+		  if (randomRealisticUnicodeString.Length > 0)
+		  {
+			string value = TestUtil.randomSimpleString(random());
+			map[randomRealisticUnicodeString] = value.Length == 0 ? "a" : value;
+		  }
+		}
+		if (map.Count == 0)
+		{
+		  map["booked"] = "books";
+		}
+		StemmerOverrideFilter.Builder builder = new StemmerOverrideFilter.Builder(random().nextBoolean());
+		ISet<KeyValuePair<string, string>> entrySet = map.SetOfKeyValuePairs();
+		foreach (KeyValuePair<string, string> entry in entrySet)
+		{
+		  builder.add(entry.Key, entry.Value);
+		}
+		StemmerOverrideMap build = builder.build();
+		foreach (KeyValuePair<string, string> entry in entrySet)
+		{
+		  if (random().nextBoolean())
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(new StringReader(entry.Key));
+			TokenStream stream = new PorterStemFilter(new StemmerOverrideFilter(tokenizer, build));
+			assertTokenStreamContents(stream, new string[] {entry.Value});
+		  }
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestStemmerOverrideFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestStemmerOverrideFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestStemmerOverrideFilterFactory.cs
new file mode 100644
index 0000000..68abb57
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestStemmerOverrideFilterFactory.cs
@@ -0,0 +1,73 @@
+namespace org.apache.lucene.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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+	using StringMockResourceLoader = org.apache.lucene.analysis.util.StringMockResourceLoader;
+
+	/// <summary>
+	/// Simple tests to ensure the stemmer override filter factory is working.
+	/// </summary>
+	public class TestStemmerOverrideFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testKeywords() throws Exception
+	  public virtual void testKeywords()
+	  {
+		// our stemdict stems dogs to 'cat'
+		Reader reader = new StringReader("testing dogs");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("StemmerOverride", TEST_VERSION_CURRENT, new StringMockResourceLoader("dogs\tcat"), "dictionary", "stemdict.txt").create(stream);
+		stream = tokenFilterFactory("PorterStem").create(stream);
+
+		assertTokenStreamContents(stream, new string[] {"test", "cat"});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testKeywordsCaseInsensitive() throws Exception
+	  public virtual void testKeywordsCaseInsensitive()
+	  {
+		Reader reader = new StringReader("testing DoGs");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("StemmerOverride", TEST_VERSION_CURRENT, new StringMockResourceLoader("dogs\tcat"), "dictionary", "stemdict.txt", "ignoreCase", "true").create(stream);
+		stream = tokenFilterFactory("PorterStem").create(stream);
+
+		assertTokenStreamContents(stream, new string[] {"test", "cat"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("StemmerOverride", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestTrimFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestTrimFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestTrimFilter.cs
new file mode 100644
index 0000000..3d394c5
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestTrimFilter.cs
@@ -0,0 +1,180 @@
+using System;
+using System.Collections.Generic;
+
+/*
+ * 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 org.apache.lucene.analysis.miscellaneous
+{
+
+
+	using KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+	using org.apache.lucene.analysis.tokenattributes;
+	using Version = org.apache.lucene.util.Version;
+
+	public class TestTrimFilter : BaseTokenStreamTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTrim() throws Exception
+	  public virtual void testTrim()
+	  {
+		char[] a = " a ".ToCharArray();
+		char[] b = "b   ".ToCharArray();
+		char[] ccc = "cCc".ToCharArray();
+		char[] whitespace = "   ".ToCharArray();
+		char[] empty = "".ToCharArray();
+
+		TokenStream ts = new IterTokenStream(new Token(a, 0, a.Length, 1, 5), new Token(b, 0, b.Length, 6, 10), new Token(ccc, 0, ccc.Length, 11, 15), new Token(whitespace, 0, whitespace.Length, 16, 20), new Token(empty, 0, empty.Length, 21, 21));
+		ts = new TrimFilter(TEST_VERSION_CURRENT, ts, false);
+
+		assertTokenStreamContents(ts, new string[] {"a", "b", "cCc", "", ""});
+
+		a = " a".ToCharArray();
+		b = "b ".ToCharArray();
+		ccc = " c ".ToCharArray();
+		whitespace = "   ".ToCharArray();
+		ts = new IterTokenStream(new Token(a, 0, a.Length, 0, 2), new Token(b, 0, b.Length, 0, 2), new Token(ccc, 0, ccc.Length, 0, 3), new Token(whitespace, 0, whitespace.Length, 0, 3));
+		ts = new TrimFilter(Version.LUCENE_43, ts, true);
+
+		assertTokenStreamContents(ts, new string[] {"a", "b", "c", ""}, new int[] {1, 0, 1, 3}, new int[] {2, 1, 2, 3}, null, new int[] {1, 1, 1, 1}, null, null, false);
+	  }
+
+	  /// @deprecated (3.0) does not support custom attributes 
+	  [Obsolete("(3.0) does not support custom attributes")]
+	  private class IterTokenStream : TokenStream
+	  {
+		internal readonly Token[] tokens;
+		internal int index = 0;
+		internal CharTermAttribute termAtt = addAttribute(typeof(CharTermAttribute));
+		internal OffsetAttribute offsetAtt = addAttribute(typeof(OffsetAttribute));
+		internal PositionIncrementAttribute posIncAtt = addAttribute(typeof(PositionIncrementAttribute));
+		internal FlagsAttribute flagsAtt = addAttribute(typeof(FlagsAttribute));
+		internal TypeAttribute typeAtt = addAttribute(typeof(TypeAttribute));
+		internal PayloadAttribute payloadAtt = addAttribute(typeof(PayloadAttribute));
+
+		public IterTokenStream(params Token[] tokens) : base()
+		{
+		  this.tokens = tokens;
+		}
+
+		public IterTokenStream(ICollection<Token> tokens) : this(tokens.toArray(new Token[tokens.Count]))
+		{
+		}
+
+//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 (index >= tokens.Length)
+		  {
+			return false;
+		  }
+		  else
+		  {
+			clearAttributes();
+			Token token = tokens[index++];
+			termAtt.setEmpty().append(token);
+			offsetAtt.setOffset(token.startOffset(), token.endOffset());
+			posIncAtt.PositionIncrement = token.PositionIncrement;
+			flagsAtt.Flags = token.Flags;
+			typeAtt.Type = token.type();
+			payloadAtt.Payload = token.Payload;
+			return true;
+		  }
+		}
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper(this);
+		checkRandomData(random(), a, 1000 * RANDOM_MULTIPLIER);
+
+		Analyzer b = new AnalyzerAnonymousInnerClassHelper2(this);
+		checkRandomData(random(), b, 1000 * RANDOM_MULTIPLIER);
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestTrimFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestTrimFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.KEYWORD, false);
+			return new TokenStreamComponents(tokenizer, new TrimFilter(Version.LUCENE_43, tokenizer, true));
+		  }
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestTrimFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestTrimFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.KEYWORD, false);
+			return new TokenStreamComponents(tokenizer, new TrimFilter(TEST_VERSION_CURRENT, tokenizer, false));
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper3(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper3 : Analyzer
+	  {
+		  private readonly TestTrimFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper3(TestTrimFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final boolean updateOffsets = random().nextBoolean();
+			bool updateOffsets = random().nextBoolean();
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.util.Version version = updateOffsets ? org.apache.lucene.util.Version.LUCENE_43 : TEST_VERSION_CURRENT;
+			Version version = updateOffsets ? Version.LUCENE_43 : TEST_VERSION_CURRENT;
+			return new TokenStreamComponents(tokenizer, new TrimFilter(version, tokenizer, updateOffsets));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestTrimFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestTrimFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestTrimFilterFactory.cs
new file mode 100644
index 0000000..8d703bf
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestTrimFilterFactory.cs
@@ -0,0 +1,57 @@
+namespace org.apache.lucene.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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure this factory is working
+	/// </summary>
+	public class TestTrimFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTrimming() throws Exception
+	  public virtual void testTrimming()
+	  {
+		Reader reader = new StringReader("trim me    ");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.KEYWORD, false);
+		stream = tokenFilterFactory("Trim").create(stream);
+		assertTokenStreamContents(stream, new string[] {"trim me"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("Trim", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestTruncateTokenFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestTruncateTokenFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestTruncateTokenFilter.cs
new file mode 100644
index 0000000..eb84659
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestTruncateTokenFilter.cs
@@ -0,0 +1,47 @@
+namespace org.apache.lucene.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 Test = org.junit.Test;
+
+	/// <summary>
+	/// Test the truncate token filter.
+	/// </summary>
+	public class TestTruncateTokenFilter : BaseTokenStreamTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTruncating() throws Exception
+	  public virtual void testTruncating()
+	  {
+		TokenStream stream = new MockTokenizer(new StringReader("abcdefg 1234567 ABCDEFG abcde abc 12345 123"), MockTokenizer.WHITESPACE, false);
+		stream = new TruncateTokenFilter(stream, 5);
+		assertTokenStreamContents(stream, new string[]{"abcde", "12345", "ABCDE", "abcde", "abc", "12345", "123"});
+	  }
+
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @Test(expected = IllegalArgumentException.class) public void testNonPositiveLength() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public virtual void testNonPositiveLength()
+	  {
+		new TruncateTokenFilter(new MockTokenizer(new StringReader("length must be a positive number")), -48);
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestTruncateTokenFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestTruncateTokenFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestTruncateTokenFilterFactory.cs
new file mode 100644
index 0000000..9b647f0
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestTruncateTokenFilterFactory.cs
@@ -0,0 +1,81 @@
+namespace org.apache.lucene.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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+
+	/// <summary>
+	/// Simple tests to ensure the simple truncation filter factory is working.
+	/// </summary>
+	public class TestTruncateTokenFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+	  /// <summary>
+	  /// Ensure the filter actually truncates text.
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testTruncating() throws Exception
+	  public virtual void testTruncating()
+	  {
+		Reader reader = new StringReader("abcdefg 1234567 ABCDEFG abcde abc 12345 123");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("Truncate", TruncateTokenFilterFactory.PREFIX_LENGTH_KEY, "5").create(stream);
+		assertTokenStreamContents(stream, new string[]{"abcde", "12345", "ABCDE", "abcde", "abc", "12345", "123"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("Truncate", TruncateTokenFilterFactory.PREFIX_LENGTH_KEY, "5", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameter(s):"));
+		}
+	  }
+
+	  /// <summary>
+	  /// Test that negative prefix length result in exception
+	  /// </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testNonPositivePrefixLengthArgument() throws Exception
+	  public virtual void testNonPositivePrefixLengthArgument()
+	  {
+		try
+		{
+		  tokenFilterFactory("Truncate", TruncateTokenFilterFactory.PREFIX_LENGTH_KEY, "-5");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains(TruncateTokenFilterFactory.PREFIX_LENGTH_KEY + " parameter must be a positive number: -5"));
+		}
+	  }
+	}
+
+
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestWordDelimiterFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestWordDelimiterFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestWordDelimiterFilter.cs
new file mode 100644
index 0000000..f646d02
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestWordDelimiterFilter.cs
@@ -0,0 +1,568 @@
+using System;
+using System.Collections.Generic;
+
+/*
+ * 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 org.apache.lucene.analysis.miscellaneous
+{
+
+	using org.apache.lucene.analysis;
+	using TokenStreamComponents = org.apache.lucene.analysis.Analyzer.TokenStreamComponents;
+	using KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+	using StopFilter = org.apache.lucene.analysis.core.StopFilter;
+	using CzechStemFilter = org.apache.lucene.analysis.cz.CzechStemFilter;
+	using StandardAnalyzer = org.apache.lucene.analysis.standard.StandardAnalyzer;
+	using PositionIncrementAttribute = org.apache.lucene.analysis.tokenattributes.PositionIncrementAttribute;
+	using CharTermAttribute = org.apache.lucene.analysis.tokenattributes.CharTermAttribute;
+	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+	using Test = org.junit.Test;
+
+
+//JAVA TO C# CONVERTER TODO TASK: This Java 'import static' statement cannot be converted to C#:
+//	import static org.apache.lucene.analysis.miscellaneous.WordDelimiterFilter.*;
+//JAVA TO C# CONVERTER TODO TASK: This Java 'import static' statement cannot be converted to C#:
+//	import static org.apache.lucene.analysis.miscellaneous.WordDelimiterIterator.DEFAULT_WORD_DELIM_TABLE;
+
+	/// <summary>
+	/// New WordDelimiterFilter tests... most of the tests are in ConvertedLegacyTest
+	/// TODO: should explicitly test things like protWords and not rely on
+	/// the factory tests in Solr.
+	/// </summary>
+	public class TestWordDelimiterFilter : BaseTokenStreamTestCase
+	{
+
+	  /// <summary>
+	  ///*
+	  /// public void testPerformance() throws IOException {
+	  ///  String s = "now is the time-for all good men to come to-the aid of their country.";
+	  ///  Token tok = new Token();
+	  ///  long start = System.currentTimeMillis();
+	  ///  int ret=0;
+	  ///  for (int i=0; i<1000000; i++) {
+	  ///    StringReader r = new StringReader(s);
+	  ///    TokenStream ts = new WhitespaceTokenizer(r);
+	  ///    ts = new WordDelimiterFilter(ts, 1,1,1,1,0);
+	  /// 
+	  ///    while (ts.next(tok) != null) ret++;
+	  ///  }
+	  /// 
+	  ///  System.out.println("ret="+ret+" time="+(System.currentTimeMillis()-start));
+	  /// }
+	  /// **
+	  /// </summary>
+
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @Test public void testOffsets() throws java.io.IOException
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public virtual void testOffsets()
+	  {
+		int flags = GENERATE_WORD_PARTS | GENERATE_NUMBER_PARTS | CATENATE_ALL | SPLIT_ON_CASE_CHANGE | SPLIT_ON_NUMERICS | STEM_ENGLISH_POSSESSIVE;
+		// test that subwords and catenated subwords have
+		// the correct offsets.
+		WordDelimiterFilter wdf = new WordDelimiterFilter(TEST_VERSION_CURRENT, new SingleTokenTokenStream(new Token("foo-bar", 5, 12)), DEFAULT_WORD_DELIM_TABLE, flags, null);
+
+		assertTokenStreamContents(wdf, new string[] {"foo", "foobar", "bar"}, new int[] {5, 5, 9}, new int[] {8, 12, 12});
+
+		wdf = new WordDelimiterFilter(TEST_VERSION_CURRENT, new SingleTokenTokenStream(new Token("foo-bar", 5, 6)), DEFAULT_WORD_DELIM_TABLE, flags, null);
+
+		assertTokenStreamContents(wdf, new string[] {"foo", "bar", "foobar"}, new int[] {5, 5, 5}, new int[] {6, 6, 6});
+	  }
+
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @Test public void testOffsetChange() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public virtual void testOffsetChange()
+	  {
+		int flags = GENERATE_WORD_PARTS | GENERATE_NUMBER_PARTS | CATENATE_ALL | SPLIT_ON_CASE_CHANGE | SPLIT_ON_NUMERICS | STEM_ENGLISH_POSSESSIVE;
+		WordDelimiterFilter wdf = new WordDelimiterFilter(TEST_VERSION_CURRENT, new SingleTokenTokenStream(new Token("übelkeit)", 7, 16)), DEFAULT_WORD_DELIM_TABLE, flags, null);
+
+		assertTokenStreamContents(wdf, new string[] {"übelkeit"}, new int[] {7}, new int[] {15});
+	  }
+
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @Test public void testOffsetChange2() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public virtual void testOffsetChange2()
+	  {
+		int flags = GENERATE_WORD_PARTS | GENERATE_NUMBER_PARTS | CATENATE_ALL | SPLIT_ON_CASE_CHANGE | SPLIT_ON_NUMERICS | STEM_ENGLISH_POSSESSIVE;
+		WordDelimiterFilter wdf = new WordDelimiterFilter(TEST_VERSION_CURRENT, new SingleTokenTokenStream(new Token("(übelkeit", 7, 17)), DEFAULT_WORD_DELIM_TABLE, flags, null);
+
+		assertTokenStreamContents(wdf, new string[] {"übelkeit"}, new int[] {8}, new int[] {17});
+	  }
+
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @Test public void testOffsetChange3() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public virtual void testOffsetChange3()
+	  {
+		int flags = GENERATE_WORD_PARTS | GENERATE_NUMBER_PARTS | CATENATE_ALL | SPLIT_ON_CASE_CHANGE | SPLIT_ON_NUMERICS | STEM_ENGLISH_POSSESSIVE;
+		WordDelimiterFilter wdf = new WordDelimiterFilter(TEST_VERSION_CURRENT, new SingleTokenTokenStream(new Token("(übelkeit", 7, 16)), DEFAULT_WORD_DELIM_TABLE, flags, null);
+
+		assertTokenStreamContents(wdf, new string[] {"übelkeit"}, new int[] {8}, new int[] {16});
+	  }
+
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @Test public void testOffsetChange4() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public virtual void testOffsetChange4()
+	  {
+		int flags = GENERATE_WORD_PARTS | GENERATE_NUMBER_PARTS | CATENATE_ALL | SPLIT_ON_CASE_CHANGE | SPLIT_ON_NUMERICS | STEM_ENGLISH_POSSESSIVE;
+		WordDelimiterFilter wdf = new WordDelimiterFilter(TEST_VERSION_CURRENT, new SingleTokenTokenStream(new Token("(foo,bar)", 7, 16)), DEFAULT_WORD_DELIM_TABLE, flags, null);
+
+		assertTokenStreamContents(wdf, new string[] {"foo", "foobar", "bar"}, new int[] {8, 8, 12}, new int[] {11, 15, 15});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void doSplit(final String input, String... output) throws Exception
+//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
+	  public virtual void doSplit(string input, params string[] output)
+	  {
+		int flags = GENERATE_WORD_PARTS | GENERATE_NUMBER_PARTS | SPLIT_ON_CASE_CHANGE | SPLIT_ON_NUMERICS | STEM_ENGLISH_POSSESSIVE;
+		WordDelimiterFilter wdf = new WordDelimiterFilter(TEST_VERSION_CURRENT, new MockTokenizer(new StringReader(input), MockTokenizer.KEYWORD, false), WordDelimiterIterator.DEFAULT_WORD_DELIM_TABLE, flags, null);
+
+		assertTokenStreamContents(wdf, output);
+	  }
+
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @Test public void testSplits() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public virtual void testSplits()
+	  {
+		doSplit("basic-split","basic","split");
+		doSplit("camelCase","camel","Case");
+
+		// non-space marking symbol shouldn't cause split
+		// this is an example in Thai    
+		doSplit("\u0e1a\u0e49\u0e32\u0e19","\u0e1a\u0e49\u0e32\u0e19");
+		// possessive followed by delimiter
+		doSplit("test's'", "test");
+
+		// some russian upper and lowercase
+		doSplit("Роберт", "Роберт");
+		// now cause a split (russian camelCase)
+		doSplit("РобЕрт", "Роб", "Ерт");
+
+		// a composed titlecase character, don't split
+		doSplit("aDžungla", "aDžungla");
+
+		// a modifier letter, don't split
+		doSplit("ســـــــــــــــــلام", "ســـــــــــــــــلام");
+
+		// enclosing mark, don't split
+		doSplit("test⃝", "test⃝");
+
+		// combining spacing mark (the virama), don't split
+		doSplit("हिन्दी", "हिन्दी");
+
+		// don't split non-ascii digits
+		doSplit("١٢٣٤", "١٢٣٤");
+
+		// don't split supplementaries into unpaired surrogates
+		doSplit("𠀀𠀀", "𠀀𠀀");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void doSplitPossessive(int stemPossessive, final String input, final String... output) throws Exception
+//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
+	  public virtual void doSplitPossessive(int stemPossessive, string input, params string[] output)
+	  {
+		int flags = GENERATE_WORD_PARTS | GENERATE_NUMBER_PARTS | SPLIT_ON_CASE_CHANGE | SPLIT_ON_NUMERICS;
+		flags |= (stemPossessive == 1) ? STEM_ENGLISH_POSSESSIVE : 0;
+		WordDelimiterFilter wdf = new WordDelimiterFilter(TEST_VERSION_CURRENT, new MockTokenizer(new StringReader(input), MockTokenizer.KEYWORD, false), flags, null);
+
+		assertTokenStreamContents(wdf, output);
+	  }
+
+	  /*
+	   * Test option that allows disabling the special "'s" stemming, instead treating the single quote like other delimiters. 
+	   */
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @Test public void testPossessives() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public virtual void testPossessives()
+	  {
+		doSplitPossessive(1, "ra's", "ra");
+		doSplitPossessive(0, "ra's", "ra", "s");
+	  }
+
+	  /*
+	   * Set a large position increment gap of 10 if the token is "largegap" or "/"
+	   */
+	  private sealed class LargePosIncTokenFilter : TokenFilter
+	  {
+		  private readonly TestWordDelimiterFilter outerInstance;
+
+		internal CharTermAttribute termAtt = addAttribute(typeof(CharTermAttribute));
+		internal PositionIncrementAttribute posIncAtt = addAttribute(typeof(PositionIncrementAttribute));
+
+		protected internal LargePosIncTokenFilter(TestWordDelimiterFilter outerInstance, TokenStream input) : base(input)
+		{
+			this.outerInstance = outerInstance;
+		}
+
+//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())
+		  {
+			if (termAtt.ToString().Equals("largegap") || termAtt.ToString().Equals("/"))
+			{
+			  posIncAtt.PositionIncrement = 10;
+			}
+			return true;
+		  }
+		  else
+		  {
+			return false;
+		  }
+		}
+	  }
+
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @Test public void testPositionIncrements() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public virtual void testPositionIncrements()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int flags = GENERATE_WORD_PARTS | GENERATE_NUMBER_PARTS | CATENATE_ALL | SPLIT_ON_CASE_CHANGE | SPLIT_ON_NUMERICS | STEM_ENGLISH_POSSESSIVE;
+		int flags = GENERATE_WORD_PARTS | GENERATE_NUMBER_PARTS | CATENATE_ALL | SPLIT_ON_CASE_CHANGE | SPLIT_ON_NUMERICS | STEM_ENGLISH_POSSESSIVE;
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.util.CharArraySet protWords = new org.apache.lucene.analysis.util.CharArraySet(TEST_VERSION_CURRENT, new HashSet<>(Arrays.asList("NUTCH")), false);
+		CharArraySet protWords = new CharArraySet(TEST_VERSION_CURRENT, new HashSet<>("NUTCH"), false);
+
+		/* analyzer that uses whitespace + wdf */
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper(this, flags, protWords);
+
+		/* in this case, works as expected. */
+		assertAnalyzesTo(a, "LUCENE / SOLR", new string[] {"LUCENE", "SOLR"}, new int[] {0, 9}, new int[] {6, 13}, new int[] {1, 1});
+
+		/* only in this case, posInc of 2 ?! */
+		assertAnalyzesTo(a, "LUCENE / solR", new string[] {"LUCENE", "sol", "solR", "R"}, new int[] {0, 9, 9, 12}, new int[] {6, 12, 13, 13}, new int[] {1, 1, 0, 1});
+
+		assertAnalyzesTo(a, "LUCENE / NUTCH SOLR", new string[] {"LUCENE", "NUTCH", "SOLR"}, new int[] {0, 9, 15}, new int[] {6, 14, 19}, new int[] {1, 1, 1});
+
+		/* analyzer that will consume tokens with large position increments */
+		Analyzer a2 = new AnalyzerAnonymousInnerClassHelper2(this, flags, protWords);
+
+		/* increment of "largegap" is preserved */
+		assertAnalyzesTo(a2, "LUCENE largegap SOLR", new string[] {"LUCENE", "largegap", "SOLR"}, new int[] {0, 7, 16}, new int[] {6, 15, 20}, new int[] {1, 10, 1});
+
+		/* the "/" had a position increment of 10, where did it go?!?!! */
+		assertAnalyzesTo(a2, "LUCENE / SOLR", new string[] {"LUCENE", "SOLR"}, new int[] {0, 9}, new int[] {6, 13}, new int[] {1, 11});
+
+		/* in this case, the increment of 10 from the "/" is carried over */
+		assertAnalyzesTo(a2, "LUCENE / solR", new string[] {"LUCENE", "sol", "solR", "R"}, new int[] {0, 9, 9, 12}, new int[] {6, 12, 13, 13}, new int[] {1, 11, 0, 1});
+
+		assertAnalyzesTo(a2, "LUCENE / NUTCH SOLR", new string[] {"LUCENE", "NUTCH", "SOLR"}, new int[] {0, 9, 15}, new int[] {6, 14, 19}, new int[] {1, 11, 1});
+
+		Analyzer a3 = new AnalyzerAnonymousInnerClassHelper3(this, flags, protWords);
+
+		assertAnalyzesTo(a3, "lucene.solr", new string[] {"lucene", "lucenesolr", "solr"}, new int[] {0, 0, 7}, new int[] {6, 11, 11}, new int[] {1, 0, 1});
+
+		/* the stopword should add a gap here */
+		assertAnalyzesTo(a3, "the lucene.solr", new string[] {"lucene", "lucenesolr", "solr"}, new int[] {4, 4, 11}, new int[] {10, 15, 15}, new int[] {2, 0, 1});
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestWordDelimiterFilter outerInstance;
+
+		  private int flags;
+		  private CharArraySet protWords;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestWordDelimiterFilter outerInstance, int flags, CharArraySet protWords)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.flags = flags;
+			  this.protWords = protWords;
+		  }
+
+		  public override TokenStreamComponents createComponents(string field, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(tokenizer, new WordDelimiterFilter(TEST_VERSION_CURRENT, tokenizer, flags, protWords));
+		  }
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestWordDelimiterFilter outerInstance;
+
+		  private int flags;
+		  private CharArraySet protWords;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestWordDelimiterFilter outerInstance, int flags, CharArraySet protWords)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.flags = flags;
+			  this.protWords = protWords;
+		  }
+
+		  public override TokenStreamComponents createComponents(string field, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(tokenizer, new WordDelimiterFilter(TEST_VERSION_CURRENT, new LargePosIncTokenFilter(outerInstance, tokenizer), flags, protWords));
+		  }
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper3 : Analyzer
+	  {
+		  private readonly TestWordDelimiterFilter outerInstance;
+
+		  private int flags;
+		  private CharArraySet protWords;
+
+		  public AnalyzerAnonymousInnerClassHelper3(TestWordDelimiterFilter outerInstance, int flags, CharArraySet protWords)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.flags = flags;
+			  this.protWords = protWords;
+		  }
+
+		  public override TokenStreamComponents createComponents(string field, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			StopFilter filter = new StopFilter(TEST_VERSION_CURRENT, tokenizer, StandardAnalyzer.STOP_WORDS_SET);
+			return new TokenStreamComponents(tokenizer, new WordDelimiterFilter(TEST_VERSION_CURRENT, filter, flags, protWords));
+		  }
+	  }
+
+	  /// <summary>
+	  /// concat numbers + words + all </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testLotsOfConcatenating() throws Exception
+	  public virtual void testLotsOfConcatenating()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int flags = GENERATE_WORD_PARTS | GENERATE_NUMBER_PARTS | CATENATE_WORDS | CATENATE_NUMBERS | CATENATE_ALL | SPLIT_ON_CASE_CHANGE | SPLIT_ON_NUMERICS | STEM_ENGLISH_POSSESSIVE;
+		int flags = GENERATE_WORD_PARTS | GENERATE_NUMBER_PARTS | CATENATE_WORDS | CATENATE_NUMBERS | CATENATE_ALL | SPLIT_ON_CASE_CHANGE | SPLIT_ON_NUMERICS | STEM_ENGLISH_POSSESSIVE;
+
+		/* analyzer that uses whitespace + wdf */
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper4(this, flags);
+
+		assertAnalyzesTo(a, "abc-def-123-456", new string[] {"abc", "abcdef", "abcdef123456", "def", "123", "123456", "456"}, new int[] {0, 0, 0, 4, 8, 8, 12}, new int[] {3, 7, 15, 7, 11, 15, 15}, new int[] {1, 0, 0, 1, 1, 0, 1});
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper4 : Analyzer
+	  {
+		  private readonly TestWordDelimiterFilter outerInstance;
+
+		  private int flags;
+
+		  public AnalyzerAnonymousInnerClassHelper4(TestWordDelimiterFilter outerInstance, int flags)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.flags = flags;
+		  }
+
+		  public override TokenStreamComponents createComponents(string field, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(tokenizer, new WordDelimiterFilter(TEST_VERSION_CURRENT, tokenizer, flags, null));
+		  }
+	  }
+
+	  /// <summary>
+	  /// concat numbers + words + all + preserve original </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testLotsOfConcatenating2() throws Exception
+	  public virtual void testLotsOfConcatenating2()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int flags = PRESERVE_ORIGINAL | GENERATE_WORD_PARTS | GENERATE_NUMBER_PARTS | CATENATE_WORDS | CATENATE_NUMBERS | CATENATE_ALL | SPLIT_ON_CASE_CHANGE | SPLIT_ON_NUMERICS | STEM_ENGLISH_POSSESSIVE;
+		int flags = PRESERVE_ORIGINAL | GENERATE_WORD_PARTS | GENERATE_NUMBER_PARTS | CATENATE_WORDS | CATENATE_NUMBERS | CATENATE_ALL | SPLIT_ON_CASE_CHANGE | SPLIT_ON_NUMERICS | STEM_ENGLISH_POSSESSIVE;
+
+		/* analyzer that uses whitespace + wdf */
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper5(this, flags);
+
+		assertAnalyzesTo(a, "abc-def-123-456", new string[] {"abc-def-123-456", "abc", "abcdef", "abcdef123456", "def", "123", "123456", "456"}, new int[] {0, 0, 0, 0, 4, 8, 8, 12}, new int[] {15, 3, 7, 15, 7, 11, 15, 15}, new int[] {1, 0, 0, 0, 1, 1, 0, 1});
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper5 : Analyzer
+	  {
+		  private readonly TestWordDelimiterFilter outerInstance;
+
+		  private int flags;
+
+		  public AnalyzerAnonymousInnerClassHelper5(TestWordDelimiterFilter outerInstance, int flags)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.flags = flags;
+		  }
+
+		  public override TokenStreamComponents createComponents(string field, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(tokenizer, new WordDelimiterFilter(TEST_VERSION_CURRENT, tokenizer, flags, null));
+		  }
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		int numIterations = atLeast(5);
+		for (int i = 0; i < numIterations; i++)
+		{
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int flags = random().nextInt(512);
+		  int flags = random().Next(512);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.util.CharArraySet protectedWords;
+		  CharArraySet protectedWords;
+		  if (random().nextBoolean())
+		  {
+			protectedWords = new CharArraySet(TEST_VERSION_CURRENT, new HashSet<>("a", "b", "cd"), false);
+		  }
+		  else
+		  {
+			protectedWords = null;
+		  }
+
+		  Analyzer a = new AnalyzerAnonymousInnerClassHelper6(this, flags, protectedWords);
+		  checkRandomData(random(), a, 1000 * RANDOM_MULTIPLIER);
+		}
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper6 : Analyzer
+	  {
+		  private readonly TestWordDelimiterFilter outerInstance;
+
+		  private int flags;
+		  private CharArraySet protectedWords;
+
+		  public AnalyzerAnonymousInnerClassHelper6(TestWordDelimiterFilter outerInstance, int flags, CharArraySet protectedWords)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.flags = flags;
+			  this.protectedWords = protectedWords;
+		  }
+
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(tokenizer, new WordDelimiterFilter(TEST_VERSION_CURRENT, tokenizer, flags, protectedWords));
+		  }
+	  }
+
+	  /// <summary>
+	  /// blast some enormous random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomHugeStrings() throws Exception
+	  public virtual void testRandomHugeStrings()
+	  {
+		int numIterations = atLeast(5);
+		for (int i = 0; i < numIterations; i++)
+		{
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int flags = random().nextInt(512);
+		  int flags = random().Next(512);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.util.CharArraySet protectedWords;
+		  CharArraySet protectedWords;
+		  if (random().nextBoolean())
+		  {
+			protectedWords = new CharArraySet(TEST_VERSION_CURRENT, new HashSet<>("a", "b", "cd"), false);
+		  }
+		  else
+		  {
+			protectedWords = null;
+		  }
+
+		  Analyzer a = new AnalyzerAnonymousInnerClassHelper7(this, flags, protectedWords);
+		  checkRandomData(random(), a, 100 * RANDOM_MULTIPLIER, 8192);
+		}
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper7 : Analyzer
+	  {
+		  private readonly TestWordDelimiterFilter outerInstance;
+
+		  private int flags;
+		  private CharArraySet protectedWords;
+
+		  public AnalyzerAnonymousInnerClassHelper7(TestWordDelimiterFilter outerInstance, int flags, CharArraySet protectedWords)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.flags = flags;
+			  this.protectedWords = protectedWords;
+		  }
+
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(tokenizer, new WordDelimiterFilter(TEST_VERSION_CURRENT, tokenizer, flags, protectedWords));
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Random random = random();
+		for (int i = 0; i < 512; i++)
+		{
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int flags = i;
+		  int flags = i;
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.util.CharArraySet protectedWords;
+		  CharArraySet protectedWords;
+		  if (random.nextBoolean())
+		  {
+			protectedWords = new CharArraySet(TEST_VERSION_CURRENT, new HashSet<>("a", "b", "cd"), false);
+		  }
+		  else
+		  {
+			protectedWords = null;
+		  }
+
+		  Analyzer a = new AnalyzerAnonymousInnerClassHelper8(this, flags, protectedWords);
+		  // depending upon options, this thing may or may not preserve the empty term
+		  checkAnalysisConsistency(random, a, random.nextBoolean(), "");
+		}
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper8 : Analyzer
+	  {
+		  private readonly TestWordDelimiterFilter outerInstance;
+
+		  private int flags;
+		  private CharArraySet protectedWords;
+
+		  public AnalyzerAnonymousInnerClassHelper8(TestWordDelimiterFilter outerInstance, int flags, CharArraySet protectedWords)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.flags = flags;
+			  this.protectedWords = protectedWords;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new WordDelimiterFilter(TEST_VERSION_CURRENT, tokenizer, flags, protectedWords));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ngram/EdgeNGramTokenFilterTest.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ngram/EdgeNGramTokenFilterTest.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ngram/EdgeNGramTokenFilterTest.cs
new file mode 100644
index 0000000..10ab5ec
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Ngram/EdgeNGramTokenFilterTest.cs
@@ -0,0 +1,407 @@
+using System;
+
+namespace org.apache.lucene.analysis.ngram
+{
+
+	/*
+	 * 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 KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+	using LetterTokenizer = org.apache.lucene.analysis.core.LetterTokenizer;
+	using WhitespaceTokenizer = org.apache.lucene.analysis.core.WhitespaceTokenizer;
+	using ASCIIFoldingFilter = org.apache.lucene.analysis.miscellaneous.ASCIIFoldingFilter;
+	using ShingleFilter = org.apache.lucene.analysis.shingle.ShingleFilter;
+	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 Version = org.apache.lucene.util.Version;
+	using TestUtil = org.apache.lucene.util.TestUtil;
+
+	/// <summary>
+	/// Tests <seealso cref="EdgeNGramTokenFilter"/> for correctness.
+	/// </summary>
+	public class EdgeNGramTokenFilterTest : BaseTokenStreamTestCase
+	{
+	  private TokenStream input;
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Override public void setUp() throws Exception
+	  public override void setUp()
+	  {
+		base.setUp();
+		input = new MockTokenizer(new StringReader("abcde"), MockTokenizer.WHITESPACE, false);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testInvalidInput() throws Exception
+	  public virtual void testInvalidInput()
+	  {
+		bool gotException = false;
+		try
+		{
+		  new EdgeNGramTokenFilter(TEST_VERSION_CURRENT, input, EdgeNGramTokenFilter.Side.FRONT, 0, 0);
+		}
+		catch (System.ArgumentException)
+		{
+		  gotException = true;
+		}
+		assertTrue(gotException);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testInvalidInput2() throws Exception
+	  public virtual void testInvalidInput2()
+	  {
+		bool gotException = false;
+		try
+		{
+		  new EdgeNGramTokenFilter(TEST_VERSION_CURRENT, input, EdgeNGramTokenFilter.Side.FRONT, 2, 1);
+		}
+		catch (System.ArgumentException)
+		{
+		  gotException = true;
+		}
+		assertTrue(gotException);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testInvalidInput3() throws Exception
+	  public virtual void testInvalidInput3()
+	  {
+		bool gotException = false;
+		try
+		{
+		  new EdgeNGramTokenFilter(TEST_VERSION_CURRENT, input, EdgeNGramTokenFilter.Side.FRONT, -1, 2);
+		}
+		catch (System.ArgumentException)
+		{
+		  gotException = true;
+		}
+		assertTrue(gotException);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFrontUnigram() throws Exception
+	  public virtual void testFrontUnigram()
+	  {
+		EdgeNGramTokenFilter tokenizer = new EdgeNGramTokenFilter(TEST_VERSION_CURRENT, input, EdgeNGramTokenFilter.Side.FRONT, 1, 1);
+		assertTokenStreamContents(tokenizer, new string[]{"a"}, new int[]{0}, new int[]{5});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBackUnigram() throws Exception
+	  public virtual void testBackUnigram()
+	  {
+		EdgeNGramTokenFilter tokenizer = new EdgeNGramTokenFilter(Version.LUCENE_43, input, EdgeNGramTokenFilter.Side.BACK, 1, 1);
+		assertTokenStreamContents(tokenizer, new string[]{"e"}, new int[]{4}, new int[]{5});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testOversizedNgrams() throws Exception
+	  public virtual void testOversizedNgrams()
+	  {
+		EdgeNGramTokenFilter tokenizer = new EdgeNGramTokenFilter(TEST_VERSION_CURRENT, input, EdgeNGramTokenFilter.Side.FRONT, 6, 6);
+		assertTokenStreamContents(tokenizer, new string[0], new int[0], new int[0]);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFrontRangeOfNgrams() throws Exception
+	  public virtual void testFrontRangeOfNgrams()
+	  {
+		EdgeNGramTokenFilter tokenizer = new EdgeNGramTokenFilter(TEST_VERSION_CURRENT, input, EdgeNGramTokenFilter.Side.FRONT, 1, 3);
+		assertTokenStreamContents(tokenizer, new string[]{"a","ab","abc"}, new int[]{0,0,0}, new int[]{5,5,5});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBackRangeOfNgrams() throws Exception
+	  public virtual void testBackRangeOfNgrams()
+	  {
+		EdgeNGramTokenFilter tokenizer = new EdgeNGramTokenFilter(Version.LUCENE_43, input, EdgeNGramTokenFilter.Side.BACK, 1, 3);
+		assertTokenStreamContents(tokenizer, new string[]{"e","de","cde"}, new int[]{4,3,2}, new int[]{5,5,5}, null, null, null, null, false);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFilterPositions() throws Exception
+	  public virtual void testFilterPositions()
+	  {
+		TokenStream ts = new MockTokenizer(new StringReader("abcde vwxyz"), MockTokenizer.WHITESPACE, false);
+		EdgeNGramTokenFilter tokenizer = new EdgeNGramTokenFilter(TEST_VERSION_CURRENT, ts, EdgeNGramTokenFilter.Side.FRONT, 1, 3);
+		assertTokenStreamContents(tokenizer, new string[]{"a","ab","abc","v","vw","vwx"}, new int[]{0,0,0,6,6,6}, new int[]{5,5,5,11,11,11}, null, new int[]{1,0,0,1,0,0}, null, null, false);
+	  }
+
+	  private class PositionFilter : TokenFilter
+	  {
+
+		internal readonly PositionIncrementAttribute posIncrAtt = addAttribute(typeof(PositionIncrementAttribute));
+		internal bool started;
+
+//JAVA TO C# CONVERTER WARNING: 'final' parameters are not available in .NET:
+//ORIGINAL LINE: PositionFilter(final org.apache.lucene.analysis.TokenStream input)
+		internal PositionFilter(TokenStream input) : base(input)
+		{
+		}
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Override public final boolean incrementToken() throws java.io.IOException
+		public override bool incrementToken()
+		{
+		  if (outerInstance.input.incrementToken())
+		  {
+			if (started)
+			{
+			  posIncrAtt.PositionIncrement = 0;
+			}
+			else
+			{
+			  started = true;
+			}
+			return true;
+		  }
+		  else
+		  {
+			return 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()
+		{
+		  base.reset();
+		  started = false;
+		}
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFirstTokenPositionIncrement() throws Exception
+	  public virtual void testFirstTokenPositionIncrement()
+	  {
+		TokenStream ts = new MockTokenizer(new StringReader("a abc"), MockTokenizer.WHITESPACE, false);
+		ts = new PositionFilter(ts); // All but first token will get 0 position increment
+		EdgeNGramTokenFilter filter = new EdgeNGramTokenFilter(TEST_VERSION_CURRENT, ts, EdgeNGramTokenFilter.Side.FRONT, 2, 3);
+		// The first token "a" will not be output, since it's smaller than the mingram size of 2.
+		// The second token on input to EdgeNGramTokenFilter will have position increment of 0,
+		// which should be increased to 1, since this is the first output token in the stream.
+		assertTokenStreamContents(filter, new string[] {"ab", "abc"}, new int[] {2, 2}, new int[] {5, 5}, new int[] {1, 0});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testSmallTokenInStream() throws Exception
+	  public virtual void testSmallTokenInStream()
+	  {
+		input = new MockTokenizer(new StringReader("abc de fgh"), MockTokenizer.WHITESPACE, false);
+		EdgeNGramTokenFilter tokenizer = new EdgeNGramTokenFilter(TEST_VERSION_CURRENT, input, EdgeNGramTokenFilter.Side.FRONT, 3, 3);
+		assertTokenStreamContents(tokenizer, new string[]{"abc","fgh"}, new int[]{0,7}, new int[]{3,10});
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testReset() throws Exception
+	  public virtual void testReset()
+	  {
+		WhitespaceTokenizer tokenizer = new WhitespaceTokenizer(TEST_VERSION_CURRENT, new StringReader("abcde"));
+		EdgeNGramTokenFilter filter = new EdgeNGramTokenFilter(TEST_VERSION_CURRENT, tokenizer, EdgeNGramTokenFilter.Side.FRONT, 1, 3);
+		assertTokenStreamContents(filter, new string[]{"a","ab","abc"}, new int[]{0,0,0}, new int[]{5,5,5});
+		tokenizer.Reader = new StringReader("abcde");
+		assertTokenStreamContents(filter, new string[]{"a","ab","abc"}, new int[]{0,0,0}, new int[]{5,5,5});
+	  }
+
+	  // LUCENE-3642
+	  // EdgeNgram blindly adds term length to offset, but this can take things out of bounds
+	  // wrt original text if a previous filter increases the length of the word (in this case æ -> ae)
+	  // so in this case we behave like WDF, and preserve any modified offsets
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testInvalidOffsets() throws Exception
+	  public virtual void testInvalidOffsets()
+	  {
+		Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper(this);
+		assertAnalyzesTo(analyzer, "mosfellsbær", new string[] {"mo", "mos", "mosf", "mosfe", "mosfel", "mosfell", "mosfells", "mosfellsb", "mosfellsba", "mosfellsbae", "mosfellsbaer"}, new int[] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, new int[] {11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11});
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly EdgeNGramTokenFilterTest outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper(EdgeNGramTokenFilterTest outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			TokenFilter filters = new ASCIIFoldingFilter(tokenizer);
+			filters = new EdgeNGramTokenFilter(Version.LUCENE_43, filters, EdgeNGramTokenFilter.Side.FRONT, 2, 15);
+			return new TokenStreamComponents(tokenizer, filters);
+		  }
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		for (int i = 0; i < 10; i++)
+		{
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int min = org.apache.lucene.util.TestUtil.nextInt(random(), 2, 10);
+		  int min = TestUtil.Next(random(), 2, 10);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int max = org.apache.lucene.util.TestUtil.nextInt(random(), min, 20);
+		  int max = TestUtil.Next(random(), min, 20);
+
+		  Analyzer a = new AnalyzerAnonymousInnerClassHelper2(this, min, max);
+		  checkRandomData(random(), a, 100 * RANDOM_MULTIPLIER);
+		}
+
+		Analyzer b = new AnalyzerAnonymousInnerClassHelper3(this);
+		checkRandomData(random(), b, 1000 * RANDOM_MULTIPLIER, 20, false, false);
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly EdgeNGramTokenFilterTest outerInstance;
+
+		  private int min;
+		  private int max;
+
+		  public AnalyzerAnonymousInnerClassHelper2(EdgeNGramTokenFilterTest outerInstance, int min, int max)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.min = min;
+			  this.max = max;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(tokenizer, new EdgeNGramTokenFilter(TEST_VERSION_CURRENT, tokenizer, min, max));
+		  }
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper3 : Analyzer
+	  {
+		  private readonly EdgeNGramTokenFilterTest outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper3(EdgeNGramTokenFilterTest outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(tokenizer, new EdgeNGramTokenFilter(Version.LUCENE_43, tokenizer, EdgeNGramTokenFilter.Side.BACK, 2, 4));
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws Exception
+	  public virtual void testEmptyTerm()
+	  {
+		Random random = random();
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper4(this);
+		checkAnalysisConsistency(random, a, random.nextBoolean(), "");
+
+		Analyzer b = new AnalyzerAnonymousInnerClassHelper5(this);
+		checkAnalysisConsistency(random, b, random.nextBoolean(), "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper4 : Analyzer
+	  {
+		  private readonly EdgeNGramTokenFilterTest outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper4(EdgeNGramTokenFilterTest outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new EdgeNGramTokenFilter(TEST_VERSION_CURRENT, tokenizer, EdgeNGramTokenFilter.Side.FRONT, 2, 15));
+		  }
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper5 : Analyzer
+	  {
+		  private readonly EdgeNGramTokenFilterTest outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper5(EdgeNGramTokenFilterTest outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new EdgeNGramTokenFilter(Version.LUCENE_43, tokenizer, EdgeNGramTokenFilter.Side.BACK, 2, 15));
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testGraphs() throws java.io.IOException
+	  public virtual void testGraphs()
+	  {
+		TokenStream tk = new LetterTokenizer(TEST_VERSION_CURRENT, new StringReader("abc d efgh ij klmno p q"));
+		tk = new ShingleFilter(tk);
+		tk = new EdgeNGramTokenFilter(TEST_VERSION_CURRENT, tk, 7, 10);
+		assertTokenStreamContents(tk, new string[] {"efgh ij", "ij klmn", "ij klmno", "klmno p"}, new int[] {6,11,11,14}, new int[] {13,19,19,21}, new int[] {3,1,0,1}, new int[] {2,2,2,2}, 23);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testSupplementaryCharacters() throws java.io.IOException
+	  public virtual void testSupplementaryCharacters()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final String s = org.apache.lucene.util.TestUtil.randomUnicodeString(random(), 10);
+		string s = TestUtil.randomUnicodeString(random(), 10);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int codePointCount = s.codePointCount(0, s.length());
+		int codePointCount = s.codePointCount(0, s.Length);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int minGram = org.apache.lucene.util.TestUtil.nextInt(random(), 1, 3);
+		int minGram = TestUtil.Next(random(), 1, 3);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int maxGram = org.apache.lucene.util.TestUtil.nextInt(random(), minGram, 10);
+		int maxGram = TestUtil.Next(random(), minGram, 10);
+		TokenStream tk = new KeywordTokenizer(new StringReader(s));
+		tk = new EdgeNGramTokenFilter(TEST_VERSION_CURRENT, tk, minGram, maxGram);
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.tokenattributes.CharTermAttribute termAtt = tk.addAttribute(org.apache.lucene.analysis.tokenattributes.CharTermAttribute.class);
+		CharTermAttribute termAtt = tk.addAttribute(typeof(CharTermAttribute));
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.tokenattributes.OffsetAttribute offsetAtt = tk.addAttribute(org.apache.lucene.analysis.tokenattributes.OffsetAttribute.class);
+		OffsetAttribute offsetAtt = tk.addAttribute(typeof(OffsetAttribute));
+		tk.reset();
+		for (int i = minGram; i <= Math.Min(codePointCount, maxGram); ++i)
+		{
+		  assertTrue(tk.incrementToken());
+		  assertEquals(0, offsetAtt.startOffset());
+		  assertEquals(s.Length, offsetAtt.endOffset());
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final int end = Character.offsetByCodePoints(s, 0, i);
+		  int end = char.offsetByCodePoints(s, 0, i);
+		  assertEquals(s.Substring(0, end), termAtt.ToString());
+		}
+		assertFalse(tk.incrementToken());
+	  }
+
+	}
+
+}
\ No newline at end of file


[15/27] lucenenet git commit: adding converted analysis common tests

Posted by sy...@apache.org.
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hu/TestHungarianLightStemFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hu/TestHungarianLightStemFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hu/TestHungarianLightStemFilter.cs
new file mode 100644
index 0000000..234736b
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hu/TestHungarianLightStemFilter.cs
@@ -0,0 +1,114 @@
+namespace org.apache.lucene.analysis.hu
+{
+
+	/*
+	 * 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 KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+	using SetKeywordMarkerFilter = org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter;
+	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+
+//JAVA TO C# CONVERTER TODO TASK: This Java 'import static' statement cannot be converted to C#:
+//	import static org.apache.lucene.analysis.VocabularyAssert.*;
+
+	/// <summary>
+	/// Simple tests for <seealso cref="HungarianLightStemFilter"/>
+	/// </summary>
+	public class TestHungarianLightStemFilter : BaseTokenStreamTestCase
+	{
+	  private Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper();
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  public AnalyzerAnonymousInnerClassHelper()
+		  {
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer source = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(source, new HungarianLightStemFilter(source));
+		  }
+	  }
+
+	  /// <summary>
+	  /// Test against a vocabulary from the reference impl </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testVocabulary() throws java.io.IOException
+	  public virtual void testVocabulary()
+	  {
+		assertVocabulary(analyzer, getDataFile("hulighttestdata.zip"), "hulight.txt");
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testKeyword() throws java.io.IOException
+	  public virtual void testKeyword()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.util.CharArraySet exclusionSet = new org.apache.lucene.analysis.util.CharArraySet(TEST_VERSION_CURRENT, asSet("babakocsi"), false);
+		CharArraySet exclusionSet = new CharArraySet(TEST_VERSION_CURRENT, asSet("babakocsi"), false);
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper2(this, exclusionSet);
+		checkOneTerm(a, "babakocsi", "babakocsi");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestHungarianLightStemFilter outerInstance;
+
+		  private CharArraySet exclusionSet;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestHungarianLightStemFilter outerInstance, CharArraySet exclusionSet)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.exclusionSet = exclusionSet;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer source = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			TokenStream sink = new SetKeywordMarkerFilter(source, exclusionSet);
+			return new TokenStreamComponents(source, new HungarianLightStemFilter(sink));
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper3(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper3 : Analyzer
+	  {
+		  private readonly TestHungarianLightStemFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper3(TestHungarianLightStemFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new HungarianLightStemFilter(tokenizer));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hu/TestHungarianLightStemFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hu/TestHungarianLightStemFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hu/TestHungarianLightStemFilterFactory.cs
new file mode 100644
index 0000000..30283d6
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hu/TestHungarianLightStemFilterFactory.cs
@@ -0,0 +1,57 @@
+namespace org.apache.lucene.analysis.hu
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the Hungarian light stem factory is working.
+	/// </summary>
+	public class TestHungarianLightStemFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStemming() throws Exception
+	  public virtual void testStemming()
+	  {
+		Reader reader = new StringReader("házakat");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("HungarianLightStem").create(stream);
+		assertTokenStreamContents(stream, new string[] {"haz"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("HungarianLightStem", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/StemmerTestBase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/StemmerTestBase.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/StemmerTestBase.cs
new file mode 100644
index 0000000..a1e0353
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/StemmerTestBase.cs
@@ -0,0 +1,95 @@
+using System.Collections.Generic;
+
+namespace org.apache.lucene.analysis.hunspell
+{
+
+	/*
+	 * 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 CharsRef = org.apache.lucene.util.CharsRef;
+	using IOUtils = org.apache.lucene.util.IOUtils;
+	using LuceneTestCase = org.apache.lucene.util.LuceneTestCase;
+
+	/// <summary>
+	/// base class for hunspell stemmer tests </summary>
+	internal abstract class StemmerTestBase : LuceneTestCase
+	{
+	  private static Stemmer stemmer;
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: static void init(String affix, String dictionary) throws java.io.IOException, java.text.ParseException
+	  internal static void init(string affix, string dictionary)
+	  {
+		init(false, affix, dictionary);
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: static void init(boolean ignoreCase, String affix, String... dictionaries) throws java.io.IOException, java.text.ParseException
+	  internal static void init(bool ignoreCase, string affix, params string[] dictionaries)
+	  {
+		if (dictionaries.Length == 0)
+		{
+		  throw new System.ArgumentException("there must be at least one dictionary");
+		}
+
+		System.IO.Stream affixStream = typeof(StemmerTestBase).getResourceAsStream(affix);
+		if (affixStream == null)
+		{
+		  throw new FileNotFoundException("file not found: " + affix);
+		}
+
+		System.IO.Stream[] dictStreams = new System.IO.Stream[dictionaries.Length];
+		for (int i = 0; i < dictionaries.Length; i++)
+		{
+		  dictStreams[i] = typeof(StemmerTestBase).getResourceAsStream(dictionaries[i]);
+		  if (dictStreams[i] == null)
+		  {
+			throw new FileNotFoundException("file not found: " + dictStreams[i]);
+		  }
+		}
+
+		try
+		{
+		  Dictionary dictionary = new Dictionary(affixStream, Arrays.asList(dictStreams), ignoreCase);
+		  stemmer = new Stemmer(dictionary);
+		}
+		finally
+		{
+		  IOUtils.closeWhileHandlingException(affixStream);
+		  IOUtils.closeWhileHandlingException(dictStreams);
+		}
+	  }
+
+	  internal static void assertStemsTo(string s, params string[] expected)
+	  {
+		assertNotNull(stemmer);
+		Arrays.sort(expected);
+
+		IList<CharsRef> stems = stemmer.stem(s);
+		string[] actual = new string[stems.Count];
+		for (int i = 0; i < actual.Length; i++)
+		{
+		  actual[i] = stems[i].ToString();
+		}
+		Arrays.sort(actual);
+
+		assertArrayEquals("expected=" + Arrays.ToString(expected) + ",actual=" + Arrays.ToString(actual), expected, actual);
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestAllDictionaries.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestAllDictionaries.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestAllDictionaries.cs
new file mode 100644
index 0000000..9ca2372
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestAllDictionaries.cs
@@ -0,0 +1,99 @@
+using System;
+using System.Diagnostics;
+
+namespace org.apache.lucene.analysis.hunspell
+{
+
+	/*
+	 * 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 IOUtils = org.apache.lucene.util.IOUtils;
+	using LuceneTestCase = org.apache.lucene.util.LuceneTestCase;
+	using RamUsageEstimator = org.apache.lucene.util.RamUsageEstimator;
+	using Ignore = org.junit.Ignore;
+
+	/// <summary>
+	/// Can be retrieved via:
+	/// wget --mirror -np http://archive.services.openoffice.org/pub/mirror/OpenOffice.org/contrib/dictionaries/
+	/// Note some of the files differ only in case. This may be a problem on your operating system!
+	/// </summary>
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @Ignore("enable manually") public class TestAllDictionaries extends org.apache.lucene.util.LuceneTestCase
+	public class TestAllDictionaries : LuceneTestCase
+	{
+
+	  // set this to the location of where you downloaded all the files
+	  internal static readonly File DICTIONARY_HOME = new File("/data/archive.services.openoffice.org/pub/mirror/OpenOffice.org/contrib/dictionaries");
+
+	  internal readonly string[] tests = new string[] {"af_ZA.zip", "af_ZA.dic", "af_ZA.aff", "ak_GH.zip", "ak_GH.dic", "ak_GH.aff", "bg_BG.zip", "bg_BG.dic", "bg_BG.aff", "ca_ANY.zip", "catalan.dic", "catalan.aff", "ca_ES.zip", "ca_ES.dic", "ca_ES.aff", "cs_CZ.zip", "cs_CZ.dic", "cs_CZ.aff", "cy_GB.zip", "cy_GB.dic", "cy_GB.aff", "da_DK.zip", "da_DK.dic", "da_DK.aff", "de_AT.zip", "de_AT.dic", "de_AT.aff", "de_CH.zip", "de_CH.dic", "de_CH.aff", "de_DE.zip", "de_DE.dic", "de_DE.aff", "de_DE_comb.zip", "de_DE_comb.dic", "de_DE_comb.aff", "de_DE_frami.zip", "de_DE_frami.dic", "de_DE_frami.aff", "de_DE_neu.zip", "de_DE_neu.dic", "de_DE_neu.aff", "el_GR.zip", "el_GR.dic", "el_GR.aff", "en_AU.zip", "en_AU.dic", "en_AU.aff", "en_CA.zip", "en_CA.dic", "en_CA.aff", "en_GB-oed.zip", "en_GB-oed.dic", "en_GB-oed.aff", "en_GB.zip", "en_GB.dic", "en_GB.aff", "en_NZ.zip", "en_NZ.dic", "en_NZ.aff", "eo.zip", "eo_l3.dic", "eo_l3.aff", "eo_EO.zip", "eo_EO.dic", "eo_EO.aff", "es_AR.zip", "es_AR.dic", "e
 s_AR.aff", "es_BO.zip", "es_BO.dic", "es_BO.aff", "es_CL.zip", "es_CL.dic", "es_CL.aff", "es_CO.zip", "es_CO.dic", "es_CO.aff", "es_CR.zip", "es_CR.dic", "es_CR.aff", "es_CU.zip", "es_CU.dic", "es_CU.aff", "es_DO.zip", "es_DO.dic", "es_DO.aff", "es_EC.zip", "es_EC.dic", "es_EC.aff", "es_ES.zip", "es_ES.dic", "es_ES.aff", "es_GT.zip", "es_GT.dic", "es_GT.aff", "es_HN.zip", "es_HN.dic", "es_HN.aff", "es_MX.zip", "es_MX.dic", "es_MX.aff", "es_NEW.zip", "es_NEW.dic", "es_NEW.aff", "es_NI.zip", "es_NI.dic", "es_NI.aff", "es_PA.zip", "es_PA.dic", "es_PA.aff", "es_PE.zip", "es_PE.dic", "es_PE.aff", "es_PR.zip", "es_PR.dic", "es_PR.aff", "es_PY.zip", "es_PY.dic", "es_PY.aff", "es_SV.zip", "es_SV.dic", "es_SV.aff", "es_UY.zip", "es_UY.dic", "es_UY.aff", "es_VE.zip", "es_VE.dic", "es_VE.aff", "et_EE.zip", "et_EE.dic", "et_EE.aff", "fo_FO.zip", "fo_FO.dic", "fo_FO.aff", "fr_FR-1990_1-3-2.zip", "fr_FR-1990.dic", "fr_FR-1990.aff", "fr_FR-classique_1-3-2.zip", "fr_FR-classique.dic", "fr_FR-classi
 que.aff", "fr_FR_1-3-2.zip", "fr_FR.dic", "fr_FR.aff", "fy_NL.zip", "fy_NL.dic", "fy_NL.aff", "ga_IE.zip", "ga_IE.dic", "ga_IE.aff", "gd_GB.zip", "gd_GB.dic", "gd_GB.aff", "gl_ES.zip", "gl_ES.dic", "gl_ES.aff", "gsc_FR.zip", "gsc_FR.dic", "gsc_FR.aff", "gu_IN.zip", "gu_IN.dic", "gu_IN.aff", "he_IL.zip", "he_IL.dic", "he_IL.aff", "hi_IN.zip", "hi_IN.dic", "hi_IN.aff", "hil_PH.zip", "hil_PH.dic", "hil_PH.aff", "hr_HR.zip", "hr_HR.dic", "hr_HR.aff", "hu_HU.zip", "hu_HU.dic", "hu_HU.aff", "hu_HU_comb.zip", "hu_HU.dic", "hu_HU.aff", "ia.zip", "ia.dic", "ia.aff", "id_ID.zip", "id_ID.dic", "id_ID.aff", "it_IT.zip", "it_IT.dic", "it_IT.aff", "ku_TR.zip", "ku_TR.dic", "ku_TR.aff", "la.zip", "la.dic", "la.aff", "lt_LT.zip", "lt_LT.dic", "lt_LT.aff", "lv_LV.zip", "lv_LV.dic", "lv_LV.aff", "mg_MG.zip", "mg_MG.dic", "mg_MG.aff", "mi_NZ.zip", "mi_NZ.dic", "mi_NZ.aff", "mk_MK.zip", "mk_MK.dic", "mk_MK.aff", "mos_BF.zip", "mos_BF.dic", "mos_BF.aff", "mr_IN.zip", "mr_IN.dic", "mr_IN.aff", "ms_MY.zip
 ", "ms_MY.dic", "ms_MY.aff", "nb_NO.zip", "nb_NO.dic", "nb_NO.aff", "ne_NP.zip", "ne_NP.dic", "ne_NP.aff", "nl_NL.zip", "nl_NL.dic", "nl_NL.aff", "nl_med.zip", "nl_med.dic", "nl_med.aff", "nn_NO.zip", "nn_NO.dic", "nn_NO.aff", "nr_ZA.zip", "nr_ZA.dic", "nr_ZA.aff", "ns_ZA.zip", "ns_ZA.dic", "ns_ZA.aff", "ny_MW.zip", "ny_MW.dic", "ny_MW.aff", "oc_FR.zip", "oc_FR.dic", "oc_FR.aff", "pl_PL.zip", "pl_PL.dic", "pl_PL.aff", "pt_BR.zip", "pt_BR.dic", "pt_BR.aff", "pt_PT.zip", "pt_PT.dic", "pt_PT.aff", "ro_RO.zip", "ro_RO.dic", "ro_RO.aff", "ru_RU.zip", "ru_RU.dic", "ru_RU.aff", "ru_RU_ye.zip", "ru_RU_ie.dic", "ru_RU_ie.aff", "ru_RU_yo.zip", "ru_RU_yo.dic", "ru_RU_yo.aff", "rw_RW.zip", "rw_RW.dic", "rw_RW.aff", "sk_SK.zip", "sk_SK.dic", "sk_SK.aff", "sl_SI.zip", "sl_SI.dic", "sl_SI.aff", "sq_AL.zip", "sq_AL.dic", "sq_AL.aff", "ss_ZA.zip", "ss_ZA.dic", "ss_ZA.aff", "st_ZA.zip", "st_ZA.dic", "st_ZA.aff", "sv_SE.zip", "sv_SE.dic", "sv_SE.aff", "sw_KE.zip", "sw_KE.dic", "sw_KE.aff", "tet_ID.zip
 ", "tet_ID.dic", "tet_ID.aff", "th_TH.zip", "th_TH.dic", "th_TH.aff", "tl_PH.zip", "tl_PH.dic", "tl_PH.aff", "tn_ZA.zip", "tn_ZA.dic", "tn_ZA.aff", "ts_ZA.zip", "ts_ZA.dic", "ts_ZA.aff", "uk_UA.zip", "uk_UA.dic", "uk_UA.aff", "ve_ZA.zip", "ve_ZA.dic", "ve_ZA.aff", "vi_VN.zip", "vi_VN.dic", "vi_VN.aff", "xh_ZA.zip", "xh_ZA.dic", "xh_ZA.aff", "zu_ZA.zip", "zu_ZA.dic", "zu_ZA.aff"};
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void test() throws Exception
+	  public virtual void test()
+	  {
+		for (int i = 0; i < tests.Length; i += 3)
+		{
+		  File f = new File(DICTIONARY_HOME, tests[i]);
+		  Debug.Assert(f.exists());
+
+		  using (ZipFile zip = new ZipFile(f, StandardCharsets.UTF_8))
+		  {
+			ZipEntry dicEntry = zip.getEntry(tests[i + 1]);
+			Debug.Assert(dicEntry != null);
+			ZipEntry affEntry = zip.getEntry(tests[i + 2]);
+			Debug.Assert(affEntry != null);
+
+			using (System.IO.Stream dictionary = zip.getInputStream(dicEntry), System.IO.Stream affix = zip.getInputStream(affEntry))
+			{
+			  Dictionary dic = new Dictionary(affix, dictionary);
+			  Console.WriteLine(tests[i] + "\t" + RamUsageEstimator.humanSizeOf(dic) + "\t(" + "words=" + RamUsageEstimator.humanSizeOf(dic.words) + ", " + "flags=" + RamUsageEstimator.humanSizeOf(dic.flagLookup) + ", " + "strips=" + RamUsageEstimator.humanSizeOf(dic.stripData) + ", " + "conditions=" + RamUsageEstimator.humanSizeOf(dic.patterns) + ", " + "affixData=" + RamUsageEstimator.humanSizeOf(dic.affixData) + ", " + "prefixes=" + RamUsageEstimator.humanSizeOf(dic.prefixes) + ", " + "suffixes=" + RamUsageEstimator.humanSizeOf(dic.suffixes) + ")");
+			}
+		  }
+		}
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testOneDictionary() throws Exception
+	  public virtual void testOneDictionary()
+	  {
+		string toTest = "hu_HU.zip";
+		for (int i = 0; i < tests.Length; i++)
+		{
+		  if (tests[i].Equals(toTest))
+		  {
+			File f = new File(DICTIONARY_HOME, tests[i]);
+			Debug.Assert(f.exists());
+
+			using (ZipFile zip = new ZipFile(f, StandardCharsets.UTF_8))
+			{
+			  ZipEntry dicEntry = zip.getEntry(tests[i + 1]);
+			  Debug.Assert(dicEntry != null);
+			  ZipEntry affEntry = zip.getEntry(tests[i + 2]);
+			  Debug.Assert(affEntry != null);
+
+			  using (System.IO.Stream dictionary = zip.getInputStream(dicEntry), System.IO.Stream affix = zip.getInputStream(affEntry))
+			  {
+				  new Dictionary(affix, dictionary);
+			  }
+			}
+		  }
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestAllDictionaries2.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestAllDictionaries2.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestAllDictionaries2.cs
new file mode 100644
index 0000000..f2e76ec
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestAllDictionaries2.cs
@@ -0,0 +1,99 @@
+using System;
+using System.Diagnostics;
+
+namespace org.apache.lucene.analysis.hunspell
+{
+
+	/*
+	 * 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 IOUtils = org.apache.lucene.util.IOUtils;
+	using LuceneTestCase = org.apache.lucene.util.LuceneTestCase;
+	using RamUsageEstimator = org.apache.lucene.util.RamUsageEstimator;
+	using Ignore = org.junit.Ignore;
+
+	/// <summary>
+	/// These thunderbird dictionaries can be retrieved via:
+	/// https://addons.mozilla.org/en-US/thunderbird/language-tools/
+	/// You must click and download every file: sorry!
+	/// </summary>
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @Ignore("enable manually") public class TestAllDictionaries2 extends org.apache.lucene.util.LuceneTestCase
+	public class TestAllDictionaries2 : LuceneTestCase
+	{
+
+	  // set this to the location of where you downloaded all the files
+	  internal static readonly File DICTIONARY_HOME = new File("/data/thunderbirdDicts");
+
+	  internal readonly string[] tests = new string[] {"addon-0.4.5-an+fx+tb+fn+sm.xpi", "dictionaries/ru.dic", "dictionaries/ru.aff", "addon-0.5.5-fx+tb.xpi", "dictionaries/ko-KR.dic", "dictionaries/ko-KR.aff", "afrikaans_spell_checker-20110323-fx+tb+fn+sm.xpi", "dictionaries/af-ZA.dic", "dictionaries/af-ZA.aff", "albanisches_worterbuch-1.6.9-fx+tb+sm+fn.xpi", "dictionaries/sq.dic", "dictionaries/sq.aff", "amharic_spell_checker-0.4-fx+fn+tb+sm.xpi", "dictionaries/am_ET.dic", "dictionaries/am_ET.aff", "arabic_spell_checking_dictionary-3.2.20120321-fx+tb.xpi", "dictionaries/ar.dic", "dictionaries/ar.aff", "armenian_spell_checker_dictionary-0.32-fx+tb+sm.xpi", "dictionaries/hy_AM.dic", "dictionaries/hy_AM.aff", "azerbaijani_spell_checker-0.3-fx+tb+fn+sm+sb.xpi", "dictionaries/az-Latn-AZ.dic", "dictionaries/az-Latn-AZ.aff", "belarusian_classic_dictionary-0.1.2-tb+fx+sm.xpi", "dictionaries/be-classic.dic", "dictionaries/be-classic.aff", "belarusian_dictionary-0.1.2-fx+sm+tb.xpi", "dictiona
 ries/be.dic", "dictionaries/be.aff", "bengali_bangladesh_dictionary-0.08-sm+tb+fx.xpi", "dictionaries/bn-BD.dic", "dictionaries/bn-BD.aff", "brazilian_portuguese_dictionary_former_spelling-28.20140203-tb+sm+fx.xpi", "dictionaries/pt-BR-antigo.dic", "dictionaries/pt-BR-antigo.aff", "brazilian_portuguese_dictionary_new_spelling-28.20140203-fx+sm+tb.xpi", "dictionaries/pt-BR.dic", "dictionaries/pt-BR.aff", "british_english_dictionary_updated-1.19.5-sm+fx+tb.xpi", "dictionaries/en-GB.dic", "dictionaries/en-GB.aff", "bulgarian_dictionary-4.3-fx+tb+sm.xpi", "dictionaries/bg.dic", "dictionaries/bg.aff", "canadian_english_dictionary-2.0.8-fx+sm+tb.xpi", "dictionaries/en-CA.dic", "dictionaries/en-CA.aff", "ceske_slovniky_pro_kontrolu_pravopisu-1.0.4-tb+sm+fx.xpi", "dictionaries/cs.dic", "dictionaries/cs.aff", "chichewa_spell_checker-0.3-fx+tb+fn+sm+sb.xpi", "dictionaries/ny_MW.dic", "dictionaries/ny_MW.aff", "corrector_de_galego-13.10.0-fn+sm+tb+fx.xpi", "dictionaries/gl_ES.dic", "dictionari
 es/gl_ES.aff", "corrector_ortografico_aragones-0.2-fx+tb+sm.xpi", "dictionaries/an_ES.dic", "dictionaries/an_ES.aff", "croatian_dictionary_-_hrvatski_rjecnik-1.0.1-firefox+thunderbird+seamonkey.xpi", "dictionaries/hr.dic", "dictionaries/hr.aff", "croatian_dictionary_hrvatski_rjecnik-1.0.9-an+fx+fn+tb+sm.xpi", "dictionaries/hr-HR.dic", "dictionaries/hr-HR.aff", "dansk_ordbog_til_stavekontrollen-2.2.1-sm+tb+fx.xpi", "dictionaries/da.dic", "dictionaries/da.aff", "deutsches_worterbuch_de_de_alte_rechtschreibung-2.1.8-sm.xpi", "dictionaries/de-DE-1901.dic", "dictionaries/de-DE-1901.aff", "diccionario_de_espanolespana-1.7-sm+tb+fn+fx.xpi", "dictionaries/es-ES.dic", "dictionaries/es-ES.aff", "diccionario_en_espanol_para_venezuela-1.1.17-sm+an+tb+fn+fx.xpi", "dictionaries/es_VE.dic", "dictionaries/es_VE.aff", "diccionario_espanol_argentina-2.5.1-tb+fx+sm.xpi", "dictionaries/es_AR.dic", "dictionaries/es_AR.aff", "diccionario_espanol_mexico-1.1.3-fn+tb+fx+sm.xpi", "dictionaries/es_MX.dic", "d
 ictionaries/es_MX.aff", "diccionario_ortografico_valenciano-2.2.0-fx+tb+fn+sm.xpi", "dictionaries/roa-ES-val.dic", "dictionaries/roa-ES-val.aff", "diccionario_papiamentoaruba-0.2-fn+sm+tb+fx.xpi", "dictionaries/Papiamento.dic", "dictionaries/Papiamento.aff", "dictionnaires_francais-5.0.2-fx+tb+sm.xpi", "dictionaries/fr-classic-reform.dic", "dictionaries/fr-classic-reform.aff", "dictionnaires_francais-5.0.2-fx+tb+sm.xpi", "dictionaries/fr-classic.dic", "dictionaries/fr-classic.aff", "dictionnaires_francais-5.0.2-fx+tb+sm.xpi", "dictionaries/fr-modern.dic", "dictionaries/fr-modern.aff", "dictionnaires_francais-5.0.2-fx+tb+sm.xpi", "dictionaries/fr-reform.dic", "dictionaries/fr-reform.aff", "difazier_an_drouizig-0.12-tb+sm+fx.xpi", "dictionaries/br.dic", "dictionaries/br.aff", "dikshonario_papiamentuantia_hulandes-0.5-fx+tb+fn+sb+sm.xpi", "dictionaries/Papiamentu.dic", "dictionaries/Papiamentu.aff", "dizionari_furlan-3.1-tb+fx+sm.xpi", "dictionaries/fur-IT.dic", "dictionaries/fur-IT.af
 f", "dizionario_italiano-3.3.2-fx+sm+tb.xpi", "dictionaries/it_IT.dic", "dictionaries/it_IT.aff", "eesti_keele_speller-3.2-fx+tb+sm.xpi", "dictionaries/et-EE.dic", "dictionaries/et-EE.aff", "english_australian_dictionary-2.1.2-tb+fx+sm.xpi", "dictionaries/en-AU.dic", "dictionaries/en-AU.aff", "esperanta_vortaro-1.0.2-fx+tb+sm.xpi", "dictionaries/eo-EO.dic", "dictionaries/eo-EO.aff", "european_portuguese_spellchecker-14.1.1.1-tb+fx.xpi", "dictionaries/pt-PT.dic", "dictionaries/pt-PT.aff", "faroese_spell_checker_faroe_islands-2.0-tb+sm+fx+fn.xpi", "dictionaries/fo_FO.dic", "dictionaries/fo_FO.aff", "frysk_wurdboek-2.1.1-fn+sm+fx+an+tb.xpi", "dictionaries/fy.dic", "dictionaries/fy.aff", "geiriadur_cymraeg-1.08-tb+sm+fx.xpi", "dictionaries/cy_GB.dic", "dictionaries/cy_GB.aff", "general_catalan_dictionary-2.5.0-tb+sm+fn+fx.xpi", "dictionaries/ca.dic", "dictionaries/ca.aff", "german_dictionary-2.0.3-fn+fx+sm+tb.xpi", "dictionaries/de-DE.dic", "dictionaries/de-DE.aff", "german_dictionary_d
 e_at_new_orthography-20130905-tb+fn+an+fx+sm.xpi", "dictionaries/de-AT.dic", "dictionaries/de-AT.aff", "german_dictionary_de_ch_new_orthography-20130905-fx+tb+fn+sm+an.xpi", "dictionaries/de-CH.dic", "dictionaries/de-CH.aff", "german_dictionary_de_de_new_orthography-20130905-tb+sm+an+fn+fx.xpi", "dictionaries/de-DE.dic", "dictionaries/de-DE.aff", "german_dictionary_extended_for_austria-2.0.3-fx+fn+sm+tb.xpi", "dictionaries/de-AT.dic", "dictionaries/de-AT.aff", "german_dictionary_switzerland-2.0.3-sm+fx+tb+fn.xpi", "dictionaries/de-CH.dic", "dictionaries/de-CH.aff", "greek_spelling_dictionary-0.8.5-fx+tb+sm.xpi", "dictionaries/el-GR.dic", "dictionaries/el-GR.aff", "gujarati_spell_checker-0.3-fx+tb+fn+sm+sb.xpi", "dictionaries/gu_IN.dic", "dictionaries/gu_IN.aff", "haitian_creole_spell_checker-0.08-tb+sm+fx.xpi", "dictionaries/ht-HT.dic", "dictionaries/ht-HT.aff", "hausa_spelling_dictionary-0.2-tb+fx.xpi", "dictionaries/ha-GH.dic", "dictionaries/ha-GH.aff", "hebrew_spell_checking_dict
 ionary_from_hspell-1.2.0.1-fx+sm+tb.xpi", "dictionaries/he.dic", "dictionaries/he.aff", "hindi_spell_checker-0.4-fx+tb+sm+sb+fn.xpi", "dictionaries/hi_IN.dic", "dictionaries/hi_IN.aff", "hungarian_dictionary-1.6.1.1-fx+tb+sm+fn.xpi", "dictionaries/hu.dic", "dictionaries/hu.aff", "kamus_pengecek_ejaan_bahasa_indonesia-1.1-fx+tb.xpi", "dictionaries/id.dic", "dictionaries/id.aff", "kannada_spell_checker-2.0.1-tb+sm+fn+an+fx.xpi", "dictionaries/kn.dic", "dictionaries/kn.aff", "kashubian_spell_checker_poland-0.9-sm+tb+fx.xpi", "dictionaries/Kaszebsczi.dic", "dictionaries/Kaszebsczi.aff", "kiswahili_spell_checker-0.3-sb+tb+fn+fx+sm.xpi", "dictionaries/sw_TZ.dic", "dictionaries/sw_TZ.aff", "kurdish_spell_checker-0.96-fx+tb+sm.xpi", "dictionaries/ku-TR.dic", "dictionaries/ku-TR.aff", "lao_spellchecking_dictionary-0-fx+tb+sm+fn+an.xpi", "dictionaries/lo_LA.dic", "dictionaries/lo_LA.aff", "latviesu_valodas_pareizrakstibas_parbaudes_vardnica-1.0.0-fn+fx+tb+sm.xpi", "dictionaries/lv_LV.dic", "d
 ictionaries/lv_LV.aff", "lithuanian_spelling_check_dictionary-1.3-fx+tb+sm+fn.xpi", "dictionaries/lt.dic", "dictionaries/lt.aff", "litreoir_gaelspell_do_mhozilla-4.7-tb+fx+sm+fn.xpi", "dictionaries/ga.dic", "dictionaries/ga.aff", "litreoir_na_liongailise-0.03-fx+sm+tb.xpi", "dictionaries/ln-CD.dic", "dictionaries/ln-CD.aff", "macedonian_mk_mk_spellchecker-1.2-fn+tb+fx+sm+sb.xpi", "dictionaries/mk-MK-Cyrl.dic", "dictionaries/mk-MK-Cyrl.aff", "macedonian_mk_mk_spellchecker-1.2-fn+tb+fx+sm+sb.xpi", "dictionaries/mk-MK-Latn.dic", "dictionaries/mk-MK-Latn.aff", "malagasy_spell_checker-0.3-fn+tb+fx+sm+sb.xpi", "dictionaries/mg_MG.dic", "dictionaries/mg_MG.aff", "marathi_dictionary-9.3-sm+tb+sb+fx.xpi", "dictionaries/mr-IN.dic", "dictionaries/mr-IN.aff", "ndebele_south_spell_checker-20110323-tb+fn+fx+sm.xpi", "dictionaries/nr-ZA.dic", "dictionaries/nr-ZA.aff", "nepali_dictionary-1.2-fx+tb.xpi", "dictionaries/ne_NP.dic", "dictionaries/ne_NP.aff", "norsk_bokmal_ordliste-2.0.10.2-fx+tb+sm.xpi
 ", "dictionaries/nb.dic", "dictionaries/nb.aff", "norsk_nynorsk_ordliste-2.1.0-sm+fx+tb.xpi", "dictionaries/nn.dic", "dictionaries/nn.aff", "northern_sotho_spell_checker-20110323-tb+fn+fx+sm.xpi", "dictionaries/nso-ZA.dic", "dictionaries/nso-ZA.aff", "oriya_spell_checker-0.3-fn+tb+fx+sm+sb.xpi", "dictionaries/or-IN.dic", "dictionaries/or-IN.aff", "polski_slownik_poprawnej_pisowni-1.0.20110621-fx+tb+sm.xpi", "dictionaries/pl.dic", "dictionaries/pl.aff", "punjabi_spell_checker-0.3-fx+tb+sm+sb+fn.xpi", "dictionaries/pa-IN.dic", "dictionaries/pa-IN.aff", "romanian_spellchecking_dictionary-1.14-sm+tb+fx.xpi", "dictionaries/ro_RO-ante1993.dic", "dictionaries/ro_RO-ante1993.aff", "russian_hunspell_dictionary-1.0.20131101-tb+sm+fn+fx.xpi", "dictionaries/ru_RU.dic", "dictionaries/ru_RU.aff", "sanskrit_spell_checker-1.1-fx+tb+sm+sb+fn.xpi", "dictionaries/sa_IN.dic", "dictionaries/sa_IN.aff", "scottish_gaelic_spell_checker-2.7-tb+fx+sm.xpi", "dictionaries/gd-GB.dic", "dictionaries/gd-GB.aff", 
 "serbian_dictionary-0.18-fx+tb+sm.xpi", "dictionaries/sr-RS-Cyrl.dic", "dictionaries/sr-RS-Cyrl.aff", "serbian_dictionary-0.18-fx+tb+sm.xpi", "dictionaries/sr-RS-Latn.dic", "dictionaries/sr-RS-Latn.aff", "slovak_spell_checking_dictionary-2.04.0-tb+fx+sm.xpi", "dictionaries/sk-SK.dic", "dictionaries/sk-SK.aff", "slovak_spell_checking_dictionary-2.04.0-tb+fx+sm.xpi", "dictionaries/sk-SK-ascii.dic", "dictionaries/sk-SK-ascii.aff", "slovar_za_slovenski_jezik-0.1.1.1-fx+tb+sm.xpi", "dictionaries/sl.dic", "dictionaries/sl.aff", "songhay_spell_checker-0.03-fx+tb+sm.xpi", "dictionaries/Songhay - Mali.dic", "dictionaries/Songhay - Mali.aff", "southern_sotho_spell_checker-20110323-tb+fn+fx+sm.xpi", "dictionaries/st-ZA.dic", "dictionaries/st-ZA.aff", "sownik_acinski-0.41.20110603-tb+fx+sm.xpi", "dictionaries/la.dic", "dictionaries/la.aff", "sownik_jezyka_dolnouzyckiego-1.4.8-an+fx+tb+fn+sm.xpi", "dictionaries/dsb.dic", "dictionaries/dsb.aff", "srpska_latinica-0.1-fx+tb+sm.xpi", "dictionaries/S
 rpski_latinica.dic", "dictionaries/Srpski_latinica.aff", "svenska_fria_ordlistan-1.1-tb+sm+fx.xpi", "dictionaries/sv.dic", "dictionaries/sv.aff", "svenska_fria_ordlistan-1.1-tb+sm+fx.xpi", "dictionaries/sv_FI.dic", "dictionaries/sv_FI.aff", "swati_spell_checker-20110323-tb+sm+fx+fn.xpi", "dictionaries/ss-ZA.dic", "dictionaries/ss-ZA.aff", "tamil_spell_checker_for_firefox-0.4-tb+fx.xpi", "dictionaries/ta-TA.dic", "dictionaries/ta-TA.aff", "telugu_spell_checker-0.3-tb+fx+sm.xpi", "dictionaries/te_IN.dic", "dictionaries/te_IN.aff", "te_papakupu_m__ori-0.9.9.20080630-fx+tb.xpi", "dictionaries/mi-x-Tai Tokerau.dic", "dictionaries/mi-x-Tai Tokerau.aff", "te_papakupu_m__ori-0.9.9.20080630-fx+tb.xpi", "dictionaries/mi.dic", "dictionaries/mi.aff", "tsonga_spell_checker-20110323-tb+sm+fx+fn.xpi", "dictionaries/ts-ZA.dic", "dictionaries/ts-ZA.aff", "tswana_spell_checker-20110323-tb+sm+fx+fn.xpi", "dictionaries/tn-ZA.dic", "dictionaries/tn-ZA.aff", "turkmen_spell_checker_dictionary-0.1.6-tb+fx+
 sm.xpi", "dictionaries/tk_TM.dic", "dictionaries/tk_TM.aff", "ukrainian_dictionary-1.7.0-sm+an+fx+fn+tb.xpi", "dictionaries/uk-UA.dic", "dictionaries/uk-UA.aff", "united_states_english_spellchecker-7.0.1-sm+tb+fx+an.xpi", "dictionaries/en-US.dic", "dictionaries/en-US.aff", "upper_sorbian_spelling_dictionary-0.0.20060327.3-tb+fx+sm.xpi", "dictionaries/hsb.dic", "dictionaries/hsb.aff", "urdu_dictionary-0.64-fx+tb+sm+sb.xpi", "dictionaries/ur.dic", "dictionaries/ur.aff", "uzbek_spell_checker-0.3-fn+tb+fx+sm+sb.xpi", "dictionaries/uz.dic", "dictionaries/uz.aff", "valencian_catalan_dictionary-2.5.0-tb+fn+sm+fx.xpi", "dictionaries/ca-ES-valencia.dic", "dictionaries/ca-ES-valencia.aff", "venda_spell_checker-20110323-tb+fn+fx+sm.xpi", "dictionaries/ve-ZA.dic", "dictionaries/ve-ZA.aff", "verificador_ortografico_para_portugues_do_brasil-2.3-3.2b1-tb+sm+fn+fx.xpi", "dictionaries/pt_BR.dic", "dictionaries/pt_BR.aff", "vietnamese_dictionary-2.1.0.159-an+sm+tb+fx+fn.xpi", "dictionaries/vi-DauCu.d
 ic", "dictionaries/vi-DauCu.aff", "vietnamese_dictionary-2.1.0.159-an+sm+tb+fx+fn.xpi", "dictionaries/vi-DauMoi.dic", "dictionaries/vi-DauMoi.aff", "woordenboek_nederlands-3.1.1-sm+tb+fx+fn.xpi", "dictionaries/nl.dic", "dictionaries/nl.aff", "xhosa_spell_checker-20110323-tb+fn+fx+sm.xpi", "dictionaries/xh-ZA.dic", "dictionaries/xh-ZA.aff", "xuxen-4.0.1-fx+tb+sm.xpi", "dictionaries/eu.dic", "dictionaries/eu.aff", "yiddish_spell_checker_yivo-0.0.3-sm+fn+fx+tb.xpi", "dictionaries/yi.dic", "dictionaries/yi.aff", "zulu_spell_checker-20110323-tb+fn+fx+sm.xpi", "dictionaries/zu-ZA.dic", "dictionaries/zu-ZA.aff"};
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void test() throws Exception
+	  public virtual void test()
+	  {
+		for (int i = 0; i < tests.Length; i += 3)
+		{
+		  File f = new File(DICTIONARY_HOME, tests[i]);
+		  Debug.Assert(f.exists());
+
+		  using (ZipFile zip = new ZipFile(f, StandardCharsets.UTF_8))
+		  {
+			ZipEntry dicEntry = zip.getEntry(tests[i + 1]);
+			Debug.Assert(dicEntry != null);
+			ZipEntry affEntry = zip.getEntry(tests[i + 2]);
+			Debug.Assert(affEntry != null);
+
+			using (System.IO.Stream dictionary = zip.getInputStream(dicEntry), System.IO.Stream affix = zip.getInputStream(affEntry))
+			{
+			  Dictionary dic = new Dictionary(affix, dictionary);
+			  Console.WriteLine(tests[i] + "\t" + RamUsageEstimator.humanSizeOf(dic) + "\t(" + "words=" + RamUsageEstimator.humanSizeOf(dic.words) + ", " + "flags=" + RamUsageEstimator.humanSizeOf(dic.flagLookup) + ", " + "strips=" + RamUsageEstimator.humanSizeOf(dic.stripData) + ", " + "conditions=" + RamUsageEstimator.humanSizeOf(dic.patterns) + ", " + "affixData=" + RamUsageEstimator.humanSizeOf(dic.affixData) + ", " + "prefixes=" + RamUsageEstimator.humanSizeOf(dic.prefixes) + ", " + "suffixes=" + RamUsageEstimator.humanSizeOf(dic.suffixes) + ")");
+			}
+		  }
+		}
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testOneDictionary() throws Exception
+	  public virtual void testOneDictionary()
+	  {
+		string toTest = "hungarian_dictionary-1.6.1.1-fx+tb+sm+fn.xpi";
+		for (int i = 0; i < tests.Length; i++)
+		{
+		  if (tests[i].Equals(toTest))
+		  {
+			File f = new File(DICTIONARY_HOME, tests[i]);
+			Debug.Assert(f.exists());
+
+			using (ZipFile zip = new ZipFile(f, StandardCharsets.UTF_8))
+			{
+			  ZipEntry dicEntry = zip.getEntry(tests[i + 1]);
+			  Debug.Assert(dicEntry != null);
+			  ZipEntry affEntry = zip.getEntry(tests[i + 2]);
+			  Debug.Assert(affEntry != null);
+
+			  using (System.IO.Stream dictionary = zip.getInputStream(dicEntry), System.IO.Stream affix = zip.getInputStream(affEntry))
+			  {
+				new Dictionary(affix, dictionary);
+			  }
+			}
+		  }
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestCaseInsensitive.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestCaseInsensitive.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestCaseInsensitive.cs
new file mode 100644
index 0000000..1a84783
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestCaseInsensitive.cs
@@ -0,0 +1,90 @@
+namespace org.apache.lucene.analysis.hunspell
+{
+
+	/*
+	 * 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 BeforeClass = org.junit.BeforeClass;
+
+	public class TestCaseInsensitive : StemmerTestBase
+	{
+
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @BeforeClass public static void beforeClass() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public static void beforeClass()
+	  {
+		init(true, "simple.aff", "mixedcase.dic");
+	  }
+
+	  public virtual void testCaseInsensitivity()
+	  {
+		assertStemsTo("lucene", "lucene", "lucen");
+		assertStemsTo("LuCeNe", "lucene", "lucen");
+		assertStemsTo("mahoute", "mahout");
+		assertStemsTo("MaHoUte", "mahout");
+	  }
+
+	  public virtual void testSimplePrefix()
+	  {
+		assertStemsTo("solr", "olr");
+	  }
+
+	  public virtual void testRecursiveSuffix()
+	  {
+		// we should not recurse here! as the suffix has no continuation!
+		assertStemsTo("abcd");
+	  }
+
+	  // all forms unmunched from dictionary
+	  public virtual void testAllStems()
+	  {
+		assertStemsTo("ab", "ab");
+		assertStemsTo("abc", "ab");
+		assertStemsTo("apach", "apach");
+		assertStemsTo("apache", "apach");
+		assertStemsTo("foo", "foo", "foo");
+		assertStemsTo("food", "foo");
+		assertStemsTo("foos", "foo");
+		assertStemsTo("lucen", "lucen");
+		assertStemsTo("lucene", "lucen", "lucene");
+		assertStemsTo("mahout", "mahout");
+		assertStemsTo("mahoute", "mahout");
+		assertStemsTo("moo", "moo");
+		assertStemsTo("mood", "moo");
+		assertStemsTo("olr", "olr");
+		assertStemsTo("solr", "olr");
+	  }
+
+	  // some bogus stuff that should not stem (empty lists)!
+	  public virtual void testBogusStems()
+	  {
+		assertStemsTo("abs");
+		assertStemsTo("abe");
+		assertStemsTo("sab");
+		assertStemsTo("sapach");
+		assertStemsTo("sapache");
+		assertStemsTo("apachee");
+		assertStemsTo("sfoo");
+		assertStemsTo("sfoos");
+		assertStemsTo("fooss");
+		assertStemsTo("lucenee");
+		assertStemsTo("solre");
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestCircumfix.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestCircumfix.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestCircumfix.cs
new file mode 100644
index 0000000..0fd32a8
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestCircumfix.cs
@@ -0,0 +1,46 @@
+namespace org.apache.lucene.analysis.hunspell
+{
+
+	/*
+	 * 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 BeforeClass = org.junit.BeforeClass;
+
+	public class TestCircumfix : StemmerTestBase
+	{
+
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @BeforeClass public static void beforeClass() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public static void beforeClass()
+	  {
+		init("circumfix.aff", "circumfix.dic");
+	  }
+
+	  public virtual void testCircumfix()
+	  {
+		assertStemsTo("nagy", "nagy");
+		assertStemsTo("nagyobb", "nagy");
+		assertStemsTo("legnagyobb", "nagy");
+		assertStemsTo("legeslegnagyobb", "nagy");
+		assertStemsTo("nagyobbobb");
+		assertStemsTo("legnagy");
+		assertStemsTo("legeslegnagy");
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestComplexPrefix.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestComplexPrefix.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestComplexPrefix.cs
new file mode 100644
index 0000000..ee892b4
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestComplexPrefix.cs
@@ -0,0 +1,47 @@
+namespace org.apache.lucene.analysis.hunspell
+{
+
+	/*
+	 * 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 BeforeClass = org.junit.BeforeClass;
+
+	public class TestComplexPrefix : StemmerTestBase
+	{
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @BeforeClass public static void beforeClass() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public static void beforeClass()
+	  {
+		init("complexprefix.aff", "complexprefix.dic");
+	  }
+
+	  public virtual void testPrefixes()
+	  {
+		assertStemsTo("ptwofoo", "foo");
+		assertStemsTo("poneptwofoo", "foo");
+		assertStemsTo("foosuf", "foo");
+		assertStemsTo("ptwofoosuf", "foo");
+		assertStemsTo("poneptwofoosuf", "foo");
+		assertStemsTo("ponefoo");
+		assertStemsTo("ponefoosuf");
+		assertStemsTo("ptwoponefoo");
+		assertStemsTo("ptwoponefoosuf");
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestCondition.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestCondition.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestCondition.cs
new file mode 100644
index 0000000..af1f60d
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestCondition.cs
@@ -0,0 +1,50 @@
+namespace org.apache.lucene.analysis.hunspell
+{
+
+	/*
+	 * 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 BeforeClass = org.junit.BeforeClass;
+
+	public class TestCondition : StemmerTestBase
+	{
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @BeforeClass public static void beforeClass() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public static void beforeClass()
+	  {
+		init("condition.aff", "condition.dic");
+	  }
+
+	  public virtual void testStemming()
+	  {
+		assertStemsTo("hello", "hello");
+		assertStemsTo("try", "try");
+		assertStemsTo("tried", "try");
+		assertStemsTo("work", "work");
+		assertStemsTo("worked", "work");
+		assertStemsTo("rework", "work");
+		assertStemsTo("reworked", "work");
+		assertStemsTo("retried");
+		assertStemsTo("workied");
+		assertStemsTo("tryed");
+		assertStemsTo("tryied");
+		assertStemsTo("helloed");
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestConv.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestConv.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestConv.cs
new file mode 100644
index 0000000..0a1f209
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestConv.cs
@@ -0,0 +1,44 @@
+namespace org.apache.lucene.analysis.hunspell
+{
+
+	using BeforeClass = org.junit.BeforeClass;
+
+	/*
+	 * 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.
+	 */
+
+	public class TestConv : StemmerTestBase
+	{
+
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @BeforeClass public static void beforeClass() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public static void beforeClass()
+	  {
+		init("conv.aff", "conv.dic");
+	  }
+
+	  public virtual void testConversion()
+	  {
+		assertStemsTo("drink", "drInk");
+		assertStemsTo("drInk", "drInk");
+		assertStemsTo("drInkAble", "drInk");
+		assertStemsTo("drInkABle", "drInk");
+		assertStemsTo("drinkABle", "drInk");
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestDependencies.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestDependencies.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestDependencies.cs
new file mode 100644
index 0000000..79a2b34
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestDependencies.cs
@@ -0,0 +1,47 @@
+namespace org.apache.lucene.analysis.hunspell
+{
+
+	/*
+	 * 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 BeforeClass = org.junit.BeforeClass;
+
+	public class TestDependencies : StemmerTestBase
+	{
+
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @BeforeClass public static void beforeClass() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public static void beforeClass()
+	  {
+		init("dependencies.aff", "dependencies.dic");
+	  }
+
+	  public virtual void testDependencies()
+	  {
+		assertStemsTo("drink", "drink", "drink");
+		assertStemsTo("drinks", "drink", "drink");
+		assertStemsTo("drinkable", "drink");
+		assertStemsTo("drinkables", "drink");
+		assertStemsTo("undrinkable", "drink");
+		assertStemsTo("undrinkables", "drink");
+		assertStemsTo("undrink");
+		assertStemsTo("undrinks");
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestDictionary.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestDictionary.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestDictionary.cs
new file mode 100644
index 0000000..266f4f5
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestDictionary.cs
@@ -0,0 +1,293 @@
+using System;
+using System.Text;
+
+namespace org.apache.lucene.analysis.hunspell
+{
+
+	/*
+	 * 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 BytesRef = org.apache.lucene.util.BytesRef;
+	using CharsRef = org.apache.lucene.util.CharsRef;
+	using IOUtils = org.apache.lucene.util.IOUtils;
+	using IntsRef = org.apache.lucene.util.IntsRef;
+	using LuceneTestCase = org.apache.lucene.util.LuceneTestCase;
+	using Builder = org.apache.lucene.util.fst.Builder;
+	using CharSequenceOutputs = org.apache.lucene.util.fst.CharSequenceOutputs;
+	using FST = org.apache.lucene.util.fst.FST;
+	using Outputs = org.apache.lucene.util.fst.Outputs;
+	using Util = org.apache.lucene.util.fst.Util;
+
+	public class TestDictionary : LuceneTestCase
+	{
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testSimpleDictionary() throws Exception
+	  public virtual void testSimpleDictionary()
+	  {
+		System.IO.Stream affixStream = this.GetType().getResourceAsStream("simple.aff");
+		System.IO.Stream dictStream = this.GetType().getResourceAsStream("simple.dic");
+
+		Dictionary dictionary = new Dictionary(affixStream, dictStream);
+		assertEquals(3, dictionary.lookupSuffix(new char[]{'e'}, 0, 1).length);
+		assertEquals(1, dictionary.lookupPrefix(new char[]{'s'}, 0, 1).length);
+		IntsRef ordList = dictionary.lookupWord(new char[]{'o', 'l', 'r'}, 0, 3);
+		assertNotNull(ordList);
+		assertEquals(1, ordList.length);
+
+		BytesRef @ref = new BytesRef();
+		dictionary.flagLookup.get(ordList.ints[0], @ref);
+		char[] flags = Dictionary.decodeFlags(@ref);
+		assertEquals(1, flags.Length);
+
+		ordList = dictionary.lookupWord(new char[]{'l', 'u', 'c', 'e', 'n'}, 0, 5);
+		assertNotNull(ordList);
+		assertEquals(1, ordList.length);
+		dictionary.flagLookup.get(ordList.ints[0], @ref);
+		flags = Dictionary.decodeFlags(@ref);
+		assertEquals(1, flags.Length);
+
+		affixStream.Close();
+		dictStream.Close();
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCompressedDictionary() throws Exception
+	  public virtual void testCompressedDictionary()
+	  {
+		System.IO.Stream affixStream = this.GetType().getResourceAsStream("compressed.aff");
+		System.IO.Stream dictStream = this.GetType().getResourceAsStream("compressed.dic");
+
+		Dictionary dictionary = new Dictionary(affixStream, dictStream);
+		assertEquals(3, dictionary.lookupSuffix(new char[]{'e'}, 0, 1).length);
+		assertEquals(1, dictionary.lookupPrefix(new char[]{'s'}, 0, 1).length);
+		IntsRef ordList = dictionary.lookupWord(new char[]{'o', 'l', 'r'}, 0, 3);
+		BytesRef @ref = new BytesRef();
+		dictionary.flagLookup.get(ordList.ints[0], @ref);
+		char[] flags = Dictionary.decodeFlags(@ref);
+		assertEquals(1, flags.Length);
+
+		affixStream.Close();
+		dictStream.Close();
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCompressedBeforeSetDictionary() throws Exception
+	  public virtual void testCompressedBeforeSetDictionary()
+	  {
+		System.IO.Stream affixStream = this.GetType().getResourceAsStream("compressed-before-set.aff");
+		System.IO.Stream dictStream = this.GetType().getResourceAsStream("compressed.dic");
+
+		Dictionary dictionary = new Dictionary(affixStream, dictStream);
+		assertEquals(3, dictionary.lookupSuffix(new char[]{'e'}, 0, 1).length);
+		assertEquals(1, dictionary.lookupPrefix(new char[]{'s'}, 0, 1).length);
+		IntsRef ordList = dictionary.lookupWord(new char[]{'o', 'l', 'r'}, 0, 3);
+		BytesRef @ref = new BytesRef();
+		dictionary.flagLookup.get(ordList.ints[0], @ref);
+		char[] flags = Dictionary.decodeFlags(@ref);
+		assertEquals(1, flags.Length);
+
+		affixStream.Close();
+		dictStream.Close();
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testCompressedEmptyAliasDictionary() throws Exception
+	  public virtual void testCompressedEmptyAliasDictionary()
+	  {
+		System.IO.Stream affixStream = this.GetType().getResourceAsStream("compressed-empty-alias.aff");
+		System.IO.Stream dictStream = this.GetType().getResourceAsStream("compressed.dic");
+
+		Dictionary dictionary = new Dictionary(affixStream, dictStream);
+		assertEquals(3, dictionary.lookupSuffix(new char[]{'e'}, 0, 1).length);
+		assertEquals(1, dictionary.lookupPrefix(new char[]{'s'}, 0, 1).length);
+		IntsRef ordList = dictionary.lookupWord(new char[]{'o', 'l', 'r'}, 0, 3);
+		BytesRef @ref = new BytesRef();
+		dictionary.flagLookup.get(ordList.ints[0], @ref);
+		char[] flags = Dictionary.decodeFlags(@ref);
+		assertEquals(1, flags.Length);
+
+		affixStream.Close();
+		dictStream.Close();
+	  }
+
+	  // malformed rule causes ParseException
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testInvalidData() throws Exception
+	  public virtual void testInvalidData()
+	  {
+		System.IO.Stream affixStream = this.GetType().getResourceAsStream("broken.aff");
+		System.IO.Stream dictStream = this.GetType().getResourceAsStream("simple.dic");
+
+		try
+		{
+		  new Dictionary(affixStream, dictStream);
+		  fail("didn't get expected exception");
+		}
+		catch (ParseException expected)
+		{
+		  assertTrue(expected.Message.startsWith("The affix file contains a rule with less than four elements"));
+		  assertEquals(24, expected.ErrorOffset);
+		}
+
+		affixStream.Close();
+		dictStream.Close();
+	  }
+
+	  // malformed flags causes ParseException
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testInvalidFlags() throws Exception
+	  public virtual void testInvalidFlags()
+	  {
+		System.IO.Stream affixStream = this.GetType().getResourceAsStream("broken-flags.aff");
+		System.IO.Stream dictStream = this.GetType().getResourceAsStream("simple.dic");
+
+		try
+		{
+		  new Dictionary(affixStream, dictStream);
+		  fail("didn't get expected exception");
+		}
+		catch (Exception expected)
+		{
+		  assertTrue(expected.Message.startsWith("expected only one flag"));
+		}
+
+		affixStream.Close();
+		dictStream.Close();
+	  }
+
+	  private class CloseCheckInputStream : FilterInputStream
+	  {
+		  private readonly TestDictionary outerInstance;
+
+		internal bool closed = false;
+
+		public CloseCheckInputStream(TestDictionary outerInstance, System.IO.Stream @delegate) : base(@delegate)
+		{
+			this.outerInstance = outerInstance;
+		}
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: @Override public void close() throws java.io.IOException
+		public override void close()
+		{
+		  this.closed = true;
+		  base.close();
+		}
+
+		public virtual bool Closed
+		{
+			get
+			{
+			  return this.closed;
+			}
+		}
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testResourceCleanup() throws Exception
+	  public virtual void testResourceCleanup()
+	  {
+		CloseCheckInputStream affixStream = new CloseCheckInputStream(this, this.GetType().getResourceAsStream("compressed.aff"));
+		CloseCheckInputStream dictStream = new CloseCheckInputStream(this, this.GetType().getResourceAsStream("compressed.dic"));
+
+		new Dictionary(affixStream, dictStream);
+
+		assertFalse(affixStream.Closed);
+		assertFalse(dictStream.Closed);
+
+		affixStream.close();
+		dictStream.close();
+
+		assertTrue(affixStream.Closed);
+		assertTrue(dictStream.Closed);
+	  }
+
+
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testReplacements() throws Exception
+	  public virtual void testReplacements()
+	  {
+		Outputs<CharsRef> outputs = CharSequenceOutputs.Singleton;
+		Builder<CharsRef> builder = new Builder<CharsRef>(FST.INPUT_TYPE.BYTE2, outputs);
+		IntsRef scratchInts = new IntsRef();
+
+		// a -> b
+		Util.toUTF16("a", scratchInts);
+		builder.add(scratchInts, new CharsRef("b"));
+
+		// ab -> c
+		Util.toUTF16("ab", scratchInts);
+		builder.add(scratchInts, new CharsRef("c"));
+
+		// c -> de
+		Util.toUTF16("c", scratchInts);
+		builder.add(scratchInts, new CharsRef("de"));
+
+		// def -> gh
+		Util.toUTF16("def", scratchInts);
+		builder.add(scratchInts, new CharsRef("gh"));
+
+		FST<CharsRef> fst = builder.finish();
+
+		StringBuilder sb = new StringBuilder("atestanother");
+		Dictionary.applyMappings(fst, sb);
+		assertEquals("btestbnother", sb.ToString());
+
+		sb = new StringBuilder("abtestanother");
+		Dictionary.applyMappings(fst, sb);
+		assertEquals("ctestbnother", sb.ToString());
+
+		sb = new StringBuilder("atestabnother");
+		Dictionary.applyMappings(fst, sb);
+		assertEquals("btestcnother", sb.ToString());
+
+		sb = new StringBuilder("abtestabnother");
+		Dictionary.applyMappings(fst, sb);
+		assertEquals("ctestcnother", sb.ToString());
+
+		sb = new StringBuilder("abtestabcnother");
+		Dictionary.applyMappings(fst, sb);
+		assertEquals("ctestcdenother", sb.ToString());
+
+		sb = new StringBuilder("defdefdefc");
+		Dictionary.applyMappings(fst, sb);
+		assertEquals("ghghghde", sb.ToString());
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testSetWithCrazyWhitespaceAndBOMs() throws Exception
+	  public virtual void testSetWithCrazyWhitespaceAndBOMs()
+	  {
+		assertEquals("UTF-8", Dictionary.getDictionaryEncoding(new ByteArrayInputStream("SET\tUTF-8\n".GetBytes(StandardCharsets.UTF_8))));
+		assertEquals("UTF-8", Dictionary.getDictionaryEncoding(new ByteArrayInputStream("SET\t UTF-8\n".GetBytes(StandardCharsets.UTF_8))));
+		assertEquals("UTF-8", Dictionary.getDictionaryEncoding(new ByteArrayInputStream("\uFEFFSET\tUTF-8\n".GetBytes(StandardCharsets.UTF_8))));
+		assertEquals("UTF-8", Dictionary.getDictionaryEncoding(new ByteArrayInputStream("\uFEFFSET\tUTF-8\r\n".GetBytes(StandardCharsets.UTF_8))));
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testFlagWithCrazyWhitespace() throws Exception
+	  public virtual void testFlagWithCrazyWhitespace()
+	  {
+		assertNotNull(Dictionary.getFlagParsingStrategy("FLAG\tUTF-8"));
+		assertNotNull(Dictionary.getFlagParsingStrategy("FLAG    UTF-8"));
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestEscaped.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestEscaped.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestEscaped.cs
new file mode 100644
index 0000000..1a50fe4
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestEscaped.cs
@@ -0,0 +1,44 @@
+namespace org.apache.lucene.analysis.hunspell
+{
+
+	/*
+	 * 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 BeforeClass = org.junit.BeforeClass;
+
+	public class TestEscaped : StemmerTestBase
+	{
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @BeforeClass public static void beforeClass() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public static void beforeClass()
+	  {
+		init("escaped.aff", "escaped.dic");
+	  }
+
+	  public virtual void testStemming()
+	  {
+		assertStemsTo("works", "work");
+		assertStemsTo("work", "work");
+		assertStemsTo("R2/D2", "R2/D2");
+		assertStemsTo("R2/D2s", "R2/D2");
+		assertStemsTo("N/A", "N/A");
+		assertStemsTo("N/As");
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestFlagLong.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestFlagLong.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestFlagLong.cs
new file mode 100644
index 0000000..c94e5fb
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestFlagLong.cs
@@ -0,0 +1,41 @@
+namespace org.apache.lucene.analysis.hunspell
+{
+
+	/*
+	 * 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 BeforeClass = org.junit.BeforeClass;
+
+	public class TestFlagLong : StemmerTestBase
+	{
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @BeforeClass public static void beforeClass() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public static void beforeClass()
+	  {
+		init("flaglong.aff", "flaglong.dic");
+	  }
+
+	  public virtual void testLongFlags()
+	  {
+		assertStemsTo("foo", "foo");
+		assertStemsTo("foos", "foo");
+		assertStemsTo("fooss");
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestFlagNum.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestFlagNum.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestFlagNum.cs
new file mode 100644
index 0000000..4873fc7
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestFlagNum.cs
@@ -0,0 +1,41 @@
+namespace org.apache.lucene.analysis.hunspell
+{
+
+	/*
+	 * 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 BeforeClass = org.junit.BeforeClass;
+
+	public class TestFlagNum : StemmerTestBase
+	{
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @BeforeClass public static void beforeClass() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public static void beforeClass()
+	  {
+		init("flagnum.aff", "flagnum.dic");
+	  }
+
+	  public virtual void testNumFlags()
+	  {
+		assertStemsTo("foo", "foo");
+		assertStemsTo("foos", "foo");
+		assertStemsTo("fooss");
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestHomonyms.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestHomonyms.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestHomonyms.cs
new file mode 100644
index 0000000..11bb494
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestHomonyms.cs
@@ -0,0 +1,40 @@
+namespace org.apache.lucene.analysis.hunspell
+{
+
+	/*
+	 * 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 BeforeClass = org.junit.BeforeClass;
+
+	public class TestHomonyms : StemmerTestBase
+	{
+
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @BeforeClass public static void beforeClass() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public static void beforeClass()
+	  {
+		init("homonyms.aff", "homonyms.dic");
+	  }
+
+	  public virtual void testExamples()
+	  {
+		assertStemsTo("works", "work", "work");
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestHunspellStemFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestHunspellStemFilter.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestHunspellStemFilter.cs
new file mode 100644
index 0000000..6c3e22b
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestHunspellStemFilter.cs
@@ -0,0 +1,178 @@
+namespace org.apache.lucene.analysis.hunspell
+{
+
+	/*
+	 * 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 KeywordTokenizer = org.apache.lucene.analysis.core.KeywordTokenizer;
+	using SetKeywordMarkerFilter = org.apache.lucene.analysis.miscellaneous.SetKeywordMarkerFilter;
+	using CharArraySet = org.apache.lucene.analysis.util.CharArraySet;
+	using IOUtils = org.apache.lucene.util.IOUtils;
+	using AfterClass = org.junit.AfterClass;
+	using BeforeClass = org.junit.BeforeClass;
+
+	public class TestHunspellStemFilter : BaseTokenStreamTestCase
+	{
+	  private static Dictionary dictionary;
+
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @BeforeClass public static void beforeClass() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public static void beforeClass()
+	  {
+		System.IO.Stream affixStream = typeof(TestStemmer).getResourceAsStream("simple.aff");
+		System.IO.Stream dictStream = typeof(TestStemmer).getResourceAsStream("simple.dic");
+		try
+		{
+		  dictionary = new Dictionary(affixStream, dictStream);
+		}
+		finally
+		{
+		  IOUtils.closeWhileHandlingException(affixStream, dictStream);
+		}
+	  }
+
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @AfterClass public static void afterClass()
+	  public static void afterClass()
+	  {
+		dictionary = null;
+	  }
+
+	  /// <summary>
+	  /// Simple test for KeywordAttribute </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testKeywordAttribute() throws java.io.IOException
+	  public virtual void testKeywordAttribute()
+	  {
+		MockTokenizer tokenizer = new MockTokenizer(new StringReader("lucene is awesome"));
+		tokenizer.EnableChecks = true;
+		HunspellStemFilter filter = new HunspellStemFilter(tokenizer, dictionary);
+		assertTokenStreamContents(filter, new string[]{"lucene", "lucen", "is", "awesome"}, new int[] {1, 0, 1, 1});
+
+		// assert with keyword marker
+		tokenizer = new MockTokenizer(new StringReader("lucene is awesome"));
+		CharArraySet set = new CharArraySet(TEST_VERSION_CURRENT, Arrays.asList("Lucene"), true);
+		filter = new HunspellStemFilter(new SetKeywordMarkerFilter(tokenizer, set), dictionary);
+		assertTokenStreamContents(filter, new string[]{"lucene", "is", "awesome"}, new int[] {1, 1, 1});
+	  }
+
+	  /// <summary>
+	  /// simple test for longestOnly option </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testLongestOnly() throws java.io.IOException
+	  public virtual void testLongestOnly()
+	  {
+		MockTokenizer tokenizer = new MockTokenizer(new StringReader("lucene is awesome"));
+		tokenizer.EnableChecks = true;
+		HunspellStemFilter filter = new HunspellStemFilter(tokenizer, dictionary, true, true);
+		assertTokenStreamContents(filter, new string[]{"lucene", "is", "awesome"}, new int[] {1, 1, 1});
+	  }
+
+	  /// <summary>
+	  /// blast some random strings through the analyzer </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testRandomStrings() throws Exception
+	  public virtual void testRandomStrings()
+	  {
+		Analyzer analyzer = new AnalyzerAnonymousInnerClassHelper(this);
+		checkRandomData(random(), analyzer, 1000 * RANDOM_MULTIPLIER);
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper : Analyzer
+	  {
+		  private readonly TestHunspellStemFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper(TestHunspellStemFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+			return new TokenStreamComponents(tokenizer, new HunspellStemFilter(tokenizer, dictionary));
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testEmptyTerm() throws java.io.IOException
+	  public virtual void testEmptyTerm()
+	  {
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper2(this);
+		checkOneTerm(a, "", "");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper2 : Analyzer
+	  {
+		  private readonly TestHunspellStemFilter outerInstance;
+
+		  public AnalyzerAnonymousInnerClassHelper2(TestHunspellStemFilter outerInstance)
+		  {
+			  this.outerInstance = outerInstance;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new HunspellStemFilter(tokenizer, dictionary));
+		  }
+	  }
+
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testIgnoreCaseNoSideEffects() throws Exception
+	  public virtual void testIgnoreCaseNoSideEffects()
+	  {
+//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
+//ORIGINAL LINE: final org.apache.lucene.analysis.hunspell.Dictionary d;
+		Dictionary d;
+		System.IO.Stream affixStream = typeof(TestStemmer).getResourceAsStream("simple.aff");
+		System.IO.Stream dictStream = typeof(TestStemmer).getResourceAsStream("simple.dic");
+		try
+		{
+		  d = new Dictionary(affixStream, Collections.singletonList(dictStream), true);
+		}
+		finally
+		{
+		  IOUtils.closeWhileHandlingException(affixStream, dictStream);
+		}
+		Analyzer a = new AnalyzerAnonymousInnerClassHelper3(this, d);
+		checkOneTerm(a, "NoChAnGy", "NoChAnGy");
+	  }
+
+	  private class AnalyzerAnonymousInnerClassHelper3 : Analyzer
+	  {
+		  private readonly TestHunspellStemFilter outerInstance;
+
+		  private Dictionary d;
+
+		  public AnalyzerAnonymousInnerClassHelper3(TestHunspellStemFilter outerInstance, Dictionary d)
+		  {
+			  this.outerInstance = outerInstance;
+			  this.d = d;
+		  }
+
+		  protected internal override TokenStreamComponents createComponents(string fieldName, Reader reader)
+		  {
+			Tokenizer tokenizer = new KeywordTokenizer(reader);
+			return new TokenStreamComponents(tokenizer, new HunspellStemFilter(tokenizer, d));
+		  }
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestHunspellStemFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestHunspellStemFilterFactory.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestHunspellStemFilterFactory.cs
new file mode 100644
index 0000000..2073e7b
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestHunspellStemFilterFactory.cs
@@ -0,0 +1,57 @@
+namespace org.apache.lucene.analysis.hunspell
+{
+
+	/*
+	 * 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 BaseTokenStreamFactoryTestCase = org.apache.lucene.analysis.util.BaseTokenStreamFactoryTestCase;
+
+	/// <summary>
+	/// Simple tests to ensure the Hunspell stemmer loads from factory
+	/// </summary>
+	public class TestHunspellStemFilterFactory : BaseTokenStreamFactoryTestCase
+	{
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testStemming() throws Exception
+	  public virtual void testStemming()
+	  {
+		Reader reader = new StringReader("abc");
+		TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
+		stream = tokenFilterFactory("HunspellStem", "dictionary", "simple.dic", "affix", "simple.aff").create(stream);
+		assertTokenStreamContents(stream, new string[] {"ab"});
+	  }
+
+	  /// <summary>
+	  /// Test that bogus arguments result in exception </summary>
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+//ORIGINAL LINE: public void testBogusArguments() throws Exception
+	  public virtual void testBogusArguments()
+	  {
+		try
+		{
+		  tokenFilterFactory("HunspellStem", "dictionary", "simple.dic", "bogusArg", "bogusValue");
+		  fail();
+		}
+		catch (System.ArgumentException expected)
+		{
+		  assertTrue(expected.Message.contains("Unknown parameters"));
+		}
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestIgnore.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestIgnore.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestIgnore.cs
new file mode 100644
index 0000000..77f5b84
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestIgnore.cs
@@ -0,0 +1,44 @@
+namespace org.apache.lucene.analysis.hunspell
+{
+
+	/*
+	 * 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 BeforeClass = org.junit.BeforeClass;
+
+	public class TestIgnore : StemmerTestBase
+	{
+
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @BeforeClass public static void beforeClass() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public static void beforeClass()
+	  {
+		init("ignore.aff", "ignore.dic");
+	  }
+
+	  public virtual void testExamples()
+	  {
+		assertStemsTo("drink", "drink");
+		assertStemsTo("drinkable", "drink");
+		assertStemsTo("dr'ink-able", "drink");
+		assertStemsTo("drank-able", "drank");
+		assertStemsTo("'-'-'-");
+	  }
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/c64856a7/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestMorph.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestMorph.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestMorph.cs
new file mode 100644
index 0000000..20a1d77
--- /dev/null
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Hunspell/TestMorph.cs
@@ -0,0 +1,42 @@
+namespace org.apache.lucene.analysis.hunspell
+{
+
+	/*
+	 * 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 BeforeClass = org.junit.BeforeClass;
+
+	public class TestMorph : StemmerTestBase
+	{
+
+//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
+//ORIGINAL LINE: @BeforeClass public static void beforeClass() throws Exception
+//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
+	  public static void beforeClass()
+	  {
+		init("morph.aff", "morph.dic");
+	  }
+
+	  public virtual void testExamples()
+	  {
+		assertStemsTo("drink", "drink");
+		assertStemsTo("drinkable", "drink");
+		assertStemsTo("drinkableable");
+	  }
+	}
+
+}
\ No newline at end of file