Class DictionaryEntryPersistor
java.lang.Object
opennlp.tools.dictionary.serializer.DictionaryEntryPersistor
This class is used by for reading and writing dictionaries of all kinds.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancreate(InputStream in, EntryInserter inserter) static voidserialize(OutputStream out, Iterator<Entry> entries) Deprecated.static voidserialize(OutputStream out, Iterator<Entry> entries, boolean casesensitive) Serializes the given entries to the givenOutputStream.
-
Constructor Details
-
DictionaryEntryPersistor
public DictionaryEntryPersistor()
-
-
Method Details
-
create
CreatesEntrys from the givenInputStreamand forwards theseEntrys to theEntryInserter. After creation is finished the providedInputStreamis closed.- Parameters:
in- stream to read entries frominserter- inserter to forward entries to- Returns:
- isCaseSensitive attribute for Dictionary
- Throws:
IOExceptionInvalidFormatException
-
serialize
@Deprecated public static void serialize(OutputStream out, Iterator<Entry> entries) throws IOException Deprecated.Serializes the given entries to the givenOutputStream. After the serialization is finished the providedOutputStreamremains open.- Parameters:
out- stream to serialize toentries- entries to serialize- Throws:
IOException- If an I/O error occurs
-
serialize
public static void serialize(OutputStream out, Iterator<Entry> entries, boolean casesensitive) throws IOException Serializes the given entries to the givenOutputStream. After the serialization is finished the providedOutputStreamremains open.- Parameters:
out- stream to serialize toentries- entries to serializecasesensitive- indicates if the written dictionary should be case sensitive or case insensitive.- Throws:
IOException- If an I/O error occurs
-
serialize(java.io.OutputStream, java.util.Iterator, boolean)instead