public class DocumentData extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
protected String |
documentTitle
The Document title.
|
protected String |
documentURI
The Document URI
|
protected HashMap<String,Serializable> |
metadata
A
HashMap of arbitrary metadata (all fields must be
Serializable ). |
protected String[] |
nonTokens
The non-tokens (i.e.
|
protected String[] |
tokens
The tokens of the document.
|
Constructor and Description |
---|
DocumentData(String documentURI,
String documentTitle,
String[] tokens,
String[] nonTokens)
Constructs a new DocumentData object.
|
Modifier and Type | Method and Description |
---|---|
String |
getDocumentTitle() |
String |
getDocumentURI() |
Serializable |
getMetadataField(String fieldName)
Gets the value of a metadata field.
|
String[] |
getNonTokens() |
String[][] |
getText(int termPosition,
int length) |
String[] |
getTokens() |
void |
putMetadataField(String fieldName,
Serializable fieldValue)
Adds a new arbitrary metadata field.
|
protected String[] tokens
protected String[] nonTokens
protected String documentURI
protected String documentTitle
protected HashMap<String,Serializable> metadata
HashMap
of arbitrary metadata (all fields must be
Serializable
).public DocumentData(String documentURI, String documentTitle, String[] tokens, String[] nonTokens)
documentURI
- the URI of the document.documentTitle
- the title of the document.tokens
- the document tokens.nonTokens
- the document non-tokens (i.e. spaces).public void putMetadataField(String fieldName, Serializable fieldValue)
fieldName
- the name for the new field.fieldValue
- the value for the new field. The value provided here must
be Serializable
. The map of metadata fields is stored separately
for each individual document; care should be taken to limit the size of
the object graph that is serialised!public Serializable getMetadataField(String fieldName)
fieldName
- the name of field to be returned.public String[] getTokens()
public String[] getNonTokens()
public String[][] getText(int termPosition, int length)
public String getDocumentURI()
public String getDocumentTitle()
Copyright © 2021 GATE. All rights reserved.