SeedVault / rhizome

conversational bot engine created by Botanic/SEED team
https://seedtoken.io
Other
7 stars 2 forks source link

Add normalization #11

Open nicolasbotanic opened 6 years ago

nicolasbotanic commented 6 years ago

Normalization process should be binded with .Flow v2 instruction $normalize. Add a new extension python file /engines/dotflow2/extensions/preprocess.py

This normlization process should be the same expected in any AIML interpreter. You can include also normal.substitution map from https://github.com/pandorabots/rosie/blob/master/lib/substitutions/normal.substitution

You can test the function with the console. This is the expected response:

$ BBOT_ENV=development python -m channels.console.app joe testbot 1 nodebug

You: :df2 normalize("I'm going to the park")
Testbot: I am going to the park

It should also remove intra-sentence punctuation, not defined in the map:

You: :df2 normalize("test'test'test")
Testbot: test test test