AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

How to reuse the previous user input in a topic?
 
 

I have a dream module, it interprets dreams.
Before I launch into the analysis, I want to 2x check that this is the intent and reuse previous input.
I am not sure how to do this.  See “a: (yes ~yes)” below.
Any advice?

So, I have a TOPIC with dream related words.

TOPIC: ~dreamdefine nostay ( dream nightmare vision daydream dream chimera hallucination reverie trance ) 

u: (*)  This sounds like a dream. Do you want me to think about your dream and what it possibly indicates?
a: (yes ~yes)  # *reuse this topic with the previous user input*
a: (no ~no)  OK, I thought you would want to know the meaning of this kind of dream.  ^keep ( ) ^poptopic ( )
a: (*)  OK, I thought you would want to know the meaning of this kind of dream.  ^keep ( ) ^poptopic ( )
u: (  << gold >> ) Seeing gold in a dream is usually is a positive dream.  Easy come, easy go is usually the underlying message when gold is in a dream. 
          a: ( ~tellmemore )    Gold cloth, garments, jewels or hats will signify honors and recognition. If you are looking for gold, this indicates that a successful change in your life can be made through your own initiative and effort.
            b: ( ~tellmemore )  Finding, mining, melting, or working with gold is a reminder that all is not gold that glitters. And it is not all that important in the grand scheme of things. 
                c: ( ~tellmemore )    Hiding it suggests that you are not aggressive enough about protecting your own interests. You might need to take positive action.
                    d: ( ~tellmemore )  Stealing or counting gold is a warning. It could indicate that the love of money is a root of evil.

This is just a made up example.

Before I start looking for meaning, I want to confirm that this is the intent and reuse the previous and current user input.

 

 
  [ # 1 ]

i think this would work:

u: (_*)  This sounds like a dream. Do you want me to think about your dream and what it possibly indicates?
a: (yes ~yes)  $_join = ^join( $$previousinput ” ” ‘_0 ) ^input($_join) ^nofail ( TOPIC ^reuse( ~dreamdefine ) )  # *reuse this topic with the previous user input*
b: (no ~no)  OK, I thought you would want to know the meaning of this kind of dream.  ^keep ( ) ^poptopic ( )

 

 
  [ # 2 ]

the code runs, but it is not reusing the topic (TOPIC: ~dreamdefine) with the variable within $$previousinput, which is “I had a dream about gold”  This should pick up this response. Stumped.

 

 
  [ # 3 ]

First: b: (no ~no)  OK, I thought you would want to know the meaning of this kind of dream.  ^keep ( ) ^poptopic ( )  should be an a: 
Second: ^input adds an input to be processed as next sentence. But you have never declared the current sentence ended so you then call ^reuse, but its on the current sentence. What you should do instead is:
a: (yes ~yes) 
$_join = ^join( $$previousinput ” ” ‘_0 )
^analyze($_join)
^nofail ( TOPIC ^reuse( ~dreamdefine ) ) 
I dont really know whether you want to reuse dreamdefine or invoke it as a topic. thats your choice

 

 

 
  [ # 4 ]

One does ^respond on a topic and ^reuse on a rule

 

 
  [ # 5 ]

THANK YOU, it worked as you suggested!!!!! 

And now I know how to reuse input, thank you!!!!
Here is a fully formed outcome. Thank you again for your significant help!

TOPIC: ~dreamdefine nostay ( dream nightmare vision daydream dream chimera hallucination reverie trance insomnia dream_interpretation dream_analysis ) 

u: (_*)  This sounds like a dream. Do you want me to think about your dream and what it possibly indicates?
a: ( [ yes ~yes ~maybe ~tellmemore ] ) 
$_join = ^join( $repeatutterance1 ” ” ‘_0 )
^analyze($_join)
^nofail ( TOPIC ^reuse( ~dreamdefine ) ) 


a: ( [ no ~no ] )  OK, I thought you would want to know the meaning of this kind of dream.  ^keep ( ) ^poptopic ( )

a: (*)  OK, I thought you would want to know the meaning of this kind of dream.  ^keep ( ) ^poptopic ( )

 

 
  login or register to react