本文整理汇总了C#中ITermAttribute类的典型用法代码示例。如果您正苦于以下问题:C# ITermAttribute类的具体用法?C# ITermAttribute怎么用?C# ITermAttribute使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ITermAttribute类属于命名空间,在下文中一共展示了ITermAttribute类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Init
private void Init(int bufferSize)
{
this.done = false;
termAtt = AddAttribute<ITermAttribute>();
offsetAtt = AddAttribute<IOffsetAttribute>();
termAtt.ResizeTermBuffer(bufferSize);
}
示例2: IKTokenizer
///<summary>
///Lucene Tokenizer适配器类构造函数
/// </summary>
/// <param name="isMaxWordLength">当为true时,分词器进行最大词长切分;当为false是,采用最细粒度切分</param>
public IKTokenizer(TextReader inreader, bool isMaxWordLength)
: base(inreader)
{
offsetAtt = AddAttribute<IOffsetAttribute>();
termAtt = AddAttribute<ITermAttribute>();
_IKImplement = new IKSegmentation(inreader, isMaxWordLength);
}
示例3: FrenchStemFilter
public FrenchStemFilter(TokenStream _in)
: base(_in)
{
stemmer = new FrenchStemmer();
termAtt = AddAttribute<ITermAttribute>();
}
示例4: LengthFilter
/// <summary> Build a filter that removes words that are too long or too
/// short from the text.
/// </summary>
public LengthFilter(TokenStream in_Renamed, int min, int max)
: base(in_Renamed)
{
this.min = min;
this.max = max;
termAtt = AddAttribute<ITermAttribute>();
}
示例5: CamelCaseFilter
public CamelCaseFilter(TokenStream stream)
: base(stream)
{
_termAttribute = AddAttribute<ITermAttribute>();
_offsetAttribute = AddAttribute<IOffsetAttribute>();
_positionIncrementAttribute = AddAttribute<IPositionIncrementAttribute>();
}
示例6: AddSuffixFilter
public AddSuffixFilter(TokenStream input, Dictionary<string, char[]> _suffixByTokenType)
: base(input)
{
termAtt = AddAttribute <ITermAttribute>();
typeAtt = AddAttribute <ITypeAttribute>();
this.suffixByTokenType = _suffixByTokenType;
}
示例7: Init
void Init()
{
InitPanGuSegment();
termAtt = AddAttribute<ITermAttribute>();
offsetAtt = AddAttribute<IOffsetAttribute>();
posIncrAtt = AddAttribute<IPositionIncrementAttribute>();
typeAtt = AddAttribute<ITypeAttribute>();
}
示例8: SynonymFilter
/// <summary>
///
/// </summary>
/// <remarks></remarks>
/// <seealso cref=""/>
/// <param name="input"></param>
/// <param name="synonymEngine"></param>
/// <return></return>
public SynonymFilter(TokenStream input, ISynonymEngine synonymEngine)
: base(input)
{
synonymStack = new Stack<String>();
this.engine = synonymEngine;
this.termAtt = AddAttribute<ITermAttribute>();
this.posIncrAtt = AddAttribute<IPositionIncrementAttribute>();
}
示例9: CutLeterDigitFilter
public CutLeterDigitFilter(TokenStream input)
: base(input)
{
reusableToken = new Token();
termAtt = AddAttribute<ITermAttribute>();
offsetAtt = AddAttribute<IOffsetAttribute>();
typeAtt = AddAttribute<ITypeAttribute>();
}
示例10: MMSegTokenizer
/*
* 此处忽略调用base(input);因调用后input的position会被移动
* by zh
*/
public MMSegTokenizer(Seg seg, TextReader input)
: base(input)
{
mmSeg = new MMSeg(input, seg);
termAtt = AddAttribute<ITermAttribute>();
offsetAtt = AddAttribute<IOffsetAttribute>();
typeAtt = AddAttribute<ITypeAttribute>();
}
示例11: DelimitedPayloadTokenFilter
public DelimitedPayloadTokenFilter(TokenStream input, char delimiter, PayloadEncoder encoder)
: base(input)
{
termAtt = AddAttribute<ITermAttribute>();
payAtt = AddAttribute<IPayloadAttribute>();
this.delimiter = delimiter;
this.encoder = encoder;
}
示例12: HunspellStemFilter
/// <summary>
/// Creates a new HunspellStemFilter that will stem tokens from the given TokenStream using
/// affix rules in the provided HunspellDictionary.
/// </summary>
/// <param name="input">TokenStream whose tokens will be stemmed.</param>
/// <param name="dictionary">HunspellDictionary containing the affix rules and words that will be used to stem the tokens.</param>
/// <param name="dedup">true if only unique terms should be output.</param>
public HunspellStemFilter(TokenStream input, HunspellDictionary dictionary, Boolean dedup = true)
: base(input)
{
_posIncAtt = AddAttribute<IPositionIncrementAttribute>();
_termAtt = AddAttribute<ITermAttribute>();
_dedup = dedup;
_stemmer = new HunspellStemmer(dictionary);
}
示例13: Init
private void Init(System.IO.TextReader _input, HebMorph.DataStructures.DictRadix<int> _prefixesTree)
{
termAtt = AddAttribute <ITermAttribute>();
offsetAtt = AddAttribute <IOffsetAttribute>();
//posIncrAtt = (PositionIncrementAttribute)AddAttribute(typeof(PositionIncrementAttribute));
typeAtt = AddAttribute <ITypeAttribute>();
input = _input;
hebMorphTokenizer = new HebMorph.Tokenizer(_input);
prefixesTree = _prefixesTree;
}
示例14: ExpandAcronymsFilter
public ExpandAcronymsFilter(TokenStream input, IAcronymExpansionProvider acronymExpansionProvider)
: base(input)
{
_acronymExpansionProvider = acronymExpansionProvider;
_termAttribute = AddAttribute<ITermAttribute>();
_positionIncrementAttribute = AddAttribute<IPositionIncrementAttribute>();
_tokenSet = new Queue<string>();
_recognizedTokens = new HashSet<string>();
}
示例15: JiebaTokenizer
public JiebaTokenizer(JiebaSegmenter seg, string input)
{
segmenter = seg;
termAtt = AddAttribute<ITermAttribute>();
offsetAtt = AddAttribute<IOffsetAttribute>();
typeAtt = AddAttribute<ITypeAttribute>();
var text = input;
tokens = segmenter.Tokenize(text, TokenizerMode.Search).ToList();
}