IBM Watson - Sys-number does not get 0

跟風遠走 提交于 2019-12-24 07:37:17

问题


in this case, I want to use sys-number to get numbers sequence, and this number can start with 0. But, if the user types 034234342342, the sys-number does not recognize the 0, just 34234342342.

Have any Contorn Solution for this? In this case, to get all number?

This is one Regex condition inside Conversation flow and I want to use sys-number to get the ALL number if the user types "My protocol number is 034234342342". And sys-number will be the new condition and get the complete number.

If not have how to do it with sys-number. Please, try answer to me how to do that in this user case.

EDIT:

Check my example:

My try it out:


回答1:


You should be able to use @sys-number to detect that number. Failing that you could do:

input.text.find('\d{11}')

find() allows to find any occurrence, while matches() is a full line match.

Capturing you can use:

<? input.text.extract('\d{11}',0) ?> 

That also allows group capturing.

Other then this you won't be able to capture preceding zeros with @sys-number.

Also if you put the checks directly into the JSON, then you need to escape out the \ with \\.



来源:https://stackoverflow.com/questions/43472182/ibm-watson-sys-number-does-not-get-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!