Class DictionaryEntryPersistor
- java.lang.Object
-
- opennlp.tools.dictionary.serializer.DictionaryEntryPersistor
-
public class DictionaryEntryPersistor extends Object
This class is used by for reading and writing dictionaries of all kinds.
-
-
Constructor Summary
Constructors Constructor Description DictionaryEntryPersistor()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static 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.
-
-
-
Method Detail
-
create
public static boolean create(InputStream in, EntryInserter inserter) throws IOException
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
-
-