| Summary | Included libraries | Package variables | Synopsis | Description | General documentation | Methods |
| Summary | Top |
| Clair::SentenceFeatures - a collection of sentence feature subroutines |
| Package variables | Top |
| No package variables defined. |
| Included modules | Top |
| Carp |
| Clair::Centroid |
| Clair::Config |
| Clair::IDF |
| Exporter |
| MEAD::SimRoutines |
| lib " $MEAD_HOME /lib " |
| Inherit | Top |
| Exporter |
| Synopsis | Top |
use Clair::SentenceFeatures qw(length_feature);
use Clair::Document;
my $doc = Clair::Document->new( ... );
$doc->compute_sentence_feature(name => "length",
length_feature => \&length_feature ); |
| Description | Top |
| This module contains sentence feature scripts to use with the compute_sentence_feature methods in Clair::Document and Clair::Cluster. |
| Methods | Top |
| centroid_feature | No description | Code |
| length_feature | No description | Code |
| position_feature | No description | Code |
| sim_with_first_feature | No description | Code |
| centroid_feature | description | prev | next | Top |
sub centroid_feature
{
my %params = @_;
my $state = $params{state};
# Pre-compute the centroid} |
| length_feature | description | prev | next | Top |
sub length_feature
{ my %params = @_;
my $sent_doc = Clair::Document->new(string => $params{sentence});
my @words = $sent_doc->split_into_words();
return scalar @words;} |
| position_feature | description | prev | next | Top |
sub position_feature
{ my %params = @_;
my $total = scalar $params{document}->sentence_count();
my $index = $params{sentence_index};
if ($total > 0) {
return ($total - $index) / $total;} |
| sim_with_first_feature | description | prev | next | Top |
sub sim_with_first_feature
{ my %params = @_;
my @sents = $params{document}->get_sentences();
my $sent = $params{sentence};
my $first_sent = $sents[0];
return GetLexSim($sent, $first_sent);} |
| SEE ALSO | Top |
| Clair::Document, Clair::Cluster. |