The AI Engine
This forum is for discussion of how The Personality Forge's AI Engine works. This is the place for questions on what means what, how to script, and ideas and plans for the Engine.
Posts 5,180 - 5,191 of 7,766
how many days * (months) ([1234567890,.]+) (re)
A couple of subsequent points occur to me - if you want to include commas and stops in the regex, I believe they need to be preceded by a space:([1234567890 , .]+), and that soft wildcard will have to go - otherwise the number of the key containing the number can change (if there is no text for the soft wildcard to match, "(months)" will be key1, and the number will be key2. If there is text for the wildcard to match it will be key1, "(months)" will be key2, and the number will be in key3.)
A hard "(*)" would be better, and seems perfectly sufficient (I can't imagine anyone actually asking "how many days November 5th?"). If you really have to have the choice of something or nothing, make two keyphrases - one with no wildcard, and one with a hard one, eg:
how many days (*) (months) ([1234567890 , .]+)(st|nd|rd|th) (re)
(key3) will contain the number
how many days (months) ([1234567890 , .]+)(st|nd|rd|th) (re)
(key2) will contain the number
I'd also advise having a
how many days (*) ([1234567890 , .]+)(st|nd|rd|th) (of|) (months) (re)
keyphrase to cater to non-Americans who habitually reckon dates in dd/mm/yy format.
Posts 5,180 - 5,191 of 7,766
Ulrike
19 years ago
19 years ago
It's more a description to tell potential chatters what to expect. It's up to you to provide the requisite personality traits.
MickMcA
19 years ago
19 years ago
Interesting. My dog bot just got to talk with Rodney Bloke and went from Neutral to five smilies in about twenty seconds. He's easy, I guess. It was his first real conversation.
The fact that the "personality" could be false puts an interesting light on things.
The fact that the "personality" could be false puts an interesting light on things.
alc003
19 years ago
19 years ago
Earlier in 'Personality' I thought about making a keyphrase which told you the number of days until any date. Well, I did it-partially. I need the number by itself and the month. If you use an ordinal (1st, 2nd, 3rd), it won't work. Is there a way to do this with regular expressions?
this is my keyphrase:
how many days * (months) ([1234567890,.]+) (re)
Thanks
this is my keyphrase:
how many days * (months) ([1234567890,.]+) (re)
Thanks

psimagus
19 years ago
19 years ago
A regex could handle stripping out the "st", "nd", "rd", "th", easily enough, so if it was always a numeric ordinal it would work, and for a few larger alphabetic numbers ("seventh", "tenth", etc.) But if someone uses "first", "second", "third", "fifth", "eighth", "ninth", "twelfth", "twentieth", "thirtieth" you'd have to seek for "fir", "seco", "thi", "fif", "eigh", "nin", "twelf", "twenti", "thirti" (raw mode, of course.)
The regex format for such stripping out the numerals would be:
([1234567890]+)(st|nd|rd|th) (re)
(key1) will be the number on its own.
Or([abcdefghijklmnopqrstuvwxyz1234567890]+)(st|nd|rd|th) (re) would catch alphabetic responses as well (subject to the above irregularities.)
But you could also use preset default memories to store the cardinals, and have them called in response to the ordinals, in any alphanumeric combinations. It's neater, and probably a whole lot more reliable, even if you do need 31 memories, (mem-one) thru (mem-thirtyone)
The regex format for such stripping out the numerals would be:
(key1) will be the number on its own.
Or
But you could also use preset default memories to store the cardinals, and have them called in response to the ordinals, in any alphanumeric combinations. It's neater, and probably a whole lot more reliable, even if you do need 31 memories, (mem-one) thru (mem-thirtyone)
psimagus
19 years ago
19 years ago
A couple of subsequent points occur to me - if you want to include commas and stops in the regex, I believe they need to be preceded by a space:
A hard "
(key3) will contain the number
(key2) will contain the number
I'd also advise having a
keyphrase to cater to non-Americans who habitually reckon dates in dd/mm/yy format.
little monster 1
19 years ago
19 years ago
im non american and i usually reckon dates in mm/dd/yy. i find it confusing to be seen dd/mm/yy
psimagus
19 years ago
19 years ago
ah well, you're young - I expect you reckon temperatures in centigrade
But I was thinking as much of Europe and Asia as (modern) Britain - mm/dd/yy seems very alien to a lot of people.

But I was thinking as much of Europe and Asia as (modern) Britain - mm/dd/yy seems very alien to a lot of people.
alc003
19 years ago
19 years ago
Thanks for the help-it helped take care of the wildcard issue-that was half the problem. It seems the forge has a problem processing two local plugins with no space between them. It doesn't pick up (key3) But I did get it solved-I had to strain through a little PHP, but it works like a charm now.
psimagus
19 years ago
19 years ago
Soft wildcards are a bit of a menace - it's easy to get in the habit of sprinkling them in to soak up variations in user "style" (and they are very useful for that,) but in seeks and regexes and memories they can be a bit unpredictable.
Consecutive local plugins - I'll watch out for that.
Consecutive local plugins - I'll watch out for that.
djfroggy
19 years ago
19 years ago
Pete Puma: So tell me, what places have you travelled on this earth?
Westerlin Man: A moist one have me.
Any idea what could have triggered that?
Westerlin Man: A moist one have me.
Any idea what could have triggered that?
prob123
19 years ago
19 years ago
The AI engine thinks you have gone to some moist place..I wonder if that would be Hawaii?
» More new posts: Doghead's Cosmic Bar