public abstract class ChunkedLanguageParser extends Object implements LanguageParser
LanguageParser that allows an
implementation to handle a single CharSequence without worrying
about mapping to the correct location or original text in the source.| Modifier and Type | Field and Description |
|---|---|
protected LanguageEncounter |
encounter |
| Constructor and Description |
|---|
ChunkedLanguageParser(LanguageEncounter encounter) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
emitToken(int offset,
TokenType type,
int length) |
protected void |
emitToken(int offset,
TokenType type,
int length,
Map<String,Object> properties) |
protected void |
emitToken(int offset,
TokenType type,
String value) |
protected void |
endSentence(int offset)
End a sentence at the given offset.
|
void |
flush()
Indicate that the current paragraph-level content is finished and that
parsed sentences and words need to be flushed.
|
protected abstract void |
handleChunk(CharSequence sequence)
Handle the given sequence of characters.
|
protected void |
startSentence(int offset)
Start a sentence at the given offset.
|
void |
text(CharSequence text,
Location start,
Location end)
Add some text that should be parsed.
|
void |
text(String text,
String original,
Location start) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitlocaleprotected final LanguageEncounter encounter
public ChunkedLanguageParser(LanguageEncounter encounter)
public void text(CharSequence text, Location start, Location end)
LanguageParsertext in interface LanguageParsertext - the text that should be parsedstart - start of the textend - end of the textpublic void flush()
LanguageParserflush in interface LanguageParserprotected void startSentence(int offset)
offset - protected void endSentence(int offset)
offset - protected void emitToken(int offset,
TokenType type,
int length)
protected void emitToken(int offset,
TokenType type,
int length,
Map<String,Object> properties)
protected abstract void handleChunk(CharSequence sequence)
startSentence(int), #emitToken(int, se.l4.lect.Token.TokenType, String) and
endSentence(int).sequence - Copyright © 2018. All rights reserved.