Class Path
java.lang.Object
org.episteme.social.linguistics.loaders.tigerxml.Path
Represents a path leading through the syntax tree that connects two
nodes. To instantiate this class use
getPathToTop(GraphNodenode)
or makePath(GraphNodestart_node,GraphNodeend_node).- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanTrue if the end node is hierarchically below the start node.protected booleanTrue if the start node is hierarchically below the end node.protected ArrayList<org.episteme.social.linguistics.loaders.tigerxml.Path.Step> The sequence of steps in the path.protected intThe higher this value the more process and debug information will written to stderr. -
Method Summary
Modifier and TypeMethodDescriptiongetFirst()Returns the first GraphNode in this Path.getLast()Returns the last GraphNode in this Path.getNext()Returns the next GraphNode in this Path relative to the current position of this Path (iteration based method).static final PathgetPathToTop(GraphNode node) This static method creates a path leading from the input node to the root node of the sentence.static final PathgetPathToTop(GraphNode node, int verbosity) This static method creates a path leading from the input node to the root node of the sentence.getPrev()Returns the previous GraphNode in this Path relative to the current position of this Path (iteration based method).intGets the currently set level of verbosity of this instance.booleanhasNext()Checks if there are more GraphNodes available on this path after the current cursor position of this instance.booleanhasPrev()Checks if there are more GraphNodes available on this path before the current cursor position of this instance.voidinvert()Inverts this path by reversing the order of the nodes and re-setting their directions (UP --> DOWN; DOWN --> UP).static final PathThis static method returns the shortest path that connects the two nodes.protected booleanDetermines if the path stays within a single argument domain.voidRemoves the first step from the path.voidRemoves the last step from the path.voidsetVerbosity(int verbosity) Sets the currently set level of verbosity of this instance.Returns a string representation of this Path similar to that used by Daniel Gildea.toString()Returns a string representation of this Path.
-
Field Details
-
steps
The sequence of steps in the path. -
start_below_end
protected boolean start_below_endTrue if the start node is hierarchically below the end node. -
end_below_start
protected boolean end_below_startTrue if the end node is hierarchically below the start node. -
verbosity
protected int verbosityThe higher this value the more process and debug information will written to stderr.
-
-
Method Details
-
toString
-
toGildeaStyleString
Returns a string representation of this Path similar to that used by Daniel Gildea.- Returns:
- A string representation of this Path similar to that used by Daniel Gildea.
-
oneArgumentDomain
protected boolean oneArgumentDomain()Determines if the path stays within a single argument domain.- Returns:
- true if it's a single argument domain
-
getPathToTop
This static method creates a path leading from the input node to the root node of the sentence. Use this method ormakePath(GraphNodestart_node,GraphNodeend_node)to instantiate this class.- Parameters:
node- The GraphNode to start the path from.- Returns:
- A Path instance representing a path from node to the root node.
-
getPathToTop
This static method creates a path leading from the input node to the root node of the sentence. Use this method ormakePath(GraphNodestart_node,GraphNodeend_node)to instantiate this class.- Parameters:
node- The GraphNode to start the path from.verbosity- the level of verbosity
-
makePath
This static method returns the shortest path that connects the two nodes.- Parameters:
start_node- The first GraphNode to connect.end_node- The second GraphNode to connect.- Returns:
- A Path instance representing the shortest path between start_node and end_node
-
invert
public void invert()Inverts this path by reversing the order of the nodes and re-setting their directions (UP --> DOWN; DOWN --> UP). -
getPrev
Returns the previous GraphNode in this Path relative to the current position of this Path (iteration based method).- Returns:
- The previous GraphNode in this Path.
-
hasPrev
public boolean hasPrev()Checks if there are more GraphNodes available on this path before the current cursor position of this instance.- Returns:
- True iff there are more nodes on this path left to the cursor.
-
getNext
Returns the next GraphNode in this Path relative to the current position of this Path (iteration based method).- Returns:
- The next GraphNode in this Path.
-
hasNext
public boolean hasNext()Checks if there are more GraphNodes available on this path after the current cursor position of this instance.- Returns:
- True iff there are more nodes on this path right to the cursor.
-
getFirst
Returns the first GraphNode in this Path.- Returns:
- The first GraphNode in this Path.
-
getLast
Returns the last GraphNode in this Path.- Returns:
- The last GraphNode in this Path.
-
removeFirst
public void removeFirst()Removes the first step from the path. -
removeLast
public void removeLast()Removes the last step from the path. -
getVerbosity
public int getVerbosity()Gets the currently set level of verbosity of this instance. The higher the value the more information is written to stderr.- Returns:
- The level of verbosity.
-
setVerbosity
public void setVerbosity(int verbosity) Sets the currently set level of verbosity of this instance. The higher the value the more information is written to stderr.- Parameters:
verbosity- The level of verbosity.
-