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 anAnnotationConfigurationwith the specifiedtypeToClassMap. -
Method Summary
Modifier and TypeMethodDescriptiongetTypeClass(String type) static AnnotationConfigurationParses a givenannConfigFileinto aAnnotationConfiguration.static AnnotationConfigurationparse(InputStream in) Parses a givenannConfigFileinto 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 anAnnotationConfigurationwith 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,nullif not found.
-
parse
Parses a givenannConfigFileinto aAnnotationConfiguration.- Parameters:
in- A validannConfigFilefrom which the config should be read. Must not benulland must be in the correct format, see: Brat annotation configuration- Returns:
- A valid
AnnotationConfigurationinstance. - Throws:
IOException- Thrown if IO errors occurred during parsing.
-
parse
Parses a givenannConfigFileinto aAnnotationConfiguration.- Parameters:
annConfigFile- A validannConfigFilefrom which the config should be read. Must not benulland must be in the correct format, see: Brat annotation configuration- Returns:
- A valid
AnnotationConfigurationinstance. - Throws:
IOException- Thrown if IO errors occurred during parsing.
-