|
NAMETree::Suffix - Perl interface to the libstree library. SYNOPSIS use Tree::Suffix;
$tree = Tree::Suffix->new;
$tree = Tree::Suffix->new(@strings);
$bool = $tree->allow_duplicates($bool);
$count = $tree->insert(@strings);
$count = $tree->remove(@strings);
$count = $tree->find($string);
$count = $tree->match($string);
$count = $tree->search($string);
@pos = $tree->find($string);
@pos = $tree->match($string);
@pos = $tree->search($string);
$string = $tree->string($id);
$string = $tree->string($id, $start ,$end);
@lcs = $tree->lcs;
@lcs = $tree->lcs($min_len, $max_len);
@lcs = $tree->longest_common_substrings;
@lrs = $tree->lrs;
@lrs = $tree->lrs($min_len, $max_len);
@lrs = $tree->longest_repeated_substrings;
$count = $tree->strings;
@pos = $tree->strings;
$count = $tree->nodes;
$tree->clear;
$tree->dump;
DESCRIPTIONThe "Tree::Suffix" module provides an interface to the C library libstree, which implements generic suffix trees. NOTICE: as libstree has outstanding bugs and has long been abandoned, this distribution is not being maintained. METHODS
EXAMPLETo find the longest palindrome of a string: use Tree::Suffix;
$str = 'mississippi';
$tree = Tree::Suffix->new($str, scalar reverse $str);
($pal) = $tree->lcs;
print "Longest palindrome: $pal\n";
This would print: Longest palindrome: ississi SEE ALSOlibstree <http://www.icir.org/christian/libstree/> SuffixTree <http://en.wikipedia.org/wiki/Suffix_tree> NOTESA memory leak will be exhibited if you are using a version of libstree < .4.2. REQUESTS AND BUGSWhen reporting a bug, first verify that you can successfully run the tests in the libstree distribution. Please report any bugs or feature requests to <http://rt.cpan.org/Public/Bug/Report.html?Queue=Tree-Suffix>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. SUPPORTYou can find documentation for this module with the perldoc command. perldoc Tree::Suffix You can also look for information at:
COPYRIGHT AND LICENSECopyright (C) 2006-2009 gray <gray at cpan.org>, all rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. AUTHORgray, <gray at cpan.org>
|