Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

intent-utterance-expander-with-ssml

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

intent-utterance-expander-with-ssml

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

latest
Source
npmnpm
Version
0.9.7
Version published
Maintainers
1
Created
Source

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

Keywords

intent

FAQs

Package last updated on 26 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts