AI-ExpertSystem-Advanced
view release on metacpan or search on metacpan
lib/AI/ExpertSystem/Advanced/Dictionary.pm view on Meta::CPAN
}
}
return undef;
}
=head2 B<get_value($id, $key)>
The L<AI::ExpertSystem::Advanced::Dictionary> consists of a hash of elements,
each element has its own properties (eg, extra keys).
This method looks for the value of the given C<$key> of a given element C<id>.
It will return the value, but if element doesn't have the given C<$key> then
C<undef> will be returned.
=cut
sub get_value {
my ($self, $id, $key) = @_;
if (!defined $self->{'stack_hash'}->{$id}) {
return undef;
lib/AI/ExpertSystem/Advanced/KnowledgeDB/YAML.pm view on Meta::CPAN
package AI::ExpertSystem::Advanced::KnowledgeDB::YAML;
=head1 NAME
AI::ExpertSystem::Advanced::KnowledgeDB::YAML - YAML Knowledge DB driver
=head1 DESCRIPTION
A YAML knowledge database driver.
It reads a given YAML file and looks for the I<rules> hash key. All of the
elements of C<rules> (causes and goals) are copied to the C<rules> hash
key of L<AI::ExpertSystem::Advanced::KnowledgeDB::Base>.
If no rules are found then it ends unsuccessfully.
It also looks for any available questions under the I<questions> hash key,
however if no questions are found then they are not copied :-)
=cut
use Moose;
use YAML::Syck;
extends 'AI::ExpertSystem::Advanced::KnowledgeDB::Base';
our $VERSION = '0.01';
( run in 0.275 second using v1.01-cache-2.11-cpan-64827b87656 )