Class GraphNode

java.lang.Object
org.episteme.social.linguistics.loaders.tigerxml.GraphNode
All Implemented Interfaces:
Serializable, Identified<Identification>
Direct Known Subclasses:
NT, T

public abstract class GraphNode extends Object implements Identified<Identification>, Serializable
Represents a node in the syntax tree, either a terminal node or a non-terminal node.
Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
See Also:
  • Field Details

    • verbosity

      protected int verbosity
  • Constructor Details

    • GraphNode

      protected GraphNode()
    • GraphNode

      protected GraphNode(String id, Sentence sentence, NT mother, String edge2mother, int index)
  • Method Details

    • isTerminal

      public abstract boolean isTerminal()
    • getId

      public Identification getId()
      Description copied from interface: Identified
      Returns the unique identifier of this entity.
      Specified by:
      getId in interface Identified<Identification>
      Returns:
      the identifier
    • setId

      public void setId(String id)
    • setId

      public void setId(Identification id)
    • getSentence

      public Sentence getSentence()
    • setSentence

      public void setSentence(Sentence sentence)
    • getCorpus

      public Corpus getCorpus()
    • getMother

      public NT getMother()
    • setMother

      public void setMother(NT mother)
    • getEdge2Mother

      public String getEdge2Mother()
    • setEdge2Mother

      public void setEdge2Mother(String edge2mother)
    • setSecMother

      public void setSecMother(NT mother, String label)
    • hasSecMothers

      public boolean hasSecMothers()
    • getSecMothers

      public List<NT> getSecMothers()
    • getEdge2SecMother

      public String getEdge2SecMother(NT sMother)
    • getIndex

      public int getIndex()
    • setIndex

      public void setIndex(int index)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • hasMother

      public boolean hasMother()
    • getText

      public abstract String getText()
    • getDescendantsByLabel

      public List<GraphNode> getDescendantsByLabel(String label)
      Returns all descendants (recursive) that have the given edge label to their mother.
      Parameters:
      label - the search label
      Returns:
      list of matching graph nodes
    • before

      public boolean before(GraphNode other)
      Checks if this node occurs before another node in the sentence.
    • after

      public boolean after(GraphNode other)
      Checks if this node occurs after another node in the sentence.
    • isDominatedBy

      public boolean isDominatedBy(String cat)
    • getDominatingNodeByCat

      public NT getDominatingNodeByCat(String cat)
    • getPath

      public Path getPath(GraphNode toNode)
    • isDominatedBy

      public boolean isDominatedBy(GraphNode node)
    • dominates

      public boolean dominates(GraphNode node)
    • toTreeString

      public String toTreeString()
    • buildTreeString

      protected abstract void buildTreeString(int depth, StringBuilder sb)
    • getVerbosity

      public int getVerbosity()
    • setVerbosity

      public void setVerbosity(int verbosity)
    • getLeftmostTerminal

      public T getLeftmostTerminal()