AI-ExpertSystem-Simple
view release on metacpan or search on metacpan
bin/consult view on Meta::CPAN
package require cmdline
################################################################################
# Some global variables
################################################################################
set display_information 1
set filehandle ""
set filename ""
set program "simpleshell"
set error ""
set choice ""
toplevel .askme
wm withdraw .askme
################################################################################
# The question asking dialog
################################################################################
proc ask_the_user {message argv} {
bin/consult view on Meta::CPAN
}
################################################################################
# The program starts here
################################################################################
# Was there a filename on the command line
set p_count 0
while {[set err [cmdline::getopt argv {f.arg p.arg} opt val]] > 0} {
switch -- $opt {
f {
if {$filename == ""} {
set filename $val
} {
set error "The $opt switch should only be used once"
}
}
p {
if {$p_count == 0} {
set program $val
incr p_count
if {[file executable $program] != 1} {
set error "The program '$program' is not runable"
}
} {
set error "The $opt switch should only be used once"
}
}
}
}
if {$err < 0} {
puts "There was an error: $val"
exit
}\
elseif {$error != ""} {
puts "There was an error: $error"
exit
}
main
bin/simpleshell view on Meta::CPAN
} else {
print "$tag2$text\n";
}
}
######################################################################
# The various ways of printing out a message
######################################################################
sub process_log {
my ($prefix, $override) = @_;
$prefix = 'information' unless $prefix;
my @log = $s->log();
if($tkinterface or $override) {
foreach my $line (@log) {
say_something($prefix, '', $line);
}
}
}
examples/Glass.xml view on Meta::CPAN
</condition>
<condition>
<attribute>plain</attribute>
<value>no</value>
</condition>
<condition>
<attribute>etched</attribute>
<value>no</value>
</condition>
<condition>
<attribute>cherry.blossom</attribute>
<value>yes</value>
</condition>
</conditions>
<actions>
<action>
<attribute>type.glass</attribute>
<value>cherry.blossom</value>
</action>
</actions>
</rule>
<rule>
<name>13</name>
<conditions>
<condition>
<attribute>rays</attribute>
<value>no</value>
</condition>
examples/Glass.xml view on Meta::CPAN
</rule>
</rules>
<questions>
<question>
<attribute>lariat</attribute>
<text>Does the piece have a looped rim?</text>
<response>yes</response>
<response>no</response>
</question>
<question>
<attribute>cherry.blossom</attribute>
<text>Are there small cherries in the pattern?</text>
<response>yes</response>
<response>no</response>
</question>
<question>
<attribute>pretzel</attribute>
<text>Does the glass have a laced pattern?</text>
<response>yes</response>
<response>no</response>
</question>
<question>
lib/AI/ExpertSystem/Simple.pm view on Meta::CPAN
When the method is called it requires one argument. This message is given if more or
less arguments were supplied.
=item Simple->load() argument 1 (FILENAME) is undefined
The corrct number of arguments were supplied with the method call, however the first
argument, FILENAME, was undefined.
=item Simple->load() XML parse failed
XML Twig encountered some errors when trying to parse the XML knowledgebase.
=item Simple->load() unable to use file
The file supplied to the load( ) method could not be used as it was either not a file
or not readable.
=item Simple->process() takes no arguments
When the method is called it requires no arguments. This message is given if
some arguments were supplied.
( run in 1.626 second using v1.01-cache-2.11-cpan-49f99fa48dc )