Tie::Ispell - Ties an hash with an ispell dictionary
Version 0.08
This module implements a way to deal with ispell dictionaries using a hash. It tries to work also with aspell.
use Tie::Ispell; tie %dict, 'Tie::Ispell', "english"; if ($dict{dog}) { print "dog is a word" } if (exists($dict{dog})) { print "dog is a word" } $dict{foo} = "now is a word :-)"; # using nearmisses feature tie %dict, 'Tie::Ispell', "english", 1; if (exists($dict{dog})) { print "dog is a word" } if ($x = $dict{doj}) { if (ref($x) eq "ARRAY") { # doj is not a word, but I have a list of nearmisses @nearmisses = @$x; } else { # doj is a word } }
Used for the tie method. Use tie as:
tie %dic, 'Tie::Ispell', 'dictionaryname';
If you want to have access to nearmisses, use
tie %dic, 'Tie::Ispell', 'dictionaryname', 1;
Fetches a word from the ispell dictionary
$dic{dogs} # returns dog $dic{dog} # returns dog $dic{doj} # returns undef
If you tied-up with nearmisses,
$dic{dogs} # returns dog $dic{dog} # returns dog $dic{doj} # returns a reference for a list of near misses
Checks if a word exists on the dictionary. Works in the same way with or without near misses.
exists($dic{dogs}) exists($dic{doj})
Defines a new word for current session dictionary
$dic{foo} = 1;
Alberto Simoes, <ambs@cpan.org>
<ambs@cpan.org>
Jose Joao Almeida, <jj@di.uminho.pt>
<jj@di.uminho.pt>
Please report any bugs or feature requests to bug-tie-ispell@rt.cpan.org, or through the web interface at http://rt.cpan.org. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-tie-ispell@rt.cpan.org
Copyright 2004-2005 Natura Project, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Tie::Ispell, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Tie::Ispell
CPAN shell
perl -MCPAN -e shell install Tie::Ispell
For more information on module installation, please visit the detailed CPAN module installation guide.