当前位置: 首页>>代码示例>>C#>>正文


C# org.apache.lucene.analysis.util.CharArraySet.add方法代码示例

本文整理汇总了C#中org.apache.lucene.analysis.util.CharArraySet.add方法的典型用法代码示例。如果您正苦于以下问题:C# org.apache.lucene.analysis.util.CharArraySet.add方法的具体用法?C# org.apache.lucene.analysis.util.CharArraySet.add怎么用?C# org.apache.lucene.analysis.util.CharArraySet.add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.lucene.analysis.util.CharArraySet的用法示例。


在下文中一共展示了org.apache.lucene.analysis.util.CharArraySet.add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: testWithStemExclusionSet

 //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
 //ORIGINAL LINE: public void testWithStemExclusionSet() throws Exception
 public virtual void testWithStemExclusionSet()
 {
     CharArraySet set = new CharArraySet(TEST_VERSION_CURRENT, 1, true);
       set.add("представление");
       Analyzer a = new RussianAnalyzer(TEST_VERSION_CURRENT, RussianAnalyzer.DefaultStopSet, set);
       assertAnalyzesTo(a, "Вместе с тем о силе электромагнитной энергии имели представление еще", new string[] {"вмест", "сил", "электромагнитн", "энерг", "имел", "представление"});
 }
开发者ID:WakeflyCBass,项目名称:lucenenet,代码行数:9,代码来源:TestRussianAnalyzer.cs

示例2: testWithKeywordAttribute

 //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
 //ORIGINAL LINE: public void testWithKeywordAttribute() throws java.io.IOException
 public virtual void testWithKeywordAttribute()
 {
     CharArraySet set = new CharArraySet(TEST_VERSION_CURRENT, 1, true);
     set.add("fischen");
     GermanStemFilter filter = new GermanStemFilter(new SetKeywordMarkerFilter(new LowerCaseTokenizer(TEST_VERSION_CURRENT, new StringReader("Fischen Trinken")), set));
     assertTokenStreamContents(filter, new string[] {"fischen", "trink"});
 }
开发者ID:WakeflyCBass,项目名称:lucenenet,代码行数:9,代码来源:TestGermanAnalyzer.cs

