Class MorBuilder

java.lang.Object
ca.phon.phontalk.parser.MorBuilder

public class MorBuilder extends Object
Utility class for building morphology trees given strings coded for the CHAT/Phon %mor/Morphology tiers. This class will build an antlr3 CommonTree which can be used with the chat tree walkers.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.antlr.runtime.tree.CommonTree
    attachGrasp(org.antlr.runtime.tree.CommonTree morTree, org.antlr.runtime.tree.CommonTree graspTree)
    Attach the given GRASP tree to the given MOR tree.
    org.antlr.runtime.tree.CommonTree
    Build a GRASP (%gra) tree to attach to mor.
    org.antlr.runtime.tree.CommonTree
    Build a common tree for the given mor string.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MorBuilder

      public MorBuilder()
  • Method Details

    • attachGrasp

      public org.antlr.runtime.tree.CommonTree attachGrasp(org.antlr.runtime.tree.CommonTree morTree, org.antlr.runtime.tree.CommonTree graspTree)
      Attach the given GRASP tree to the given MOR tree.
      Parameters:
      morTree -
      graspTree -
      Returns:
      the reference to the provided morTree
    • buildGraspTree

      public org.antlr.runtime.tree.CommonTree buildGraspTree(String gra) throws IllegalArgumentException
      Build a GRASP (%gra) tree to attach to mor.
      Parameters:
      gra - , must be a string of 4 values separated by pipes (i.e., 1|2|3|4)
      Returns:
      the grasp tree
      Throws:
      IllegalArgumentException
    • buildMorTree

      public org.antlr.runtime.tree.CommonTree buildMorTree(String mor) throws IllegalArgumentException
      Build a common tree for the given mor string.
      Parameters:
      mor -
      Returns:
      the generated CommonTree
      Throws:
      PhonTalkMessage - if the string cannot be parsed
      IllegalArgumentException