lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [13/27] lucenenet git commit: adding converted analysis common tests
Date Thu, 10 Dec 2015 18:39:02 GMT
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


Mime
View raw message