Package com.gengoai.hermes.format
Class HermesJsonFormat
- java.lang.Object
-
- com.gengoai.hermes.format.WholeFileTextFormat
-
- com.gengoai.hermes.format.HermesJsonFormat
-
- All Implemented Interfaces:
DocFormat
,OneDocPerFileFormat
,Serializable
public class HermesJsonFormat extends WholeFileTextFormat implements OneDocPerFileFormat, Serializable
Format Name: hjson
Reads and writes documents in Hermes Json format created when using
Document.toJson()
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
HermesJsonFormat.Provider
The type Provider.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DocFormatParameters
getParameters()
protected Stream<Document>
readSingleFile(String content)
Converts the content of an entire file into one ore more documents.void
write(Document document, Resource outputResource)
Writes the given document in this format to the given output resource.-
Methods inherited from class com.gengoai.hermes.format.WholeFileTextFormat
read
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.gengoai.hermes.format.OneDocPerFileFormat
write
-
-
-
-
Method Detail
-
getParameters
public DocFormatParameters getParameters()
- Specified by:
getParameters
in interfaceDocFormat
- Returns:
- the
DocFormatParameters
set for the instance of this foramt
-
readSingleFile
protected Stream<Document> readSingleFile(String content)
Description copied from class:WholeFileTextFormat
Converts the content of an entire file into one ore more documents.- Specified by:
readSingleFile
in classWholeFileTextFormat
- Parameters:
content
- the content- Returns:
- the stream of documents.
-
write
public void write(Document document, Resource outputResource) throws IOException
Description copied from interface:DocFormat
Writes the given document in this format to the given output resource.- Specified by:
write
in interfaceDocFormat
- Parameters:
document
- the documentoutputResource
- the output resource- Throws:
IOException
- Something went wrong writing the document
-
-