public class SingleWordReaderParser extends Object implements WordParser<SingleToken,Reader>
Modifier and Type | Field and Description |
---|---|
protected String |
content |
static char |
END_OF_WORD |
protected int |
line |
protected int |
pos |
protected LineNumberReader |
reader |
static WordDescription |
ZERO_WORD_DESCRIPTION |
Constructor and Description |
---|
SingleWordReaderParser() |
Modifier and Type | Method and Description |
---|---|
List<SingleToken> |
nextSentenceTokens()
返回下一个句子中的Token列表
|
SingleToken |
nextToken()
返回下一个Token,如果返回值为空,表示已经以结尾
|
void |
parse(WordParserManager wordParserManager,
Reader reader,
WordParserType wordParserType,
WordParserMode wordParserMode)
解析资源,调用此方法时,会清空缓冲
|
Collection<SingleToken> |
tokens()
返回所有解析出来的Token列表,调用时,会把nextToken置为开头
|
public static final char END_OF_WORD
public static final WordDescription ZERO_WORD_DESCRIPTION
protected int line
protected LineNumberReader reader
protected int pos
protected String content
public void parse(WordParserManager wordParserManager, Reader reader, WordParserType wordParserType, WordParserMode wordParserMode)
WordParser
parse
in interface WordParser<SingleToken,Reader>
reader
- 表示来源public Collection<SingleToken> tokens() throws IOException
WordParser
tokens
in interface WordParser<SingleToken,Reader>
IOException
public SingleToken nextToken() throws IOException
WordParser
nextToken
in interface WordParser<SingleToken,Reader>
IOException
public List<SingleToken> nextSentenceTokens() throws IOException
WordParser
nextSentenceTokens
in interface WordParser<SingleToken,Reader>
IOException
Copyright © 2006–2018 TinyGroup. All rights reserved.