本文整理汇总了C#中MockTokenizer.incrementToken方法的典型用法代码示例。如果您正苦于以下问题:C# MockTokenizer.incrementToken方法的具体用法?C# MockTokenizer.incrementToken怎么用?C# MockTokenizer.incrementToken使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MockTokenizer
的用法示例。
在下文中一共展示了MockTokenizer.incrementToken方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: testDelim
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public void testDelim() throws Exception
public virtual void testDelim()
{
Reader reader = new StringReader("the*0.1 quick*0.1 red*0.1");
TokenStream stream = new MockTokenizer(reader, MockTokenizer.WHITESPACE, false);
stream = tokenFilterFactory("DelimitedPayload", "encoder", "float", "delimiter", "*").create(stream);
stream.reset();
while (stream.incrementToken())
{
PayloadAttribute payAttr = stream.getAttribute(typeof(PayloadAttribute));
assertNotNull(payAttr);
sbyte[] payData = payAttr.Payload.bytes;
assertNotNull(payData);
float payFloat = PayloadHelper.decodeFloat(payData);
assertEquals(0.1f, payFloat, 0.0f);
}
stream.end();
stream.close();
}