|
||||||||||
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(Document document,
ExtractionContainer extractions,
TextTokenizer textTokenizer)
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. |
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(Document document, ExtractionContainer extractions, TextTokenizer textTokenizer)
document
- the document to useextractions
- the extractions in this documenttextTokenizer
- the tokenizer used to split extractions into tokensMethod 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 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 |