AI Zone Admin Forum Add your forum

NEWS: Chatbots.org survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

leading and trailing blanks in user sentence
 
 

Question is : Rivescript doen’t cut the trailing blanks after cleaning punctuation symbols
(I’am using the javacript interpreter,from aichaos/rivescript-js )

for example, with :
+ do you love me
- yes, i do !

if user enter :
do you love me ? (with a blank before ? ), this doen’t match
do you love me?  works well
  do you love me? doesn’t match

I can cut leading blanks before sending the sentence outside RiveScript, but not trailing as the ? are splitted inside interpreter,

=> this must be done inside interpreter.  Is there some option that miss me ?

 

 

 
  [ # 1 ]

I tried this in the python interpreter, 1.8.0, and it doesn’t match “do you love me ?” either, but it does match ” do you love me?”

 

 
  [ # 2 ]

This is probably something to enhanced also in py as you cannot pre-process yourself, as punctuation removal is under interpreter’s responsibility and arrived later.
I just started Rivescript a few days ago and was very surprised that this elementary cleaning was not done: you cannot test with ..me? me ? me ?  by subst.

 

 
  [ # 3 ]

I really like Rivescript, but I think the user base just isn’t big enough to find all the little issues like this. I experimented some more, and
“do you   love me”
with extra spaces between you and love does not match, and neither does
“do you
love me”
with a newline in the middle, but this does match:
“do you lo
ve me”

 

 
  [ # 4 ]

I had not yet test your cases, but it seems also to be enhanced as a basic normalization of string spaces before processing.
Nevertheless, it can be done under developer’s responsibility before submission ( reduce several spaces as a single one ). The previous problem cannot be done before, as the symbols removal is done inside the interpreter. As a future, the best way probably could be to inject (or overload) normalizations we want to apply at the different steps. For these days i’ll clean spaces before entering Rivescript.

 

 
  [ # 5 ]

The space trimming issue (removing spaces from the start and end of the message) has been fixed in the JS version as of v1.1.8; I found the issue is also reproducible in the Python version and therefore probably all of the other versions.

I created a ticket on GitHub to keep track of this issue: https://github.com/aichaos/rivescript-js/issues/57

 

 
  login or register to react