3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-10-06 11:28:43 +02:00

Plugin/FuncBuiltins: do not ucfirst on nicks; add more POS to maybe-the

This commit is contained in:
Pragmatic Software 2022-07-09 19:09:27 -07:00
parent 10e49bbbb6
commit d12a463987
2 changed files with 12 additions and 4 deletions

View File

@ -117,6 +117,14 @@ sub func_title {
sub func_ucfirst { sub func_ucfirst {
my $self = shift; my $self = shift;
my $text = "@_"; my $text = "@_";
my ($word) = $text =~ m/^\s*([^',.;: ]+)/;
# don't ucfirst on nicks
if ($self->{pbot}->{nicklist}->is_present_any_channel($word)) {
return $text;
}
return ucfirst $text; return ucfirst $text;
} }
@ -162,7 +170,7 @@ sub func_maybe_the {
my $self = shift; my $self = shift;
my $text = "@_"; my $text = "@_";
my ($word) = $text =~ m/^\s*([^',.; ]+)/; my ($word) = $text =~ m/^\s*([^',.;: ]+)/;
# don't prepend "the" if a proper-noun nick follows # don't prepend "the" if a proper-noun nick follows
if ($self->{pbot}->{nicklist}->is_present_any_channel($word)) { if ($self->{pbot}->{nicklist}->is_present_any_channel($word)) {
@ -171,7 +179,7 @@ sub func_maybe_the {
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)>/) { if ($tagged !~ m/^\s*<(?:det|prps?|cd|in|nnp|to|rb|wdt|vbg|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 => 4555, BUILD_REVISION => 4556,
BUILD_DATE => "2022-07-08", BUILD_DATE => "2022-07-09",
}; };
sub initialize {} sub initialize {}