Class Dependency

java.lang.Object
com.basistech.rosette.dm.BaseAttribute
com.basistech.rosette.dm.Dependency
All Implemented Interfaces:
Serializable

public class Dependency extends BaseAttribute implements Serializable
An inter-token dependency from a parser. Note that a token index of -1 means 'ROOT'.
Consider a ConLL file with dependency information:
 1    My      my      PRP$  _   2   poss    _   O
 2    dog     dog     NN    _   3   nsubj   _   O
 3    has     have    VBZ   _   0   root    _   O
 4    fleas   flea    NNS   _   3   dobj    _   O
 5    .       .       .     _   3   punct   _   O
 
Each token has two columns related to dependencies: the 'governor' and the 'label'. In the ADM, this would turn into a list of Dependency objects as follows:
An example list of Dependencies
relationship governorTokenIndex dependencyTokenIndex
poss 1 0
nsubj 2 1
root -1 2
dobj 2 3
punct 2 4
Viewed as a list, the dependencyTokenIndex is redundant, but it is useful to pass a single dependency around in isolation as a complete representation of a dependency arc.
See Also:
  • Constructor Details

    • Dependency

      protected Dependency(String relationship, int governorTokenIndex, int dependencyTokenIndex, Map<String,Object> extendedProperties)
  • Method Details

    • getRelationship

      public String getRelationship()
      Returns:
      the relationship label.
    • getGovernorTokenIndex

      public int getGovernorTokenIndex()
      Returns:
      the index of the governing token.
    • getDependencyTokenIndex

      public int getDependencyTokenIndex()
      Returns:
      the index of the dependency token.
    • toStringHelper

      protected com.google.common.base.MoreObjects.ToStringHelper toStringHelper()
      Overrides:
      toStringHelper in class BaseAttribute