Class Arborist

  • Direct Known Subclasses:
    Lumberjack, TreeSurgeon

    public abstract class Arborist
    extends java.lang.Object
    One who might be employed to extract trees from a forest.
    • Method Detail

      • getTree

        public abstract void getTree​(TreeBuilder builder)
        Get the next tree.
        Parameters:
        builder - the builder.
      • isAmbiguous

        public abstract boolean isAmbiguous()
        Is the parse ambiguous?
        Returns:
        true if it is.
      • isAbsolutelyAmbiguous

        public abstract boolean isAbsolutelyAmbiguous()
        Is the underlying forest infinitely ambiguous?
        Returns:
        true if it is.
      • hasMoreTrees

        public abstract boolean hasMoreTrees()
        Are there more trees?
        Returns:
        true if there are.
      • reset

        public abstract void reset()
        Reset the arborist.
      • getArborist

        public static Arborist getArborist​(ParseForest forest)
        Get an arborist for the forest.

        By default, the arborist uses a SequentialAxe.

        Parameters:
        forest - The forest
        Returns:
        the arborist
      • getArborist

        public static Arborist getArborist​(ParseForest forest,
                                           Axe axe)
        Get an arborist for the forest.
        Parameters:
        forest - The forest
        axe - The axe to use
        Returns:
        the arborist
      • isInfinitelyAmbiguous

        public boolean isInfinitelyAmbiguous()
        Is the underlying forest infinitely ambiguous?
        Returns:
        true if it is
      • getSelectedNodes

        public java.util.Set<java.lang.Integer> getSelectedNodes()
        Return the selected nodes.
        Returns:
        The nodes
      • getSelectedTrees

        public java.util.List<TreeSelection> getSelectedTrees()
        Return the selected trees.
        Returns:
        The trees.