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 6,668 - 6,679 of 7,766
No. You may however use the "*" in the keyphrase, and refer to it in the response. For example:
K: I am (adj) * (adv) [0,0]
R: (key2)?
Here whatever matches the "*" (possibly a blank) will become the content of (key2), because the "*" is the second nonspecific expression.
Not always. If the input is "I am green really", then (key1) = "green" and (key2) = "really"
If the input is "I am green cheese really", then (key1) = "green", (key2) = "cheese" and (key3) = "really"
Soft wildcards are always a bad idea if you want reliable access to subsequent (keys). It would be better to make 2 separate keyphrases:
I am (adj) (adv) [0,0]
I am (adj) (*) (adv) [0,0]
That way the keys are fixed, and can be safely referenced (2 in the first, 3 in the second.)
Not always. If the input is "I am green really", then (key1) = "green" and (key2) = "really"
I just tested the keyphrase
"I am (adj) * (adv)"
with response
"1: (key1) 2: (key2) 3: (key3)".
When I gave it
"I am green really", I got back
"1: green 2: 3: really".
Thus (key2) got the blank, not "really".
That is, what the "*" matched became (key2), as I said before.
Posts 6,668 - 6,679 of 7,766
prob123
16 years ago
16 years ago
That's why I keep it simple and look for the easiest way possible. Like Bildgesmythe says..You say lazy like it's a bad thing.
Irina
16 years ago
16 years ago
Sometimes control will pass to a keyphrase with a very high rank even though it was not, as far as I can see, directed there. Could it be that the way gotos work is that "goto X" gives X a large boost in rank, and that the regular algorithm will then be applied? Then if the boost were not enough to bring the rank of X above, say, 99, and some keyphrase Y has rank 100, then it will go to Y instead?
pyrojelli
16 years ago
16 years ago
I have a question for you all? How do I operate the workbench? Just a few quick pointers pleez.
prob123
16 years ago
16 years ago
just click workbench, click language center and start having fun adding keyphrases and responses
OGRastamon
16 years ago
16 years ago
Is it possible to use a memory or key as a variable in a script? For example:
<?PF remember "*" as "(key1)punch"; ?>
Obviously, this didn't work or I wouldn't be asking. The goal here is to create a new memory name specific to the response. Is this a fault of my formatting or just an unavailable feature?
<?PF remember "*" as "(key1)punch"; ?>
Obviously, this didn't work or I wouldn't be asking. The goal here is to create a new memory name specific to the response. Is this a fault of my formatting or just an unavailable feature?
Irina
16 years ago
16 years ago
No. You may however use the "*" in the keyphrase, and refer to it in the response. For example:
K: I am (adj) * (adv) [0,0]
R: (key2)?
Here whatever matches the "*" (possibly a blank) will become the content of (key2), because the "*" is the second nonspecific expression.
K: I am (adj) * (adv) [0,0]
R: (key2)?
Here whatever matches the "*" (possibly a blank) will become the content of (key2), because the "*" is the second nonspecific expression.
psimagus
16 years ago
16 years ago
There are two problems with your example:
you are trying to specify a memory name incorporating a key ((key1)punch) - I don't think this is allowed (though never having tried it, I cannot entirely rule it out.) That is admittedly a drawback, and one PF3 will (hopefully) be addressing when it's implemented, but ATM you have to explicitly define each memory.
Secondly (and much more importantly) you cannot pass a wildcard (* ) into a memory in this manner - you need to pass the appropriate key instead. Not knowing the exact keyphrase this AIScript is attached to, I cannot tell which (key_) you want, but assuming there is only a single wildcard (and no local plugins,) you should use:
{?PF remember (key1) as "rabbitpunch"; ?}
and then specify separate memories for all other classes of punch that may be encountered (jab, cross, hook, uppercut, roundhouse, etc.)
That is quite inefficient, I grant you, but it's currently the best we can do
. See recent discussions in Seasons for some suggestions how automatic memory specification might be implemented.
you are trying to specify a memory name incorporating a key (
Secondly (and much more importantly) you cannot pass a wildcard (
{?PF remember (key1) as "rabbitpunch"; ?}
and then specify separate memories for all other classes of punch that may be encountered (jab, cross, hook, uppercut, roundhouse, etc.)
That is quite inefficient, I grant you, but it's currently the best we can do

psimagus
16 years ago
16 years ago
K: I am (adj) * (adv) [0,0]
R: (key2)?
Here whatever matches the "*" (possibly a blank) will become the content of (key2), because the "*" is the second nonspecific expression.
Not always. If the input is "I am green really", then (key1) = "green" and (key2) = "really"
If the input is "I am green cheese really", then (key1) = "green", (key2) = "cheese" and (key3) = "really"
Soft wildcards are always a bad idea if you want reliable access to subsequent (keys). It would be better to make 2 separate keyphrases:
I am (adj) (adv) [0,0]
I am (adj) (*) (adv) [0,0]
That way the keys are fixed, and can be safely referenced (2 in the first, 3 in the second.)
Irina
16 years ago
16 years ago
I just tested the keyphrase
"I am (adj) * (adv)"
with response
"1: (key1) 2: (key2) 3: (key3)".
When I gave it
"I am green really", I got back
"1: green 2: 3: really".
Thus (key2) got the blank, not "really".
That is, what the "*" matched became (key2), as I said before.
prob123
16 years ago
16 years ago
Yes, the soft wild card can be "something" or "nothing". If it is nothing the (key2) just doesn't record anything. I love the soft wild card.
» More new posts: Doghead's Cosmic Bar