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