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

Using Persian language in rivascript #393

Open
hamidreza01 opened this issue Apr 22, 2022 · 5 comments
Open

Using Persian language in rivascript #393

hamidreza01 opened this issue Apr 22, 2022 · 5 comments

Comments

@hamidreza01
Copy link

Hi, do I encounter syntax error while using rivaScript with Persian? Do you know any way to fix it?

@hamidreza01
Copy link
Author

hamidreza01 commented Apr 22, 2022

using '?' :
image
using '+ :
image

@kirsle
Copy link
Member

kirsle commented Apr 26, 2022

Hey @hamidreza01 be sure that UTF-8 mode is enabled and these should parse correctly.

The ? command is a special workaround for if you want a "keyword trigger" where it matches if the word is used anywhere in the user's message (equivalent to a trigger of + [*] word [*] but due to JavaScript Unicode issues with that syntax, the ? command was added).

@hamidreza01
Copy link
Author

hamidreza01 commented Apr 28, 2022

Thank you and your wonderful library, do you just have a solution for the following command?

? [*] سلام [*]
It does not work when it is in Persian, but it works well when it is in English

@kirsle
Copy link
Member

kirsle commented May 9, 2022

Hey @hamidreza01

I think this command may work:

? سلام

The [*] wildcards surrounding the word aren't necessary, as the ? command basically provides the functionality that the [*] wildcards were trying to provide. So if the word "سلام" is seen anywhere in the user's message the above trigger should (hopefully) match it.

@hamidreza01
Copy link
Author

Yes, fortunately, or perhaps unfortunately, it works. But what should I do if I want it not to work for other sentences?

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