Class DictionaryEntryPersistor
- java.lang.Object
-
- opennlp.tools.dictionary.serializer.DictionaryEntryPersistor
-
public class DictionaryEntryPersistor extends Object
A persistor used by for reading and writingdictionaries
of all kinds.- See Also:
Dictionary
-
-
Constructor Summary
Constructors Constructor Description DictionaryEntryPersistor()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static boolean
create(InputStream in, EntryInserter inserter)
static void
serialize(OutputStream out, Iterator<Entry> entries)
Deprecated.Useserialize(OutputStream, Iterator, boolean)
instead.static void
serialize(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
CreatesEntry
s from the givenInputStream
and forwards theseEntry
s to theEntryInserter
.Note: After creation is finished the provided
InputStream
is closed.- Parameters:
in
- The openInputStream
to read entries from.inserter
- inserter to forward entries to- Returns:
- The
isCaseSensitive
attribute of aDictionary
. - Throws:
IOException
- Thrown if IO errors occurred.InvalidFormatException
- Thrown if parameters were invalid.
-
serialize
@Deprecated public static void serialize(OutputStream out, Iterator<Entry> entries) throws IOException
Deprecated.Useserialize(OutputStream, Iterator, boolean)
instead.Serializes the given entries to the givenOutputStream
.Note: After the serialization is finished the provided
OutputStream
remains open.- Parameters:
out
- TheOutputStream
to serialize to.entries
- Theentries
to serialize.- Throws:
IOException
- Thrown if IO errors occurred.InvalidFormatException
- Thrown if parameters were invalid.
-
serialize
public static void serialize(OutputStream out, Iterator<Entry> entries, boolean casesensitive) throws IOException
Serializes the given entries to the givenOutputStream
.Note: After the serialization is finished the provided
OutputStream
remains open.- Parameters:
out
- TheOutputStream
to serialize to.entries
- Theentries
to serialize.casesensitive
- Indicates if the written dictionary should be case-sensitive, or not.- Throws:
IOException
- Thrown if IO errors occurred.InvalidFormatException
- Thrown if parameters were invalid.
-
-