public class ProtoGrammaticalRelation
extends java.lang.Object
implements java.io.Serializable
GrammaticalRelation
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected java.util.List<ProtoGrammaticalRelation> |
children |
protected java.lang.String |
longName |
protected ProtoGrammaticalRelation |
parent |
private static long |
serialVersionUID |
protected java.lang.String |
shortName |
protected java.util.regex.Pattern |
sourcePattern |
protected java.lang.String |
specific |
protected java.util.List<edu.stanford.nlp.trees.tregex.TregexPattern> |
targetPatterns |
Constructor and Description |
---|
ProtoGrammaticalRelation(java.lang.String shortName,
java.lang.String longName,
ProtoGrammaticalRelation parent,
java.lang.String sourcePattern,
java.lang.String[] targetPatterns,
java.lang.String specificString) |
Modifier and Type | Method and Description |
---|---|
protected void |
addChild(ProtoGrammaticalRelation child) |
static java.util.List<edu.stanford.nlp.trees.tregex.TregexPattern> |
compileTargetPatterns(java.lang.String[] patternStrings)
Compile list of strings into TregexPatterns
|
java.util.List<? extends ProtoGrammaticalRelation> |
getChildren()
Returns the children of this
GrammaticalRelation . |
java.lang.String |
getLongName() |
ProtoGrammaticalRelation |
getParent()
Returns the parent of this
GrammaticalRelation . |
java.util.Collection<edu.stanford.nlp.trees.Tree> |
getRelatedNodes(edu.stanford.nlp.trees.Tree tree,
edu.stanford.nlp.trees.Tree root)
Given a
Tree node tree , attempts to return a list of nodes to which node tree has this grammatical relation. |
java.lang.String |
getShortName() |
java.util.regex.Pattern |
getSourcePattern()
Returns the source patterns of this
GrammaticalRelation . |
java.lang.String |
getSpecific() |
java.util.List<edu.stanford.nlp.trees.tregex.TregexPattern> |
getTargetPatterns()
Returns the target patterns of this
GrammaticalRelation . |
boolean |
isAncestor(ProtoGrammaticalRelation gr0) |
boolean |
isApplicable(edu.stanford.nlp.trees.Tree tree)
Returns
true iff the value of Tree node tree matches the sourcePattern for this
GrammaticalRelation , indicating that this GrammaticalRelation is one that could hold between Tree node
tree and some other node. |
boolean |
isFromString()
This function is used to determine whether the GrammaticalRelation in question is one that was created to be a thin wrapper around a String
representation by valueOf(String), or whether it is a full-fledged GrammaticalRelation created by direct invocation of the constructor.
|
java.lang.String |
toString()
Returns short name (abbreviation) for this
GrammaticalRelation . |
private static final long serialVersionUID
protected java.lang.String shortName
protected java.lang.String longName
protected ProtoGrammaticalRelation parent
protected java.util.List<ProtoGrammaticalRelation> children
protected java.util.regex.Pattern sourcePattern
protected java.util.List<edu.stanford.nlp.trees.tregex.TregexPattern> targetPatterns
protected java.lang.String specific
public ProtoGrammaticalRelation(java.lang.String shortName, java.lang.String longName, ProtoGrammaticalRelation parent, java.lang.String sourcePattern, java.lang.String[] targetPatterns, java.lang.String specificString)
public boolean isFromString()
protected void addChild(ProtoGrammaticalRelation child)
public java.util.Collection<edu.stanford.nlp.trees.Tree> getRelatedNodes(edu.stanford.nlp.trees.Tree tree, edu.stanford.nlp.trees.Tree root)
Tree
node tree
, attempts to return a list of nodes to which node tree
has this grammatical relation.tree
- Target for finding governors of tree related by this GRroot
- The root of the Treepublic boolean isApplicable(edu.stanford.nlp.trees.Tree tree)
true
iff the value of Tree
node tree
matches the sourcePattern
for this
GrammaticalRelation
, indicating that this GrammaticalRelation
is one that could hold between Tree
node
tree
and some other node.tree
- treepublic boolean isAncestor(ProtoGrammaticalRelation gr0)
public final java.lang.String toString()
GrammaticalRelation
.toString
in class java.lang.Object
public java.lang.String getLongName()
public java.lang.String getShortName()
public java.lang.String getSpecific()
public ProtoGrammaticalRelation getParent()
GrammaticalRelation
.public java.util.List<? extends ProtoGrammaticalRelation> getChildren()
GrammaticalRelation
.public java.util.regex.Pattern getSourcePattern()
GrammaticalRelation
.public java.util.List<edu.stanford.nlp.trees.tregex.TregexPattern> getTargetPatterns()
GrammaticalRelation
.public static java.util.List<edu.stanford.nlp.trees.tregex.TregexPattern> compileTargetPatterns(java.lang.String[] patternStrings)
patternStrings
- array of pattern strings