Clair::SentenceSegmenter

Text


Included librariesPackage variablesGeneral documentationMethods

Package variablesTop
No package variables defined.

Included modulesTop
Carp
Clair::SentenceSegmenter::SentenceSegmenter
Text::Sentence

InheritTop
Clair::SentenceSegmenter::SentenceSegmenter

SynopsisTop
No synopsis!
DescriptionTop
No description!
MethodsTop
newNo descriptionCode
split_sentencesNo descriptionCode

Methods description


None available.

Methods code


newdescriptionprevnextTop
sub new {
  my $class = shift;
  my %params = @_;

  # Instantiate our base class/create representation
$params{segmenter_type} = "Text"; my $self = $class->new_sentence_segmenter (%params); return $self;
}

split_sentencesdescriptionprevnextTop
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;
}

General documentation


No general documentation available.