alpha icon indicating copy to clipboard operation
alpha copied to clipboard

cannot use special charactor in the name ?

Open RonnSanji opened this issue 5 years ago • 2 comments

I use some special charactor like "?" in the name . the bot cannot reply and just hang there, how to solve this ?

RonnSanji avatar Apr 10 '19 01:04 RonnSanji

@CharlieIGG can you take a look into this?

kurenn avatar Apr 10 '19 14:04 kurenn

The current basic implementation for Alpha is not hooked up to DialogFlow or any other kind of NLP @kurenn @RonnSanji.

Instead of that it tests against pre-defined patterns, such as the following:

 /My\s+name\s+is\s+([A-zÁ-ÿ]+)/i,
      /I\s+am\s+([A-zÁ-ÿ]+)/i,
      /I'm\s+([A-zÁ-ÿ]+)/i,
      /Im\s+([A-zÁ-ÿ]+)/i,
      /This\s+is\s+([A-zÁ-ÿ]+)/i,
      /(hello|hi|hey)\W?\s+My\s+name\s+is\s+([A-zÁ-ÿ]+)/i,
      /(hello|hi|hey)\W?\s+I\s+am\s+([A-zÁ-ÿ]+)/i,
      /(hello|hi|hey)\W?\s+I'm\s+([A-zÁ-ÿ]+)/i,
      /(hello|hi|hey)\W?\s+Im\s+([A-zÁ-ÿ]+)/i,
      /(hello|hi|hey)\W?\s+This\s+is\s+([A-zÁ-ÿ]+)/i,
      /(?!^hello$|^hi$|^hey$)\s*([A-zÁ-ÿ]+)/i,

We might need to add some escape routes so it doesn't get stuck. But I'm unsure as to what other RegEx patterns might be better suited.

If you want something more sophisticated, you can plug in an NLP service using the ReduxSagas included in the project, but you'll have to do some tinkering.

Thoughts @kurenn ?

CharlieIGG avatar Apr 11 '19 22:04 CharlieIGG