3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-20 02:49:49 +01:00

FuncBuiltins: maybe-the: special-case some indefinite nouns

This commit is contained in:
Pragmatic Software 2022-07-14 10:15:30 -07:00
parent f7d361beca
commit e4becb22a1
2 changed files with 8 additions and 3 deletions

View File

@ -177,9 +177,14 @@ sub func_maybe_the {
return $text; return $text;
} }
# special-case some indefinite nouns that Lingua::EN::Tagger treats as plain nouns
if ($word =~ m/(some|any|every|no)(thing|one|body|how|way|where|when|time|place)/i) {
return $text;
}
my $tagged = $self->{tagger}->add_tags($word); my $tagged = $self->{tagger}->add_tags($word);
if ($tagged !~ m/^\s*<(?:det|prps?|cd|in|nnp|to|rb|wdt|vbg|rbr|jjr)>/) { if ($tagged !~ m/^\s*<(?:det|prps?|cd|in|nnp|to|rb|wdt|rbr|jjr)>/) {
$text = "the $text"; $text = "the $text";
} }

View File

@ -25,8 +25,8 @@ use PBot::Imports;
# These are set by the /misc/update_version script # These are set by the /misc/update_version script
use constant { use constant {
BUILD_NAME => "PBot", BUILD_NAME => "PBot",
BUILD_REVISION => 4559, BUILD_REVISION => 4560,
BUILD_DATE => "2022-07-10", BUILD_DATE => "2022-07-14",
}; };
sub initialize {} sub initialize {}