示例3: testWithStemExclusionSet

 //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
 //ORIGINAL LINE: public void testWithStemExclusionSet() throws java.io.IOException
 public virtual void testWithStemExclusionSet()
 {
     CharArraySet set = new CharArraySet(TEST_VERSION_CURRENT, 1, true);
     set.add("پیاوە");
     Analyzer a = new SoraniAnalyzer(TEST_VERSION_CURRENT, CharArraySet.EMPTY_SET, set);
     assertAnalyzesTo(a, "پیاوە", new string[] {"پیاوە"});
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:9,代码来源:TestSoraniAnalyzer.cs

示例4: testWithStemExclusionSet

 //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
 //ORIGINAL LINE: public void testWithStemExclusionSet() throws java.io.IOException
 public virtual void testWithStemExclusionSet()
 {
     CharArraySet set = new CharArraySet(TEST_VERSION_CURRENT, 1, true);
     set.add("hole");
     CzechAnalyzer cz = new CzechAnalyzer(TEST_VERSION_CURRENT, CharArraySet.EMPTY_SET, set);
     assertAnalyzesTo(cz, "hole desek", new string[] {"hole", "desk"});
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:9,代码来源:TestCzechAnalyzer.cs

示例5: testWithKeywordAttribute

 //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
 //ORIGINAL LINE: public void testWithKeywordAttribute() throws java.io.IOException
 public virtual void testWithKeywordAttribute()
 {
     CharArraySet set = new CharArraySet(TEST_VERSION_CURRENT, 1, true);
     set.add("yourselves");
     Tokenizer tokenizer = new MockTokenizer(new StringReader("yourselves yours"), MockTokenizer.WHITESPACE, false);
     TokenStream filter = new PorterStemFilter(new SetKeywordMarkerFilter(tokenizer, set));
     assertTokenStreamContents(filter, new string[] {"yourselves", "your"});
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:10,代码来源:TestPorterStemFilter.cs

示例6: testSetFilterIncrementToken

 //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);
 }
开发者ID:WakeflyCBass,项目名称:lucenenet,代码行数:14,代码来源:TestKeywordMarkerFilter.cs

示例7: test

        //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
        //ORIGINAL LINE: public void test() throws Exception
        public virtual void test()
        {
            //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
            //ORIGINAL LINE: final org.apache.lucene.analysis.util.CharArraySet cas = new org.apache.lucene.analysis.util.CharArraySet(TEST_VERSION_CURRENT, 3, false);
            CharArraySet cas = new CharArraySet(TEST_VERSION_CURRENT, 3, false);
            cas.add("jjp");
            cas.add("wlmwoknt");
            cas.add("tcgyreo");

            //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
            //ORIGINAL LINE: final org.apache.lucene.analysis.charfilter.NormalizeCharMap.Builder builder = new org.apache.lucene.analysis.charfilter.NormalizeCharMap.Builder();
            NormalizeCharMap.Builder builder = new NormalizeCharMap.Builder();
            builder.add("mtqlpi", "");
            builder.add("mwoknt", "jjp");
            builder.add("tcgyreo", "zpfpajyws");
            //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
            //ORIGINAL LINE: final org.apache.lucene.analysis.charfilter.NormalizeCharMap map = builder.build();
            NormalizeCharMap map = builder.build();

            Analyzer a = new AnalyzerAnonymousInnerClassHelper(this, cas, map);
            checkAnalysisConsistency(random(), a, false, "wmgddzunizdomqyj");
        }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:24,代码来源:TestBugInSomething.cs

示例8: testWithKeywordAttribute

 //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
 //ORIGINAL LINE: public void testWithKeywordAttribute() throws java.io.IOException
 public virtual void testWithKeywordAttribute()
 {
     CharArraySet set = new CharArraySet(TEST_VERSION_CURRENT, 1, true);
     set.add("Brasília");
     BrazilianStemFilter filter = new BrazilianStemFilter(new SetKeywordMarkerFilter(new LowerCaseTokenizer(TEST_VERSION_CURRENT, new StringReader("Brasília Brasilia")), set));
     assertTokenStreamContents(filter, new string[] {"brasília", "brasil"});
 }
开发者ID:WakeflyCBass,项目名称:lucenenet,代码行数:9,代码来源:TestBrazilianStemmer.cs

示例9: testWithKeywordAttribute

        //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
        //ORIGINAL LINE: public void testWithKeywordAttribute() throws java.io.IOException
        public virtual void testWithKeywordAttribute()
        {
            CharArraySet set = new CharArraySet(TEST_VERSION_CURRENT, 1, true);
            set.add("ساهدهات");
            ArabicLetterTokenizer tokenStream = new ArabicLetterTokenizer(TEST_VERSION_CURRENT, new StringReader("ساهدهات"));

            ArabicStemFilter filter = new ArabicStemFilter(new SetKeywordMarkerFilter(tokenStream, set));
            assertTokenStreamContents(filter, new string[]{"ساهدهات"});
        }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:11,代码来源:TestArabicStemFilter.cs

示例10: testExclusionTableViaCtor

        //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"});
        }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:12,代码来源:TestFrenchAnalyzer.cs

示例11: testExclusionTableViaCtor

        //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
        //ORIGINAL LINE: public void testExclusionTableViaCtor() throws java.io.IOException
        public virtual void testExclusionTableViaCtor()
        {
            CharArraySet set = new CharArraySet(Version.LUCENE_30, 1, true);
            set.add("lichamelijk");
            DutchAnalyzer a = new DutchAnalyzer(TEST_VERSION_CURRENT, CharArraySet.EMPTY_SET, set);
            assertAnalyzesTo(a, "lichamelijk lichamelijke", new string[] {"lichamelijk", "licham"});

            a = new DutchAnalyzer(TEST_VERSION_CURRENT, CharArraySet.EMPTY_SET, set);
            assertAnalyzesTo(a, "lichamelijk lichamelijke", new string[] {"lichamelijk", "licham"});
        }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:12,代码来源:TestDutchStemmer.cs

示例12: testWithKeywordAttribute

        //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
        //ORIGINAL LINE: public void testWithKeywordAttribute() throws java.io.IOException
        public virtual void testWithKeywordAttribute()
        {
            CharArraySet set = new CharArraySet(TEST_VERSION_CURRENT, 1, true);
            set.add("строеве");
            MockTokenizer tokenStream = new MockTokenizer(new StringReader("строевете строеве"), MockTokenizer.WHITESPACE, false);

            BulgarianStemFilter filter = new BulgarianStemFilter(new SetKeywordMarkerFilter(tokenStream, set));
            assertTokenStreamContents(filter, new string[] {"строй", "строеве"});
        }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:11,代码来源:TestBulgarianStemmer.cs

示例13: testWithStemExclusionSet

 //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
 //ORIGINAL LINE: public void testWithStemExclusionSet() throws java.io.IOException
 public virtual void testWithStemExclusionSet()
 {
     CharArraySet set = new CharArraySet(TEST_VERSION_CURRENT, 1, true);
     set.add("строеве");
     Analyzer a = new BulgarianAnalyzer(TEST_VERSION_CURRENT, CharArraySet.EMPTY_SET, set);
     assertAnalyzesTo(a, "строевете строеве", new string[] {"строй", "строеве"});
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:9,代码来源:TestBulgarianAnalyzer.cs

示例14: testWithKeywordAttribute

 //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
 //ORIGINAL LINE: public void testWithKeywordAttribute() throws java.io.IOException
 public virtual void testWithKeywordAttribute()
 {
     CharArraySet set = new CharArraySet(TEST_VERSION_CURRENT, 1, true);
     set.add("hole");
     CzechStemFilter filter = new CzechStemFilter(new SetKeywordMarkerFilter(new MockTokenizer(new StringReader("hole desek"), MockTokenizer.WHITESPACE, false), set));
     assertTokenStreamContents(filter, new string[] {"hole", "desk"});
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:9,代码来源:TestCzechStemmer.cs

示例15: uniqueStems

 /// <summary>
 /// Find the unique stem(s) of the provided word
 /// </summary>
 /// <param name="word"> Word to find the stems for </param>
 /// <returns> List of stems for the word </returns>
 public IList<CharsRef> uniqueStems(char[] word, int length)
 {
     IList<CharsRef> stems = stem(word, length);
     if (stems.Count < 2)
     {
       return stems;
     }
     CharArraySet terms = new CharArraySet(Version.LUCENE_CURRENT, 8, dictionary.ignoreCase);
     IList<CharsRef> deduped = new List<CharsRef>();
     foreach (CharsRef s in stems)
     {
       if (!terms.contains(s))
       {
     deduped.Add(s);
     terms.add(s);
       }
     }
     return deduped;
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:24,代码来源:Stemmer.cs


注:本文中的org.apache.lucene.analysis.util.CharArraySet.add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。