pihsi 0.0.7 → 0.0.8

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: 22b3b365012c105fea0820185dce021c02c28b3e
4
- data.tar.gz: 820d34da1e6bdee5cfb395ea8b6dd836a727e049
3
+ metadata.gz: 650af7f9bd97d82f5d9163c4572835755f7175bb
4
+ data.tar.gz: c1e853d14cd7ce5110b332357041a17cc839c0fc
5
5
  SHA512:
6
- metadata.gz: f5ae1e4eddf7e564e3d4e28509c1e7d7b7f1d7280db543d59fa15095481159463866095c3d85e6b85549c39b95eb38268ecc986933922112fdec92d895bb115f
7
- data.tar.gz: 7362822983580aa600b4f23408c3c7e68fd7a3bc40c11997d8f32f5d588d7a910a675bf463af7e38e68bf0319da02a68d7ed1bf3d5cad30bbcde8f477f0ea4f8
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({}) do |result, (key, value)|
9
- result["-#{key}"] = value unless value.nil?
8
+ _options = options.inject([]) do |result, (key, value)|
9
+ result << ["-#{key}", value] unless value.nil?
10
10
  result
11
- end.to_a
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
@@ -1,3 +1,3 @@
1
1
  module Pihsi
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
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.7
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-03 00:00:00.000000000 Z
11
+ date: 2014-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler