-
Notifications
You must be signed in to change notification settings - Fork 144
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
Optionals issue with non-English (Arabic) #333
Comments
Hello, This has been a problem affecting the JavaScript version for a while (putting [*] on either side of Unicode text), so a while back I added a work-around command for this specific use case:
Put a "?" symbol in place of the "+" and remove the [*] optional wildcards from either end. It makes it a "keyword trigger" which tries various different formats of wildcard to make a +Trigger that simply checks that the keyword is in the message "somewhere". More information about the bug can be found in #147 and other issues with the unicode tag. The root cause is that the [optional] syntax in RiveScript gets turned into a regexp that uses the word-boundary metacharacter "\b" and in JavaScript the "\b" doesn't consider Unicode characters to be words. |
Sorry for long time without reply..
But it wasn't the best choice for sure. So "?" will be very useful and clean code instead of this trick. Oh i was wondering..Does this problem happen in other language implementations? |
I tested some of the other versions (Go, Perl and Python). It seems the Go version has a similar bug, but it works in the Perl and Python versions. I tested this on the Python version and it worked fine:
And Perl:
|
English works fine with that:
+ [*] welcome [*]
But when I type Arabic letters it doesn't work..
+ [*] مرحبا [*]
I usually use optionals in my triggers so it's a serious problem for me :v , also I tried many times to fix that issue.. So I think it's a unicode problem.
The text was updated successfully, but these errors were encountered: