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

opennlp.tools.formats.brat

## Class BratDocument

- java.lang.Object
- - opennlp.tools.formats.brat.BratDocument

-     public class BratDocument
      extends Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BratDocument(AnnotationConfiguration config, String id, String text, Collection<BratAnnotation> annotations)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `BratAnnotation` | `getAnnotation(String id)`
    `Collection<BratAnnotation>` | `getAnnotations()`
    `AnnotationConfiguration` | `getConfig()`
    `String` | `getId()`
    `String` | `getText()`
    `static BratDocument` | `parseDocument(AnnotationConfiguration config, String id, InputStream txtIn, InputStream annIn)`

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

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

- - ### Constructor Detail

    - #### BratDocument

          public BratDocument(AnnotationConfiguration config,
                              String id,
                              String text,
                              Collection<BratAnnotation> annotations)

  - ### Method Detail

    - #### getConfig

          public AnnotationConfiguration getConfig()

    - #### getId

          public String getId()

    - #### getText

          public String getText()

    - #### getAnnotation

          public BratAnnotation getAnnotation(String id)

    - #### getAnnotations

          public Collection<BratAnnotation> getAnnotations()

    - #### parseDocument

          public static BratDocument parseDocument(AnnotationConfiguration config,
                                                   String id,
                                                   InputStream txtIn,
                                                   InputStream annIn)
                                            throws IOException

      Throws:
        `IOException`

Copyright © 2026 The Apache Software Foundation. All rights reserved.