Class Debinarizer

  • All Implemented Interfaces:
    TreeTransformer, Function<Tree,​Tree>

    public class Debinarizer
    extends Object
    implements TreeTransformer
    Debinarizes a binary tree from the parser. Node values with a '@' in them anywhere are assumed to be inserted nodes for the purpose of binarization, and are removed. The code also removes the last child of the root node, assuming that it is an inserted dependency root.
    • Constructor Detail

      • Debinarizer

        public Debinarizer​(boolean forceCNF)
      • Debinarizer

        public Debinarizer​(boolean forceCNF,
                           LabelFactory lf)
    • Method Detail

      • transformTreeHelper

        protected Tree transformTreeHelper​(Tree t)
      • transformTree

        public Tree transformTree​(Tree t)
        Description copied from interface: TreeTransformer
        Does whatever one needs to do to a particular tree. This routine is passed a whole Tree, and could itself work recursively, but the canonical usage is to invoke this method via the Tree.transform() method, which will apply the transformer in a bottom-up manner to each local Tree, and hence the implementation of TreeTransformer should merely examine and change a local (one-level) Tree.
        Specified by:
        transformTree in interface TreeTransformer
        Parameters:
        t - A tree. Classes implementing this interface can assume that the tree passed in is not null.
        Returns:
        The transformed Tree