mirror of
https://github.com/pragma-/pbot.git
synced 2025-05-08 07:37:35 +02:00
Plugin/FuncBuiltins: do not ucfirst on nicks; add more POS to maybe-the
This commit is contained in:
parent
10e49bbbb6
commit
d12a463987
@ -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";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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 {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user