Please advise on Haskell libraries to compare trees in textual representation.<br>I need to compare both structure and node contents of two trees, find similar sub-trees, and need some metric to measure distance between two trees.<br>
Also need advice on simple parser to convert textual tree representation into a data type convenient for tree manipulation (comparison, matching, etc.) What data type to use for trees with arbitrary structure?<br><br>Example trees:<br>
<br>*** Tree 1:<br>(ROOT<br> (S<br> (NP (DT The) (NN voice) (NN quality))<br> (VP (VBD was)<br> (ADJP (JJ clear) (RB too)))<br> (. .)))<br><br><br>*** Tree 2: <br clear="all">(ROOT<br> (S<br> (SBAR (IN Although)<br>
(S<br> (NP (DT the) (NN battery) (NN life))<br> (VP (VBD was) (RB not)<br> (ADJP (JJ long)))))<br>
(, ,)<br> (NP (DT that))<br> (VP (VBZ is)<br> (VP (VBN ok)<br> (PP (IN for)<br> (NP (PRP me)))))<br> (. .)))<br><br>Thanks!<br>Dmitri<br><br>