diff --git a/.gitignore b/.gitignore index add0ee6..2e50e5b 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ node_modules coverage .coveralls.yml .editorconfig +.idea/ diff --git a/README.md b/README.md index fcec750..0a8ae02 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,20 @@ var results = grammarGenerator.generateModels('Find flights from {airline} ', to ``` +## Introduction to Alexa Skills +Alexa, the voice service that powers Echo, provides a set of built-in abilities, or skills, that enable customers to interact with devices in a more intuitive way using voice. +Examples of these skills include the ability to play music, answer general questions, set an alarm or timer and more. +With the Alexa Skills Kit, you can easily build and add your own skills to Alexa. +Customers can access these new skills simply by asking Alexa a question or making a command. + +Developers can create their own implementations of Alexa skills. This involves building and packaging an Alexa skill as a configuration and implementing a backend service that interacts based on this definition. + +The configuration for an Alexa skill must include the following components to define the voice interface: + +An Intent Schema: A JSON structure which declares the set of intents your service can accept and process. +A set of Sample Utterances: A structured text file that connects the intents to likely spoken phrases and containing as many representative phrases as possible. +These inputs are entered in the Interaction Model section of an Alexa skill configuration. + ## License This code is licensed under the MIT license for [Scott Beaudreau](). For more information, please refer to the [LICENSE](/LICENSE) file. diff --git a/package.json b/package.json index 9e52be1..693cb54 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ }, "license": "MIT", "dependencies": { - "spoken-numbers": "0.0.0", + "spoken-numbers": "*", "underscore": "^1.8.3" } } diff --git a/test/index.js b/test/index.js index 6e81f6f..4efd417 100644 --- a/test/index.js +++ b/test/index.js @@ -24,9 +24,6 @@ describe('alexa-grammar', function () { }); }); describe('alexa-grammar.basic', function () { - it('should be able to instantiate the helper object', function () { - assert(grammarGenerator !== null, 'We should have a valid object'); - }); it('should support generating a grammar with a literal model and no topics', function () { var results = grammarGenerator.generateModels('Mary had a little lamb'); assert(results.length === 1, 'There should be 1 results'); @@ -69,6 +66,22 @@ describe('alexa-grammar', function () { }); }); describe('alexa-grammar.advanced', function () { + it('should support generating a grammar with a single model with two slots', function () { + var topics = { + airline: { + type: 'dictionary', + count: 100, + entries: [ + { id: 'aal', values: ['aa', 'american airlines', 'american'] }, + { id: 'dal', values: ['dl', 'delta airlines', 'delta'] } + ] + }, + flightNumber: {type: 'number', min: 10, max: 2000, count: 3, format: 'spelled'} + }; + var results = grammarGenerator.generateModels('{airline} {flightNumber}', topics); + //console.log(require('util').inspect(results, {showHidden: true})); + assert(results.length === 18, 'There should be 18 results'); + }); it('should support generating a grammar with a single model and multiple topic entries with multiple surface forms', function () { var topics = { airline: {