mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-08-16 23:10:31 +03:00
Revert "use ucfirst instead of defined uppercase function"
This reverts commit dfbb17e549
.
This commit is contained in:
parent
7bc56b66f2
commit
26940e714a
@ -60,19 +60,19 @@ sub process {
|
||||
$line =~ s/\s+$//;
|
||||
my @WORD = split(/\s+/,$line);
|
||||
|
||||
# uppercase first char of word at sentence start
|
||||
# uppercase at sentence start
|
||||
my $sentence_start = 1;
|
||||
for(my $i=0;$i<scalar(@WORD);$i++) {
|
||||
ucfirst(\$WORD[$i]) if $sentence_start;
|
||||
&uppercase(\$WORD[$i]) if $sentence_start;
|
||||
if (defined($SENTENCE_END{ $WORD[$i] })) { $sentence_start = 1; }
|
||||
elsif (!defined($DELAYED_SENTENCE_START{$WORD[$i] })) { $sentence_start = 0; }
|
||||
}
|
||||
|
||||
# uppercase first char of each word in headlines {
|
||||
# uppercase headlines {
|
||||
if (defined($SRC) && $HEADLINE[$sentence]) {
|
||||
foreach (@WORD) {
|
||||
ucfirst(\$_) unless $ALWAYS_LOWER{$_};
|
||||
}
|
||||
&uppercase(\$_) unless $ALWAYS_LOWER{$_};
|
||||
}
|
||||
}
|
||||
|
||||
# output
|
||||
@ -85,3 +85,8 @@ sub process {
|
||||
print "\n";
|
||||
$sentence++;
|
||||
}
|
||||
|
||||
sub uppercase {
|
||||
my ($W) = @_;
|
||||
$$W = uc(substr($$W,0,1)).substr($$W,1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user