示例#1
0
 def create():
     return GetUserInput(
         _id=StylePreferenceProfileCheckInput.__id(),
         children=[
             Input(
                 Grammar(
                     watson_items=[
                         "What",
                         "$ what",
                         "$ which",
                         "$ tell me"
                     ]
                 ),
                 children=[
                     Input(
                         Grammar(
                             watson_items=[
                                 "styles",
                                 "$ they",
                                 "$ ones",
                                 "$ choices",
                                 "$ options",
                                 "$ styles",
                                 "$ what else"
                             ]
                         ),
                         children=[
                             Output(
                                 Prompt(
                                     items=[
                                         "For example.... Boots, High heels, Sandals, Trainers or Flats <br> <br>"]
                                 ),
                                 children=[StylePreferenceProfileCheckInput.goto()]
                             )
                         ]
                     )
                 ]
             ),
             Input(
                 Grammar(
                     items=[
                         EntityGrammarItem(dynamic_field_assignment="Style_Preference", entity_id="STYLE")
                     ],
                     watson_items=[
                         "Style",
                         "$ (Style)={Style_Preference}"
                     ]
                 ),
                 children=[
                     CurrentIndexAction.set_to_zero(),
                     PageAction.set_to_new(),
                     SearchNowAction.set_to_no(),
                     StylePreferenceAction.set_to_value(),
                     Goto(ref="output_ok_do_search")
                 ]
             ),
             # {
             #     (0, "grammar"): {
             #         "item": [
             #             "NC-17",
             #             "$ NC-17"
             #         ]
             #     },
             #     (1, "output"): {
             #         (0, "prompt"): {
             #             "item": "I'm afraid I cannot look up NC-17-rated movies.",
             #             "@selectionType": "RANDOM"
             #         },
             #         (1, "goto"): StylePreferenceProfileCheckInput.goto()
             #     }
             # },
             Input(
                 Grammar(
                     watson_items=[
                         "No",
                         "$ don't care",
                         "$ don't know",
                         "$ no preference",
                         "$ no",
                         "$ none",
                         "$ all",
                         "$ any",
                         "$ anything",
                         "$ whatever",
                         "$ nothing specific",
                         "$ don't have a preference"
                     ]
                 ),
                 children=[
                     CurrentIndexAction.set_to_zero(),
                     PageAction.set_to_new(),
                     Goto(ref="output_2456875")
                 ]
             ),
             Input(
                 GenericGrammar.yes(),
                 children=[
                     Output(
                         Prompt(items=["What style?", "Please tell me the style you would prefer."]),
                         children=[StylePreferenceProfileCheckInput.goto()]
                     )
                 ]
             ),
             PreliminarySequencesSearch.goto()
         ]
     )
示例#2
0
 def create():
     return GetUserInput(
             _id=ColorPreferenceProfileCheckInput.__id(),
             children=[
                 Input(
                         Grammar(
                                 watson_items=[
                                     "What",
                                     "$ what",
                                     "$ which",
                                     "$ tell me"
                                 ]
                         ),
                         children=[
                             Input(
                                     Grammar(
                                             watson_items=[
                                                 "colors",
                                                 "$ they",
                                                 "$ ones",
                                                 "$ choices",
                                                 "$ options",
                                                 "$ ratings",
                                                 "$ certifications",
                                                 "$ what else"
                                             ]
                                     ),
                                     children=[
                                         Output(
                                                 Prompt(
                                                         items=["Black, White, Red, Brown or Green <br> <br>"]
                                                 ),
                                                 children=[ColorPreferenceProfileCheckInput.goto()]
                                         )
                                     ]
                             )
                         ]
                 ),
                 Input(
                         Grammar(
                                 watson_items=[
                                     "Color",
                                     "$ (COLOR)={Color_Preference}"
                                 ]
                         ),
                         children=[
                             CurrentIndexAction.set_to_zero(),
                             PageAction.set_to_new(),
                             SearchNowAction.set_to_no(),
                             ColorPreferenceAction.set_to_value(),
                             Goto(ref="output_ok_do_search")
                         ]
                 ),
                 # TODO NOT SUPPORTED PATH
                 # {
                 #     (0, "grammar"): {
                 #         "item": [
                 #             "NC-17",
                 #             "$ NC-17"
                 #         ]
                 #     },
                 #     (1, "output"): {
                 #         (0, "prompt"): {
                 #             "item": "I'm afraid I cannot look up NC-17-rated movies.",
                 #             "@selectionType": "RANDOM"
                 #         },
                 #         (1, "goto"): {
                 #             "@ref": "getUserInput_2443780a"
                 #         }
                 #     }
                 # },
                 Input(
                         Grammar(
                                 watson_items=[
                                     "No",
                                     "$ don't care",
                                     "$ don't know",
                                     "$ no preference",
                                     "$ no",
                                     "$ none",
                                     "$ all",
                                     "$ any",
                                     "$ anything",
                                     "$ whatever",
                                     "$ nothing specific",
                                     "$ don't have a preference"
                                 ]
                         ),
                         children=[
                             CurrentIndexAction.set_to_zero(),
                             PageAction.set_to_new(),
                             Goto(ref="output_2456875")
                         ]
                 ),
                 Input(
                         GenericGrammar.yes_okay(wildcard=False),
                         children=[
                             Output(
                                     Prompt(items=["Which one?"]),
                                     children=[ColorPreferenceProfileCheckInput.goto()]
                             )
                         ]
                 ),
                 PreliminarySequencesSearch.goto()
             ]
     )