Package com.basistech.rosette.dm
Class Dependency
java.lang.Object
com.basistech.rosette.dm.BaseAttribute
com.basistech.rosette.dm.Dependency
- All Implemented Interfaces:
Serializable
An inter-token dependency from a parser.
Note that a token index of
Consider a ConLL file with dependency information:
Viewed as a list, the
-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 _ OEach 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:
relationship | governorTokenIndex | dependencyTokenIndex |
poss | 1 | 0 |
nsubj | 2 | 1 |
root | -1 | 2 |
dobj | 2 | 3 |
punct | 2 | 4 |
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:
-
Nested Class Summary
-
Field Summary
Fields inherited from class com.basistech.rosette.dm.BaseAttribute
extendedProperties
-
Constructor Summary
ModifierConstructorDescriptionprotected
Dependency
(String relationship, int governorTokenIndex, int dependencyTokenIndex, Map<String, Object> extendedProperties) -
Method Summary
Modifier and TypeMethodDescriptionint
int
protected com.google.common.base.MoreObjects.ToStringHelper
Methods inherited from class com.basistech.rosette.dm.BaseAttribute
getExtendedProperties, listOrNull, setExtendedProperty, toString
-
Constructor Details
-
Dependency
-
-
Method Details
-
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 classBaseAttribute
-