| Summary | Package variables | Synopsis | General documentation | Methods |
| Summary | Top |
| Stem - An implementation of a stemmer |
| Package variables | Top |
| No package variables defined. |
| Synopsis | Top |
| This module implements a stemmer, to take one word at a time and return the stem of it. Create a object with new, then stem a word with stem: my $stemmer = new Stem; my $stemmed_test = $stemmer->stem("test"); my $stemmed_testing = $stemmer->stem("testing"); |
| Description | Top |
| Methods | Top |
| new | Description | Code |
| stem | Description | Code |
| new | code | next | Top |
| my $stemmer = new Stem; This creates a stemmer object and initializes it so calls to stem() can be made. |
| stem | code | prev | next | Top |
| $stemmed_word = $stemmer->stem($word); Returns the stemmed version of a word. |
| new | description | prev | next | Top |
sub new
{ my %step2list;
my %step3list;
my ($c, $v, $C, $V, $mgr0, $meq1, $mgr1, $_v);
%step2list =
( 'ational'=>'ate', 'tional'=>'tion', 'enci'=>'ence', 'anci'=>'ance', 'izer'=>'ize', 'bli'=>'ble',
'alli'=>'al', 'entli'=>'ent', 'eli'=>'e', 'ousli'=>'ous', 'ization'=>'ize', 'ation'=>'ate',
'ator'=>'ate', 'alism'=>'al', 'iveness'=>'ive', 'fulness'=>'ful', 'ousness'=>'ous', 'aliti'=>'al',
'iviti'=>'ive', 'biliti'=>'ble', 'logi'=>'log');
%step3list =
('icate'=>'ic', 'ative'=>'', 'alize'=>'al', 'iciti'=>'ic', 'ical'=>'ic', 'ful'=>'', 'ness'=>'');
$c = "[^aeiou]"; # consonant} |
| stem | description | prev | next | Top |
sub stem
{ my $self = shift;
my %step2list = %{ $self->{step2list} };
my %step3list = %{ $self->{step3list} };
my $c = $self->{c};
my $v = $self->{v};
my $C = $self->{cap_C};
my $V = $self->{cap_V};
my $mgr0 = $self->{mgr0};
my $meq1 = $self->{meq1};
my $mgr1 = $self->{mgr1};
my $_v = $self->{un_v};
# local %step2list;} |
| VERSION | Top |
| Version 0.01 |
| AUTHOR | Top |
| Hodges, Mark << <clair at umich.edu> >> Radev, Dragomir << <radev at umich.edu> >> |
| BUGS | Top |
| Please report any bugs or feature requests to bug-clair-document at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=clairlib-dev. I will be notified, and then you will automatically be notified of progress on your bug as I make changes. |
| SUPPORT | Top |
You can find documentation for this module with the perldoc command.perldoc StemYou can also look for information at: |
| COPYRIGHT & LICENSE | Top |
| Copyright 2006 The University of Michigan, all rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. |