alexa_modelbuilder 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/alexa_modelbuilder.rb +10 -4
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3381dc4cce19a37241b13d42f67cbe89b6d712b8
|
4
|
+
data.tar.gz: 721badd3aaf8e564a74ba5f273242a44cebd3918
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 175d0a8a904520aabdd27834996cb5976e82b1c9d85885f6abe23dcd4c0d3d075350aa3a41730e1241dafe9e7a5418f359db6fd2f28df91b3981f2b49a52f44b
|
7
|
+
data.tar.gz: 1c52c23db717c4e7eadc4b4366c59a9494e7c44a9ec044edd634cf01adf52f5292948fb8f2937f197ae8ece2cf8b9e257c6dfdc0bf4c07054972c7c0c17e19c7
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/alexa_modelbuilder.rb
CHANGED
@@ -9,7 +9,7 @@ require 'lineparser'
|
|
9
9
|
|
10
10
|
class AlexaModelBuilder
|
11
11
|
|
12
|
-
attr_reader :to_h, to_json
|
12
|
+
attr_reader :to_h, :to_json
|
13
13
|
|
14
14
|
def initialize(s)
|
15
15
|
|
@@ -52,10 +52,14 @@ class AlexaModelBuilder
|
|
52
52
|
|
53
53
|
intents = raw_intents.map do |x|
|
54
54
|
|
55
|
-
|
55
|
+
raw_utterances = x[3].select {|y| y.first == :utterance}
|
56
|
+
utterances = raw_utterances.map {|z| z[2].first.rstrip }
|
57
|
+
|
58
|
+
{'name' => x[1].values.first, 'samples' => utterances }
|
56
59
|
|
57
60
|
end
|
58
61
|
|
62
|
+
|
59
63
|
lm['intents'] = intents
|
60
64
|
|
61
65
|
raw_types = r.find {|x| x.first == :types}
|
@@ -65,7 +69,10 @@ class AlexaModelBuilder
|
|
65
69
|
name, raw_val = raw_types[2][1].first.split(/: */)
|
66
70
|
values = raw_val.split(/, */)
|
67
71
|
|
68
|
-
types = {'name' => name, 'values' =>
|
72
|
+
types = {'name' => name, 'values' => []}
|
73
|
+
types['values'] = values.map do |x|
|
74
|
+
{'name' => {'value' => x }}
|
75
|
+
end
|
69
76
|
|
70
77
|
lm['types'] = types
|
71
78
|
|
@@ -77,4 +84,3 @@ class AlexaModelBuilder
|
|
77
84
|
end
|
78
85
|
|
79
86
|
end
|
80
|
-
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|