mirror of
https://github.com/perlbot/perlbuut
synced 2025-06-07 16:35:40 -04:00
adding support for not suggesting things when backdressed
This commit is contained in:
parent
2c296fcd82
commit
5e72911b37
2 changed files with 3 additions and 2 deletions
|
@ -309,6 +309,7 @@ sub _said {
|
||||||
$said->{body} = $body;
|
$said->{body} = $body;
|
||||||
$said->{addressed} = 1;
|
$said->{addressed} = 1;
|
||||||
$said->{addressed_as} = $1;
|
$said->{addressed_as} = $1;
|
||||||
|
$said->{backdressed} = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -512,12 +512,12 @@ sub basic_get_fact {
|
||||||
return "$fact->{predicate}";
|
return "$fact->{predicate}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
my $soundex = soundex( _clean_subject($subject, 1) );
|
my $soundex = soundex( _clean_subject($subject, 1) );
|
||||||
|
|
||||||
my $matches = $self->_soundex_matches( $soundex );
|
my $matches = $self->_soundex_matches( $soundex );
|
||||||
|
|
||||||
if( $matches and @$matches ) {
|
if( ($matches and @$matches) && (!$said->{backdressed}) ) {
|
||||||
return "No factoid found. Did you mean one of these: " . join " ", map "[$_]", @$matches;
|
return "No factoid found. Did you mean one of these: " . join " ", map "[$_]", @$matches;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue