Click here to get back home

write a new module for suffix trees?

 HomeNewsGroups | Search | About
 comp.lang.perl.modules    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
write a new module for suffix trees? Heiko Eißfeldt 04-03-2008
Posted by Heiko Eißfeldt on April 3, 2008, 5:12 pm
Please log in for more thread options
Hello,

for the purpose of detecting code copies in Perl sources,
I would like to use a suffix tree with a method to get
all longest repeated substrings (lrs).

I had a look at

1. Tree::Suffix, which looks good at first sight.
It is a wrapper around the c library libstree.
But libstree has a pretty buggy last version, and
the lib author does not respond to patches and email.
It has a lrs function, but it is buggy (incomplete).
I have patches for some of the bugs, but not all.

2. SuffixTree, which has no bugs, but lacks the lrs function.
The module does not allow for extensions.

3. Array::Suffix has not a generic enough interface for my
purpose and does not seem suitable.

So, I am thinking of writing my own.
What strategy would you suggest:

Making a pure Perl implementation?
Adapting a c library?

Thanks for any input,
Heiko (who only wants to write a new perlcritic policy)
(heiko!at!hexco!dot!de)

Posted by John Bokma on April 3, 2008, 6:20 pm
Please log in for more thread options

> Hello,
>
> for the purpose of detecting code copies in Perl sources,
> I would like to use a suffix tree with a method to get
> all longest repeated substrings (lrs).
>
> I had a look at
>
> 1. Tree::Suffix, which looks good at first sight.
> It is a wrapper around the c library libstree.
> But libstree has a pretty buggy last version, and
> the lib author does not respond to patches and email.
> It has a lrs function, but it is buggy (incomplete).
> I have patches for some of the bugs, but not all.

Can you fork this lib?

if so, would it be possible to make Tree::Suffix use your fork.

--
John

http://johnbokma.com/perl/

Posted by Heiko Eißfeldt on April 3, 2008, 6:30 pm
Please log in for more thread options

>> 1. Tree::Suffix, which looks good at first sight.
>> It is a wrapper around the c library libstree.
>> But libstree has a pretty buggy last version, and
>> the lib author does not respond to patches and email.
>> It has a lrs function, but it is buggy (incomplete).
>> I have patches for some of the bugs, but not all.
>
> Can you fork this lib?
>
> if so, would it be possible to make Tree::Suffix use your fork.

I guess, i could. But sometimes it is less work to
start over afresh than bending your mind in order to
understand the given lib...
It would really need a test suite first.

Ok, so you would prefer the c library implementation over a
pure Perl imp.

Thanks, heiko

Posted by unkempt on April 4, 2008, 12:18 pm
Please log in for more thread options
On Apr 3, 2:12=A0pm, "Heiko Ei=DFfeldt"
> 2. SuffixTree, which has no bugs, but lacks the lrs function.
> The module does not allow for extensions.

I suggest forking this one.

Posted by unkempt on April 4, 2008, 12:23 pm
Please log in for more thread options
Heiko Ei=DFfeldt wrote:
> 2. SuffixTree, which has no bugs, but lacks the lrs function.
> The module does not allow for extensions.

This sounds the most promising to me. Can you get the author to add
the function? Write a patchfile yourself and submit it?

Similar ThreadsPosted
Perl module for R-trees March 29, 2005, 9:02 pm
I don't want to write an HTML templating module August 30, 2007, 5:27 am
[RFC] Data::Endian (proposal for module to read/write big-endian floats/doubles) July 3, 2007, 5:26 pm
SerialPort write question October 28, 2004, 11:52 am
Tie::YAML doesn't write to tmp file first? December 23, 2007, 9:34 am
How to write into existing Excel Spreadsheets? July 13, 2004, 1:24 pm
Can I write Macros in excel workbook ? October 8, 2004, 7:50 am
write permissions installing XML-SAX-Expat-0.38 locally June 9, 2007, 10:44 am
SpreadSheet::Write Excel- Is there a way to set background color for entire worksheet? January 21, 2005, 12:56 pm
How to write Delphi 2005 XML-style project files (.bdsproj)? February 23, 2005, 10:48 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap