/// <summary> /// Test that custom stopwords work, and are not case-sensitive. /// </summary> //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: public void testCustomStopwords() throws Exception public virtual void testCustomStopwords() { CharArraySet set = new CharArraySet(TEST_VERSION_CURRENT, asSet("the", "and", "a"), false); ArabicAnalyzer a = new ArabicAnalyzer(TEST_VERSION_CURRENT, set); assertAnalyzesTo(a, "The quick brown fox.", new string[] { "quick", "brown", "fox" }); }
/// <summary> /// Simple tests to show things are getting reset correctly, etc. /// </summary> //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: public void testReusableTokenStream() throws Exception public virtual void testReusableTokenStream() { ArabicAnalyzer a = new ArabicAnalyzer(TEST_VERSION_CURRENT); assertAnalyzesTo(a, "كبير", new string[] { "كبير" }); assertAnalyzesTo(a, "كبيرة", new string[] { "كبير" }); // feminine marker }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: public void testWithStemExclusionSet() throws java.io.IOException public virtual void testWithStemExclusionSet() { CharArraySet set = new CharArraySet(TEST_VERSION_CURRENT, asSet("ساهدهات"), false); ArabicAnalyzer a = new ArabicAnalyzer(TEST_VERSION_CURRENT, CharArraySet.EMPTY_SET, set); assertAnalyzesTo(a, "كبيرة the quick ساهدهات", new string[] { "كبير", "the", "quick", "ساهدهات" }); assertAnalyzesTo(a, "كبيرة the quick ساهدهات", new string[] { "كبير", "the", "quick", "ساهدهات" }); a = new ArabicAnalyzer(TEST_VERSION_CURRENT, CharArraySet.EMPTY_SET, CharArraySet.EMPTY_SET); assertAnalyzesTo(a, "كبيرة the quick ساهدهات", new string[] { "كبير", "the", "quick", "ساهد" }); assertAnalyzesTo(a, "كبيرة the quick ساهدهات", new string[] { "كبير", "the", "quick", "ساهد" }); }
/// <summary> /// Some simple tests showing some features of the analyzer, how some regular forms will conflate /// </summary> //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: public void testBasicFeatures() throws Exception public virtual void testBasicFeatures() { ArabicAnalyzer a = new ArabicAnalyzer(TEST_VERSION_CURRENT); assertAnalyzesTo(a, "كبير", new string[] {"كبير"}); assertAnalyzesTo(a, "كبيرة", new string[] {"كبير"}); // feminine marker assertAnalyzesTo(a, "مشروب", new string[] {"مشروب"}); assertAnalyzesTo(a, "مشروبات", new string[] {"مشروب"}); // plural -at assertAnalyzesTo(a, "أمريكيين", new string[] {"امريك"}); // plural -in assertAnalyzesTo(a, "امريكي", new string[] {"امريك"}); // singular with bare alif assertAnalyzesTo(a, "كتاب", new string[] {"كتاب"}); assertAnalyzesTo(a, "الكتاب", new string[] {"كتاب"}); // definite article assertAnalyzesTo(a, "ما ملكت أيمانكم", new string[] {"ملكت", "ايمانكم"}); assertAnalyzesTo(a, "الذين ملكت أيمانكم", new string[] {"ملكت", "ايمانكم"}); // stopwords }
/// <summary> /// Some simple tests showing some features of the analyzer, how some regular forms will conflate /// </summary> //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: public void testBasicFeatures() throws Exception public virtual void testBasicFeatures() { ArabicAnalyzer a = new ArabicAnalyzer(TEST_VERSION_CURRENT); assertAnalyzesTo(a, "كبير", new string[] { "كبير" }); assertAnalyzesTo(a, "كبيرة", new string[] { "كبير" }); // feminine marker assertAnalyzesTo(a, "مشروب", new string[] { "مشروب" }); assertAnalyzesTo(a, "مشروبات", new string[] { "مشروب" }); // plural -at assertAnalyzesTo(a, "أمريكيين", new string[] { "امريك" }); // plural -in assertAnalyzesTo(a, "امريكي", new string[] { "امريك" }); // singular with bare alif assertAnalyzesTo(a, "كتاب", new string[] { "كتاب" }); assertAnalyzesTo(a, "الكتاب", new string[] { "كتاب" }); // definite article assertAnalyzesTo(a, "ما ملكت أيمانكم", new string[] { "ملكت", "ايمانكم" }); assertAnalyzesTo(a, "الذين ملكت أيمانكم", new string[] { "ملكت", "ايمانكم" }); // stopwords }
/// <summary> /// Simple tests to show things are getting reset correctly, etc. /// </summary> //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: public void testReusableTokenStream() throws Exception public virtual void testReusableTokenStream() { ArabicAnalyzer a = new ArabicAnalyzer(TEST_VERSION_CURRENT); assertAnalyzesTo(a, "كبير", new string[] {"كبير"}); assertAnalyzesTo(a, "كبيرة", new string[] {"كبير"}); // feminine marker }
/// <summary> /// Test that custom stopwords work, and are not case-sensitive. /// </summary> //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: public void testCustomStopwords() throws Exception public virtual void testCustomStopwords() { CharArraySet set = new CharArraySet(TEST_VERSION_CURRENT, asSet("the", "and", "a"), false); ArabicAnalyzer a = new ArabicAnalyzer(TEST_VERSION_CURRENT, set); assertAnalyzesTo(a, "The quick brown fox.", new string[] {"quick", "brown", "fox"}); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: public void testWithStemExclusionSet() throws java.io.IOException public virtual void testWithStemExclusionSet() { CharArraySet set = new CharArraySet(TEST_VERSION_CURRENT, asSet("ساهدهات"), false); ArabicAnalyzer a = new ArabicAnalyzer(TEST_VERSION_CURRENT, CharArraySet.EMPTY_SET, set); assertAnalyzesTo(a, "كبيرة the quick ساهدهات", new string[] {"كبير","the", "quick", "ساهدهات"}); assertAnalyzesTo(a, "كبيرة the quick ساهدهات", new string[] {"كبير","the", "quick", "ساهدهات"}); a = new ArabicAnalyzer(TEST_VERSION_CURRENT, CharArraySet.EMPTY_SET, CharArraySet.EMPTY_SET); assertAnalyzesTo(a, "كبيرة the quick ساهدهات", new string[] {"كبير","the", "quick", "ساهد"}); assertAnalyzesTo(a, "كبيرة the quick ساهدهات", new string[] {"كبير","the", "quick", "ساهد"}); }