public class FlatJSONDocument extends Object implements Document
Modifier and Type | Field and Description |
---|---|
protected int |
fieldIndex |
protected List<String> |
fieldQueue |
protected String[] |
fieldsToProcess |
protected Map<String,String> |
properties |
protected int |
remainingTokens |
protected int |
tokenIndex |
protected Tokeniser |
tokenizer |
String[][] |
tokens |
Constructor and Description |
---|
FlatJSONDocument(com.google.gson.JsonObject json) |
FlatJSONDocument(String rawJson) |
Modifier and Type | Method and Description |
---|---|
boolean |
endOfDocument()
Returns true when the end of the document has been reached, and there
are no other terms to be retrieved from it.
|
Map<String,String> |
getAllProperties()
Returns the underlying map of all the properties defined by this Document.
|
Set<String> |
getFields()
Returns a list of the fields the current term appears in.
|
String |
getNextTerm()
Gets the next term of the document.
|
String |
getProperty(String name)
Allows access to a named property of the Document.
|
Reader |
getReader()
Returns a Reader object so client code can tokenise the document
or deal with the document itself.
|
protected void |
initalize(String rawJson) |
protected Tokeniser tokenizer
public String[][] tokens
protected String[] fieldsToProcess
protected int fieldIndex
protected int tokenIndex
protected int remainingTokens
public FlatJSONDocument(com.google.gson.JsonObject json)
public FlatJSONDocument(String rawJson) throws com.fasterxml.jackson.core.JsonParseException, com.fasterxml.jackson.databind.JsonMappingException, IOException
com.fasterxml.jackson.core.JsonParseException
com.fasterxml.jackson.databind.JsonMappingException
IOException
protected void initalize(String rawJson)
public boolean endOfDocument()
Document
endOfDocument
in interface Document
public Map<String,String> getAllProperties()
Document
getAllProperties
in interface Document
public Set<String> getFields()
Document
public String getNextTerm()
Document
getNextTerm
in interface Document
public String getProperty(String name)
Document
getProperty
in interface Document
name
- Name of the property. It is suggested, but not required that this name
should not be case insensitive.Terrier Information Retrieval Platform 5.1. Copyright © 2004-2019, University of Glasgow