From: timriker Date: Tue, 27 Jul 2004 23:22:19 +0000 (+0000) Subject: multiple spell's supported X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=5e017a427bec1d8947bc63b61c4e1d6867ecb837;p=infobot.git multiple spell's supported git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@1017 c11ca15a-4712-0410-83d8-924469b57eb5 --- diff --git a/src/UserExtra.pl b/src/UserExtra.pl index 6ae80de..97fffc4 100644 --- a/src/UserExtra.pl +++ b/src/UserExtra.pl @@ -238,8 +238,21 @@ sub karma { sub ispell { my $query = shift; + my $binary; + my @binaries = ( + '/usr/bin/aspell', + '/usr/bin/ispell', + '/usr/bin/spell' + ); + + foreach (@binaries) { + if (-x $_) { + $binary=$_; + last; + } + } - if (! -x "/usr/bin/ispell") { + if (!$binary) { &msg($who, "no binary found."); return; } @@ -251,7 +264,7 @@ sub ispell { my $reply = "I can't find alternate spellings for '$query'"; - foreach (`/bin/echo '$query' | /usr/bin/ispell -a -S`) { + foreach (`/bin/echo '$query' | $binary -a -S`) { chop; last if !length; # end of query.