本文整理汇总了C#中Lucene.Net.Analysis.Token.StartOffset方法的典型用法代码示例。如果您正苦于以下问题:C# Token.StartOffset方法的具体用法?C# Token.StartOffset怎么用?C# Token.StartOffset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lucene.Net.Analysis.Token
的用法示例。
在下文中一共展示了Token.StartOffset方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsNewFragment
public virtual bool IsNewFragment(Token token)
{
char kar1 = this.text[token.StartOffset() - 2];
char kar2 = this.text[token.StartOffset() - 3];
char kar3 = this.text[token.StartOffset() - 4];
bool isNewFrag= ((token.EndOffset()>=(fragmentSize*(currentNumFrags - 1) + (fragmentSize/2))&&
(isCriticalChar(kar1) || isCriticalChar(kar2) || isCriticalChar(kar3)))
|| (token.EndOffset()>=(fragmentSize*currentNumFrags)));
if(isNewFrag)
{
currentNumFrags++;
}
return isNewFrag;
}
示例2: Next
/// <summary>
///
/// </summary>
/// <returns>Returns the next token in the stream, or null at EOS</returns>
public override Token Next()
{
if ((token = input.Next()) == null)
{
return null;
}
else
{
String s = stemmer.Stem(token.TermText());
if (!s.Equals(token.TermText()))
{
return new Token(s, token.StartOffset(), token.EndOffset(),
token.Type());
}
return token;
}
}
示例3: updateSuffixToken
public virtual Token updateSuffixToken(Token suffixToken, Token lastInputToken)
{
suffixToken.SetOffset(lastInputToken.EndOffset() + suffixToken.StartOffset(), lastInputToken.EndOffset() + suffixToken.EndOffset());
return suffixToken;
}
示例4: updateInputToken
public virtual Token updateInputToken(Token inputToken, Token lastPrefixToken)
{
inputToken.SetOffset(lastPrefixToken.EndOffset() + inputToken.StartOffset(), lastPrefixToken.EndOffset() + inputToken.EndOffset());
return inputToken;
}
示例5: UpdateSuffixToken
/// <summary>
/// The default implementation adds last prefix token end offset to the suffix token start and end offsets.
/// </summary>
/// <param name="suffixToken">a token from the suffix stream</param>
/// <param name="lastPrefixToken">the last token from the prefix stream</param>
/// <returns>consumer token</returns>
public virtual Token UpdateSuffixToken(Token suffixToken, Token lastPrefixToken)
{
suffixToken.SetStartOffset(lastPrefixToken.EndOffset() + suffixToken.StartOffset());
suffixToken.SetEndOffset(lastPrefixToken.EndOffset() + suffixToken.EndOffset());
return suffixToken;
}
示例6: SetCurrentToken
private void SetCurrentToken(Token token)
{
if (token == null) return;
ClearAttributes();
_termAtt.SetTermBuffer(token.TermBuffer(), 0, token.TermLength());
_posIncrAtt.SetPositionIncrement(token.GetPositionIncrement());
_flagsAtt.SetFlags(token.GetFlags());
_offsetAtt.SetOffset(token.StartOffset(), token.EndOffset());
_typeAtt.SetType(token.Type());
_payloadAtt.SetPayload(token.GetPayload());
}
示例7: UpdateSuffixToken
public Token UpdateSuffixToken(Token suffixToken, Token lastInputToken)
{
suffixToken.SetStartOffset(lastInputToken.EndOffset() + suffixToken.StartOffset());
suffixToken.SetEndOffset(lastInputToken.EndOffset() + suffixToken.EndOffset());
return suffixToken;
}
示例8: UpdateInputToken
public Token UpdateInputToken(Token inputToken, Token lastPrefixToken)
{
inputToken.SetStartOffset(lastPrefixToken.EndOffset() + inputToken.StartOffset());
inputToken.SetEndOffset(lastPrefixToken.EndOffset() + inputToken.EndOffset());
return inputToken;
}
示例9: GetTokenView
protected override string GetTokenView(Token token)
{
return token.TermText() + " Start: " + token.StartOffset().ToString().PadLeft(5) + " End: " + token.EndOffset().ToString().PadLeft(5) + "\r\n";
}