Evaluation flow, declaring new :response sentences and miscelany |
Okay, I'm stumped. I think I've simplified the POS tagging to simply associating everything. I've successfully done that and had it check if all words of a statement are associated. I can't however bifurcate the evaluation into a question or an assertion routine. I want to divert to a question routine if there is an "is" present, but loop through the remaining words. Got that, but I'm not seeing a way to loop through all words without the "is" without instructions to loop on :anything (which disregards the "is" diversion). I think what is needed is an 'case NOT "is" ..' statement, which I tried with no success. Any ideas?
// Initial Self programmed state machine for Comprehension
// This state machine is used by the bot to program itself.
State:Associate0 {
case :input goto State:processState for each #word of :sentence;
// case :input goto State:sentenceState for each #word of :sentence;
:input {
set #input to :sentence;
set #speaker to :speaker;
set #comment to "// case :input goto State:sentenceState for each #word of :sentence;
";
set #comment to "
";
set #conversation to :conversation;
set #target to :target;
}
:sentence {
set #instantiation to #sentence;
}
State:processState {
case "is" goto State:verify;
case :anything goto State:processState;
case :anything goto State:response;
Quotient:1.00:Equation:process;
Equation:process {
assign :response to (new #sentence);
assign #word to :word1;
associate :word1 to :word2 by #next;
assign #word to :word2;
append "process:" to #word of :response;
append "okay, recorded" to #word of :response;
}
State:verify {
case :anything goto State:verify;
Quotient:1.00:Equation:verify;
Equation:verify {
assign :response to (new #sentence);
assign #word to :word1;
if (is #word related to :word2, #true)
then (do (append "verified" to #word of :response))
else (do (append "notverified" to #word of :response));
assign #word to :word2;
}
}
State:response {
Quotient:1.00:Equation:response;
Equation:response {
assign :word1 to (get #word from :sentence at 1);
assign :word2 to (get #word from :sentence at 2);
assign :word3 to (get #word from :sentence at 3);
append "words:" to #word of :response;
append :word1 to #word of :response;
append :word2 to #word of :response;
append :word3 to #word of :response;
return :response;
return "l2";
}
}
}
}
// Initial Self programmed state machine for Comprehension
// This state machine is used by the bot to program itself.
State:Associate0 {
case :input goto State:processState for each #word of :sentence;
// case :input goto State:sentenceState for each #word of :sentence;
:input {
set #input to :sentence;
set #speaker to :speaker;
set #comment to "// case :input goto State:sentenceState for each #word of :sentence;
";
set #comment to "
";
set #conversation to :conversation;
set #target to :target;
}
:sentence {
set #instantiation to #sentence;
}
State:processState {
do (assign :response to (new #sentence));
case "is" goto State:verify;
case "that" goto State:process;
case :anything goto State:response;
State:verify {
case :anything goto State:verify;
Quotient:1.00:Equation:verify;
Equation:verify {
assign :response to (new #sentence);
assign :word2 to (get #word from :sentence at 2);
assign :word3 to (get #word from :sentence at 3);
assign :word4 to (get #word from :sentence at 4);
if (is :word2 related to :word3, #true)
then (do (if (is :word3 related to :word4, #true)
then (do (
append :word2 to #word of :response,
append :word3 to #word of :response,
append :word4 to #word of :response
))))
else (do (
append "notverified" to #word of :response,
append :word1 to #word of :response,
append :word2 to #word of :response,
append :word3 to #word of :response,
append :word4 to #word of :response
));
assign #word to :word2;
return :response;
}
}
State:process {
case :anything goto State:process;
Quotient:1.00:Equation:process;
Equation:process {
assign #word to :word1;
associate :word1 to :word2 by #next;
assign #word to :word2;
append "process:" to #word of :response;
append "okay, recorded" to #word of :response;
}
}
State:response {
Quotient:1.00:Equation:response;
Equation:response {
assign :word1 to (get #word from :sentence at 1);
assign :word2 to (get #word from :sentence at 2);
assign :word3 to (get #word from :sentence at 3);
assign :word4 to (get #word from :sentence at 4);
append "words:" to #word of :response;
append :word1 to #word of :response;
append :word2 to #word of :response;
append :word3 to #word of :response;
append :word4 to #word of :response;
return :response;
return "l2";
}
}
}
}
|
|
|
|
|