Package org.apache.uima.search
Interface Style
- All Superinterfaces:
Serializable
,XMLizable
- All Known Implementing Classes:
Style_impl
An indexing style. A set of indexing styles make up a
IndexRule
, which is then applied to
an IndexBuildItem
in order to assign indexing behavior to an annotation type.
We support an open-ended schema for styles. Each style has a name
and zero or
more getAttributes()
, where each attribute has a name and a value. Any given indexer
implementation can declare which styles it implements, and which attributes it supports. An
indexer should gracefully handle unknown styles or attributes and report them in an appropriate
manner.
The following styles and attributes are currently defined:
- Term - the span of this annotation indicates a single token.
- lemma - the value of this optional attribute is the name of the feature whose value should be taken as the token to index. If not specified, the covered text of the annotation will be indexed.
- Breaking - the indexer should record a sentence boundary before and after the span of
this annotation.
- no attributes defined
- Annotation - this annotation should be recorded in the index as a span that can be
queried by the user.
- fixedName - the value of this optional attribute is the name to assign to the span in the index. If neither this nor nameFeature is specified, the annotation's exact type name, without namespace, will be indexed.
- nameFeature - the value of this optional attribute is the name to a feature whose value will be used as the name of the span in the index. If neither this nor fixedName is specified, the annotation's exact type name, without namespace, will be indexed. It is an error to give values for both nameFeature and fixedName.
attribute mappings
, which specify which how the features (properties) of the annotation should be indexed.
XMLizable
interface and can be parsed from an XML
representation.-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetAttribute
(String aName) Gets the value of an attribute with the given name.Mapping[]
Gets the mappings that specify which features (properties) of the annotation should be indexed, and under which names.Gets theAttribute
s for this style.getName()
Gets the name of this style.void
setAttributeMappings
(Mapping[] aMappings) Sets the mappings that specify which features (properties) of the annotation should be indexed, and under which names.void
setAttributes
(Attribute[] aAttributes) Sets theAttribute
s for this style.void
Sets the name of this style.Methods inherited from interface org.apache.uima.util.XMLizable
buildFromXMLElement, buildFromXMLElement, toXML, toXML, toXML, toXML
-
Field Details
-
TERM
Constant for the name of the Term style.- See Also:
-
BREAKING
Constant for the name of the Breaking style.- See Also:
-
ANNOTATION
Constant for the name of the Annotation style.- See Also:
-
-
Method Details
-
getName
String getName()Gets the name of this style. See the class comment for a list of defined style names. Implementations must make sure that all names areString.intern()
ed so that they can be compared with the == operator.- Returns:
- the name of this style
-
setName
Sets the name of this style. See the class comment for a list of defined style names. Implementations must make sure that all names areString.intern()
ed so that they can be compared with the == operator.- Parameters:
aName
- the name of this style
-
getAttributes
Attribute[] getAttributes()Gets theAttribute
s for this style. See the class comment for a list of defined attributes for each style name.- Returns:
- the attributes for this style.
-
setAttributes
Sets theAttribute
s for this style. See the class comment for a list of defined attributes for each style name.- Parameters:
aAttributes
- the attributes for this style.
-
getAttribute
Gets the value of an attribute with the given name.- Parameters:
aName
- name of an attribute- Returns:
- the value of the named attribute, null if there is no such attribute declared on this style
-
getAttributeMappings
Mapping[] getAttributeMappings()Gets the mappings that specify which features (properties) of the annotation should be indexed, and under which names.- Returns:
- an array of objects that each specify a mapping from a CAS feature name to the name under which this feature should be recorded in the index.
-
setAttributeMappings
Sets the mappings that specify which features (properties) of the annotation should be indexed, and under which names.- Parameters:
aMappings
- an array of objects that each specify a mapping from a CAS feature name to the name under which this feature should be recorded in the index.
-