]> git.donarmstrong.com Git - infobot.git/blobdiff - src/Modules/spell.pl
take a few more things literally
[infobot.git] / src / Modules / spell.pl
index b34b3e65467d8d9867ff06f3f211b049ac6eeb31..705854dfdde8913266c9c61d6cd7e46697c665ec 100644 (file)
@@ -14,6 +14,10 @@ use strict;
 
 sub spell::spell {
        my $query = shift;
+       if ($query =~ m/[^[:alpha:]]/) {
+               return('only one word of alphabetic characters supported');
+       }
+
        my $binary;
        my @binaries = (
                '/usr/bin/aspell',
@@ -29,11 +33,11 @@ sub spell::spell {
        }
 
        if (!$binary) {
-               return("no binary found.");
+               return('no binary found.');
        }
 
-       if (!&main::validExec($query)) {
-               return("argument appears to be fuzzy.");
+       if (!&::validExec($query)) {
+               return('argument appears to be fuzzy.');
        }
 
        my $reply = "I can't find alternate spellings for '$query'";
@@ -54,13 +58,13 @@ sub spell::spell {
                        $reply = "possible spellings for $query: @array";
                        last;
                } elsif (/^\+/) {
-                       &main::DEBUG("spell: '+' found => '$_'.");
+                       &::DEBUG("spell: '+' found => '$_'.");
                        last;
                } elsif (/^# (.*?) 0$/) {
                        # none found.
                        last;
                } else {
-                       &main::DEBUG("spell: unknown: '$_'.");
+                       &::DEBUG("spell: unknown: '$_'.");
                }
        }