Data::SearchEngine::Results::Spellcheck - spellcheck role for Spellchecking
version 0.33
package Data::SeachEngine::Foo; use Moose; with 'Data::SearchEngine::Results::Spellcheck'; sub search { # do stuff my $results = Data::SearchEngine::Results->new; $results->set_spell_suggestion('popuar', Data::SearchEngine::Results::Spellcheck::Suggestion->new( word => 'popular', # the suggested replacement frequency => 12 # optional, how often it occurs in the index ) ); }
Provides storage and methods for retrieving spellcheck information.
Intended to hold the 'suggested' spelling result from spellchecking. A search for "basebll bat" would likely have a collation of "baseball bat". It is so named as it contains a collation of the best results for the various tokens.
Hash containing the original token in as the key and the frequency it occurs in the index as the value. This may not be used by all backends.
HashRef of spellcheck suggestions for this query. The HashRef is keyed by the word for which spellcheck suggestions are being provided and the values are the suggestions.
Boolean value to signal to the front end if the query was spelled correctly.
Gets the frequency for the specified word.
Sets the frequency for the provided word.
Gets the suggestion with the specified name. Returns undef if one does not exist.
Sets the suggestion with the specified name.
Returns an array of all the keys of suggestions.
suggestions
Cory G Watson <gphat@cpan.org>
This software is copyright (c) 2012 by Cold Hard Code, LLC.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Data::SearchEngine, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Data::SearchEngine
CPAN shell
perl -MCPAN -e shell install Data::SearchEngine
For more information on module installation, please visit the detailed CPAN module installation guide.