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:39:05 UTC
[16/27] lucenenet git commit: adding converted analysis common tests
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