sub split_sentences
{ my $self = shift;
my $text = shift;
# print "Text, splitting.\n";
# Setting the locale first may be worthwhile here. TODO my @sentences = Text::Sentence::split_sentences( $text );
# The rest of clairlib expects to see a single whitespace char at the end of # each sentence. # MxTerminator keeps a single whitespace character at the end of each sentence. # Text::Sentence does not, leading to undesired behavior. # The following loop makes this function conform to its original authors' # expectations. for my $i (0..$#sentences) {
$sentences[$i] = "$sentences[$i] ";
}
return @sentences; } |