當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。