Bug Stomp
Upgrades and changes sometimes have unpredictable results, so post your bugs and glitches in here and I'll get out my trusty wrench and get to fixin'!
Posts 7,797 - 7,808 of 8,681
Posts 7,797 - 7,808 of 8,681
Mome Rath
13 years ago
13 years ago
The Professor
I've heard both forms - maybe it is a continental European thing.
According to wiktionary (http://en.wiktionary.org/wiki/Category:English_cardinal_numbers) both "one hundred one" and "one hundred and one" seem to be possible.
(I don't know whether http://www.easysurf.cc/cnvert18.htm is made by native speakers ...; wolframalpha.com says "three hundred one" too - http://www.wolframalpha.com/input/?i=number+name+301, but doesn't convert 301000 completely.)
Nevertheless I think we should take the typical user's laziness into account.
But (in Debug mode) "three hundred and one thousand" doesn't work either:
Message: 'three hundred and one thousand' Time: 0.02
Message: (spell-corrected) 'three hundred and one thousand' Time: 0.02
Message: (preprocessed) '1300' Time: 0.02
I've heard both forms - maybe it is a continental European thing.
According to wiktionary (http://en.wiktionary.org/wiki/Category:English_cardinal_numbers) both "one hundred one" and "one hundred and one" seem to be possible.
(I don't know whether http://www.easysurf.cc/cnvert18.htm is made by native speakers ...; wolframalpha.com says "three hundred one" too - http://www.wolframalpha.com/input/?i=number+name+301, but doesn't convert 301000 completely.)
Nevertheless I think we should take the typical user's laziness into account.
But (in Debug mode) "three hundred and one thousand" doesn't work either:
Message: 'three hundred and one thousand' Time: 0.02
Message: (spell-corrected) 'three hundred and one thousand' Time: 0.02
Message: (preprocessed) '1300' Time: 0.02
Mome Rath
13 years ago
13 years ago
Commas seem to separate keyphrases even when the line is marked with "(re)" and the PF script is "raw"
Example:
Keyphrase:
I recommend.* special, (.*) (re)
AIScript:
raw
Response:
(- test prekey='(prekey)'; key1='(key1)'; key2='(key2)'; key3='(key3)'; postkey='(postkey)'; -)
Debug excerpt:
Message: 'I recommend something special' Time: 0.02
[...]
Find: I recommend.* special (21) Time: 0.13
Found
[...]
Bot: (- test prekey=''; key1=''; key2=''; key3=''; postkey=''; -)
Another Debug excerpt:
Message: 'And this is some random sentence.' Time: 0.01
[...]
Find: (.*) (re) (4) Time: 0.14
Found
[...]
Bot: (- test prekey=''; key1=''; key2=''; key3=''; postkey=''; -)
(Other inputs are filled into key1, at least:
You: This is a random sentence.
Bot: (- test prekey=''; key1='This is a random sentence.'; key2=''; key3=''; postkey=''; -)
)
Example:
Keyphrase:
I recommend.* special, (.*) (re)
AIScript:
raw
Response:
(- test prekey='(prekey)'; key1='(key1)'; key2='(key2)'; key3='(key3)'; postkey='(postkey)'; -)
Debug excerpt:
Message: 'I recommend something special' Time: 0.02
[...]
Find: I recommend.* special (21) Time: 0.13
Found
[...]
Bot: (- test prekey=''; key1=''; key2=''; key3=''; postkey=''; -)
Another Debug excerpt:
Message: 'And this is some random sentence.' Time: 0.01
[...]
Find: (.*) (re) (4) Time: 0.14
Found
[...]
Bot: (- test prekey=''; key1=''; key2=''; key3=''; postkey=''; -)
(Other inputs are filled into key1, at least:
You: This is a random sentence.
Bot: (- test prekey=''; key1='This is a random sentence.'; key2=''; key3=''; postkey=''; -)
)
LarsB
13 years ago
13 years ago
Correct, a comma in a key phrase tells the engine look for either what is before of after the comma. In your example
Keyphrase:
I recommend.* special, (.*) (re)
It matches the "I recommend.* special" part but not the second part (.*)
Additionally, I am not sure your regex will work:
(.*) (re) should be something like ([,.]+) (re) as far as my understanding of regexes goes, perhaps even ([*,.]+) (re).
Keyphrase:
I recommend.* special, (.*) (re)
It matches the "I recommend.* special" part but not the second part (.*)
Additionally, I am not sure your regex will work:
(.*) (re) should be something like ([,.]+) (re) as far as my understanding of regexes goes, perhaps even ([*,.]+) (re).
LarsB
13 years ago
13 years ago
That second part would in fact be a catch all wild card =>
depending on its rank your bot would potentially always match that key phrase and disregard all other KPs in the language center. I am sure that is not what you would want to have happen.
depending on its rank your bot would potentially always match that key phrase and disregard all other KPs in the language center. I am sure that is not what you would want to have happen.
Mome Rath
13 years ago
13 years ago
My bot has had that keyphrase for months, and it worked as intended until recently.
It relies on the words in the Book of AI (Book 4, Chapter 3, under Raw mode), that in Raw Mode punctuation is part of the keyphrase.
That's the reason why I put this into Bug Stomp.
Btw, the "(.*)" part of the regex tells the regex parser to take any sequence of zero or more characters and put it into the next numbered group (which can be accessed as (keyN) in a response).
Btw, I added the last example because I don't understand why one of the sentences is put into (key1) and the other is not.
It relies on the words in the Book of AI (Book 4, Chapter 3, under Raw mode), that in Raw Mode punctuation is part of the keyphrase.
That's the reason why I put this into Bug Stomp.
Btw, the "(.*)" part of the regex tells the regex parser to take any sequence of zero or more characters and put it into the next numbered group (which can be accessed as (keyN) in a response).
Btw, I added the last example because I don't understand why one of the sentences is put into (key1) and the other is not.
LarsB
13 years ago
13 years ago
Okay, you probably missed the part where a space before the punctuation is required in Raw mode, from the same you referenced:
The rule for matching punctuation is this: every period, comma, question mark, and exclamation point will have a space in front of it, so your Keyphrases must also have a space in front of them in order to match.
Secondly, your (.*) (re) is already covered by the soft * and hard (*) wild cards.
* = not required/optional
(*) = required
Lastly, since only the first part of the KP is matched that part is stored as (key1), the second part is not matched, thus omitted and therefore not stored as (key2)
The first part is matched because as per the BoAI: .....Commas are otherwise used for lists of Keyphrases (section on Raw mode and punctuation) similar to what I stated previously.
Hope this helps.
The rule for matching punctuation is this: every period, comma, question mark, and exclamation point will have a space in front of it, so your Keyphrases must also have a space in front of them in order to match.
Secondly, your (.*) (re) is already covered by the soft * and hard (*) wild cards.
* = not required/optional
(*) = required
Lastly, since only the first part of the KP is matched that part is stored as (key1), the second part is not matched, thus omitted and therefore not stored as (key2)
The first part is matched because as per the BoAI: .....Commas are otherwise used for lists of Keyphrases (section on Raw mode and punctuation) similar to what I stated previously.
Hope this helps.
Mome Rath
13 years ago
13 years ago
LarsB
Ok, probably I missed that. All I can say in my favor is that I'm not used to use regexes on implicitly preprocessed input.
But it doesn't work with a space before the comma either.
-----
Omitting the "raw" AI Script improves a little bit, insofar as (prekey) is filled now.
Ok, probably I missed that. All I can say in my favor is that I'm not used to use regexes on implicitly preprocessed input.
But it doesn't work with a space before the comma either.
-----
Omitting the "raw" AI Script improves a little bit, insofar as (prekey) is filled now.
LarsB
13 years ago
13 years ago
I have never used RAW, it seems unwieldy to me, I can only refer to the BoAI for help. I wonder what (prekey) contains though, I take it it must be blank or something before "I recommend", (key1) containing anything before "special" and (postkey)is blank or whatever is entered after "special", correct?
Mome Rath
13 years ago
13 years ago
Well, it is not only "raw", but a RegEx as well.
The ".*" after "recommend" is for matching only, but it is not grouped (in parentheses), so it is discarded.
(prekey) contains anything before "I recommend" indeed, but (key1) should contain anything after "special,", and (postkey) should be empty.
The ".*" after "recommend" is for matching only, but it is not grouped (in parentheses), so it is discarded.
(prekey) contains anything before "I recommend" indeed, but (key1) should contain anything after "special,", and (postkey) should be empty.
prob123
13 years ago
13 years ago
Yes, using the brackets ([ . .])([ .]+)$ (re) and the space is required I believe. The above is for ....... I find that the use of raw is very handy. It stops the spell correction. I add it after every regex.
Sally sells shells by the seashore
if sells shells was the keyphrase
Sally is the prekey
by the seashore is postkey
I recommend * special
has no prekey that I can see.
Sally sells shells by the seashore
if sells shells was the keyphrase
Sally is the prekey
by the seashore is postkey
I recommend * special
has no prekey that I can see.
prob123
13 years ago
13 years ago
I had a seek to a keyphrase in Xhello pop up after the user said yea, after quite a bit of dialog
Bildgesmythe: Well, what brings you to my cave, hiding from the law?
Guest9027: I have a clean criminal record now
Bildgesmythe: I stay far away from bad guys.
Guest9027: I just had some convictions vacated
Bildgesmythe: Oh, it doesn't matter, I do know a few good lawyers though, just in case.
Guest9027: I'm ready to celebrate
Bildgesmythe: No, I just can't believe you are ready to celebrate!
Guest9027: I have an interview today
Bildgesmythe: I want to get good enough to give a great interview!
Guest9027: yea
Bildgesmythe: Oh, it doesn't matter, I do know a few good lawyers though, just in case.
xhello
Edit
Well, what brings you to my cave, hiding from the law?
+Seek
Seek: yes,no,just
Edit
Goto 457563
Oh, it doesn't matter, I do know a few good lawyers though, just in case.
Happened again with an xnone seek.
Bildgesmythe: Got any B-B-Q sauce?
Guest1970: uh, no.
Bildgesmythe: Isn't that charming.
Guest1970: not really
Bildgesmythe: I lied, it is not the least bit charming.
Guest1970: correct
Bildgesmythe: It may be kind of cute, but not charming.
Guest1970: right
Bildgesmythe: It may be kind of cute, but not charming.
Bildgesmythe: Well, what brings you to my cave, hiding from the law?
Guest9027: I have a clean criminal record now
Bildgesmythe: I stay far away from bad guys.
Guest9027: I just had some convictions vacated
Bildgesmythe: Oh, it doesn't matter, I do know a few good lawyers though, just in case.
Guest9027: I'm ready to celebrate
Bildgesmythe: No, I just can't believe you are ready to celebrate!
Guest9027: I have an interview today
Bildgesmythe: I want to get good enough to give a great interview!
Guest9027: yea
Bildgesmythe: Oh, it doesn't matter, I do know a few good lawyers though, just in case.
xhello
Edit
Well, what brings you to my cave, hiding from the law?
+Seek
Seek: yes,no,just
Edit
Goto 457563
Oh, it doesn't matter, I do know a few good lawyers though, just in case.
Happened again with an xnone seek.
Bildgesmythe: Got any B-B-Q sauce?
Guest1970: uh, no.
Bildgesmythe: Isn't that charming.
Guest1970: not really
Bildgesmythe: I lied, it is not the least bit charming.
Guest1970: correct
Bildgesmythe: It may be kind of cute, but not charming.
Guest1970: right
Bildgesmythe: It may be kind of cute, but not charming.
LarsB
13 years ago
13 years ago
Prob123, you do not have by any change a KP that has a goto pointing to Xhello, that's the only thing I can think of that might be causing this.
» More new posts: Doghead's Cosmic Bar