Adds horizontal markovization to an already binarized tree with no markovization.
Adds horizontal markovization to an already binarized tree with no markovization.
The sibling history of a node is: If one of its children is an intermediate, then its history concatenated with its sibling (if it exists), markovizing. if neither is an intermediate, and it is an intermediate, then the right child. Otherwise it is empty
Adds parent-markovization to an already binarized tree.
Adds parent-markovization to an already binarized tree. Also handles the unary layering we do by ignoring identity unary transitions in the history
type of the tree
the tree
join: join two elements of the history into a single label. (child,parent)=>newChild
is this an intermediate symbol? Determines whether or not we should include the immediate parent of this label in the history
how much history to keep