Class BratDocument
public class BratDocument
- Inheritance
-
BratDocument
- Inherited Members
Constructors
BratDocument(AnnotationConfiguration, string, string, ICollection<BratAnnotation>)
public BratDocument(AnnotationConfiguration config, string id, string text, ICollection<BratAnnotation> annotations)
Parameters
configAnnotationConfigurationidstringtextstringannotationsICollection<BratAnnotation>
Properties
Annotations
public ICollection<BratAnnotation> Annotations { get; }
Property Value
Config
public AnnotationConfiguration Config { get; }
Property Value
Id
public string Id { get; }
Property Value
Text
public string Text { get; }
Property Value
Methods
GetAnnotation(string)
Gets the annotation registered under id.
public BratAnnotation? GetAnnotation(string id)
Parameters
idstringthe annotation id to look up
Returns
- BratAnnotation
the annotation, or
nullif no annotation has that id
ParseDocument(AnnotationConfiguration, string, Stream, Stream)
Parses a brat document from its text and annotation streams.
public static BratDocument ParseDocument(AnnotationConfiguration config, string id, Stream txtIn, Stream annIn)
Parameters
configAnnotationConfigurationthe annotation configuration to parse against
idstringthe document id
txtInStreamthe stream to read the document text from
annInStreamthe stream to read the .ann annotations from
Returns
- BratDocument
the parsed BratDocument
Exceptions
- IOException
if there is an error during reading