Algorithm for Building the Tree
For each processed word in the paragraph, each sense is taken in order and
added to the tree. A configurable discount factor is applied to each weight in
sequence. Using "1" will of course stop this behavior.
Each sense has the HYPERNYM relationship followed to the top, and that's stored
in a list. The list is used to build the tree from the root down to the sense,
and weight is added to each node according to some configurable scheme.
(Constant, linear, and exponential are currently implemented.) This is done for
each sense of each word.
Once done, each sense node has some number associated with it, the "weight".
When it comes time to join the tree, the union of each tree is taken
(discarding nodes that only appear in one but not the other), and a
configurable function is applied to each matching node pair to determine the
weight of the node in the union tree.
I rewrote the code so this is much cleaner now, notably the union code which is
no longer recursive.