alexa_generator 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 95714b270aa9dfa94bdaf3804000a38200a89003
|
4
|
+
data.tar.gz: ab78ce1ab42d021cffee7eb1351da3476d66c164
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b057be5889006152bafea85083c142bdf89bfa2ab2ff59731843620828653973e25178993acab399349691d40f0569506a5fa6962ce44149b9fb90c528224ed9
|
7
|
+
data.tar.gz: 489d2b018e6605b7ad7d64e06b8f5af47f10ea45691394cb40348b0e1be36a7d3db9e3ba6b254b982f30761a0d043962bf10b8e8680ccf8ebe001326728881e2
|
@@ -5,7 +5,7 @@ require 'alexa_generator/slot_binding'
|
|
5
5
|
require 'set'
|
6
6
|
|
7
7
|
module AlexaGenerator
|
8
|
-
class
|
8
|
+
class InteractionModel
|
9
9
|
attr_reader :intents
|
10
10
|
|
11
11
|
class Builder
|
@@ -23,7 +23,7 @@ module AlexaGenerator
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def create
|
26
|
-
|
26
|
+
InteractionModel.new(@intents, @utterance_templates, @bindings)
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
data/lib/alexa_generator.rb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
require 'alexa_generator/
|
1
|
+
require 'alexa_generator/interaction_model'
|
2
2
|
require 'alexa_generator/version'
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
require 'json'
|
3
3
|
|
4
|
-
describe AlexaGenerator::
|
4
|
+
describe AlexaGenerator::InteractionModel do
|
5
5
|
context 'builder' do
|
6
6
|
it 'should build a valid voice interface' do
|
7
|
-
iface = AlexaGenerator::
|
7
|
+
iface = AlexaGenerator::InteractionModel.build do |iface|
|
8
8
|
iface.add_intent(:IntentOne) do |intent|
|
9
9
|
intent.add_slot(:SlotOne, AlexaGenerator::Slot::SlotType::LITERAL) do |slot|
|
10
10
|
slot.add_binding('value1')
|
@@ -14,7 +14,7 @@ describe AlexaGenerator::VoiceInterface do
|
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
-
expect(iface).to be_an_instance_of(AlexaGenerator::
|
17
|
+
expect(iface).to be_an_instance_of(AlexaGenerator::InteractionModel)
|
18
18
|
expect(iface.intent_schema).to eq(
|
19
19
|
{
|
20
20
|
intents: [
|
@@ -32,7 +32,7 @@ describe AlexaGenerator::VoiceInterface do
|
|
32
32
|
end
|
33
33
|
|
34
34
|
it 'should produce bound utterances' do
|
35
|
-
iface = AlexaGenerator::
|
35
|
+
iface = AlexaGenerator::InteractionModel.build do |iface|
|
36
36
|
iface.add_intent(:MyIntent) do |intent|
|
37
37
|
intent.add_slot(:SlotOne, AlexaGenerator::Slot::SlotType::LITERAL) do |slot|
|
38
38
|
slot.add_binding('make me a sandwich')
|
@@ -75,7 +75,7 @@ describe AlexaGenerator::VoiceInterface do
|
|
75
75
|
slot_bindings = []
|
76
76
|
|
77
77
|
it 'should produce utterances' do
|
78
|
-
actual = AlexaGenerator::
|
78
|
+
actual = AlexaGenerator::InteractionModel.new(intents, utterance_templates, slot_bindings).sample_utterances(:MyIntent)
|
79
79
|
expected = [ "#{utterance_templates.first.intent_name} #{utterance_templates.first.template}" ]
|
80
80
|
|
81
81
|
expect(actual).to eq(expected)
|
@@ -97,7 +97,7 @@ describe AlexaGenerator::VoiceInterface do
|
|
97
97
|
]
|
98
98
|
|
99
99
|
it 'should produce bound utterances' do
|
100
|
-
actual = AlexaGenerator::
|
100
|
+
actual = AlexaGenerator::InteractionModel.new(intents, utterance_templates, slot_bindings).sample_utterances(:MyIntent)
|
101
101
|
|
102
102
|
expect(actual.count).to eq(slot_bindings.count)
|
103
103
|
expect(actual).to include('MyIntent Alexa, please {make me a sandwich|SlotOne}')
|
@@ -130,7 +130,7 @@ describe AlexaGenerator::VoiceInterface do
|
|
130
130
|
]
|
131
131
|
|
132
132
|
it 'should produce bound utterances' do
|
133
|
-
actual = AlexaGenerator::
|
133
|
+
actual = AlexaGenerator::InteractionModel.new(intents, utterance_templates, slot_bindings).sample_utterances(:MyIntent)
|
134
134
|
|
135
135
|
expect(actual.count).to eq(8)
|
136
136
|
expect(actual).to include('MyIntent Alexa, please {fix my motorcycle|SlotOne} {one|SlotTwo} at {noon|SlotThree}')
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alexa_generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christopher Mullins
|
@@ -53,15 +53,15 @@ files:
|
|
53
53
|
- lib/alexa_generator.rb
|
54
54
|
- lib/alexa_generator/intent.rb
|
55
55
|
- lib/alexa_generator/intent_schema.rb
|
56
|
+
- lib/alexa_generator/interaction_model.rb
|
56
57
|
- lib/alexa_generator/sample_utterance_template.rb
|
57
58
|
- lib/alexa_generator/slot.rb
|
58
59
|
- lib/alexa_generator/slot_binding.rb
|
59
60
|
- lib/alexa_generator/version.rb
|
60
|
-
- lib/alexa_generator/voice_interface.rb
|
61
61
|
- spec/alexa_generator/intent_spec.rb
|
62
|
+
- spec/alexa_generator/interaction_model_spec.rb
|
62
63
|
- spec/alexa_generator/sample_utterance_template_spec.rb
|
63
64
|
- spec/alexa_generator/slot_spec.rb
|
64
|
-
- spec/alexa_generator/voice_interface_spec.rb
|
65
65
|
- spec/spec_helper.rb
|
66
66
|
homepage: http://github.com/sidoh/alexa_generator
|
67
67
|
licenses: []
|