public class PathFeatureHelper extends Object
Modifier and Type | Field and Description |
---|---|
static String |
PATH_DOWN_STRING
This string indicates a path going down a parse tree in the path string.
|
static String |
PATH_UP_STRING
This string indicates a path going up a parse tree in the path string.
|
Constructor and Description |
---|
PathFeatureHelper() |
Modifier and Type | Method and Description |
---|---|
static Constituent |
getCommonAncestor(Constituent start,
Constituent end,
int maxDepth)
Returns the common ancestor of the two constituent.
|
static String |
getDependencyPathString(Constituent startDependencyConstituent,
Constituent endDependencyCOnstituent,
int maxDepth)
Get the dependency path between two Constituents as a String.
|
static String |
getFullParsePathString(Constituent startParseConstituent,
Constituent endParseConstituent,
int maxDepth)
Get the path between Constituents belonging to a parse tree as a String.
|
static List<Constituent> |
getPathConstituents(Constituent start,
Constituent end,
int maxDepth) |
static Pair<List<Constituent>,List<Constituent>> |
getPathsToCommonAncestor(Constituent start,
Constituent end,
int maxDepth)
Get the paths from two constituents to their common ancestor.
|
static String |
getPathString(Constituent start,
Constituent end,
int maxDepth,
boolean includeConstituentLabel,
boolean includeRelationLabel)
Returns the path from start to end as a String.
|
static String |
getPathString(Pair<List<Constituent>,List<Constituent>> paths,
boolean includeConstituentLabel,
boolean includeRelationLabel) |
static List<Constituent> |
getPathToRoot(Constituent node,
int maxDepth)
Gets the path (that is, a sequence of constituents) from the given node to the root node.
|
public static final String PATH_UP_STRING
public static final String PATH_DOWN_STRING
public static List<Constituent> getPathToRoot(Constituent node, int maxDepth)
Assumptions:
Constituent
s, where the first element is the one that is given to
the function and the last element is the root.public static Pair<List<Constituent>,List<Constituent>> getPathsToCommonAncestor(Constituent start, Constituent end, int maxDepth)
Note: This function requires the two constituents to be from the same View
.
IllegalArgumentException
- If no common ancestor is found.getPathToRoot(Constituent,
int)
public static Constituent getCommonAncestor(Constituent start, Constituent end, int maxDepth)
It internally uses
getPathsToCommonAncestor(Constituent, Constituent, int)
. So, the restrictions related to that function apply here too.
public static String getPathString(Constituent start, Constituent end, int maxDepth, boolean includeConstituentLabel, boolean includeRelationLabel)
It internally uses
getPathsToCommonAncestor(Constituent, Constituent, int)
. So, the restrictions related to that function apply here too.
public static String getPathString(Pair<List<Constituent>,List<Constituent>> paths, boolean includeConstituentLabel, boolean includeRelationLabel)
public static List<Constituent> getPathConstituents(Constituent start, Constituent end, int maxDepth)
public static String getDependencyPathString(Constituent startDependencyConstituent, Constituent endDependencyCOnstituent, int maxDepth)
public static String getFullParsePathString(Constituent startParseConstituent, Constituent endParseConstituent, int maxDepth)
Copyright © 2017. All rights reserved.