protected static class RelationTriple.WithTree extends RelationTriple
RelationTriple, but with the tree saved as well.RelationTriple.WithTree| Modifier and Type | Field and Description |
|---|---|
SemanticGraph |
sourceTree |
object, relation, subject| Constructor and Description |
|---|
WithTree(List<CoreLabel> subject,
List<CoreLabel> relation,
List<CoreLabel> object,
SemanticGraph tree)
Create a new triple with known values for the subject, relation, and object.
|
| Modifier and Type | Method and Description |
|---|---|
Optional<SemanticGraph> |
asDependencyTree()
An optional method, returning the dependency tree this triple was extracted from
|
asSentence, equals, hashCode, objectGloss, relationGloss, segment, subjectGloss, toStringpublic final SemanticGraph sourceTree
public WithTree(List<CoreLabel> subject, List<CoreLabel> relation, List<CoreLabel> object, SemanticGraph tree)
subject - The subject of this triple; e.g., "cats".relation - The relation of this triple; e.g., "play with".object - The object of this triple; e.g., "yarn".tree - The tree this extraction was created from; we create a deep copy of the tree.public Optional<SemanticGraph> asDependencyTree()
asDependencyTree in class RelationTriple