0

I need to create an utterance where the user needs to say either a 4, 5 or 6 character code. Each code is alphanumeric.

How do I design the utterance so that a variable length code can be used?

For the six-digit code, I have the following:

MySkill look up code {XXX_ONE} {XXX_TWO} {XXX_THREE} {XXX_FOUR} {XXX_FIVE} {XXX_SIX}

where the slots are defined as :

  "slots": [
    {
      "name": "XXX_ONE",
      "type": "ALPHANUM"
    },
    {
      "name": "XXX_TWO",
      "type": "ALPHANUM"
    },
    {
      "name": "XXX_THREE",
      "type": "ALPHANUM"
    },
    {
      "name": "XXX_FOUR",
      "type": "ALPHANUM"
    },
    {
      "name": "XXX_FIVE",
      "type": "ALPHANUM"
    },
    {
      "name": "XXX_SIX",
      "type": "ALPHANUM"
    }
  ],
BENBUN Coder
  • 4,801
  • 7
  • 52
  • 89

1 Answers1

0

this is really similar to this question and also similar to the intent ADDWORD in this repo The main idea is you can create a custom slot type, let say CODE, and it can have the values like a.b.c.1.2.3 for code ABC123 and so on for your all your multiple codes independently of the length.

In this case the utterance will not be accepted if spelling a non existing code, if you want to accept those you could add as values all the possible combinations of alphanumeric characters with 4, 5 and 6.

It isn't very well documented, but you can use "a.", "b.", "c." etc to represent the letter, as opposed to the sound.

Edwin
  • 836
  • 7
  • 17