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


C# CharArraySet类代码示例

本文整理汇总了C#中CharArraySet的典型用法代码示例。如果您正苦于以下问题:C# CharArraySet类的具体用法?C# CharArraySet怎么用?C# CharArraySet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: TestExclude

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

示例2: TestExclude

 public virtual void TestExclude()
 {
     CharArraySet exclusionSet = new CharArraySet(TEST_VERSION_CURRENT, AsSet("jaktkarlarne"), false);
     Analyzer a = new SwedishAnalyzer(TEST_VERSION_CURRENT, SwedishAnalyzer.DefaultStopSet, exclusionSet);
     CheckOneTerm(a, "jaktkarlarne", "jaktkarlarne");
     CheckOneTerm(a, "jaktkarlens", "jaktkarl");
 }
开发者ID:ChristopherHaws,项目名称:lucenenet,代码行数:7,代码来源:TestSwedishAnalyzer.cs

示例3: TestExclude

 public virtual void TestExclude()
 {
     CharArraySet exclusionSet = new CharArraySet(TEST_VERSION_CURRENT, AsSet("undersøgelse"), false);
     Analyzer a = new DanishAnalyzer(TEST_VERSION_CURRENT, DanishAnalyzer.DefaultStopSet, exclusionSet);
     CheckOneTerm(a, "undersøgelse", "undersøgelse");
     CheckOneTerm(a, "undersøg", "undersøg");
 }
开发者ID:ChristopherHaws,项目名称:lucenenet,代码行数:7,代码来源:TestDanishAnalyzer.cs

示例4: 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

示例5: TestExclude

 public virtual void TestExclude()
 {
     CharArraySet exclusionSet = new CharArraySet(TEST_VERSION_CURRENT, AsSet("peledakan"), false);
     Analyzer a = new IndonesianAnalyzer(TEST_VERSION_CURRENT, IndonesianAnalyzer.DefaultStopSet, exclusionSet);
     CheckOneTerm(a, "peledakan", "peledakan");
     CheckOneTerm(a, "pembunuhan", "bunuh");
 }
开发者ID:ChristopherHaws,项目名称:lucenenet,代码行数:7,代码来源:TestIndonesianAnalyzer.cs

示例6: CapitalizationFilterFactory

        internal readonly bool forceFirstLetter; // make sure the first letter is capital even if it is in the keep list

        /// <summary>
        /// Creates a new CapitalizationFilterFactory </summary>
        public CapitalizationFilterFactory(IDictionary<string, string> args)
            : base(args)
        {
            assureMatchVersion();
            bool ignoreCase = getBoolean(args, KEEP_IGNORE_CASE, false);
            HashSet<string> k = getSet(args, KEEP);
            if (k != null)
            {
                keep = new CharArraySet(luceneMatchVersion, 10, ignoreCase);
                keep.AddAll(k);
            }

            k = getSet(args, OK_PREFIX);
            if (k != null)
            {
                okPrefix = new List<char[]>();
                foreach (string item in k)
                {
                    okPrefix.Add(item.ToCharArray());
                }
            }

            minWordLength = getInt(args, MIN_WORD_LENGTH, 0);
            maxWordCount = getInt(args, MAX_WORD_COUNT, CapitalizationFilter.DEFAULT_MAX_WORD_COUNT);
            maxTokenLength = getInt(args, MAX_TOKEN_LENGTH, CapitalizationFilter.DEFAULT_MAX_TOKEN_LENGTH);
            onlyFirstWord = getBoolean(args, ONLY_FIRST_WORD, true);
            forceFirstLetter = getBoolean(args, FORCE_FIRST_LETTER, true);
            if (args.Count > 0)
            {
                throw new System.ArgumentException("Unknown parameters: " + args);
            }
        }
开发者ID:paulirwin,项目名称:lucene.net,代码行数:36,代码来源:CapitalizationFilterFactory.cs

示例7: 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

示例8: CapitalizationFilter

        /// <summary>
        /// Creates a CapitalizationFilter with the specified parameters. </summary>
        /// <param name="in"> input tokenstream </param>
        /// <param name="onlyFirstWord"> should each word be capitalized or all of the words? </param>
        /// <param name="keep"> a keep word list.  Each word that should be kept separated by whitespace. </param>
        /// <param name="forceFirstLetter"> Force the first letter to be capitalized even if it is in the keep list. </param>
        /// <param name="okPrefix"> do not change word capitalization if a word begins with something in this list. </param>
        /// <param name="minWordLength"> how long the word needs to be to get capitalization applied.  If the
        ///                      minWordLength is 3, "and" > "And" but "or" stays "or". </param>
        /// <param name="maxWordCount"> if the token contains more then maxWordCount words, the capitalization is
        ///                     assumed to be correct. </param>
        /// <param name="maxTokenLength"> ??? </param>
        public CapitalizationFilter(TokenStream @in, bool onlyFirstWord, CharArraySet keep, bool forceFirstLetter, ICollection<char[]> okPrefix, int minWordLength, int maxWordCount, int maxTokenLength)
            : base(@in)
        {
            // LUCENENET: The guard clauses were copied here from the version of Lucene.
            // Apparently, the tests were not ported from 4.8.0 because they expected this and the
            // original tests did not. Adding them anyway because there is no downside to this.
            if (minWordLength < 0)
            {
                throw new ArgumentOutOfRangeException("minWordLength must be greater than or equal to zero");
            }
            if (maxWordCount < 1)
            {
                throw new ArgumentOutOfRangeException("maxWordCount must be greater than zero");
            }
            if (maxTokenLength < 1)
            {
                throw new ArgumentOutOfRangeException("maxTokenLength must be greater than zero");
            }

            this.onlyFirstWord = onlyFirstWord;
            this.keep = keep;
            this.forceFirstLetter = forceFirstLetter;
            this.okPrefix = okPrefix;
            this.minWordLength = minWordLength;
            this.maxWordCount = maxWordCount;
            this.maxTokenLength = maxTokenLength;
            termAtt = AddAttribute<ICharTermAttribute>();
        }
开发者ID:ChristopherHaws,项目名称:lucenenet,代码行数:40,代码来源:CapitalizationFilter.cs

示例9: TestExclude

 public virtual void TestExclude()
 {
     CharArraySet exclusionSet = new CharArraySet(TEST_VERSION_CURRENT, AsSet("ağacı"), false);
     Analyzer a = new TurkishAnalyzer(TEST_VERSION_CURRENT, TurkishAnalyzer.DefaultStopSet, exclusionSet);
     CheckOneTerm(a, "ağacı", "ağacı");
     CheckOneTerm(a, "ağaç", "ağaç");
 }
开发者ID:ChristopherHaws,项目名称:lucenenet,代码行数:7,代码来源:TestTurkishAnalyzer.cs

示例10: 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

示例11: TestExclude

 public virtual void TestExclude()
 {
     CharArraySet exclusionSet = new CharArraySet(TEST_VERSION_CURRENT, AsSet("llengües"), false);
     Analyzer a = new CatalanAnalyzer(TEST_VERSION_CURRENT, CatalanAnalyzer.DefaultStopSet, exclusionSet);
     CheckOneTerm(a, "llengües", "llengües");
     CheckOneTerm(a, "llengua", "llengu");
 }
开发者ID:ChristopherHaws,项目名称:lucenenet,代码行数:7,代码来源:TestCatalanAnalyzer.cs

示例12: TestExclude

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

示例13: TestExclude

 public virtual void TestExclude()
 {
     CharArraySet exclusionSet = new CharArraySet(TEST_VERSION_CURRENT, AsSet("havnedistriktene"), false);
     Analyzer a = new NorwegianAnalyzer(TEST_VERSION_CURRENT, NorwegianAnalyzer.DefaultStopSet, exclusionSet);
     CheckOneTerm(a, "havnedistriktene", "havnedistriktene");
     CheckOneTerm(a, "havnedistrikter", "havnedistrikt");
 }
开发者ID:ChristopherHaws,项目名称:lucenenet,代码行数:7,代码来源:TestNorwegianAnalyzer.cs

示例14: TestExclude

 public virtual void TestExclude()
 {
     CharArraySet exclusionSet = new CharArraySet(TEST_VERSION_CURRENT, AsSet("tirgiem"), false);
     Analyzer a = new LatvianAnalyzer(TEST_VERSION_CURRENT, LatvianAnalyzer.DefaultStopSet, exclusionSet);
     CheckOneTerm(a, "tirgiem", "tirgiem");
     CheckOneTerm(a, "tirgus", "tirg");
 }
开发者ID:ChristopherHaws,项目名称:lucenenet,代码行数:7,代码来源:TestLatvianAnalyzer.cs

示例15: TestExclude

 public virtual void TestExclude()
 {
     CharArraySet exclusionSet = new CharArraySet(TEST_VERSION_CURRENT, AsSet("chicano"), false);
     Analyzer a = new SpanishAnalyzer(TEST_VERSION_CURRENT, SpanishAnalyzer.DefaultStopSet, exclusionSet);
     CheckOneTerm(a, "chicana", "chican");
     CheckOneTerm(a, "chicano", "chicano");
 }
开发者ID:ChristopherHaws,项目名称:lucenenet,代码行数:7,代码来源:TestSpanishAnalyzer.cs


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