NAME

Data::Classifier::Result

OVERVIEW

NOTE: You should have already read the documentation for Data::Classifier which has an example on how to produce Data::Classifier::Result instances.

This class represents results from classification requests sent to a Data::Classifier instance.

METHODS

$class = $result->class

Returns the most specific class that matched as a hash; this includes all of the attributes stored in a node. If no classification could be done, this returns undef.

@classes = $result->stack

Returns a list of the entire class hierarchy for the result. The root node is at 0 and the most specific node is at the end.

$name = $result->name

Returns a string that is the name of the most specific class that matched.

$fqn = $result->fqn

Returns a string of the entire class path name for the match, seperated by double colons. For instance: Root::BMW::Sports

@attributes = $result->attributes

Returns a list of the specified attributes for all the nodes in the matching class hierarchy. The root node is at 0 and the most specific node is at the end. If a node has no attribute by this name, undef will be stored in the list at its corresponding position.

SUBCLASSING

This class is designed to be subclassed and be used in conjuction with other classes that extended the functionality of Data::Classifier.

The following methods are designed to be overloaded to change behavior:

$result->init

This method will be called as the last step in the constructor, prior to actually returning the new instance. If you need to do any kind of initialization in your subclass, this would be the place to do it.

IMPROVEMENTS

This class could probably use a method that searches through the tree, like the look_down method on HTML::Element

MORE INFORMATION

This is a class used by Data::Classifier - see the documentation for that class for information on authors and bugs and for more documentation.