Closed mariusursache closed 9 years ago
Ah... regarding this:
Only wildcards that are NOT ZERO length can be used to capture input. So wildcards will not capture the text back, but exact length wildcards and optionals will capture the input.
Actually optionals don't capture the input right now. Maybe they should, though... Right now, capturing works for variable-length, fixed-length wildcards, alternates and wordnet.
Correct. I had an issue trying to capture zero length things because we gobble up the sentence boundary and I don't know if we are capturing the word in question, or the next word - false positive.
Here are the tests for wildcard behaviour. https://github.com/silentrob/superscript/blob/master/test/script.js#L9-L210 And the fixture https://github.com/silentrob/superscript/blob/master/test/fixtures/script/script.ss
Also, relevant Ive added matching interface just a few weeks back and is slightly more powerful, but has yet to be documented.
Min/Max Wildcards
*(n-m)
Where n is min, and m is max.
https://github.com/silentrob/superscript/blob/master/test/script.js#L114-L143
I believe *(n)
defaults to exact match behaviour.
I am documenting the new behavior in the new documentation. We can close this issue.
Need clarification on which wildcards are capturable.
Currently, the current SuperScript docs are a bit confusing on this matter:
then
And your comment in #14:
Testing the following scenarios with the user input
Hello John
with the samehello back <cap>
reply:hello *~2
hello *~2
hello *~2
hello (*~2)
hello (*~2)
hello (*~2)
hello *1
hello *
This is from a previous reply on chatbots.org and makes things clear (also SS works this way now—tested:
Let me know if this is right, and I will update the wiki draft documentation with it.