Package opennlp.tools.formats

# Class NameFinderCensus90NameStream

java.lang.Object
opennlp.tools.formats.NameFinderCensus90NameStream

All Implemented Interfaces:
  `AutoCloseable`, `opennlp.tools.util.ObjectStream<opennlp.tools.util.StringList>`

@Internal public class NameFinderCensus90NameStream extends Object implements opennlp.tools.util.ObjectStream<opennlp.tools.util.StringList>
This class helps to read the US Census data from the files to build a StringList for each dictionary entry in the name-finder dictionary. The entries in the source file are as follows:

SMITH 1.006 1.006 1

- The first field is the name (in ALL CAPS).
- The next field is a frequency in percent.
- The next is a cumulative frequency in percent.
- The last is a ranking.

Note: Do not use this class, internal use only!

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `NameFinderCensus90NameStream(opennlp.tools.util.InputStreamFactory in, Charset encoding)`
  Initializes a `NameFinderCensus90NameStream` via an `InputStreamFactory` and a `Charset`.
  `NameFinderCensus90NameStream(opennlp.tools.util.ObjectStream<String> lineStream)`
  Initializes a `NameFinderCensus90NameStream` via `opennlp.tools.util.ObjectStream<String>`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  `opennlp.tools.util.StringList`
  `read()`
  `void`
  `reset()`

  ### Methods inherited from class java.lang.Object

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

- ## Constructor Details

  - ### NameFinderCensus90NameStream

    public NameFinderCensus90NameStream(opennlp.tools.util.ObjectStream<String> lineStream)
    Initializes a `NameFinderCensus90NameStream` via `opennlp.tools.util.ObjectStream<String>`.
    Parameters:
      `lineStream` - An `opennlp.tools.util.ObjectStream<String>` that represents the input file to be attached to this class.

  - ### NameFinderCensus90NameStream

    public NameFinderCensus90NameStream(opennlp.tools.util.InputStreamFactory in, Charset encoding) throws IOException
    Initializes a `NameFinderCensus90NameStream` via an `InputStreamFactory` and a `Charset`. Opens an associated stream object with the specified encoding specified.
    Parameters:
      `in` - The `InputStreamFactory` for the input file.
      `encoding` - the `Charset` to apply to the input stream.
    Throws:
      `IOException` - Thrown if IO errors occurred.

- ## Method Details

  - ### read

    public opennlp.tools.util.StringList read() throws IOException
    Specified by:
      `read` in interface `opennlp.tools.util.ObjectStream<opennlp.tools.util.StringList>`
    Throws:
      `IOException`

  - ### reset

    public void reset() throws IOException, UnsupportedOperationException
    Specified by:
      `reset` in interface `opennlp.tools.util.ObjectStream<opennlp.tools.util.StringList>`
    Throws:
      `IOException`
      `UnsupportedOperationException`

  - ### close

    public void close() throws IOException
    Specified by:
      `close` in interface `AutoCloseable`
    Specified by:
      `close` in interface `opennlp.tools.util.ObjectStream<opennlp.tools.util.StringList>`
    Throws:
      `IOException`