pihsi 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pihsi/speech_recognizer.rb +6 -3
- data/lib/pihsi/version.rb +1 -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: 650af7f9bd97d82f5d9163c4572835755f7175bb
|
4
|
+
data.tar.gz: c1e853d14cd7ce5110b332357041a17cc839c0fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0ce6a10c92c009980f9500a3cb6bdca5984e3671b433ae2862d59532acf94c575b05e4c1241bb2268291fe4a99a77db52d3d56e09a99e78cdda601ca2e8c2d8
|
7
|
+
data.tar.gz: 00df6ac4921be463b5bef64df63c18d563d4f6bc87d6162704b689aae22161fb3ede23895366e9067604b3e1e7ded91e39da23cfcb1c7ae449f4a7e95c771c0a
|
@@ -5,13 +5,16 @@ module Pihsi
|
|
5
5
|
attr_reader :decoder
|
6
6
|
|
7
7
|
def initialize(options = {})
|
8
|
-
_options = options.inject(
|
9
|
-
result["-#{key}"
|
8
|
+
_options = options.inject([]) do |result, (key, value)|
|
9
|
+
result << ["-#{key}", value] unless value.nil?
|
10
10
|
result
|
11
|
-
end
|
11
|
+
end
|
12
12
|
@decoder = PocketSphinx::Decoder.new(_options)
|
13
13
|
end
|
14
14
|
|
15
|
+
# Converts raw audio data into text
|
16
|
+
# @param data [String] the raw audio data
|
17
|
+
# @return [String, nil] the transcribed text or nil
|
15
18
|
def recognize(data)
|
16
19
|
if result = decoder.decode(data.unpack('s*'))
|
17
20
|
result["hypothesis"]
|
data/lib/pihsi/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pihsi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zhi-Qiang Lei
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|