GermEval2014NameSampleStream (Apache OpenNLP :: Core :: Formats 3.0.0-M4 API)
Description: declaration: package: opennlp.tools.formats, class: GermEval2014NameSampleStream

Package opennlp.tools.formats

# Class GermEval2014NameSampleStream

java.lang.Object
opennlp.tools.formats.GermEval2014NameSampleStream

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

@Internal public class GermEval2014NameSampleStream extends Object implements opennlp.tools.util.ObjectStream<opennlp.tools.namefind.NameSample>
Parser for the GermEval 2014 Named Entity Recognition Shared Task data.

The data is in a tab-separated format with four columns:

1. Token index (1-based per sentence)
2. Token text
3. Outer named entity tag (IOB2 scheme)
4. Nested/embedded named entity tag (IOB2 scheme)

Comment lines starting with `#` mark document boundaries and contain source URL and date metadata. Blank lines separate sentences.

The data uses four main entity types: Person (PER), Location (LOC), Organization (ORG) and Other (OTH), with additional `deriv` and `part` suffixes for derived forms and name parts respectively.

Since `NameSample` does not support overlapping spans, this stream requires selecting either the `outer` or `inner` annotation layer via a `GermEval2014NameSampleStream.NerLayer` parameter.

Data can be found on this web site.

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

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static enum`
  `GermEval2014NameSampleStream.NerLayer`
  Selects which NER annotation layer to read from the GermEval 2014 data.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `GENERATE_LOCATION_ENTITIES`
  `static final int`
  `GENERATE_MISC_ENTITIES`
  `static final int`
  `GENERATE_ORGANIZATION_ENTITIES`
  `static final int`
  `GENERATE_PERSON_ENTITIES`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `GermEval2014NameSampleStream(opennlp.tools.util.InputStreamFactory in, int types, GermEval2014NameSampleStream.NerLayer layer)`
  Initializes a `GermEval2014NameSampleStream`.
  `GermEval2014NameSampleStream(opennlp.tools.util.ObjectStream<String> lineStream, int types, GermEval2014NameSampleStream.NerLayer layer)`
  Initializes a `GermEval2014NameSampleStream`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  `opennlp.tools.namefind.NameSample`
  `read()`
  `void`
  `reset()`

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

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

- ## Field Details

  - ### GENERATE_PERSON_ENTITIES

    public static final int GENERATE_PERSON_ENTITIES
    See Also:
      - Constant Field Values

  - ### GENERATE_ORGANIZATION_ENTITIES

    public static final int GENERATE_ORGANIZATION_ENTITIES
    See Also:
      - Constant Field Values

  - ### GENERATE_LOCATION_ENTITIES

    public static final int GENERATE_LOCATION_ENTITIES
    See Also:
      - Constant Field Values

  - ### GENERATE_MISC_ENTITIES

    public static final int GENERATE_MISC_ENTITIES
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### GermEval2014NameSampleStream

    public GermEval2014NameSampleStream(opennlp.tools.util.ObjectStream<String> lineStream, int types, GermEval2014NameSampleStream.NerLayer layer)
    Initializes a `GermEval2014NameSampleStream`.
    Parameters:
      `lineStream` - An `ObjectStream` over the lines in the GermEval 2014 data file.
      `types` - The entity types to include in the Name Sample object stream.
      `layer` - The `GermEval2014NameSampleStream.NerLayer` to read.

  - ### GermEval2014NameSampleStream

    public GermEval2014NameSampleStream(opennlp.tools.util.InputStreamFactory in, int types, GermEval2014NameSampleStream.NerLayer layer) throws IOException
    Initializes a `GermEval2014NameSampleStream`.
    Parameters:
      `in` - The `InputStreamFactory` for the input file.
      `types` - The entity types to include in the Name Sample object stream.
      `layer` - The `GermEval2014NameSampleStream.NerLayer` to read.
    Throws:
      `IOException` - Thrown if IO errors occurred.

- ## Method Details

  - ### read

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

  - ### reset

    public void reset() throws IOException, UnsupportedOperationException
    Specified by:
      `reset` in interface `opennlp.tools.util.ObjectStream<opennlp.tools.namefind.NameSample>`
    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.namefind.NameSample>`
    Throws:
      `IOException`