Class Path

java.lang.Object
org.episteme.social.linguistics.loaders.tigerxml.Path

public class Path extends Object
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

    Fields
    Modifier and Type
    Field
    Description
    protected boolean
    True if the end node is hierarchically below the start node.
    protected boolean
    True 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 int
    The higher this value the more process and debug information will written to stderr.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the first GraphNode in this Path.
    Returns the last GraphNode in this Path.
    Returns the next GraphNode in this Path relative to the current position of this Path (iteration based method).
    static final Path
    This static method creates a path leading from the input node to the root node of the sentence.
    static final Path
    getPathToTop(GraphNode node, int verbosity)
    This static method creates a path leading from the input node to the root node of the sentence.
    Returns the previous GraphNode in this Path relative to the current position of this Path (iteration based method).
    int
    Gets the currently set level of verbosity of this instance.
    boolean
    Checks if there are more GraphNodes available on this path after the current cursor position of this instance.
    boolean
    Checks if there are more GraphNodes available on this path before the current cursor position of this instance.
    void
    Inverts this path by reversing the order of the nodes and re-setting their directions (UP --> DOWN; DOWN --> UP).
    static final Path
    makePath(GraphNode start_node, GraphNode end_node)
    This static method returns the shortest path that connects the two nodes.
    protected boolean
    Determines if the path stays within a single argument domain.
    void
    Removes the first step from the path.
    void
    Removes the last step from the path.
    void
    setVerbosity(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.
    Returns a string representation of this Path.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • steps

      protected ArrayList<org.episteme.social.linguistics.loaders.tigerxml.Path.Step> steps
      The sequence of steps in the path.
    • start_below_end

      protected boolean start_below_end
      True if the start node is hierarchically below the end node.
    • end_below_start

      protected boolean end_below_start
      True if the end node is hierarchically below the start node.
    • verbosity

      protected int verbosity
      The higher this value the more process and debug information will written to stderr.
  • Method Details

    • toString

      public String toString()
      Returns a string representation of this Path.
      Overrides:
      toString in class Object
      Returns:
      The string representation of this Path.
    • toGildeaStyleString

      public String 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

      public static final Path getPathToTop(GraphNode node)
      This static method creates a path leading from the input node to the root node of the sentence. Use this method or makePath(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

      public static final Path getPathToTop(GraphNode node, int verbosity)
      This static method creates a path leading from the input node to the root node of the sentence. Use this method or makePath(GraphNodestart_node,GraphNodeend_node) to instantiate this class.
      Parameters:
      node - The GraphNode to start the path from.
      verbosity - the level of verbosity
    • makePath

      public static final Path makePath(GraphNode start_node, GraphNode end_node)
      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

      public GraphNode 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

      public GraphNode 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

      public GraphNode getFirst()
      Returns the first GraphNode in this Path.
      Returns:
      The first GraphNode in this Path.
    • getLast

      public GraphNode 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.