public interface Parser
Modifier and Type | Method and Description |
---|---|
Locale |
getLanguage()
Returns the language which the parser can parse.
|
String |
getName()
Returns the name of the parser in a user-presentable form.
|
int |
getParsePosition()
Returns the position in the text the parser is currently parsing.
|
boolean |
isAnnotateFirstOccurrenceOnly()
Return if only the first occurrence of a word should be annotated.
|
boolean |
isIgnoreNewlines()
Return if the parser skips newlines in the imported text.
|
List<TextAnnotation> |
parse(char[] text,
int start,
int length)
Parses the text, returning a list with annotations for words in the text.
|
void |
reset()
Clears any caches which may have been filled during parsing.
|
void |
setAnnotateFirstOccurrenceOnly(boolean firstOccurrence)
Set if only the first occurrence of a word should be annotated.
|
void |
setIgnoreNewlines(boolean ignoreNewlines)
Set if the parser should skip newlines in the imported text.
|
List<TextAnnotation> parse(char[] text, int start, int length) throws SearchException
text
- The text to parse.text annotations
. If no annotations were created, the empty
list will be returned.SearchException
- If an error occurrs during a dictionary lookup.int getParsePosition()
void reset()
setAnnotateFirstOccurenceOnly
is set to
true
.void setIgnoreNewlines(boolean ignoreNewlines)
boolean isIgnoreNewlines()
void setAnnotateFirstOccurrenceOnly(boolean firstOccurrence)
true
, an annotated word will be cached and further occurrences will be ignored.
The cache of annotated words will be cleared when reset
is called.boolean isAnnotateFirstOccurrenceOnly()
String getName()
Locale getLanguage()
Copyright © 2001-2013 the JGloss developers. All Rights Reserved.