# dialog specification schema version 2.0
# discussed with Jose Robins and team 2021-02-03 at wed night mob programming
#
# Additional features not yet discussed:
#   - next condition: `null` causes the chatbot program to say goodbye and exit
#   - `yes`, `y`, `true` creates a default list of affirmative intents
# If only a single next_condition intent string is found, additional intents are inferred:
#   - If there is another list of intents that starts with a single intent string? use that
#   - state names and keywords (like next_condition) fall back to normalized version that remove spaces, underscores, and fold case to lowercase (like wiki_normalize_text but dont delete/ignore digits)

- # optional defaults for this yml file
  state: __default__
  nlp:
    __default__: exact
  version: 2.0 # added by Hobson 2021-03-14
- state: welcome_state
  bot:
    - Are you ready for some questions about Bash commands?
  next: __finish__ # state to go to if 'yes' or 'ok' are not the player responses
  nlp:
    Q1: exact # only leading and trailing whitespace is stripped with the .strip() method
    Q2: normalize # normalize text to delete all non word characters (\w=[a-zA-Z0-9_]) and perform case-insensitive exact matching
    Q3: keyword # presence/absence of the intent str is checked, e.g. 'Yes'.lower() in user_statement.lower()
    Q4: case_sensitive_keyword # same as keyword, but don't lower the user statement nor intent str
    welcome_state: lower # case-insensitive exact str match, equivalent to "case_insensitive" and upper
    __default__: exact # all states without an NLP parameter specified will use this matching algorithm
  next_score:
    Q1: "+= 1"
  next_condition:
    Q1: # state to go to if 'yes' or 'ok' are entered.
      - "yes"
      - ok
      - "true"
      - "y"
    welcome_state:
      - "no"
      - go back
      - nope
    other_state:
      - "i don't know" # uses welcome state `nlp: __default__: lower` algorithm to process this
      - "help"
      - "tell me more"

- state: Q1
  bot:
    - What does CD do?
  next_condition:
    next_score:
      Q2: "+= 2"
      __finish__: "+=1"
    __finish__: # to test when only one value in the list is presetnt
      - finish
      - stop
      - I'm done


    q2_correct:
      - The CD command lets you change directories.
      - It changes directories.
      - It lets you change folders.
      - You can move between folders.
      - Go from one folder to another.
      - change folders

- state: q2_incorrect
  bot:
    - "Sorry, that doesn't look correct.  How about this one: What does MKDIR do?"

    # Have another "unanswered question" state


    # __finish__:
    #   - int
    #   - float
    #   - integer
    #   - float


- state: q2_correct
  bot:
    - "Great job!  Can you answer this one: What does MKDIR do?"
- state: other_state
  bot:
    - I don't know
  next_condition:
    another_system_default_state:
      - "help me please" # this would be processed with the global __default__ nlp algorithm
      # User would say this after the "I don't know"
      # This is not defined.
- state: another_system_default_state
  bot:
    - "I still don't know what to say"


  next_condition:
    Q3:
      - The MKDIR command lets you make a new directory.
      - make a folder

- state: Q3
  bot:
    - What does CAT do?
  next_condition:
    Q4:
      - The CAT command prints a document to the terminal.
      - prints documents
- state: __finish__
  Bot:
    - Goodbye
-
