pt-va: Delimit sentences by . or ?

This commit is contained in:
Brian Fraser fraserb@gmail.com
2012-07-30 11:47:59 -03:00
parent 2f0812fb33
commit 2192eb9e4e
2 changed files with 15 additions and 4 deletions

View File

@@ -3598,9 +3598,9 @@ sub print_advice {
foreach my $id ( @$advice ) {
my $info = $adv->get_rule_info($id);
my @desc = map {
$_ .= '.' unless m/\.$/;
$_ .= '.' unless m/[.?]$/;
$_;
} split(/\.\s{1,2}/, $info->{description} || '');
} split(/(?<=[.?])\s{1,2}/, $info->{description} || '');
$desc[1] ||= ""; # Some desc have only 1 sentence.
my $desc = $verbose == 1 ? $desc[0] # terse
: $verbose == 2 ? "$desc[0] $desc[1]" # fuller