本文整理汇总了C#中Lucene.Net.Analysis.Token.SetType方法的典型用法代码示例。如果您正苦于以下问题:C# Token.SetType方法的具体用法?C# Token.SetType怎么用?C# Token.SetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lucene.Net.Analysis.Token
的用法示例。
在下文中一共展示了Token.SetType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetNextInputToken
private Token GetNextInputToken(Token token)
{
if (!_input.IncrementToken()) return null;
token.SetTermBuffer(_inTermAtt.TermBuffer(), 0, _inTermAtt.TermLength());
token.SetPositionIncrement(_inPosIncrAtt.GetPositionIncrement());
token.SetFlags(_inFlagsAtt.GetFlags());
token.SetOffset(_inOffsetAtt.StartOffset(), _inOffsetAtt.EndOffset());
token.SetType(_inTypeAtt.Type());
token.SetPayload(_inPayloadAtt.GetPayload());
return token;
}
示例2: UpdateToken
/// <summary>
/// Final touch of a shingle token before it is passed on to the consumer from method {@link #next(org.apache.lucene.analysis.Token)}.
///
/// Calculates and sets type, flags, position increment, start/end offsets and weight.
/// </summary>
/// <param name="token">Shingle Token</param>
/// <param name="shingle">Tokens used to produce the shingle token.</param>
/// <param name="currentPermutationStartOffset">Start offset in parameter currentPermutationTokens</param>
/// <param name="currentPermutationRows">index to Matrix.Column.Row from the position of tokens in parameter currentPermutationTokens</param>
/// <param name="currentPermuationTokens">tokens of the current permutation of rows in the matrix. </param>
public void UpdateToken(Token token, List<Token> shingle, int currentPermutationStartOffset, List<Row> currentPermutationRows, List<Token> currentPermuationTokens)
{
token.SetType(typeof(ShingleMatrixFilter).Name);
token.SetFlags(0);
token.SetPositionIncrement(1);
token.SetStartOffset((shingle[0]).StartOffset());
token.SetEndOffset(shingle[shingle.Count - 1].EndOffset());
_settingsCodec.SetWeight(
token,
CalculateShingleWeight(token, shingle, currentPermutationStartOffset, currentPermutationRows, currentPermuationTokens)
);
}
示例3: GetNextSuffixInputToken
private Token GetNextSuffixInputToken(Token token)
{
if (!Suffix.IncrementToken()) return null;
token.SetTermBuffer(_termAtt.TermBuffer(), 0, _termAtt.TermLength());
token.SetPositionIncrement(_posIncrAtt.GetPositionIncrement());
token.SetFlags(_flagsAtt.GetFlags());
token.SetOffset(_offsetAtt.StartOffset(), _offsetAtt.EndOffset());
token.SetType(_typeAtt.Type());
token.SetPayload(_payloadAtt.GetPayload());
return token;
}