FileDocCategorySizeDatePackage
TestChineseTokenizer.javaAPI DocApache Lucene 2.0.01407Fri May 26 09:53:54 BST 2006org.apache.lucene.analysis.cn

TestChineseTokenizer

public class TestChineseTokenizer extends TestCase
author
rayt

Fields Summary
Constructors Summary
Methods Summary
public voidtestOtherLetterOffset()

        String s = "a天b";
        ChineseTokenizer tokenizer = new ChineseTokenizer(new StringReader(s));
        Token token;

        int correctStartOffset = 0;
        int correctEndOffset = 1;
        while ((token = tokenizer.next()) != null)
        {
            assertEquals(correctStartOffset, token.startOffset());
            assertEquals(correctEndOffset, token.endOffset());
            correctStartOffset++;
            correctEndOffset++;
        }