Search::Mousse::Writer - Writer for Search::Mousse databases
my $mousse = Search::Mousse::Writer->new( directory => $directory, name => 'recipes', ); $mousse->add("Borscht", $recipe, "borscht beet soup russian"); $mousse->write;
Search::Mousse::Writer creates a Search::Mousse database.
Use Search::Mousse to query a database.
The default stemmer is:
sub { my $words = lc shift; return uniq(split / /, $words); }
The constructor takes a few arguments: the directory to store files in, and a name for the database. If you have a custom stemmer, also pass it in:
my $mousse = Search::Mousse::Writer->new( directory => $directory, name => 'recipes', ); my $mousse2 = Search::Mousse::Writer->new( directory => $directory, name => 'photos', stemmer => \&stemmer, );
Adds a document to the database. A document has a key, a value (which can be a Perl data structure or an object) and some keywords:
$mousse->add("Borscht", $recipe, "borscht beet soup russian");
After adding all the documents, you must call the write() method:
$mousse->write;
Search::Mousse::Writer
Leon Brocard, <acme@astray.com>
<acme@astray.com>
Copyright (C) 2005, Leon Brocard
This module is free software; you can redistribute it or modify it under the same terms as Perl itself.
To install Search::Mousse, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Search::Mousse
CPAN shell
perl -MCPAN -e shell install Search::Mousse
For more information on module installation, please visit the detailed CPAN module installation guide.