Class NT

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

public class NT extends GraphNode
Represents a non-terminal node in a syntax tree.

Non-terminal nodes (NT) represent syntactic units (categories) such as NP (Noun Phrase), VP (Verb Phrase), etc. They contain other nodes (daughters) which can be either terminals (T) or non-terminals (NT).

* @see GraphNode
Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
See Also:
  • Constructor Details

    • NT

      public NT()
      Creates an empty NT node.
    • NT

      public NT(Element ntElement, Sentence sent)
      Creates an NT node from a DOM element.
      Parameters:
      ntElement - the DOM element.
      sent - the parent sentence.
    • NT

      public NT(Element ntElement, Sentence sent, int verbosity)
      Creates an NT node from a DOM element with specified verbosity.
  • Method Details

    • isTerminal

      public boolean isTerminal()
      Specified by:
      isTerminal in class GraphNode
    • setCat

      public void setCat(String cat)
    • getCat

      public String getCat()
    • getSpan

      public String getSpan()
      Returns a compact MMAX-style span of all terminal IDs.
      Returns:
      the span string (e.g., "s1_1..s1_5").
    • addDaughter

      public void addDaughter(GraphNode daughter)
    • addSecDaughter

      public void addSecDaughter(GraphNode daughter)
    • getDaughters

      public List<GraphNode> getDaughters()
      Returns primary daughters sorted by linear precedence.
    • getSecDaughters

      public List<GraphNode> getSecDaughters()
    • getAllDaughters

      public List<GraphNode> getAllDaughters()
    • getTerminals

      public List<T> getTerminals()
      Recursively collects all terminal nodes in this subtree.
      Returns:
      list of terminal nodes sorted by precedence.
    • getText

      public String getText()
      Specified by:
      getText in class GraphNode
    • getDaughtersByLabel

      public List<GraphNode> getDaughtersByLabel(String label)
    • getAllDaughtersByLabel

      public List<GraphNode> getAllDaughtersByLabel(String label)
    • buildTreeString

      protected void buildTreeString(int depth, StringBuilder sb)
      Specified by:
      buildTreeString in class GraphNode
    • print2XML

      public void print2XML(FileWriter out) throws IOException
      Throws:
      IOException