|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.fu_berlin.ties.extract.ExtractionLocator
public class ExtractionLocator
Locates extractions in a document.
Constructor Summary | |
---|---|
ExtractionLocator(ExtractionContainer extractions,
TextTokenizer textTokenizer)
Creates a new instance, setting isRetrySilently() to
false . |
|
ExtractionLocator(ExtractionContainer extractions,
TextTokenizer textTokenizer,
boolean doRetrySilently)
Creates a new instance. |
Method Summary | |
---|---|
boolean |
endOfExtraction()
Whether we reached the end of the current extraction. |
Extraction |
getCurrentExtraction()
Returns the current extraction. |
boolean |
inExtraction()
Whether we are currently within an extraction. |
boolean |
isRetrySilently()
Whether the locator accepts extractions that are not explicitly located in the document. |
void |
reachedEndOfDocument()
This method must be called at the end of the current document. |
boolean |
startOfExtraction(String token,
int tokenRep)
Whether the current token starts a new extraction. |
void |
switchToNextExtraction()
Switches to the next extraction, updating the current extraction and related fields. |
String |
toString()
Returns a string representation of this object. |
boolean |
updateExtraction(String token,
int tokenRep)
Updates the currently processed extraction. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ExtractionLocator(ExtractionContainer extractions, TextTokenizer textTokenizer)
isRetrySilently()
to
false
.
extractions
- the extractions in this documenttextTokenizer
- the tokenizer used to split extractions into tokenspublic ExtractionLocator(ExtractionContainer extractions, TextTokenizer textTokenizer, boolean doRetrySilently)
extractions
- the extractions in this documenttextTokenizer
- the tokenizer used to split extractions into tokensdoRetrySilently
- sets the state of isRetrySilently()
Method Detail |
---|
public boolean endOfExtraction()
true
iff the current extraction has endedpublic Extraction getCurrentExtraction()
public boolean inExtraction()
true
iff are processing the
getCurrentExtraction()
, false
otherwise (we are
waiting for it to start or there are no more extractions)public boolean isRetrySilently()
true
, the locator accepts extractions
that are not explicitly located in the document (negative
(FirstTokenRep
). If such an
extraction is encountered, the locator will try to matching at all
possible positions. When updateExtraction(String, int)
fails
(returns false
) in such a case (indicating that only the
first token(s) of the extraction could be matched, but not the full
extraction), the locator will silently to locate the extraction against
the next possible position.
false
by defaultpublic void reachedEndOfDocument()
public boolean startOfExtraction(String token, int tokenRep)
token
- the token to checktokenRep
- the repetition of the token
in the document
(counting starts with 0, as the first occurrence is the "0th
repetition").
true
iff the given token starts a new extractionpublic void switchToNextExtraction() throws IllegalStateException
endOfExtraction()
must be true
.
IllegalStateException
- if endOfExtraction()
is not
true
(there are still remaining tokens to processpublic String toString()
toString
in class Object
public boolean updateExtraction(String token, int tokenRep)
token
- the token to processtokenRep
- the repetition of the token
in the document
(counting starts with 0, as the first occurrence is the "0th
repetition").
true
iff the extraction was successfully updated;
false
if the token was erroneous (not expected to occur
within the current extraction)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |