DictionaryEntryPersistor (Apache OpenNLP Tools 1.9.5 API)
Date: 2026-06-18

opennlp.tools.dictionary.serializer

## 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 and Description
    `DictionaryEntryPersistor()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `static boolean` | `create(InputStream in, EntryInserter inserter)` Creates `Entry`s from the given `InputStream` and forwards these `Entry`s 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

    - #### DictionaryEntryPersistor

          public DictionaryEntryPersistor()

  - ### Method Detail

    - #### create

          public static boolean create(InputStream in,
                                       EntryInserter inserter)
                                throws IOException

      Creates `Entry`s from the given `InputStream` and forwards these `Entry`s 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 © 2026 The Apache Software Foundation. All rights reserved.