本文整理汇总了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");
}
示例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");
}
示例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");
}
示例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" });
}
示例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");
}
示例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);
}
}
示例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[] { "вмест", "сил", "электромагнитн", "энерг", "имел", "представление" });
}
示例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>();
}
示例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ç");
}
示例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[] { "строй", "строеве" });
}
示例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");
}
示例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");
}
示例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");
}
示例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");
}
示例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");
}