public class DependencyTreeTransformer
Transforms an English structure parse tree in order to get the dependencies right:
-- put a ROOT node
-- remove NONE nodes
-- retain only NP-TMP, NP-ADV, UCP-TMP tags
The UCP- tags will later be turned into NP- anyway
(Note [cdm]: A lot of this overlaps other existing functionality in trees.
Could aim to unify it.)
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.