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


C# ITermAttribute类代码示例

本文整理汇总了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);
		}
开发者ID:mindis,项目名称:Transformalize,代码行数:7,代码来源:KeywordTokenizer.cs

示例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);
        }
开发者ID:mamboer,项目名称:IKAnalyzer.Net,代码行数:11,代码来源:IKTokenizer.cs

示例3: FrenchStemFilter

        public FrenchStemFilter(TokenStream _in)
            : base(_in)
        {

            stemmer = new FrenchStemmer();
            termAtt = AddAttribute<ITermAttribute>();
        }
开发者ID:synhershko,项目名称:lucene.net,代码行数:7,代码来源:FrenchStemFilter.cs

示例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>();
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:10,代码来源:LengthFilter.cs

示例5: CamelCaseFilter

 public CamelCaseFilter(TokenStream stream)
     : base(stream)
 {
     _termAttribute = AddAttribute<ITermAttribute>();
     _offsetAttribute = AddAttribute<IOffsetAttribute>();
     _positionIncrementAttribute = AddAttribute<IPositionIncrementAttribute>();
 }
开发者ID:NuGet,项目名称:Entropy,代码行数:7,代码来源:CamelCaseFilter.cs

示例6: AddSuffixFilter

        public AddSuffixFilter(TokenStream input, Dictionary<string, char[]> _suffixByTokenType)
            : base(input)
        {
			termAtt = AddAttribute <ITermAttribute>();
			typeAtt = AddAttribute <ITypeAttribute>();
            this.suffixByTokenType = _suffixByTokenType;
        }
开发者ID:doronuziel71,项目名称:HebMorph,代码行数:7,代码来源:AddSuffixFilter.cs

示例7: Init

 void Init()
 {
     InitPanGuSegment();
     termAtt = AddAttribute<ITermAttribute>();
     offsetAtt = AddAttribute<IOffsetAttribute>();
     posIncrAtt = AddAttribute<IPositionIncrementAttribute>();
     typeAtt = AddAttribute<ITypeAttribute>();
 }
开发者ID:alinote,项目名称:Lucene.Net.Analysis.PanGu,代码行数:8,代码来源:PanGuTokenizer.cs

示例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>();
 }
开发者ID:BEXIS2,项目名称:Core,代码行数:16,代码来源:SynonymFilter.cs

示例9: CutLeterDigitFilter

 public CutLeterDigitFilter(TokenStream input)
     : base(input)
 {
     reusableToken = new Token();
     termAtt = AddAttribute<ITermAttribute>();
     offsetAtt = AddAttribute<IOffsetAttribute>();
     typeAtt = AddAttribute<ITypeAttribute>();
 }
开发者ID:vebin,项目名称:Lucene.Net.Analysis.MMSeg,代码行数:8,代码来源:CutLeterDigitFilter.cs

示例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>();
 }
开发者ID:vebin,项目名称:Lucene.Net.Analysis.MMSeg,代码行数:12,代码来源:MMSegTokenizer.cs

示例11: DelimitedPayloadTokenFilter

 public DelimitedPayloadTokenFilter(TokenStream input, char delimiter, PayloadEncoder encoder)
     : base(input)
 {
     termAtt = AddAttribute<ITermAttribute>();
     payAtt = AddAttribute<IPayloadAttribute>();
     this.delimiter = delimiter;
     this.encoder = encoder;
 }
开发者ID:synhershko,项目名称:lucene.net,代码行数:8,代码来源:DelimitedPayloadTokenFilter.cs

示例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);
        }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:16,代码来源:HunspellStemFilter.cs

示例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;
        }
开发者ID:doronuziel71,项目名称:HebMorph,代码行数:10,代码来源:HebrewTokenizer.cs

示例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>();
        }
开发者ID:NuGet,项目名称:NuGet.Services.Metadata,代码行数:10,代码来源:ExpandAcronymsFilter.cs

示例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();
        }
开发者ID:applenele,项目名称:SmallCode,代码行数:10,代码来源:JiebaTokenizer.cs


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