• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ITermAttribute类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



ITermAttribute类属于命名空间,在下文中一共展示了ITermAttribute类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: ExpanderFilter

        public ExpanderFilter(TokenStream input, [NotNull] Func<String, IEnumerable<Expansion>> expander, Boolean emitSource = true)
            : base(input)
        {
            if (expander == null)
                throw new ArgumentNullException("expander");

            _expander = expander;
            _emitSource = emitSource;
            _termAttr = AddAttribute<ITermAttribute>();
            _posAttr = AddAttribute<IPositionIncrementAttribute>();
            _typeAttr = AddAttribute<ITypeAttribute>();
        }
开发者ID:devhost,项目名称:Corelicious,代码行数:12,代码来源:ExpanderFilter.cs


示例17: SnowballFilter

		/// <summary>Construct the named stemming filter.
		/// 
		/// </summary>
        /// <param name="input">the input tokens to stem
		/// </param>
		/// <param name="name">the name of a stemmer
		/// </param>
		public SnowballFilter(TokenStream input, System.String name) : base(input)
		{
			try
			{
				System.Type stemClass = System.Type.GetType("SF.Snowball.Ext." + name + "Stemmer");
				stemmer = (SnowballProgram) System.Activator.CreateInstance(stemClass);
			}
			catch (System.Exception e)
			{
				throw new System.SystemException(e.ToString());
			}
		    termAtt = AddAttribute<ITermAttribute>();
		}
开发者ID:synhershko,项目名称:lucene.net,代码行数:20,代码来源:SnowballFilter.cs


示例18: Init

        private void Init(System.IO.TextReader input, HebMorph.StreamLemmatizer _lemmatizer,
            HebMorph.LemmaFilters.LemmaFilterBase _lemmaFilter, bool AlwaysSaveMarkedOriginal)
        {
			termAtt = AddAttribute <ITermAttribute>();
	        offsetAtt = AddAttribute<IOffsetAttribute>();
	        posIncrAtt = AddAttribute<IPositionIncrementAttribute>();
			typeAtt = AddAttribute <ITypeAttribute>();
            //payAtt = (PayloadAttribute)AddAttribute(typeof(PayloadAttribute));

        	this.input = input;
            this._streamLemmatizer = _lemmatizer;
            this._streamLemmatizer.SetStream(input);
            this.alwaysSaveMarkedOriginal = AlwaysSaveMarkedOriginal;
            this.lemmaFilter = _lemmaFilter;
        }
开发者ID:doronuziel71,项目名称:HebMorph,代码行数:15,代码来源:StreamLemmasFilter.cs


示例19: StopFilter

		/// <summary> Construct a token stream filtering the given input.
		/// If <c>stopWords</c> is an instance of <see cref="CharArraySet" /> (true if
		/// <c>makeStopSet()</c> was used to construct the set) it will be directly used
		/// and <c>ignoreCase</c> will be ignored since <c>CharArraySet</c>
		/// directly controls case sensitivity.
		/// <p/>
		/// If <c>stopWords</c> is not an instance of <see cref="CharArraySet" />,
		/// a new CharArraySet will be constructed and <c>ignoreCase</c> will be
		/// used to specify the case sensitivity of that set.
		/// </summary>
		/// <param name="enablePositionIncrements">true if token positions should record the removed stop words</param>
		/// <param name="input">Input TokenStream</param>
		/// <param name="stopWords">A Set of strings or strings or char[] or any other ToString()-able set representing the stopwords</param>
        /// <param name="ignoreCase">if true, all words are lower cased first</param>
        public StopFilter(bool enablePositionIncrements, TokenStream input, ISet<string> stopWords, bool ignoreCase)
            : base(input)
		{
		    if (stopWords is CharArraySet)
		    {
		        this.stopWords = (CharArraySet) stopWords;
		    }
		    else
		    {
		        this.stopWords = new CharArraySet(stopWords.Count, ignoreCase);
		        this.stopWords.AddAll(stopWords);
		    }
		    this.enablePositionIncrements = enablePositionIncrements;
		    termAtt = AddAttribute<ITermAttribute>();
            posIncrAtt = AddAttribute<IPositionIncrementAttribute>();
		}
开发者ID:JokerMisfits,项目名称:linux-packaging-mono,代码行数:30,代码来源:StopFilter.cs


示例20: NGramTokenFilter

        /*
         * Creates NGramTokenFilter with given min and max n-grams.
         * <param name="input"><see cref="TokenStream"/> holding the input to be tokenized</param>
         * <param name="minGram">the smallest n-gram to generate</param>
         * <param name="maxGram">the largest n-gram to generate</param>
         */
        public NGramTokenFilter(TokenStream input, int minGram, int maxGram)
            : base(input)
        {
            if (minGram < 1)
            {
                throw new System.ArgumentException("minGram must be greater than zero");
            }
            if (minGram > maxGram)
            {
                throw new System.ArgumentException("minGram must not be greater than maxGram");
            }
            this.minGram = minGram;
            this.maxGram = maxGram;

            this.termAtt = AddAttribute<ITermAttribute>();
            this.offsetAtt = AddAttribute<IOffsetAttribute>();
        }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:23,代码来源:NGramTokenFilter.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ITerminal类代码示例发布时间:2022-05-24
下一篇:
C# ITemplateKey类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap