|
|
|
Make a copy of the original tree and collapse the subtrees with only one child
|
|
Convert the tree to Chomsky Normal Form i.e. each subtree has either two subtree children or a single leaf value. This conversion can be performed using either left- or right-factoring.
|
|
Employ some Markov smoothing to make the artificial node labels a bit more readable. See the treetransforms.py documentation for more details.
|
Convert the transformed tree back to its original form
|