botpress / studio

The studio is the main interface you'll use to build and edit your chatbot.
https://botpress.com/docs/quickstart#conversation-studio
39 stars 38 forks source link

fix(nlu): trim entity occurences on change #223

Closed franklevasseur closed 2 years ago

franklevasseur commented 2 years ago

fixes DEV-1217 fixes https://github.com/botpress/v12/issues/1215

entities_trim

linear[bot] commented 2 years ago
DEV-1217 [BUG] Entity creation with leading and trailing white spaces (botpress/botpress botpress/v12#1215)

**Describe the bug** It is possible to create the same entity using leading and trailing white spaces, they are all treated as the same one, but later causes issue in comparisons ex.: (if entity === 'one') **To Reproduce** Steps to reproduce the behavior: 1. create a list entity 2. add "one" -> no space 3. add " one" -> space before 4. add " one " -> space before and after 5. add "one " - space after 6. add "one" -> here we get a "duplicate error" **Expected behavior** Trimmed entities **Screenshots** ![image](https://user-images.githubusercontent.com/59566773/106144382-1dc33400-6142-11eb-91cd-b83dee03aaaa.png) **Environment (please complete the following information):** - 12.16.3 **Additional context** Add any other context about the problem here.