opennlp.tools.dictionary.serializer
Class DictionarySerializer

java.lang.Object
  extended by opennlp.tools.dictionary.serializer.DictionarySerializer

public class DictionarySerializer
extends Object

This class is used by for reading and writing dictionaries of all kinds.


Constructor Summary
DictionarySerializer()
           
 
Method Summary
static boolean create(InputStream in, EntryInserter inserter)
          Creates Entrys from the given InputStream and forwards these Entrys to the EntryInserter.
static void serialize(OutputStream out, Iterator<Entry> entries)
          Deprecated. Use serialize(java.io.OutputStream, java.util.Iterator, boolean) instead
static void serialize(OutputStream out, Iterator<Entry> entries, boolean casesensitive)
          Serializes the given entries to the given OutputStream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DictionarySerializer

public DictionarySerializer()
Method Detail

create

public static boolean create(InputStream in,
                             EntryInserter inserter)
                      throws IOException,
                             InvalidFormatException
Creates Entrys from the given InputStream and forwards these Entrys to the EntryInserter. After creation is finished the provided InputStream is closed.

Parameters:
in - stream to read entries from
inserter - inserter to forward entries to
Returns:
isCaseSensitive attribute for Dictionary
Throws:
IOException
InvalidFormatException

serialize

@Deprecated
public static void serialize(OutputStream out,
                                        Iterator<Entry> entries)
                      throws IOException
Deprecated. Use serialize(java.io.OutputStream, java.util.Iterator, boolean) instead

Serializes the given entries to the given OutputStream. After the serialization is finished the provided OutputStream remains open.

Parameters:
out - stream to serialize to
entries - 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 given OutputStream. After the serialization is finished the provided OutputStream remains open.

Parameters:
out - stream to serialize to
entries - entries to serialize
casesensitive - indicates if the written dictionary should be case sensitive or case insensitive.
Throws:
IOException - If an I/O error occurs


Copyright © 2013 The Apache Software Foundation. All Rights Reserved.