
Lingua::FeatureMatrix::Eme - Abstract base class contains one single eme's features.

TO DO:
use Lingua::FeatureMatrix::Eme; blah blah blah

This class is a container for a list of features. A Lingua::FeatureMatrix object stores a table of these.

Use this class to build your own subtypes for use with Lingua::FeatureMatrix. Lingua::FeatureMatrix::Eme provides the necessary base class methods to interact with Lingua::FeatureMatrix.

The following methods are public (and used by Lingua::FeatureMatrix):
The new() method will construct and return an object blessed into the current class. In addition, this method will initialize each element of the feature list (returned from the getFeatureList() method) with the string "unset".
Arguments passed to new() will be treated as a hash of name => value pairs. All keys (see exception below) will be treated as method names, and the method will be invoked with the corresponding value (this will ordinarily set the feature named key to value).
NOTE: users will probably rarely invoke this method directly, since the Lingua::FeatureMatrix code builds these objects as needed while configuring itself.
Note also that the key options will be explicitly ignored if present so that subclasses can hang any special initialization values off that argument. This allows users to pass their special arguments to their subclasses via the eme_opts named parameter to Lingua::FeatureMatrix-new()>.
Lists how this class fails its own contract. By extension, indicates how a subclass fails the contract. Handy for sanity checking.
returns whether the feature passed by argument is specified. Will croak if the feature specified is not supported by the class.
Returns which features have never been specified. Note this is *not* the same as those features that are undef, since that undef is a value that can legitimately be specified. See "Implicatures" in Lingua::FeatureMatrix for more details.
Returns whether the Eme object in question has had all its features fully specified.
Returns whether the Eme object is equivalent to a (different) Eme object of the same class handed in.
Rejects Eme objects of different classes, and issues warnings if any fields needed to make the decision are as yet unset (though undef fields are acceptable).
Returns that list of features that were specified by the user (not by implication).
Returns that list of features that were computed by the implications specified while configuring the Lingua::FeatureMatrix parent object.
Returns feature's value. Note that ungrammatical features will return a false value.
Dumps textual representation of self's featureset, including the [] brackets. Note any features that were not set by user or by implication will be dumped as ?.
Dumps the features passed by argument, and their value, as a text string.
Given a featurename, returns a list of the text form of the implications that were used to set that feature. If the feature does not exist, returns undefined.

Those who want to build their own subclass should build one to the following specification. Note that the Phone and Letter subclasses provided in the examples/ distribution of Lingua::FeatureMatrix are good places to start.
Any subclass should support a class method getFeatureNames which should return, in some interesting (and ideally reliable) order, the list of features that are supported by the subclass.
Each feature listed by getFeatureNames should:
Class::MethodMaker).Class::MethodMaker).new() should respond as follows:
Either don't provide a new() (let superclass take care of it) or:
options key/value pair from the argument list, then:Eme object handles itself properly.In general, try to follow OO subclassing best practices, or use the provided examples/Phone.pm and examples/Letter.pm as guides.
It is strongly recommended to use Class::MethodMaker to build the feature subroutines; in fact, that is all the author has tested with.


Jeremy Kahn, <kahn@cpan.org>

perl.