Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sentence issue #7

Open
johnnymast opened this issue Aug 8, 2021 · 2 comments
Open

Sentence issue #7

johnnymast opened this issue Aug 8, 2021 · 2 comments

Comments

@johnnymast
Copy link

Hi,

While developing Rivescript-php I found yet another issue. This time it's in the playground.

+ sentence test 2
- roger this is: {sentence}first sentence with ucfirst. this is the second sentence with ucfirst{/sentence}

translates to

Bot: roger this is: First sentence with ucfirst. this is the second sentence with ucfirst

This is incorrect according to the docs this should translate to

Bot: roger this is: First sentence with ucfirst. This is the second sentence with ucfirst

How to fix:

Fix the code accordingly maybe trim the sentences. I have the same problem in the PHP version, I might trim the sentences I don't know yet.

@kirsle
Copy link
Member

kirsle commented Aug 13, 2021

Yeah unfortunately the {sentence} tag wasn't defined well enough that it should work across multiple sentences. I think your version would be the more correct way to handle the {sentence} tag.

When I was first designing RiveScript, my bot's use cases were that the user would only ask one question at a time (or else my program would split multiple sentences apart, and reply to each one in turn) and the {sentence} tag was mainly to use the user's recent message echoed back at them, like:

+ knock knock
- Who's there?

+ *
% who is there
- <sentence> who?

+ *
% * who
- Haha! {sentence}<botstar> <star>{/sentence}!

To which their current implementation works great! 🤣 Since you're writing a new module you should fix it properly in your version, I'm not sure if or when I'll update mine.

@johnnymast
Copy link
Author

Hi @kirsle ,

Currently, I have unit tests in place checking {sentence} (and other tags as well) work with multiple words or sentences within a wildcard parameter. I just created a new to-do that I have to check what will happen if I use more of the same tag in one sentence and if they will be replaced as well.

Let's say in this case.

+ What does your name mean
- <bot name>, the conqueror of worlds in search of 42 that's what <bot name> means.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants