Letter - contains features to describe a single letter


Lingua-FeatureMatrix documentation Contained in the Lingua-FeatureMatrix distribution.

Index


Code Index:

NAME

Top

Letter -- contains features to describe a single letter

SYNOPSIS

Top

  use Letter; # a sample derived class from Lingua::FeatureMatrix
  my $matrix = Lingua::FeatureMatrix->new(file => 'lettermatrix.dat',
                                          eme => 'Letter');

  $matrix->matchesFeatureClass('d', 'RISER'); # true
  $matrix->matchesFeatureClass('l', 'FULLWIDTH'); # false

DESCRIPTION

Top

HISTORY

Top

Long and tortured.


Lingua-FeatureMatrix documentation Contained in the Lingua-FeatureMatrix distribution.

##################################################################
# example subclass of Lingua::FeatureMatrix::Eme
package Letter;
use strict;
use warnings;
my (@featureList);

use base 'Lingua::FeatureMatrix::Eme';
BEGIN {
  # this is in a BEGIN block so that the use Class::MethodMaker in
  # Phone can install booleans appropriately.
  @featureList = (
		  qw( riser faller ), # general
		  qw( vow cons ),
		  qw( capital ),
		  qw ( em en ell ), # widths
		  );
}
##################################################################
use Class::MethodMaker
    get_set => [ @featureList ];
##################################################################
sub getFeatureNames {
  return @featureList;
}
##################################################################
1;