本文整理汇总了C#中ICharTermAttribute类的典型用法代码示例。如果您正苦于以下问题:C# ICharTermAttribute类的具体用法?C# ICharTermAttribute怎么用?C# ICharTermAttribute使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ICharTermAttribute类属于命名空间,在下文中一共展示了ICharTermAttribute类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ASCIIFoldingFilter
/// <summary>
/// Create a new <seealso cref="ASCIIFoldingFilter"/>.
/// </summary>
/// <param name="input">
/// TokenStream to filter </param>
/// <param name="preserveOriginal">
/// should the original tokens be kept on the input stream with a 0 position increment
/// from the folded tokens?
/// </param>
public ASCIIFoldingFilter(TokenStream input, bool preserveOriginal)
: base(input)
{
this.preserveOriginal = preserveOriginal;
termAtt = AddAttribute<ICharTermAttribute>();
posIncAttr = AddAttribute<IPositionIncrementAttribute>();
}
示例2: ChineseFilter
public ChineseFilter(TokenStream @in)
: base(@in)
{
stopTable = new CharArraySet(LuceneVersion.LUCENE_CURRENT, Arrays.AsList(STOP_WORDS), false);
termAtt = AddAttribute<ICharTermAttribute>();
}
示例3: MockTokenFilter
/// <summary>
/// Create a new MockTokenFilter.
/// </summary>
/// <param name="input"> TokenStream to filter </param>
/// <param name="filter"> DFA representing the terms that should be removed. </param>
public MockTokenFilter(TokenStream input, CharacterRunAutomaton filter)
: base(input)
{
this.Filter = filter;
TermAtt = AddAttribute<ICharTermAttribute>();
PosIncrAtt = AddAttribute<IPositionIncrementAttribute>();
}
示例4: NorwegianMinimalStemFilter
/// <summary>
/// Creates a new NorwegianLightStemFilter </summary>
/// <param name="flags"> set to <seealso cref="NorwegianLightStemmer#BOKMAAL"/>,
/// <seealso cref="NorwegianLightStemmer#NYNORSK"/>, or both. </param>
public NorwegianMinimalStemFilter(TokenStream input, int flags)
: base(input)
{
this.stemmer = new NorwegianMinimalStemmer(flags);
termAtt = AddAttribute<ICharTermAttribute>();
keywordAttr = AddAttribute<IKeywordAttribute>();
}
示例5: CannedTokenizer
public CannedTokenizer(System.IO.TextReader reader, TokenAndPos[] tokens)
: base(reader)
{
this.tokens = tokens;
this.termAtt = AddAttribute<ICharTermAttribute>();
this.posIncrAtt = AddAttribute<IPositionIncrementAttribute>();
}
示例6: CompoundWordTokenFilterBase
protected CompoundWordTokenFilterBase(LuceneVersion matchVersion, TokenStream input, CharArraySet dictionary, int minWordSize, int minSubwordSize, int maxSubwordSize, bool onlyLongestMatch)
: base(input)
{
termAtt = AddAttribute<ICharTermAttribute>();
offsetAtt = AddAttribute<IOffsetAttribute>();
posIncAtt = AddAttribute<IPositionIncrementAttribute>();
this.matchVersion = matchVersion;
this.tokens = new LinkedList<CompoundToken>();
if (minWordSize < 0)
{
throw new System.ArgumentException("minWordSize cannot be negative");
}
this.minWordSize = minWordSize;
if (minSubwordSize < 0)
{
throw new System.ArgumentException("minSubwordSize cannot be negative");
}
this.minSubwordSize = minSubwordSize;
if (maxSubwordSize < 0)
{
throw new System.ArgumentException("maxSubwordSize cannot be negative");
}
this.maxSubwordSize = maxSubwordSize;
this.onlyLongestMatch = onlyLongestMatch;
this.dictionary = dictionary;
}
示例7: PatternKeywordMarkerFilter
/// <summary>
/// Create a new <seealso cref="PatternKeywordMarkerFilter"/>, that marks the current
/// token as a keyword if the tokens term buffer matches the provided
/// <seealso cref="Pattern"/> via the <seealso cref="KeywordAttribute"/>.
/// </summary>
/// <param name="in">
/// TokenStream to filter </param>
/// <param name="pattern">
/// the pattern to apply to the incoming term buffer
/// </param>
public PatternKeywordMarkerFilter(TokenStream @in, Pattern pattern)
: base(@in)
{
termAtt = AddAttribute<ICharTermAttribute>();
this.matcher = pattern.matcher("");
}
示例8: CodepointCountFilter
/// <summary>
/// Create a new <seealso cref="CodepointCountFilter"/>. This will filter out tokens whose
/// <seealso cref="CharTermAttribute"/> is either too short (<seealso cref="Character#CodePointCount(char[], int, int)"/>
/// < min) or too long (<seealso cref="Character#codePointCount(char[], int, int)"/> > max). </summary>
/// <param name="version"> the Lucene match version </param>
/// <param name="in"> the <seealso cref="TokenStream"/> to consume </param>
/// <param name="min"> the minimum length </param>
/// <param name="max"> the maximum length </param>
public CodepointCountFilter(LuceneVersion version, TokenStream @in, int min, int max)
: base(version, @in)
{
this.min = min;
this.max = max;
termAtt = AddAttribute<ICharTermAttribute>();
}
示例9: SnowballFilter
public SnowballFilter(TokenStream input, SnowballProgram stemmer)
: base(input)
{
this.stemmer = stemmer;
this.termAtt = AddAttribute<ICharTermAttribute>();
this.keywordAttr = AddAttribute<IKeywordAttribute>();
}
示例10: IndonesianStemFilter
/// <summary>
/// Create a new IndonesianStemFilter.
/// <para>
/// If <code>stemDerivational</code> is false,
/// only inflectional suffixes (particles and possessive pronouns) are stemmed.
/// </para>
/// </summary>
public IndonesianStemFilter(TokenStream input, bool stemDerivational)
: base(input)
{
this.stemDerivational = stemDerivational;
termAtt = AddAttribute<ICharTermAttribute>();
keywordAtt = AddAttribute<IKeywordAttribute>();
}
示例11: UpperCaseFilter
/// <summary>
/// Create a new UpperCaseFilter, that normalizes token text to upper case.
/// </summary>
/// <param name="matchVersion"> See <a href="#version">above</a> </param>
/// <param name="in"> TokenStream to filter </param>
public UpperCaseFilter(LuceneVersion matchVersion, TokenStream @in)
: base(@in)
{
termAtt = AddAttribute<ICharTermAttribute>();
termAtt = AddAttribute<ICharTermAttribute>();
charUtils = CharacterUtils.GetInstance(matchVersion);
}
示例12: SimplePayloadFilter
public SimplePayloadFilter(TokenStream input)
: base(input)
{
Pos = 0;
PayloadAttr = input.AddAttribute<IPayloadAttribute>();
TermAttr = input.AddAttribute<ICharTermAttribute>();
}
示例13: DelimitedPayloadTokenFilter
public DelimitedPayloadTokenFilter(TokenStream input, char delimiter, IPayloadEncoder encoder)
: base(input)
{
this.delimiter = delimiter;
this.encoder = encoder;
termAtt = AddAttribute<ICharTermAttribute>();
payAtt = AddAttribute<IPayloadAttribute>();
}
示例14: StempelFilter
/// <summary>
/// Create filter using the supplied stemming table.
/// </summary>
/// <param name="in">input token stream</param>
/// <param name="stemmer">stemmer</param>
/// <param name="minLength">For performance reasons words shorter than minLength
/// characters are not processed, but simply returned.</param>
public StempelFilter(TokenStream @in, StempelStemmer stemmer, int minLength)
: base(@in)
{
this.stemmer = stemmer;
this.minLength = minLength;
this.termAtt = AddAttribute<ICharTermAttribute>();
this.keywordAtt = AddAttribute<IKeywordAttribute>();
}
示例15: GraphTokenizer
public GraphTokenizer(TextReader input)
: base(input)
{
TermAtt = AddAttribute<ICharTermAttribute>();
OffsetAtt = AddAttribute<IOffsetAttribute>();
PosIncrAtt = AddAttribute<IPositionIncrementAttribute>();
PosLengthAtt = AddAttribute<IPositionLengthAttribute>();
}