alexa_modelbuilder 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: c44e124875b4740defdf51be9c5595e8350462dc
4
- data.tar.gz: 3c020c59c2b8176bb40d22288402ef7ac161f3d3
3
+ metadata.gz: 3381dc4cce19a37241b13d42f67cbe89b6d712b8
4
+ data.tar.gz: 721badd3aaf8e564a74ba5f273242a44cebd3918
5
5
  SHA512:
6
- metadata.gz: c83b559c32bafdfe230f28ba4dd31ba93814b44c2230611b6afd8d951acf2512248c664552b5986a4f1c6ed7e362e1e39187459d7598f3b4fffef5ac1e97bdd6
7
- data.tar.gz: 07aa420de775265458e5aa5d22bdfd33fc12436b4a26fefae47b0d40df7d0c2dddbf04604b692035d1c777a5cbfdaa5a86e7acc413c1ff3dcb7c364fa9830c8b
6
+ metadata.gz: 175d0a8a904520aabdd27834996cb5976e82b1c9d85885f6abe23dcd4c0d3d075350aa3a41730e1241dafe9e7a5418f359db6fd2f28df91b3981f2b49a52f44b
7
+ data.tar.gz: 1c52c23db717c4e7eadc4b4366c59a9494e7c44a9ec044edd634cf01adf52f5292948fb8f2937f197ae8ece2cf8b9e257c6dfdc0bf4c07054972c7c0c17e19c7
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -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
- {'name' => x[1].values.first, 'samples' => [] }
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' => values.map {|x| {'name' => {'value' => x }} } }
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
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alexa_modelbuilder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file