本文整理汇总了C#中IPositionIncrementAttribute类的典型用法代码示例。如果您正苦于以下问题:C# IPositionIncrementAttribute类的具体用法?C# IPositionIncrementAttribute怎么用?C# IPositionIncrementAttribute使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IPositionIncrementAttribute类属于命名空间,在下文中一共展示了IPositionIncrementAttribute类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: MockHoleInjectingTokenFilter
public MockHoleInjectingTokenFilter(Random random, TokenStream @in)
: base(@in)
{
RandomSeed = random.Next();
PosIncAtt = AddAttribute<IPositionIncrementAttribute>();
PosLenAtt = AddAttribute<IPositionLengthAttribute>();
}
开发者ID:joyanta,项目名称:lucene.net,代码行数:7,代码来源:MockHoleInjectingTokenFilter.cs
示例2: 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
示例3: FilteringTokenFilter
public FilteringTokenFilter(Lucene.Net.Util.LuceneVersion version, bool enablePositionIncrements, TokenStream input)
: this(version, input)
{
posIncrAtt = AddAttribute<IPositionIncrementAttribute>();
CheckPositionIncrement(version, enablePositionIncrements);
this.enablePositionIncrements = enablePositionIncrements;
}
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:7,代码来源:FilteringTokenFilter.cs
示例4: FilteringTokenFilter
/// <summary>
/// Create a new <seealso cref="FilteringTokenFilter"/>. </summary>
/// <param name="version"> the Lucene match version </param>
/// <param name="in"> the <seealso cref="TokenStream"/> to consume </param>
public FilteringTokenFilter(LuceneVersion version, TokenStream @in)
: base(@in)
{
posIncrAtt = AddAttribute<IPositionIncrementAttribute>();
this.version = version;
this.enablePositionIncrements = true;
}
开发者ID:ChristopherHaws,项目名称:lucenenet,代码行数:11,代码来源:FilteringTokenFilter.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: 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
示例7: CamelCaseFilter
public CamelCaseFilter(TokenStream stream)
: base(stream)
{
_termAttribute = AddAttribute<ITermAttribute>();
_offsetAttribute = AddAttribute<IOffsetAttribute>();
_positionIncrementAttribute = AddAttribute<IPositionIncrementAttribute>();
}
开发者ID:NuGet,项目名称:Entropy,代码行数:7,代码来源:CamelCaseFilter.cs
示例8: 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
示例9: 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
示例10: 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
示例11: 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
示例12: 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
示例13: CannedBinaryTokenStream
public CannedBinaryTokenStream(params BinaryToken[] tokens)
: base()
{
this.Tokens = tokens;
TermAtt = AddAttribute<IBinaryTermAttribute>();
PosIncrAtt = AddAttribute<IPositionIncrementAttribute>();
PosLengthAtt = AddAttribute<IPositionLengthAttribute>();
OffsetAtt = AddAttribute<IOffsetAttribute>();
}
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:9,代码来源:CannedBinaryTokenStream.cs
示例14: MockPayloadFilter
public MockPayloadFilter(TokenStream input, string fieldName)
: base(input)
{
this.FieldName = fieldName;
Pos = 0;
i = 0;
PosIncrAttr = input.AddAttribute<IPositionIncrementAttribute>();
PayloadAttr = input.AddAttribute<IPayloadAttribute>();
TermAttr = input.AddAttribute<ICharTermAttribute>();
}
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:10,代码来源:MockPayloadAnalyzer.cs
示例15: 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
示例16: CommonGramsFilter
/// <summary>
/// Construct a token stream filtering the given input using a Set of common
/// words to create bigrams. Outputs both unigrams with position increment and
/// bigrams with position increment 0 type=gram where one or both of the words
/// in a potential bigram are in the set of common words .
/// </summary>
/// <param name="input"> TokenStream input in filter chain </param>
/// <param name="commonWords"> The set of common words. </param>
public CommonGramsFilter(LuceneVersion matchVersion, TokenStream input, CharArraySet commonWords)
: base(input)
{
termAttribute = AddAttribute<ICharTermAttribute>();
offsetAttribute = AddAttribute<IOffsetAttribute>();
typeAttribute = AddAttribute<ITypeAttribute>();
posIncAttribute = AddAttribute<IPositionIncrementAttribute>();
posLenAttribute = AddAttribute<IPositionLengthAttribute>();
this.commonWords = commonWords;
}
开发者ID:ChristopherHaws,项目名称:lucenenet,代码行数:18,代码来源:CommonGramsFilter.cs
示例17: LimitTokenPositionFilter
/// <summary>
/// Build a filter that limits the maximum position of tokens to emit.
/// </summary>
/// <param name="in"> the stream to wrap </param>
/// <param name="maxTokenPosition"> max position of tokens to produce (1st token always has position 1) </param>
/// <param name="consumeAllTokens"> whether all tokens from the wrapped input stream must be consumed
/// even if maxTokenPosition is exceeded. </param>
public LimitTokenPositionFilter(TokenStream @in, int maxTokenPosition, bool consumeAllTokens)
: base(@in)
{
if (maxTokenPosition < 1)
{
throw new System.ArgumentException("maxTokenPosition must be greater than zero");
}
this.maxTokenPosition = maxTokenPosition;
this.consumeAllTokens = consumeAllTokens;
posIncAtt = AddAttribute<IPositionIncrementAttribute>();
}
开发者ID:ChristopherHaws,项目名称:lucenenet,代码行数:18,代码来源:LimitTokenPositionFilter.cs
示例18: IterTokenStream
public IterTokenStream(params Token[] tokens)
: base()
{
this.tokens = tokens;
this.termAtt = AddAttribute<ICharTermAttribute>();
this.offsetAtt = AddAttribute<IOffsetAttribute>();
this.posIncAtt = AddAttribute<IPositionIncrementAttribute>();
this.flagsAtt = AddAttribute<IFlagsAttribute>();
this.typeAtt = AddAttribute<ITypeAttribute>();
this.payloadAtt = AddAttribute<IPayloadAttribute>();
}
开发者ID:ChristopherHaws,项目名称:lucenenet,代码行数:11,代码来源:TestTrimFilter.cs
示例19: ThaiWordFilter
private bool hasIllegalOffsets = false; // only if the length changed before this filter
/// <summary>
/// Creates a new ThaiWordFilter with the specified match version. </summary>
public ThaiWordFilter(LuceneVersion matchVersion, TokenStream input)
: base(matchVersion.OnOrAfter(LuceneVersion.LUCENE_31) ? input : new LowerCaseFilter(matchVersion, input))
{
if (!DBBI_AVAILABLE)
{
throw new System.NotSupportedException("This JRE does not have support for Thai segmentation");
}
handlePosIncr = matchVersion.OnOrAfter(LuceneVersion.LUCENE_31);
termAtt = AddAttribute<ICharTermAttribute>();
offsetAtt = AddAttribute<IOffsetAttribute>();
posAtt = AddAttribute<IPositionIncrementAttribute>();
}
开发者ID:ChristopherHaws,项目名称:lucenenet,代码行数:16,代码来源:ThaiWordFilter.cs
示例20: 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
注:本文中的IPositionIncrementAttribute类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论