alexa-utterance-expander
Compiles short-hand notation for alexa utterances into exhaustive utterances needed by Alexa
Last updated 3 years ago by rain-agency .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install alexa-utterance-expander 
SYNC missed versions from official npm registry.

alexa-utterance-expander

Write your Amazon Alexa utterances file in a simple-to-use DSL, and compile it to the full utternaces. Re-use placeholders, and let the compiler handle the work of creating the many variations.

Install

npm install alexa-utterance-expander

Usage

Require the library;

const UtteranceExpander = require('alexa-utterance-expander');

Define place holders

console.log(UtteranceExpander(`
[game] game
[game] match
[game] round

[play] play
[play] start

LaunchIntent [play] a [game]
`));

generates

LaunchIntent play a game
LaunchIntent play a match
LaunchIntent play a round
LaunchIntent start a game
LaunchIntent start a match
LaunchIntent start a round

Some built-in placeholders

  • PLEASE
  • YES
  • NO
  • NEXT
  • REPEAT
  • STOP
  • CANCEL
  • STARTOVER
  • HELP

#From Gulp#

gulp.task('compile', function (cb) {
    fs.readFile(path.join(__dirname,'interaction-model','utterances-src.txt'),function(err,file){
          if(err) return cb(err);
               var expanded = UtteranceExpaander(file);
                    fs.writeFile(path.join(__dirname,'interaction-model','utterances.txt'),expanded,cb);
                       
        });
         
    });

Current Tags

  • 1.1.0                                ...           latest (3 years ago)

11 Versions

  • 1.1.0                                ...           3 years ago
  • 1.0.9                                ...           3 years ago
  • 1.0.8                                ...           3 years ago
  • 1.0.7                                ...           3 years ago
  • 1.0.6                                ...           3 years ago
  • 1.0.5                                ...           3 years ago
  • 1.0.4                                ...           3 years ago
  • 1.0.3                                ...           3 years ago
  • 1.0.2                                ...           3 years ago
  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 2
Dependencies (0)
None
Dev Dependencies (2)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |