GrammarScope  4.0.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Private Attributes | List of all members
grammarscope.mutable.ProtoGrammaticalRelation Class Reference
Inheritance diagram for grammarscope.mutable.ProtoGrammaticalRelation:
Inheritance graph
[legend]
Collaboration diagram for grammarscope.mutable.ProtoGrammaticalRelation:
Collaboration graph
[legend]

Public Member Functions

boolean isFromString ()
 
 ProtoGrammaticalRelation (final String shortName, final String longName, final ProtoGrammaticalRelation parent, final String sourcePattern, final String[] targetPatterns, final String specificString)
 
Collection< Tree > getRelatedNodes (final Tree tree, final Tree root)
 
boolean isApplicable (final Tree tree)
 
boolean isAncestor (final ProtoGrammaticalRelation gr0)
 
final String toString ()
 
String getLongName ()
 
String getShortName ()
 
String getSpecific ()
 
ProtoGrammaticalRelation getParent ()
 
List<? extends ProtoGrammaticalRelationgetChildren ()
 
Pattern getSourcePattern ()
 
List< TregexPattern > getTargetPatterns ()
 

Static Public Member Functions

static List< TregexPattern > compileTargetPatterns (final String[] patternStrings)
 

Protected Member Functions

void addChild (final ProtoGrammaticalRelation child)
 

Protected Attributes

String shortName
 
String longName
 
ProtoGrammaticalRelation parent
 
List< ProtoGrammaticalRelationchildren = new ArrayList<>()
 
Pattern sourcePattern
 
List< TregexPattern > targetPatterns = new ArrayList<>()
 
String specific
 

Static Private Attributes

static final long serialVersionUID = 1L
 

Detailed Description

ProtoGrammaticalRelation is used to define a standardized, hierarchical set of grammatical relations, together with patterns for identifying them in parse trees.

Author
Bill MacCartney
Galen Andrew (refactoring English-specific stuff)
Ilya Sherman (refactoring annotation-relation pairing)
Bernard Bou (this class factored out of GrammaticalRelation)
See also
GrammaticalRelation

Constructor & Destructor Documentation

◆ ProtoGrammaticalRelation()

grammarscope.mutable.ProtoGrammaticalRelation.ProtoGrammaticalRelation ( final String  shortName,
final String  longName,
final ProtoGrammaticalRelation  parent,
final String  sourcePattern,
final String[]  targetPatterns,
final String  specificString 
)

Member Function Documentation

◆ addChild()

void grammarscope.mutable.ProtoGrammaticalRelation.addChild ( final ProtoGrammaticalRelation  child)
protected

◆ compileTargetPatterns()

static List<TregexPattern> grammarscope.mutable.ProtoGrammaticalRelation.compileTargetPatterns ( final String[]  patternStrings)
static

Compile list of strings into TregexPatterns

Parameters
patternStringsarray of pattern strings
Returns
list of TregexPattern

◆ getChildren()

List<? extends ProtoGrammaticalRelation> grammarscope.mutable.ProtoGrammaticalRelation.getChildren ( )

Returns the children of this GrammaticalRelation.

Returns
children

◆ getLongName()

String grammarscope.mutable.ProtoGrammaticalRelation.getLongName ( )

◆ getParent()

ProtoGrammaticalRelation grammarscope.mutable.ProtoGrammaticalRelation.getParent ( )

Returns the parent of this GrammaticalRelation.

Returns
parent

Reimplemented in grammarscope.mutable.MutableGrammaticalRelation.

◆ getRelatedNodes()

Collection<Tree> grammarscope.mutable.ProtoGrammaticalRelation.getRelatedNodes ( final Tree  tree,
final Tree  root 
)

Given a Tree node tree, attempts to return a list of nodes to which node tree has this grammatical relation.

Parameters
treeTarget for finding governors of tree related by this GR
rootThe root of the Tree
Returns
Governor nodes to which tree bears this GR

◆ getShortName()

String grammarscope.mutable.ProtoGrammaticalRelation.getShortName ( )

◆ getSourcePattern()

Pattern grammarscope.mutable.ProtoGrammaticalRelation.getSourcePattern ( )

Returns the source patterns of this GrammaticalRelation.

Returns
source pattern

◆ getSpecific()

String grammarscope.mutable.ProtoGrammaticalRelation.getSpecific ( )

◆ getTargetPatterns()

List<TregexPattern> grammarscope.mutable.ProtoGrammaticalRelation.getTargetPatterns ( )

Returns the target patterns of this GrammaticalRelation.

Returns
target patterns

◆ isAncestor()

boolean grammarscope.mutable.ProtoGrammaticalRelation.isAncestor ( final ProtoGrammaticalRelation  gr0)

◆ isApplicable()

boolean grammarscope.mutable.ProtoGrammaticalRelation.isApplicable ( final 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.

Parameters
treetree
Returns
true if applicable

◆ isFromString()

boolean grammarscope.mutable.ProtoGrammaticalRelation.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.

Returns
Whether this relation is just a wrapper created by valueOf(String)

◆ toString()

final String grammarscope.mutable.ProtoGrammaticalRelation.toString ( )

Returns short name (abbreviation) for this GrammaticalRelation.

Member Data Documentation

◆ children

List<ProtoGrammaticalRelation> grammarscope.mutable.ProtoGrammaticalRelation.children = new ArrayList<>()
protected

◆ longName

String grammarscope.mutable.ProtoGrammaticalRelation.longName
protected

◆ parent

ProtoGrammaticalRelation grammarscope.mutable.ProtoGrammaticalRelation.parent
protected

◆ serialVersionUID

final long grammarscope.mutable.ProtoGrammaticalRelation.serialVersionUID = 1L
staticprivate

◆ shortName

String grammarscope.mutable.ProtoGrammaticalRelation.shortName
protected

◆ sourcePattern

Pattern grammarscope.mutable.ProtoGrammaticalRelation.sourcePattern
protected

◆ specific

String grammarscope.mutable.ProtoGrammaticalRelation.specific
protected

◆ targetPatterns

List<TregexPattern> grammarscope.mutable.ProtoGrammaticalRelation.targetPatterns = new ArrayList<>()
protected

The documentation for this class was generated from the following file: