Lingua-PT-PLN

 view release on metacpan or  search on metacpan

examples/divideFrases  view on Meta::CPAN

#!/usr/bin/perl
use Lingua::PT::PLN;

$/='';

while(<>){
  print Lingua::PT::PLN::xmlsentences($_);
}

lib/Lingua/PT/PLN.pm  view on Meta::CPAN

      }
    }
  } else {
    return (%oco)
  }
}

### syllabs, and accents

sub accent {
  local $/ = "";           # input record separator=1 or more empty lines
  my $p=shift;
  $p =~ s/(\w+)/ wordaccent($1) /ge;
  $p
}

sub wordaccent {
  my $p = syllable($_[0]);
  my $flag = $_[1] or 0; # 0 (default) => use : after vowel; 1 => use " before syllable
  for ($p) {
    s{(\w*$acento)}{"$1}i             or  # word with an accent character



( run in 0.320 second using v1.01-cache-2.11-cpan-49f99fa48dc )