Package opennlp.tools.formats

# Class BioNLP2004NameSampleStream

java.lang.Object
opennlp.tools.formats.BioNLP2004NameSampleStream

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

@Internal public class BioNLP2004NameSampleStream extends Object implements opennlp.tools.util.ObjectStream<opennlp.tools.namefind.NameSample>
A `sample stream` for the training files of the BioNLP/NLPBA 2004 shared task.

The data contains five named entity types:

- `DNA`
- `RNA`
- `protein`
- `cell_type`
- `cell_line`

Data can be found on this website, or in this GitHub repository.

The BioNLP/NLPBA 2004 data were originally published here,

yet this page was gone when last checked in December 2022.

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

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `GENERATE_CELLLINE_ENTITIES`
  `static final int`
  `GENERATE_CELLTYPE_ENTITIES`
  `static final int`
  `GENERATE_DNA_ENTITIES`
  `static final int`
  `GENERATE_PROTEIN_ENTITIES`
  `static final int`
  `GENERATE_RNA_ENTITIES`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BioNLP2004NameSampleStream(opennlp.tools.util.InputStreamFactory in, int types)`
  Initializes a `BioNLP2004NameSampleStream`.

- ## 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_DNA_ENTITIES

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

  - ### GENERATE_PROTEIN_ENTITIES

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

  - ### GENERATE_CELLTYPE_ENTITIES

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

  - ### GENERATE_CELLLINE_ENTITIES

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

  - ### GENERATE_RNA_ENTITIES

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

- ## Constructor Details

  - ### BioNLP2004NameSampleStream

    public BioNLP2004NameSampleStream(opennlp.tools.util.InputStreamFactory in, int types) throws IOException
    Initializes a `BioNLP2004NameSampleStream`.
    Parameters:
      `in` - The `InputStreamFactory` to use.
      `types` - The types to use.
    Throws:
      `IOException` - Thrown if IO errors occurred during initialization.

- ## 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`