Phone - an example 'Eme' class. See Lingua::FeatureMatrix.


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

Index


Code Index:

NAME

Top

Phone -- an example 'Eme' class. See Lingua::FeatureMatrix.

DESCRIPTION

Top

Distributed with Lingua::FeatureMatrix as a sample class derived from Lingua::FeatureMatrix::Eme.

(It's a Phone Eme, get it?)

Altering for your own use

Top

The most likely change you will probably want to make is to alter the featureset supported by this file. To do so at minimal edit distance, change the file-scoped array @featureList. Make sure it is still inside the BEGIN block so that the Class::MethodMaker calls will still pick up the right values.

See Also

Top

Lingua::FeatureMatrix, which can be used to create tables of feature behavior.

Lingua::FeatureMatrix::Eme, of which this is a subclass.

Graph. (a different Lingua::FeatureMatrix::Eme subclass).

Author

Top

This file began life as an example file by Jeremy Kahn kahn@cpan.org.

HISTORY

Top

This began life as a sample class distributed with Lingua::FeatureMatrix, distributed under the same terms as Perl itself.

Copyright

Top


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

##################################################################
# example subclass of Lingua::FeatureMatrix::Eme
package Phone;
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( vow cons voice son ), # general
		  qw( fric stop liq nas ), # cons features, usually
		  qw( lab dent vel alv pal ), # position
		  qw( high low front back tense ), # vow features, usually
		  );
}
##################################################################
use Class::MethodMaker
    get_set => [ @featureList ];
##################################################################
sub getFeatureNames {
  return @featureList;
}
##################################################################
1;