dictation 1.0.0 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dictation/serializer.rb +9 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f30ad73e17b72aa741016ab25b236bd28cc44a59
|
4
|
+
data.tar.gz: d5321bc86848ddce6b51c3a6cf068d98a1663405
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: afbba9306282cd7ac299eec403179ad75c81c74cde5b5cb0aafc6b1a466e452d8ad5cbfc93e0d7791dcde6134faa30be0259aa4776cfcb22dd179b1c91420008
|
7
|
+
data.tar.gz: 4234d2deb105c0530767224c61856ad7ace0f090c4bd5f9ebc023388b7bf32e632fd9bced65f1c6b0c6588805e99aff644eebdb85157772a901f30822c727785
|
data/lib/dictation/serializer.rb
CHANGED
@@ -13,7 +13,15 @@ module Dictation
|
|
13
13
|
def deserialize(file)
|
14
14
|
words = []
|
15
15
|
File.open(file).each do |line|
|
16
|
-
|
16
|
+
obj = JSON.parse(line)
|
17
|
+
if obj.is_a?(Hash)
|
18
|
+
class_name = obj['json_class'].split('::').inject(Kernel) { |namespace, const_name| namespace.const_get(const_name) }
|
19
|
+
args = obj['data']
|
20
|
+
word = class_name.new(*args)
|
21
|
+
else
|
22
|
+
word = obj
|
23
|
+
end
|
24
|
+
words.push(word)
|
17
25
|
end
|
18
26
|
words
|
19
27
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dictation
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jing Li
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Practice foreign language by listening and writing (only for Mac OS X).
|
14
14
|
email:
|