简体   繁体   中英

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.

I want to know if have some form to get the @sys-number with just 4 digits, like: Watson: What the year, please? Format example: - 2017

  • User say: the year is 17 (@sys-number get the 17 fine)

  • User say: the year is 2017 (@sys-number get the 2017 fine)

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.

My condition currently within the node is:

  • if bot recognizes @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. You could even add another predicate and limit the range of valid years.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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