pihsi 0.2.0 → 0.2.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: 39a878f44496fcecc39a526f4452d31df5dc2fdf
4
- data.tar.gz: 64e75af38da0c529812822f718efaed69c6e4db5
3
+ metadata.gz: d4f0e6120918c54fa462d6637a14fe68e50252d3
4
+ data.tar.gz: 7e65d7762c199fe1040fbb5bc58cf82d4620030b
5
5
  SHA512:
6
- metadata.gz: 6b7c9e706f8130b30cae6cb064fd7ab0ad019371a781867c05499412f09a5718b8a41512839d807f9e86c69a78f9382d2b9c901d4dbca6ef431cfaf93658d8ca
7
- data.tar.gz: 5d53020195f0b5e8791ae2c60aef44e4be810f8141c0cbb0ec5a4220025b8b16568d41b237f45025e4ebc83ca33a663ed42f1d56b99a83ed384b31c38bdf1e52
6
+ metadata.gz: a64f057c9b2349e18bcb8707d4f121e43c65286501e56d96dfb84bfdc7cb72faf2fe7a135958c8f643fec4cb7b1b09aecb077b5dd5f1b7b474122720b3affc3f
7
+ data.tar.gz: 6ee89879a47c8ce58dd12030bc6d999aaec353bec98260d601d4045427bd52661a6f6c84fb298db26a648564c6bf0aa9ef062396b2088c9273f3fcb485b5d2b6
@@ -5,6 +5,8 @@ typedef struct ps {
5
5
  ps_decoder_t *decoder;
6
6
  } PocketSphinx;
7
7
 
8
+ static VALUE rb_mPihsi;
9
+ static VALUE rb_cSpeechRecognizer;
8
10
  static VALUE rb_eUtteranceError;
9
11
 
10
12
  static VALUE decode(ps_decoder_t *ps, VALUE data) {
@@ -52,10 +54,9 @@ VALUE recognize(VALUE self, VALUE data) {
52
54
  return decode(pocketSphinx -> decoder, string);
53
55
  }
54
56
 
55
- static void deallocate(void *ps) {
56
- PocketSphinx *pocketSphinx = ps;
57
+ static void deallocate(PocketSphinx *pocketSphinx) {
57
58
  ps_free(pocketSphinx -> decoder);
58
- free(pocketSphinx);
59
+ xfree(pocketSphinx);
59
60
  }
60
61
 
61
62
  static VALUE allocate(VALUE self) {
@@ -100,8 +101,9 @@ VALUE initialize(VALUE self, VALUE options_hash) {
100
101
  }
101
102
 
102
103
  void Init_pocket_sphinx() {
103
- VALUE rb_mPihsi = rb_define_module("Pihsi");
104
- VALUE rb_cSpeechRecognizer = rb_define_class_under(rb_mPihsi, "SpeechRecognizer", rb_cObject);
104
+ rb_mPihsi = rb_define_module("Pihsi");
105
+
106
+ rb_cSpeechRecognizer = rb_define_class_under(rb_mPihsi, "SpeechRecognizer", rb_cObject);
105
107
  rb_define_alloc_func(rb_cSpeechRecognizer, allocate);
106
108
  rb_define_method(rb_cSpeechRecognizer, "initialize", initialize, 1);
107
109
  rb_define_method(rb_cSpeechRecognizer, "recognize", recognize, 1);
data/lib/pihsi/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Pihsi
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
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.2.0
4
+ version: 0.2.1
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-08 00:00:00.000000000 Z
11
+ date: 2014-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler