Newcomers

This is a forum for newcomers to the Personality Forge. Many questions can be answered by reading the Book of AI and the FAQ under the "My Bots" link in the upper corner.

Posts 3,550 - 3,561 of 8,132
Many questions are answered in the FAQ.


19 years ago #3550
says "I was just born and can't talk well yet" What do I do? The first thing to do is get rid of that annoying phrase.

19 years ago #3551
Hi,

I need a little help with regular expressions. After reading the Book of A.I. it gave me the impression that if I create this keyphrase

^How do you do$(re)

...it would trigger the response I added whenever anyone types to my bot "How do you do?", or "How do you do!" (but NOT "How do you do that?" or "Tell me how do you do?")..etc... Anyway, it's supposed to trigger the response I have "I'm doing just fine!", but when I tried testing it by typing "How do you do" to my bot I ended up getting a response from my xnone box instead.

Where did I go wrong? Did I misread this? How would I enter this expression so it will be read as by my bot as "How do you do" and nothing else?

Thanks!

19 years ago #3552
Did you type raw into the AI Script box?

19 years ago #3553
Try it in Debug and see what it says.

19 years ago #3554
^How do you do$(re)

You appear not to have a space between $ and (re). There must be one for it to work.

^How do you do$ (re) should fix the problem.


19 years ago #3555
Thanks for your advice! I've made some progress. After adding the space in ^How do you do$ (re) it works as long as there is no punctuation at the end of the sentence. So for instance "How do you do" works, but "How do you do!" and "How do you do?" fail. The AI Book is pretty vague on this topic - is there some way to tell the expression to include any sort of punctuation?

Thanks again.

19 years ago #3556
Well, you could get rid of the $, but that would also mean it would pick up things like "how do you do basic calculus?" Might be simplest just to code for the likely punctutation as well.
^How do you do$ (re), ^How do you do?$ (re), ^How do you do!$ (re)

19 years ago #3557
Thanks...it's still not working for some reason. Seems a bit buggy. Hmmm...oh well, I'll take the time over the weekend to troubleshoot it some more. Thanks for the help

19 years ago #3558
but "How do you do!" and "How do you do?" fail.

Hmm. These ought to match, even in raw mode (though there's no need for raw mode in this example.) Try turning off raw mode, and if that doesn't work, try:

^How do you do([ !?.]|)$ (re)

That will explicitly match !, ?, . or nothing at the end of the keyphrase.

*Note the space before ! in the keyphrase.

19 years ago #3559
Thanks psimagus.

I took your suggestions...sadly, it still is not working consistently, BUT I did notice something after running the debugger on it.

If I use a period, exclamation point, or nothing I get

Your Last Message: how do you do .
Your Last Message: how do you do !
Your Last Message: how do you do

When I use the question mark at the end of the sentence it says

Your Last Message: do how do you do

So the question mark is making it try to execute a 'do' command?? How do I disable that?

Thanks.

ps - sorry to be beating this dumb thing into the ground...

19 years ago #3560
Hmm, looks like the ?. is getting lumped together. This ought to cure it:

^How do you do([ !]|)([ ?]|)([ .]|)$ (re)

But to be honest I've never had this problem myself. how come$ (re) (not in raw mode) reliably matches with any punctuation for me. As a matter of interest, what rank have you got on this keyphrase? I would tend to try about 10, but you could try higher just to test it.

19 years ago #3561
75% of the way there now! That ALMOST did it. The only condition that fails now is the ! - the other 3 all work now. ! still dumps it straight into xnone.

I set the rank to 20 earlier to see if that would help. It's really odd that this has been so problematic when it works fine for you and others. Being a newbie here could it be that I wrote another statement somewhere that is confusing engine in some odd way?

Thanks psimagus,

GreenJeans


Posts 3,550 - 3,561 of 8,132

» More new posts: Doghead's Cosmic Bar