summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
895c131)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@1017
c11ca15a-4712-0410-83d8-
924469b57eb5
sub ispell {
my $query = shift;
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") {
&msg($who, "no binary found.");
return;
}
&msg($who, "no binary found.");
return;
}
my $reply = "I can't find alternate spellings for '$query'";
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.
chop;
last if !length; # end of query.