diff --git a/PBot/DualIndexHashObject.pm b/PBot/DualIndexHashObject.pm index dd1f4434..97e97510 100644 --- a/PBot/DualIndexHashObject.pm +++ b/PBot/DualIndexHashObject.pm @@ -234,7 +234,7 @@ sub levenshtein_matches { my $distance = fastdistance($secondary_index_key, $index); my $length = (length($secondary_index_key) > length($index)) ? length $secondary_index_key : length $index; - if($distance / $length < 0.50) { + if($distance / $length < 0.60) { $result .= $comma . $index; $comma = ", "; } diff --git a/PBot/FactoidCommands.pm b/PBot/FactoidCommands.pm index b6802f5d..aa9edbe2 100644 --- a/PBot/FactoidCommands.pm +++ b/PBot/FactoidCommands.pm @@ -275,8 +275,7 @@ sub factadd { if(defined $trigger) { $self->{pbot}->logger->log("$nick!$user\@$host attempt to overwrite $keyword\n"); - return undef; - return "/msg $nick $keyword already exists."; + return "/msg $nick $keyword already exists for " . ($from_chan eq '.*' ? 'global channel' : $from_chan) . "."; } $self->{pbot}->factoids->add_factoid('text', $from_chan, $nick, $keyword, $text); diff --git a/PBot/Factoids.pm b/PBot/Factoids.pm index a196ed71..da1df53b 100644 --- a/PBot/Factoids.pm +++ b/PBot/Factoids.pm @@ -13,7 +13,6 @@ $VERSION = $PBot::PBot::VERSION; use HTML::Entities; use Time::HiRes qw(gettimeofday); -use Text::Levenshtein qw(fastdistance); use Carp (); use PBot::FactoidModuleLauncher; @@ -204,7 +203,7 @@ sub interpreter { ($channel, $keyword) = $self->find_factoid($from, $keyword, $arguments); if(not defined $keyword) { - my $matches = $self->factoids->levenshtein_matches($from, lc $original_keyword); + my $matches = $self->factoids->levenshtein_matches('.*', lc $original_keyword); return undef if $matches eq 'none'; diff --git a/PBot/VERSION.pm b/PBot/VERSION.pm index 797ea69c..c9354bdb 100644 --- a/PBot/VERSION.pm +++ b/PBot/VERSION.pm @@ -13,8 +13,8 @@ use warnings; # These are set automatically by the build/commit script use constant { BUILD_NAME => "PBot", - BUILD_REVISION => 222, - BUILD_DATE => "2010-06-29", + BUILD_REVISION => 223, + BUILD_DATE => "2010-06-30", }; 1;