Subject: | Some Documentation/implementation issues on tree->string method and tree->find |
Hi Gray,
This two methods are really useful.
Just few things.
1. I'm just wondering why the find method
returns Array of Array, while I thought
it would be much straightforward as simple array.
Since the content is always 3 elements right?
2. In your documentation you said that:
$tree->string(string_index)
$tree->string(string_index, start)
$tree->string(string_index, start, end)
Returns the string at index_id. The start and end positions may be
specified to return a substring.
Actually the method returns the "reference" of the string.
Please see my code below. Was that your initial intention?
If so, wouldn't it be better if you return simple string
instead?
I'm using:
Tree::Suffix version 0.12
perl, v5.8.5 built for i386-linux-thread-multi
Linux localhost 2.6.8.1-12mdk #1 Fri Oct 1 12:53:41 CEST 2004 i686
Intel(R) Pentium(R) 4 CPU 2.80GHz unknown GNU/Linux
__BEGIN__
use strict;
use Data::Dumper;
use Carp;
use Tree::Suffix;
my @strings = qw ( TTTTGGGGGGGGGGGGGGGGG
ATCGGGGGACCGTTCTCTCCCC );
my $tree = Tree::Suffix->new(@strings);
my $string = 'TTTT';
my @lcs = $tree->lcs;
my @bool2 = $tree->find($string);
print "BOOL\n";
print Dumper @bool2 ;
print "Index: $bool2[0]->[0] \n";
print Dumper $tree->string(0,0,3);
my @indices = $tree->strings;
print Dumper \@indices ;
__END__
Regards,
Edward WIJAYA