public class AddDep extends SsurgeonEdit
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
LABEL |
Constructor and Description |
---|
AddDep(java.lang.String govNodeName,
GrammaticalRelation relation,
java.util.Map<java.lang.String,java.lang.String> attributes,
java.lang.String position) |
AddDep(java.lang.String govNodeName,
GrammaticalRelation relation,
java.util.Map<java.lang.String,java.lang.String> attributes,
java.lang.String position,
double weight) |
Modifier and Type | Method and Description |
---|---|
static void |
checkIllegalAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)
Certain attributes cannot be edited, especially docid, sentid, idx,
or they mess up the hashmaps in the SemanticGraph
|
boolean |
evaluate(SemanticGraph sg,
SemgrexMatcher sm)
TODO: bombproof if this gov, dep, and reln already exist.
|
static CoreLabel |
fromCheapStrings(java.util.Map<java.lang.String,java.lang.String> attributes)
Given the keys and values of the CoreAnnotation attributes,
build a CoreLabel to use as the new word
|
static void |
moveNode(SemanticGraph sg,
SemgrexMatcher sm,
IndexedWord word,
int newIndex) |
static void |
moveNodes(SemanticGraph sg,
SemgrexMatcher sm,
java.util.function.Function<java.lang.Integer,java.lang.Boolean> shouldMove,
java.util.function.Function<java.lang.Integer,java.lang.Integer> destination,
boolean reverse)
reverse: operate in reverse order, highest index to first.
|
java.lang.String |
toEditString()
Emits a parseable instruction string.
|
addNamedNode, equals, getNamedNode, getOwningPattern, setOwningPattern, toString
public static final java.lang.String LABEL
public AddDep(java.lang.String govNodeName, GrammaticalRelation relation, java.util.Map<java.lang.String,java.lang.String> attributes, java.lang.String position)
public AddDep(java.lang.String govNodeName, GrammaticalRelation relation, java.util.Map<java.lang.String,java.lang.String> attributes, java.lang.String position, double weight)
public java.lang.String toEditString()
toEditString
in class SsurgeonEdit
public static void moveNode(SemanticGraph sg, SemgrexMatcher sm, IndexedWord word, int newIndex)
public static void moveNodes(SemanticGraph sg, SemgrexMatcher sm, java.util.function.Function<java.lang.Integer,java.lang.Boolean> shouldMove, java.util.function.Function<java.lang.Integer,java.lang.Integer> destination, boolean reverse)
public boolean evaluate(SemanticGraph sg, SemgrexMatcher sm)
evaluate
in class SsurgeonEdit
public static void checkIllegalAttributes(java.util.Map<java.lang.String,java.lang.String> attributes)
public static CoreLabel fromCheapStrings(java.util.Map<java.lang.String,java.lang.String> attributes)