public class GATEDocument extends Object implements it.unimi.di.big.mg4j.document.Document
Modifier and Type | Field and Description |
---|---|
static GATEDocument |
END_OF_QUEUE
A special instance of GATEDocument used to mark the end of a queue.
|
Modifier | Constructor and Description |
---|---|
protected |
GATEDocument()
Private constructor used to create the
END_OF_QUEUE instance. |
|
GATEDocument(gate.Document gateDocument,
IndexConfig indexConfig) |
Modifier and Type | Method and Description |
---|---|
void |
addOccurrences(long newOccurrences)
Notifies this GATEDocument that some more index occurrences were produced
in the process of indexing it.
|
void |
close() |
Object |
content(int field) |
gate.Document |
getDocument()
Obtains the GATE document wrapped by this object.
|
String[] |
getNonTokens()
Gets the array of string representing the document content segments between
the token annotations.
|
long |
getOccurrences()
Returns the number of index occurrences that the indexing of this
GATEDocument has generated.
|
gate.Annotation[] |
getTokenAnnots()
Gets the array of offset-sorted token annotations for this document.
|
void |
setOutputQueue(BlockingQueue<GATEDocument> outputQueue)
Sets the output queue for this document.
|
CharSequence |
title() |
CharSequence |
uri() |
it.unimi.dsi.io.WordReader |
wordReader(int field) |
public static final GATEDocument END_OF_QUEUE
protected GATEDocument()
END_OF_QUEUE
instance.public GATEDocument(gate.Document gateDocument, IndexConfig indexConfig)
public void close() throws IOException
close
in interface it.unimi.di.big.mg4j.document.Document
close
in interface Closeable
close
in interface AutoCloseable
IOException
public void setOutputQueue(BlockingQueue<GATEDocument> outputQueue)
close()
method
is called, this document will add itself to the output queue.outputQueue
- the outputQueue to setpublic gate.Document getDocument()
public Object content(int field) throws IOException
content
in interface it.unimi.di.big.mg4j.document.Document
IOException
public CharSequence title()
title
in interface it.unimi.di.big.mg4j.document.Document
public CharSequence uri()
uri
in interface it.unimi.di.big.mg4j.document.Document
public void addOccurrences(long newOccurrences)
newOccurrences
- the number of new occurrences generatedpublic long getOccurrences()
public it.unimi.dsi.io.WordReader wordReader(int field)
wordReader
in interface it.unimi.di.big.mg4j.document.Document
public gate.Annotation[] getTokenAnnots()
public String[] getNonTokens()
Copyright © 2021 GATE. All rights reserved.