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

C# ICharTermAttribute类代码示例

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

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



ICharTermAttribute类属于命名空间,在下文中一共展示了ICharTermAttribute类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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>();
 }
开发者ID:ChristopherHaws,项目名称:lucenenet,代码行数:16,代码来源:ASCIIFoldingFilter.cs


示例2: ChineseFilter

        public ChineseFilter(TokenStream @in)
            : base(@in)
        {

            stopTable = new CharArraySet(LuceneVersion.LUCENE_CURRENT, Arrays.AsList(STOP_WORDS), false);
            termAtt = AddAttribute<ICharTermAttribute>();
        }
开发者ID:ChristopherHaws,项目名称:lucenenet,代码行数:7,代码来源:ChineseFilter.cs


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


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


示例5: CannedTokenizer

 public CannedTokenizer(System.IO.TextReader reader, TokenAndPos[] tokens)
     : base(reader)
 {
     this.tokens = tokens;
     this.termAtt = AddAttribute<ICharTermAttribute>();
     this.posIncrAtt = AddAttribute<IPositionIncrementAttribute>();
 }
开发者ID:ChristopherHaws,项目名称:lucenenet,代码行数:7,代码来源:TestMultiPhraseQueryParsing.cs


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


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


示例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)"/>
 /// &lt; min) or too long (<seealso cref="Character#codePointCount(char[], int, int)"/> &gt; 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>();
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:15,代码来源:CodepointCountFilter.cs


示例9: SnowballFilter

 public SnowballFilter(TokenStream input, SnowballProgram stemmer)
       : base(input)
 {
     this.stemmer = stemmer;
     this.termAtt = AddAttribute<ICharTermAttribute>();
     this.keywordAttr = AddAttribute<IKeywordAttribute>();
 }
开发者ID:ChristopherHaws,项目名称:lucenenet,代码行数:7,代码来源:SnowballFilter.cs


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


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


示例12: SimplePayloadFilter

 public SimplePayloadFilter(TokenStream input)
     : base(input)
 {
     Pos = 0;
     PayloadAttr = input.AddAttribute<IPayloadAttribute>();
     TermAttr = input.AddAttribute<ICharTermAttribute>();
 }
开发者ID:ChristopherHaws,项目名称:lucenenet,代码行数:7,代码来源:TestBasics.cs


示例13: DelimitedPayloadTokenFilter

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


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


示例15: GraphTokenizer

 public GraphTokenizer(TextReader input)
     : base(input)
 {
     TermAtt = AddAttribute<ICharTermAttribute>();
     OffsetAtt = AddAttribute<IOffsetAttribute>();
     PosIncrAtt = AddAttribute<IPositionIncrementAttribute>();
     PosLengthAtt = AddAttribute<IPositionLengthAttribute>();
 }
开发者ID:joyanta,项目名称:lucene.net,代码行数:8,代码来源:TestGraphTokenizers.cs


示例16: StemmerOverrideFilter

 /// <summary>
 /// Create a new StemmerOverrideFilter, performing dictionary-based stemming
 /// with the provided <code>dictionary</code>.
 /// <para>
 /// Any dictionary-stemmed terms will be marked with <seealso cref="KeywordAttribute"/>
 /// so that they will not be stemmed with stemmers down the chain.
 /// </para>
 /// </summary>
 public StemmerOverrideFilter(TokenStream input, StemmerOverrideMap stemmerOverrideMap)
       : base(input)
 {
     this.stemmerOverrideMap = stemmerOverrideMap;
     fstReader = stemmerOverrideMap.BytesReader;
     termAtt = AddAttribute<ICharTermAttribute>();
     keywordAtt = AddAttribute<IKeywordAttribute>();
 }
开发者ID:ChristopherHaws,项目名称:lucenenet,代码行数:16,代码来源:StemmerOverrideFilter.cs


示例17: PatternReplaceFilter

 /// <summary>
 /// Constructs an instance to replace either the first, or all occurances
 /// </summary>
 /// <param name="in"> the TokenStream to process </param>
 /// <param name="pattern"> the pattern (a <seealso cref="Regex"/> object) to apply to each Token </param>
 /// <param name="replacement"> the "replacement string" to substitute, if null a
 ///        blank string will be used. Note that this is not the literal
 ///        string that will be used, '$' and '\' have special meaning. </param>
 /// <param name="all"> if true, all matches will be replaced otherwise just the first match. </param>
 /// <seealso cref= Matcher#quoteReplacement </seealso>
 public PatternReplaceFilter(TokenStream @in, Regex pattern, string replacement, bool all)
       : base(@in)
 {
     this.replacement = (null == replacement) ? "" : replacement;
     this.all = all;
     this.pattern = pattern;
     termAtt = AddAttribute<ICharTermAttribute>();
 }
开发者ID:ChristopherHaws,项目名称:lucenenet,代码行数:18,代码来源:PatternReplaceFilter.cs


示例18: RepeatingTokenizer

 public RepeatingTokenizer(TextReader reader, string val, Random random, float percentDocs, int maxTF)
     : base(reader)
 {
     this.Value = val;
     this.Random = random;
     this.PercentDocs = percentDocs;
     this.MaxTF = maxTF;
     this.TermAtt = AddAttribute<ICharTermAttribute>();
 }
开发者ID:ChristopherHaws,项目名称:lucenenet,代码行数:9,代码来源:TestTermdocPerf.cs


示例19: SuggestStopFilter

 /// <summary>
 /// Sole constructor. </summary>
 public SuggestStopFilter(TokenStream input, CharArraySet stopWords)
     : base(input)
 {
     this.stopWords = stopWords;
     this.termAtt = AddAttribute<ICharTermAttribute>();
     this.posIncAtt = AddAttribute<IPositionIncrementAttribute>();
     this.keywordAtt = AddAttribute<IKeywordAttribute>();
     this.offsetAtt = AddAttribute<IOffsetAttribute>();
 }
开发者ID:ChristopherHaws,项目名称:lucenenet,代码行数:11,代码来源:SuggestStopFilter.cs


示例20: TruncateTokenFilter

 public TruncateTokenFilter(TokenStream input, int length) : base(input)
 {
     if (length < 1)
     {
         throw new System.ArgumentOutOfRangeException("length parameter must be a positive number: " + length);
     }
     this.length = length;
     this.termAttribute = AddAttribute<ICharTermAttribute>();
     this.keywordAttr = AddAttribute<IKeywordAttribute>();
 }
开发者ID:ChristopherHaws,项目名称:lucenenet,代码行数:10,代码来源:TruncateTokenFilter.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# ICharacter类代码示例发布时间:2022-05-24
下一篇:
C# ICharStream类代码示例发布时间: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