public class PatternLabelBuilder extends java.lang.Object implements GridLabelBuilder
Modifier and Type | Class and Description |
---|---|
static class |
PatternLabelBuilder.BoundaryElement |
static class |
PatternLabelBuilder.CharacterElement |
static class |
PatternLabelBuilder.CountElement |
static interface |
PatternLabelBuilder.Element |
static class |
PatternLabelBuilder.HeadPropertyElement |
static class |
PatternLabelBuilder.LengthElement |
static class |
PatternLabelBuilder.PropertyElement |
static class |
PatternLabelBuilder.SentencePropertyElement |
Modifier and Type | Field and Description |
---|---|
protected java.lang.StringBuilder |
buffer |
protected PatternLabelBuilder.Element[] |
elements |
static java.util.Map<java.lang.Object,java.lang.Object> |
magicCharacters |
protected java.lang.String |
pattern |
Constructor and Description |
---|
PatternLabelBuilder(java.lang.String pattern) |
Modifier and Type | Method and Description |
---|---|
protected PatternLabelBuilder.Element[] |
compile(java.lang.String pattern)
Default implementation magic characters:
|
java.lang.String |
getLabel(EntityGridNode node,
int spanIndex)
|
java.lang.String |
getPattern() |
void |
setPattern(java.lang.String pattern) |
protected java.lang.String pattern
protected PatternLabelBuilder.Element[] elements
protected java.lang.StringBuilder buffer
public static final java.util.Map<java.lang.Object,java.lang.Object> magicCharacters
public java.lang.String getPattern()
public void setPattern(java.lang.String pattern)
protected PatternLabelBuilder.Element[] compile(java.lang.String pattern)
Character | Description |
---|---|
\ | escaping character to allow for magic characters to be used without substitution |
b | begin index of the Span |
e | end index of the Span |
c | number of Span s within the given ones Cluster in this sentence |
r | range of the given Span , i.e. the number of tokens it spans across in the surrounding sentence |
l | length of the current Span in terms of characters (note that whitespace characters are included) |
%...% | value of the span property associated with the given key (%name% would cause the value for the 'name' property to be inserted) |
$...$ | value of the sentence property associated with the given key (%form% would cause the value for the 'form' property to be inserted) |
All characters not listed as magic characters remain untouched by the replacement engine.
public java.lang.String getLabel(EntityGridNode node, int spanIndex)
GridLabelBuilder
getLabel
in interface GridLabelBuilder
GridLabelBuilder.getLabel(de.ims.icarus.plugins.coref.view.grid.EntityGridNode, int)