public class PatternMentionDescriber extends Object implements AbstractSemanticAnnotationHelper.MentionDescriber
AbstractSemanticAnnotationHelper.MentionDescriber
that uses a user-given pattern to describe
annotation mentions.Modifier and Type | Field and Description |
---|---|
protected static Pattern |
FEATURE_FINDER
Regex used to find feature names in the pattern.
|
protected Set<String> |
featureNames
The set of feature names that actually occur in the pattern.
|
protected String |
pattern
The pattern used to generate mention descriptions.
|
Constructor and Description |
---|
PatternMentionDescriber()
Construct a new pattern-based mention describer.
|
PatternMentionDescriber(String pattern)
Construct a new pattern-based mention describer.
|
Modifier and Type | Method and Description |
---|---|
String |
describeMention(AbstractSemanticAnnotationHelper helper,
String mentionUri,
String[] descriptiveFeatureNames,
String[] descriptiveFeatureValues) |
String |
getPattern() |
void |
setPattern(String pattern)
Sets the pattern to be used when describing annotation mentions.
|
protected static final Pattern FEATURE_FINDER
protected String pattern
public PatternMentionDescriber()
setPattern(String)
.public PatternMentionDescriber(String pattern)
pattern
- the pattern used to generate mentions. To describe an
annotation mention, all occurrences of "${name}" in the pattern
are replaced with the values of the name
feature for the given
annotation.public String getPattern()
public void setPattern(String pattern)
pattern
- the pattern used to generate mentions. To describe an
annotation mention, all occurrences of "${name}" in the pattern
are replaced with the values of the name
feature for the given
annotation.public String describeMention(AbstractSemanticAnnotationHelper helper, String mentionUri, String[] descriptiveFeatureNames, String[] descriptiveFeatureValues)
describeMention
in interface AbstractSemanticAnnotationHelper.MentionDescriber
Copyright © 2021 GATE. All rights reserved.