Data::LetterTree - Native letter tree Perl binding
use Data::LetterTree; my $tree = Data::LetterTree->new(); $tree->add_data('foo', 'stuff'); $tree->add_data('bar', 'more'); $tree->add_data('bar', 'stuff'); foreach my $word (qw/foo bar baz/) { if ($tree->has_word($word)) { print "$word:" . $tree->get_data($word) . "\n"; } else { print "$word: not found\n"; }
This module provides perl binding over a native implementation of a letter tree, allowing to index any kind of perl scalar variable by a large set of string with a reduced memory footprint over native perl hashes by sharing their prefixes.
Creates and returns a new Data::LetterTree object.
Data::LetterTree
Add $word in the tree, pushing $data in indexed values.
Return a true value if $word is present in the tree.
Return all values indexed by $word as a list.
Guillaume Rousse, <Guillaume.Rousse@inria.fr>
Many thanks to Sebastien Aperghis-Tramoni and Rafaël Garcia-Suarez for helping me with in my first XS steps...
Copyright (C) 2005 INRIA
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.7 or, at your option, any later version of Perl 5 you may have available.
1 POD Error
The following errors were encountered while parsing the POD:
Non-ASCII character seen before =encoding in 'Rafaël'. Assuming CP1252
To install Data::LetterTree, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::LetterTree
CPAN shell
perl -MCPAN -e shell install Data::LetterTree
For more information on module installation, please visit the detailed CPAN module installation guide.