DictionarySerializer (Apache OpenNLP Tools 2.5.9 API)
Description: declaration: package: opennlp.tools.util.model, class: DictionarySerializer

# Class DictionarySerializer

java.lang.Object
opennlp.tools.util.model.DictionarySerializer

All Implemented Interfaces:
  `ArtifactSerializer<Dictionary>`

public class DictionarySerializer extends Object implements ArtifactSerializer<Dictionary>
An `ArtifactSerializer` implementation for `dictionaries`.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DictionarySerializer()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Dictionary`
  `create(InputStream in)`
  Creates an artifact from the provided `InputStream`.
  `void`
  `serialize(Dictionary dictionary, OutputStream out)`
  Serializes an artifact to the provided `OutputStream`.

  ### Methods inherited from class Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### DictionarySerializer

    public DictionarySerializer()

- ## Method Details

  - ### create

    public Dictionary create(InputStream in) throws IOException
    Description copied from interface: `ArtifactSerializer`
    Creates an artifact from the provided `InputStream`.

    Note: The `InputStream` remains open.

    Specified by:
      `create` in interface `ArtifactSerializer<Dictionary>`
    Parameters:
      `in` - A valid, open `InputStream` ready to read from.
    Returns:
      A valid `artifact`.
    Throws:
      `IOException` - Thrown if IO errors occurred during creation.

  - ### serialize

    public void serialize(Dictionary dictionary, OutputStream out) throws IOException
    Description copied from interface: `ArtifactSerializer`
    Serializes an artifact to the provided `OutputStream`.

    Note: The `OutputStream` remains open.

    Specified by:
      `serialize` in interface `ArtifactSerializer<Dictionary>`
    Parameters:
      `dictionary` - A valid `artifact`.
      `out` - A valid, open `OutputStream` ready to write to.
    Throws:
      `IOException` - Thrown if IO errors occurred during serialization.