JSPM

intent-utterance-expander

0.0.9
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q58067F
  • License

Expand custom utterance slots of phrases, to use with Alexa Skills Kit Sample Utterances

Package Exports

  • intent-utterance-expander

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (intent-utterance-expander) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

intent-utterance-expander

Expand custom utterance slots of phrases, to use with Alexa Skills Kit Sample Utterances.

Demo

https://lab.miguelmota.com/intent-utterance-expander

Install

npm install intent-utterance-expander

Usage

const intentUtteranceExpander = require('intent-utterance-expander');

console.log(intentUtteranceExpander(`(hello|hi) (|mighty) world`));
/*
[
  "hello mighty world",
  "hello world",
  "hi mighty world",
  "hi world"
]
*/

console.log(intentUtteranceExpander([`hello (|mighty) world`, `(great|good) day`]);
/*
[
  [
    "hello mighty world",
    "hello world"
  ],
  [
    "great day",
    "good day"
  ]
]
*/

console.log(intentUtteranceExpander(`(when is|when's) the (|next) Dodger's (|baseball) game?`));
/*
[
  "when is the next Dodger's baseball game?",
  "when is the next Dodger's game?",
  "when is the Dodger's baseball game?",
  "when is the Dodger's game?",
  "when's the next Dodger's baseball game?",
  "when's the next Dodger's game?",
  "when's the Dodger's baseball game?",
  "when's the Dodger's game?"
]
*/

console.log(intentUtteranceExpander(`(today is|today's) (|a) {(monday|tuesday)|day}`));
/*
[
  "today is a {monday|day}",
  "today is a {tuesday|day}",
  "today is {monday|day}",
  "today is {tuesday|day}",
  "today's a {monday|day}",
  "today's a {tuesday|day}",
  "today's {monday|day}",
  "today's {tuesday|day}"
]
*/

Test

npm test

License

MIT