NAME

Data::LetterTree - Native letter tree Perl binding

SYNOPSIS

    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";
    }

DESCRIPTION

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.

METHODS

new()

Creates and returns a new Data::LetterTree object.

$tree->add_data($word, $data)

Add $word in the tree, pushing $data in indexed values.

$tree->has_word($word)

Return a true value if $word is present in the tree.

$tree->get_data($word)

Return all values indexed by $word as a list.

AUTHOR

Guillaume Rousse, <Guillaume.Rousse@inria.fr>

ACKNOWLEDGEMENTS

Many thanks to Sebastien Aperghis-Tramoni and Rafaël Garcia-Suarez for helping me with in my first XS steps...

COPYRIGHT AND LICENSE

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:

Around line 68:

Non-ASCII character seen before =encoding in 'Rafaël'. Assuming ISO8859-1