class FLExReader extends DefaultHandler2 implements FLExText
A generic FLExReader class that can create annotations and meta annotations from FLEx ‘lang’ and ‘type’ elements and he respective values.
Modifier and Type | Field and Description |
---|---|
private Map<String,Integer> |
multipleAnnoMap |
protected org.corpus_tools.pepper.modules.PepperModuleProperties |
properties |
FLEX__ANALYSIS_STATUS_ATTR, FLEX__LANG_ATTR, FLEX__TYPE_ATTR, FLEX_ITEM_TYPE__PUNCT, FLEX_ITEM_TYPE__TXT, FLEX_LANGUAGE__ENCODING_ATTR, FLEX_LANGUAGE__FONT_ATTR, FLEX_LANGUAGE__VERNACULAR_ATTR, ITEM_LAYER_MORPH, ITEM_LAYER_PHRASE, ITEM_LAYER_WORD, PROCESSING__ACTIVE_ELEMENT_VALUE, PROCESSING__KEY_VALUE_SEPARATOR, PROCESSING__UNDERSCORE, TAG_INTERLINEAR_TEXT, TAG_ITEM, TAG_LANGUAGE, TAG_LANGUAGES, TAG_MORPH, TAG_MORPHEMES, TAG_PARAGRAPH, TAG_PHRASE, TAG_SEQNUM, TAG_WORD, TAG_WORDS, TOKEN_LAYER_LEXICAL, TOKEN_LAYER_MORPHOLOGICAL
Constructor and Description |
---|
FLExReader(org.corpus_tools.pepper.modules.PepperModuleProperties properties)
A constructor taking a properties argument and setting the respective field.
|
Modifier and Type | Method and Description |
---|---|
protected void |
createAnnotation(org.corpus_tools.salt.core.SNode node,
String namespace,
String name,
String value)
Forwards to
#createAnnotation(SDocument, String, String, String, boolean) with the isMeta argument set to false . |
private org.corpus_tools.salt.core.SAbstractAnnotation |
createAnnotation(org.corpus_tools.salt.core.SNode node,
String namespace,
String name,
String value,
boolean isMeta)
Handles failsafe creation of (meta) annotations by checking against a map whether an annotation with the same namespace and name already exists for the respective node, and adding an incrementing counter to the name should it exist.
|
protected org.corpus_tools.salt.core.SAbstractAnnotation |
createLanguagedAnnotation(org.corpus_tools.salt.core.SNode node,
String languageString,
String name,
String value)
Checks for language mapping properties, makes required changed to language strings, and forwards to
#createAnnotation(SDocument, String, String, String, boolean) with the isMeta argument set to false . |
attributeDecl, comment, elementDecl, endCDATA, endDTD, endEntity, externalEntityDecl, getExternalSubset, internalEntityDecl, resolveEntity, resolveEntity, startCDATA, startDTD, startEntity
characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl, warning
protected final org.corpus_tools.pepper.modules.PepperModuleProperties properties
FLExReader(org.corpus_tools.pepper.modules.PepperModuleProperties properties)
A constructor taking a properties argument and setting the respective field.
properties
- protected void createAnnotation(org.corpus_tools.salt.core.SNode node, String namespace, String name, String value)
Forwards to #createAnnotation(SDocument, String, String, String, boolean)
with the isMeta
argument set to false
.
doc
- namespace
- name
- value
- protected org.corpus_tools.salt.core.SAbstractAnnotation createLanguagedAnnotation(org.corpus_tools.salt.core.SNode node, String languageString, String name, String value)
Checks for language mapping properties, makes required changed to language strings, and forwards to #createAnnotation(SDocument, String, String, String, boolean)
with the isMeta
argument set to false
.
node
- languageString
- name
- value
- private org.corpus_tools.salt.core.SAbstractAnnotation createAnnotation(org.corpus_tools.salt.core.SNode node, String namespace, String name, String value, boolean isMeta)
Handles failsafe creation of (meta) annotations by checking against a map whether an annotation with the same namespace and name already exists for the respective node, and adding an incrementing counter to the name should it exist.
This method expects node.getId() to not return null
!
node
- The node to create an annotation on (could be graphs, tokens, spans, etc.)namespace
- The namespace of the annotation to createname
- The nae of the annotation to createvalue
- The value of the annotation to creteisMeta
- Whether the annotation to create should be of type SMetaAnnotation
Copyright © 2011–2018 Humboldt-Universität zu Berlin. All rights reserved.