本文整理汇总了C#中Token.Clone方法的典型用法代码示例。如果您正苦于以下问题:C# Token.Clone方法的具体用法?C# Token.Clone怎么用?C# Token.Clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Token
的用法示例。
在下文中一共展示了Token.Clone方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SingleTokenTokenStream
public SingleTokenTokenStream(Token token) : base(Token.TOKEN_ATTRIBUTE_FACTORY)
{
Debug.Assert(token != null);
this.singleToken = token.Clone();
tokenAtt = AddAttribute <ICharTermAttribute>();
Debug.Assert(tokenAtt is Token);
}
示例2: SingleTokenTokenStream
public SingleTokenTokenStream(Token token)
: base(Token.TOKEN_ATTRIBUTE_FACTORY)
{
Debug.Assert(token != null, "Token was null!");
_singleToken = (Token) token.Clone();
_tokenAtt = (Attribute)AddAttribute<ITermAttribute>();
Debug.Assert(_tokenAtt is Token);
}
示例3: SingleTokenTokenStream
public SingleTokenTokenStream(Token token) : base(Token.TOKEN_ATTRIBUTE_FACTORY)
{
Debug.Assert(token != null);
this.singleToken = (Token)token.Clone();
// LUCENENET TODO: This is ugly. Can't we just use the type we want?
// The interface doesn't convert to Attribute, so we need to do a cast.
tokenAtt = (CharTermAttribute)AddAttribute<ICharTermAttribute>();
Debug.Assert(tokenAtt is Token);
}
示例4: Decompose
protected void Decompose(Token token)
{
// In any case we give the original token back
tokens.AddLast((Token)token.Clone());
// Only words longer than minWordSize get processed
if (token.TermLength() < this.minWordSize)
{
return;
}
DecomposeInternal(token);
}
示例5: CreateToken
protected Token CreateToken(int offset, int length,
Token prototype)
{
int newStart = prototype.StartOffset + offset;
Token t = prototype.Clone(prototype.TermBuffer(), offset, length, newStart, newStart + length);
t.PositionIncrement = 0;
return t;
}
示例6: UnexpectedLexemeException
public UnexpectedLexemeException(Token token)
: base(string.Format("The lexeme was unexpected at this time ({0}:'{1}')",
token.GetType().Name, token))
{
Token = (Token)token.Clone();
}
示例7: UnexpectedTokenException
public UnexpectedTokenException(Token token)
: base(string.Format("Unexpected lexeme at {2} ({0}:'{1}'). Environment ASCII: {3}",
token.GetType().Name, token, token.Offset, token.GetEnvironment()))
{
Token = (Token) token.Clone();
}
示例8: SetToken
public void SetToken(Token token)
{
_singleToken = (Token) token.Clone();
}