简体   繁体   English

IBM Watson Assistant:如何使用系统实体sys-number仅获取少量数字

[英]IBM Watson Assistant: How to get just few numbers with System entities sys-number

I have some Business rule to follow. 我要遵循一些业务规则。

I need to request for the user one Year , and currently, I'm using @sys-number to get the Year and other data if need numbers. 我需要为用户请求一个Year ,目前,我正在使用@sys-number来获取Year和其他需要的数据。

I want to know if have some form to get the @sys-number with just 4 digits, like: Watson: What the year, please? 我想知道是否有某种形式可以获取只有4位数字的@ sys-number,例如:Watson:请问是哪一年? Format example: - 2017 格式范例:-2017年

  • User say: the year is 17 (@sys-number get the 17 fine) 用户说:年是17(@ sys-number会被罚款17)

  • User say: the year is 2017 (@sys-number get the 2017 fine) 用户说:年份是2017(@ sys-number会被罚款2017)

I need: ONLY If the user types the 4 numbers from the year, the condition @sys-number[4] //I don't know will get the year correctly and the Conversation will flow. 我需要:仅当用户键入年份中的4个数字时,条件@sys-number[4] //I don't know会正确地获得年份,并且对话将继续进行。

My condition currently within the node is: 我目前在节点内的状况是:

  • if bot recognizes @sys-number 如果机器人识别出@sys-number

You could use two predicates: 您可以使用两个谓词:
if @sys-number and @sys-number>1000 The first would make sure that really a number was entered, the second predicate would take care of 4 digits. if @sys-number and @sys-number>1000 ,则第一个将确保确实输入了一个数字,第二个谓词将使用4位数字。 You could even add another predicate and limit the range of valid years. 您甚至可以添加另一个谓词并限制有效年份的范围。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM