[Haskell-cafe] Libraries to compare trees?

Ivan Lazar Miljenovic ivan.miljenovic at gmail.com
Fri Oct 28 00:31:25 CEST 2011


Well, for arbitrary directed graphs, FGL is probably your best bet, or
roll-your-own.

_But_ you'll need to write the parser yourself using something like
trifecta, uu-parsinglib, polyparse, parsec, etc.

It would help if you described the structure of these graphs and what
kind of support you'd want in a data structure.

On 28 October 2011 00:27, dokondr <dokondr at gmail.com> wrote:
> My mistake: need advice on libraries and data types not for trees but for
> directed graphs.
>
> On Thu, Oct 27, 2011 at 4:49 PM, dokondr <dokondr at gmail.com> wrote:
>>
>> Please advise on Haskell libraries to compare trees in textual
>> representation.
>> 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.
>> 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?
>>
>> Example trees:
>>
>> *** Tree 1:
>> (ROOT
>>   (S
>>     (NP (DT The) (NN voice) (NN quality))
>>     (VP (VBD was)
>>       (ADJP (JJ clear) (RB too)))
>>     (. .)))
>>
>>
>> *** Tree 2:
>> (ROOT
>>   (S
>>     (SBAR (IN Although)
>>       (S
>>         (NP (DT the) (NN battery) (NN life))
>>         (VP (VBD was) (RB not)
>>           (ADJP (JJ long)))))
>>     (, ,)
>>     (NP (DT that))
>>     (VP (VBZ is)
>>       (VP (VBN ok)
>>         (PP (IN for)
>>           (NP (PRP me)))))
>>     (. .)))
>>
>> Thanks!
>> Dmitri
>>
>
>
>
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>



-- 
Ivan Lazar Miljenovic
Ivan.Miljenovic at gmail.com
IvanMiljenovic.wordpress.com



More information about the Haskell-Cafe mailing list