AI Zone Admin Forum Add your forum
Basic question from a beginner
 
 

Hello !
I would like to get only one word in a sentence but it doesn’t work :

t[Hello] [Hi] [Hey]what's your name?
 u: ({"my name is"} _*1)
 $name = '
_0
 Hi $name 

If i write “my name is Phil Norly”, i get “Hi Phil Norly!” whereas i want “Hi Phil!”.
with

u: ({"my name is"} _*>) 

it doesn’t work neither.
It should not match with “my name is Phil Norly” (because there are 2 words after “my name is”) but it does. Why?

How should i do? I thank you in advance.

 

 
  [ # 1 ]

ChatScript automatically converts proper names into single tokens. So the tokenization of your input is “my name is Phil_Norly”.

You can do this..

u: ({“my name is”} _*1 >) _0 = burst(_0 _ ) 

to burst the matched value into pieces

 

 
  [ # 2 ]

Oh, ok ! So, it’s not a bug it’s a feature ! smile

The strange thing is that it works if i write “Phil Norly” (i get “Hi Phil!”) but not if i write (“my name is Phil Norly”).

With “my name is Phil Norly” i get the generic “Hey, sorry. What were we talking about?”

Is there something that i don’t understand with the {} expressions?

 

 
  [ # 3 ]

No. You understood {} correctly.
And you have stated it WORKED for you earlier.
This suggests that after working once, you have not started the bot with a fresh
user, so the line gets erased because you didnt add noerase() to the output

 

 
  [ # 4 ]

When doing “build 1”, i get the message : “* Warning- is” is unknown as a word in pattern”. Why?
Line “u: ({“my name is”} _*1 >) _0 = burst(_0 _ ) ” is wrong?

 

 
  [ # 5 ]

shouldn’t be getting that message. “is” is obviously a word and is known to the system.
I don’t get that message.

First things first…. are you in synch with the latest version released on sourceforge?
if not, then synch.
if so, then email me the file you are trying to build and let me try that.  gowilcox at gmail

 

 
  [ # 6 ]

This is a real basic question.  I am refamiliarizing (getting serious about it now :] ), myself with Chatscript and running back through your ChatScript tutorial.  When using this code..

topic: ~introductions noerase repeat []
t: [Hello] [Hi] [Hey], I will help you plan your travel. Just tell me where you are and
where you want to go to.
u: (be * [at in] _*)
OK, you want to go from _0.
$source = ‘_0
u: ([go fly travel] to _*)
$target = ‘_0
OK, you want to go to $target .
u: (what do I want)
You want to go from $source to $target .

I get this dialog transaction…..

1   I am at Earth. ==>  OK, you want to go from Earth. 
2   No, I am at work. ==>  OK, you want to go from. 
3   No, I am at school. ==>  OK, you want to go from school. 

My question is on #2.  Why doesn’t the word “work” show up in the bots return statement?

Thanks!

 

 
  [ # 7 ]

Also any hints on why these the following dialogs come out the way they do.  (using the same code as above)

5   I am in the office ==>  OK, you want to go from The Office. 
6   I am in my office. ==>  OK, you want to go from I office

#5 why is “The” capitilized in the response
# 6 I understand that the canonical of “my” is “I”.  Must be a simple rule to write to get “my” to come out as “your” in the bot response.

Thanks again ahead f time.

 

 
  [ # 8 ]

The first thing to do when debugging is type in an input with :prepare.  E.g :prepare I am at work.
This tells you how the system viewed your input. WordNet, as it turns out, has “at_work” as a single word, so the system smooshed them together and thus didn’t see them as two words. I have removed this from my dictionary. Until I upload a new version, you could edit DICT/a.txt to remove the lines for that entry, erase dict.bin, and then run Chatscript.

The_Office is the name of tv show in RAWDATA/WORLDDATA/movies_tv.tbl.  You could remove that entry and then :build 0 to get rid of it.

 

 

 
  [ # 9 ]

Then, for your application, you probably dont want it matching ANY movie or tv name, so you either delete the file and rebuild OR removed the reference to the file from files0.txt and rebuild.

For pronoun flipping you want ^pos(pronoun ‘_0 flip) but be careful to use the std keyboard apostrophe and not the fancy tilted one this edit window chose to display with.

 

 
  [ # 10 ]

Thank you Bruce!  I am re-reading the User Manual and taking notes so as not to bug the forum with to many questions that have answers already in the docs or forums.

 

 
  [ # 11 ]

No problem. I am overdue on rewriting the manual, breaking out separate manuals for facts, debugging, analytics etc

 

 
 
  login or register to react
‹‹ "Smart Chat"      How to access tables? ››