alexa_generator 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 99ce7ef9324a3916c4bcb74eeec1b951d08b9528
|
4
|
+
data.tar.gz: c90ada13a698c92ccb4d1b2d0b550de43ca15ce2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 871ce5c20db59cb50c4e585c04810f12ca56770fbebc60e91b93e72b01b1305c7b00b998538081e17114e0fa9fa8b8c22840064100c923dcca6c9676bfd3cfa9
|
7
|
+
data.tar.gz: b9c3c54b1c190e8616be539cfbd81cf7413ca61e0cfff925afaf58c7c9e08429ceff119e4f979235f6c00e68ead3a2ea2b6fc1e02387befb460937c67a9fc6e9
|
@@ -30,7 +30,7 @@ module AlexaGenerator
|
|
30
30
|
def initialize(intents, utterance_templates, slot_bindings)
|
31
31
|
# Validate that utterance templates reference only defined slots
|
32
32
|
all_referenced_slots = utterance_templates.map(&:referenced_slots).flatten
|
33
|
-
slot_names = Set.new(
|
33
|
+
slot_names = Set.new(intents.map(&:slots).flatten.map(&:name))
|
34
34
|
undefined_slots = all_referenced_slots.reject { |x| slot_names.include?(x) }
|
35
35
|
|
36
36
|
if undefined_slots.any?
|
@@ -231,4 +231,15 @@ describe AlexaGenerator::InteractionModel do
|
|
231
231
|
expect(type2_bindings).to contain_exactly(*%w(valueA))
|
232
232
|
end
|
233
233
|
end
|
234
|
+
|
235
|
+
context 'with slots not having bindings' do
|
236
|
+
it 'should work' do
|
237
|
+
model = AlexaGenerator::InteractionModel.build do |iface|
|
238
|
+
iface.add_intent(:IntentOne) do |intent|
|
239
|
+
intent.add_slot(:SlotOne, AlexaGenerator::Slot::SlotType::DURATION)
|
240
|
+
intent.add_utterance_template('do something for {SlotOne}')
|
241
|
+
end
|
242
|
+
end
|
243
|
+
end
|
244
|
+
end
|
234
245
|
end
|