Bot-BasicBot-Pluggable-Module-Tools

 view release on metacpan or  search on metacpan

lib/Bot/BasicBot/Pluggable/Module/Spell.pm  view on Meta::CPAN


    my ($r) = spellcheck($body);

    return "$body is probably spelt correctly" unless $r;


    return "$1 is spelt correctly"                        if ($r->{type} eq 'ok');
    return "$1 can be formed from the root ".$r->{'root'} if ($r->{type} eq 'root');
    return "$1 is a valid compund word"                   if ($r->{'type'} eq 'compound' );
    return "Near misses: ".join(", ",@{$r->{'misses'}})   if ($r->{'type'} eq 'miss' );
    return "Suggestions: ".join(", ", @{$r->{'guesses'}}) if ($r->{type} eq 'guess');

    return "I have no idea, sorry";
}

sub help {
    return "Commands: 'spell <word>'";
}

1;



( run in 2.712 seconds using v1.01-cache-2.11-cpan-748bfb374f4 )