Closed rmasci closed 4 years ago
The rivescript directive looks like this:
+ echo domain * - What is \<star1>
So I tried this with the rivescript command:
MyServer1:/opt/chatbot/rivescript$ /usr/local/bin/rivescript /opt/chatbot/rivescript
. .
.:...:: RiveScript Interpreter (Go)
.:: ::. Library Version: v0.3.0 (build -unknown-)
..:;;. ' .;;:..
. ''' . Type '/quit' to quit.
:;,:,;: Type '/help' for more options.
: :
Using the RiveScript bot found in: /opt/chatbot/rivescript
Type a message to the bot and press Return to send it.
You> echo domain www.google.com
RiveScript> What is wwwgooglecom
You>
It stripped off the '.' from www.google.com just like it did in my code -- is there a way around this?
Periods (and some other characters) are stripped by default. From the the docs:
// Make a new bot with UTF-8 mode enabled.
bot := rivescript.New(rivescript.WithUTF8())
// Override the punctuation characters that get stripped
// from the user's message.
bot.SetUnicodePunctuation(`[.,!?;:]`);
So to allow periods through you’d need to add that final line and edit it as such:
bot.SetUnicodePunctuation(`[,!?;:]`);
But yeah, I'd recommend reading the whole section in the the docs to get a better idea of what's going on: https://godoc.org/github.com/aichaos/rivescript-go#hdr-UTF_8_Support
OK So I have a rive script that looks like this:
Rivescript: + echo domain * - What is \<star1>
What is happening is that rivescript appears to be stripping off the . in urls. Not sure why...