Lingua-PT-ProperNames
view release on metacpan or search on metacpan
lib/Lingua/PT/ProperNames.pm view on Meta::CPAN
}
}
}
=head2 getPN
=cut
sub getPN {
local $/ = ""; # input record separator=1 or more empty lines
my %opt;
@opt{@_} = @_;
my (%profissao, %names, %namesduv, %gnames);
while (<>) {
chop;
s/\n/ /g;
for (/[.?!:;"]\s+($np1\s+$np)/g) { $namesduv{$_}++;}
for (/[)>(]\s*($np1\s+$np)/g) { $namesduv{$_}++;}
lib/Lingua/PT/ProperNames.pm view on Meta::CPAN
printPN - extrai os nomes próprios dum texto.
-comp junta certos nomes: Fermat + Pierre de Fermat = (Pierre de) Fermat
-prof
-e "Sebastiao e Silva" "e" como pertencente a PN
-em "em Famalicão" como pertencente a PN
=cut
sub printPN{
local $/ = ""; # input record separator=1 or more empty lines
my %opt;
@opt{@_} = @_;
my (%profissao, %names, %namesduv, %gnames);
while (<>) {
chop;
s/\n/ /g;
for (/[.?!:;"]\s+($np1\s+$np)/g) { $namesduv{$_}++ }
for (/[)>(]\s*($np1\s+$np)/g) { $namesduv{$_}++ }
samples/ucPN view on Meta::CPAN
#!/usr/bin/perl
use locale;
use Lingua::PT::ProperNames;
$/ = '';
while(<>){
s/\s*\n\s*/ /g;
print forPNstring(sub{uc($_[0])}, $_);
}
( run in 0.314 second using v1.01-cache-2.11-cpan-49f99fa48dc )