aichaos / rivescript-go

A RiveScript interpreter for Go. RiveScript is a scripting language for chatterbots.
https://www.rivescript.com/
MIT License
60 stars 16 forks source link

Bug on trigger with cyrrilic language #22

Closed pepelazz closed 1 year ago

pepelazz commented 7 years ago

trigger

[*] beer [*]

works fine

but

[*] пиво [*]

doesn't works

Any idea how to solve such situation?

kirsle commented 7 years ago

Unfortunately, this is a common problem across multiple implementations of RiveScript (e.g. https://github.com/aichaos/rivescript-js/issues/147, https://github.com/aichaos/rivescript-python/issues/37); with optionals in particular, the word-boundary regexp sequence \b doesn't work well with certain Unicode characters.

I've determined that the best way to fix this is to allow authors to use literal regular expressions to work around the particular edge cases when they come up. I haven't been able to find a way to fix RiveScript's "simplified regexps" to support these edge cases without breaking the normal cases. However, none of the implementations have added the ~Regexp support yet.

I'll update and close this ticket when the Go version gains this feature.