mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-22 11:59:43 +01: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 {
|
||||
my $self = shift;
|
||||
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;
|
||||
}
|
||||
|
||||
@ -162,7 +170,7 @@ sub func_maybe_the {
|
||||
my $self = shift;
|
||||
my $text = "@_";
|
||||
|
||||
my ($word) = $text =~ m/^\s*([^',.; ]+)/;
|
||||
my ($word) = $text =~ m/^\s*([^',.;: ]+)/;
|
||||
|
||||
# don't prepend "the" if a proper-noun nick follows
|
||||
if ($self->{pbot}->{nicklist}->is_present_any_channel($word)) {
|
||||
@ -171,7 +179,7 @@ sub func_maybe_the {
|
||||
|
||||
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";
|
||||
}
|
||||
|
||||
|
@ -25,8 +25,8 @@ use PBot::Imports;
|
||||
# These are set by the /misc/update_version script
|
||||
use constant {
|
||||
BUILD_NAME => "PBot",
|
||||
BUILD_REVISION => 4555,
|
||||
BUILD_DATE => "2022-07-08",
|
||||
BUILD_REVISION => 4556,
|
||||
BUILD_DATE => "2022-07-09",
|
||||
};
|
||||
|
||||
sub initialize {}
|
||||
|
Loading…
Reference in New Issue
Block a user