I am creating a Pizza Delivery Chatbot and I need to be able to extract from an input this : I would like 2 margarita and three regina But I can't do it with regex because :
Entities don't accept regex like input.text.find('@sys-number.+@pizza_name')
I absolutely need the entities because answer number can be written with letters (as in the example above)
For the same reason, the 'pizza name' can be or not be in the @pizza_name entity and a regex can't help me or the regex would take me forever to write
So the problem is how do I extract from the same input several instances (identical or differents it matters not) of the same entity.
I tried to look for an answer in the SPeL language syntax documentation ( a very poor doc by the way) and I could not find a single response. I then tried to trigger this : if (@sys-number and @pizza_name) and (@sys-number and @pizza_name)
But it triggers wether you put once or twenty times the combined syntagm : (2 margarita) or (2 margarita 2 3 regina and 4 calzone)
I am a little desesperate so if anyone ANYONE has a solution or encountered the same issue, I would be grateful forever if you help me, or tell me you had the same problem so I feel less lonely haha Thanks !
via Leon-Paul Schaub
No comments:
Post a Comment