Package opennlp.tools.formats.brat
Class AnnotationConfiguration
java.lang.Object
opennlp.tools.formats.brat.AnnotationConfiguration
Encapsulates a type to class mapping for entities, relations, events, etc.
Details on how a annotation configuration file should be structured can be found in the brat annotation configuration section of the official BRAT documentation.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAnnotationConfiguration
(Map<String, String> typeToClassMap) Initializes anAnnotationConfiguration
with the specifiedtypeToClassMap
. -
Method Summary
Modifier and TypeMethodDescriptiongetTypeClass
(String type) static AnnotationConfiguration
Parses a givenannConfigFile
into aAnnotationConfiguration
.static AnnotationConfiguration
parse
(InputStream in) Parses a givenannConfigFile
into aAnnotationConfiguration
.
-
Field Details
-
SPAN_TYPE
- See Also:
-
ENTITY_TYPE
- See Also:
-
RELATION_TYPE
- See Also:
-
ATTRIBUTE_TYPE
- See Also:
-
EVENT_TYPE
- See Also:
-
-
Constructor Details
-
AnnotationConfiguration
Initializes anAnnotationConfiguration
with the specifiedtypeToClassMap
.- Parameters:
typeToClassMap
- A type to class mapping. Must not benull
.
-
-
Method Details
-
getTypeClass
- Parameters:
type
- The type to get the type class for.- Returns:
- Retrieves the class for the specified
type
,null
if not found.
-
parse
Parses a givenannConfigFile
into aAnnotationConfiguration
.- Parameters:
in
- A validannConfigFile
from which the config should be read. Must not benull
and must be in the correct format, see: Brat annotation configuration- Returns:
- A valid
AnnotationConfiguration
instance. - Throws:
IOException
- Thrown if IO errors occurred during parsing.
-
parse
Parses a givenannConfigFile
into aAnnotationConfiguration
.- Parameters:
annConfigFile
- A validannConfigFile
from which the config should be read. Must not benull
and must be in the correct format, see: Brat annotation configuration- Returns:
- A valid
AnnotationConfiguration
instance. - Throws:
IOException
- Thrown if IO errors occurred during parsing.
-