]> git.donarmstrong.com Git - infobot.git/commitdiff
multiple spell's supported
authortimriker <timriker@c11ca15a-4712-0410-83d8-924469b57eb5>
Tue, 27 Jul 2004 23:22:19 +0000 (23:22 +0000)
committertimriker <timriker@c11ca15a-4712-0410-83d8-924469b57eb5>
Tue, 27 Jul 2004 23:22:19 +0000 (23:22 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@1017 c11ca15a-4712-0410-83d8-924469b57eb5

src/UserExtra.pl

index 6ae80deeac76f34b90087aac504217a2ba209062..97fffc4b29a6c17ba07ddb7c7c924c68015fb2e7 100644 (file)
@@ -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.