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


C# CharArraySet.add方法代码示例

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


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

示例1: TestWithStemExclusionSet

 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:ChristopherHaws,项目名称:lucenenet,代码行数:7,代码来源:TestRussianAnalyzer.cs

示例2: TestWithKeywordAttribute

 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:ChristopherHaws,项目名称:lucenenet,代码行数:7,代码来源:TestGermanAnalyzer.cs

示例3: TestWithStemExclusionSet

 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:ChristopherHaws,项目名称:lucenenet,代码行数:7,代码来源:TestBulgarianAnalyzer.cs

示例4: TestWithStemExclusionSet

 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:ChristopherHaws,项目名称:lucenenet,代码行数:7,代码来源:TestSoraniAnalyzer.cs

示例5: TestWithStemExclusionSet

 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:ChristopherHaws,项目名称:lucenenet,代码行数:7,代码来源:TestCzechAnalyzer.cs

示例6: Test

        public virtual void Test()
        {
            CharArraySet cas = new CharArraySet(TEST_VERSION_CURRENT, 3, false);
            cas.add("jjp");
            cas.add("wlmwoknt");
            cas.add("tcgyreo");

            NormalizeCharMap.Builder builder = new NormalizeCharMap.Builder();
            builder.Add("mtqlpi", "");
            builder.Add("mwoknt", "jjp");
            builder.Add("tcgyreo", "zpfpajyws");
            NormalizeCharMap map = builder.Build();

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

示例7: TestWithKeywordAttribute

 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:ChristopherHaws,项目名称:lucenenet,代码行数:8,代码来源:TestPorterStemFilter.cs

示例8: TestSetFilterIncrementToken

 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:ChristopherHaws,项目名称:lucenenet,代码行数:11,代码来源:TestKeywordMarkerFilter.cs

示例9: GetWordSet

	  /// <summary>
	  /// Reads lines from a Reader and adds every line as an entry to a CharArraySet (omitting
	  /// leading and trailing whitespace). Every line of the Reader should contain only
	  /// one word. The words need to be in lowercase if you make use of an
	  /// Analyzer which uses LowerCaseFilter (like StandardAnalyzer).
	  /// </summary>
	  /// <param name="reader"> Reader containing the wordlist </param>
	  /// <param name="result"> the <seealso cref="CharArraySet"/> to fill with the readers words </param>
	  /// <returns> the given <seealso cref="CharArraySet"/> with the reader's words </returns>
	  public static CharArraySet GetWordSet(TextReader reader, CharArraySet result)
	  {
		BufferedReader br = null;
		try
		{
		  br = getBufferedReader(reader);
		  string word = null;
		  while ((word = br.readLine()) != null)
		  {
			result.add(word.Trim());
		  }
		}
		finally
		{
		  IOUtils.close(br);
		}
		return result;
	  }
开发者ID:paulirwin,项目名称:lucene.net,代码行数:27,代码来源:WordlistLoader.cs

示例10: TestWithKeywordAttribute

        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:ChristopherHaws,项目名称:lucenenet,代码行数:9,代码来源:TestBulgarianStemmer.cs

示例11: TestExclusionTableViaCtor

        public virtual void TestExclusionTableViaCtor()
        {
#pragma warning disable 612, 618
            CharArraySet set = new CharArraySet(LuceneVersion.LUCENE_30, 1, true);
#pragma warning restore 612, 618
            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:ChristopherHaws,项目名称:lucenenet,代码行数:13,代码来源:TestDutchStemmer.cs

示例12: TestWithKeywordAttribute

 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:ChristopherHaws,项目名称:lucenenet,代码行数:7,代码来源:TestBrazilianStemmer.cs

示例13: TestExclusionTableViaCtor

        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:ChristopherHaws,项目名称:lucenenet,代码行数:10,代码来源:TestFrenchAnalyzer.cs

示例14: TestWithKeywordAttribute

        public virtual void TestWithKeywordAttribute()
        {
            CharArraySet set = new CharArraySet(TEST_VERSION_CURRENT, 1, true);
            set.add("ساهدهات");
#pragma warning disable 612, 618
            ArabicLetterTokenizer tokenStream = new ArabicLetterTokenizer(TEST_VERSION_CURRENT, new StringReader("ساهدهات"));
#pragma warning restore 612, 618

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

示例15: testUnmodifiableSet

        public virtual void testUnmodifiableSet()
        {
            CharArraySet set = new CharArraySet(TEST_VERSION_CURRENT, 10,true);
            set.addAll(TEST_STOP_WORDS);
            set.add(Convert.ToInt32(1));
            //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
            //ORIGINAL LINE: final int size = set.size();
            int size = set.size();
            set = CharArraySet.unmodifiableSet(set);
            assertEquals("Set size changed due to unmodifiableSet call", size, set.size());
            foreach (string stopword in TEST_STOP_WORDS)
            {
              assertTrue(set.contains(stopword));
            }
            assertTrue(set.contains(Convert.ToInt32(1)));
            assertTrue(set.contains("1"));
            assertTrue(set.contains(new char[]{'1'}));

            try
            {
              CharArraySet.unmodifiableSet(null);
              fail("can not make null unmodifiable");
            }
            catch (System.NullReferenceException)
            {
              // expected
            }
        }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:28,代码来源:TestCharArraySet.cs


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