Skip to content
Browse files

Merge pull request #9 from Ases/patch-1

fix a bug when no hypothesis is returned
  • Loading branch information...
2 parents a3bce5e + 7b0b05f commit 557fc26b3a91eed378c0de74cd57b80959331b1a @taf2 committed Oct 26, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/speech/audio_to_text.rb
View
2 lib/speech/audio_to_text.rb
@@ -65,7 +65,7 @@ def convert_chunk(easy, chunk, options={})
self.captured_json['status'] = data['status']
self.captured_json['id'] = data['id']
self.captured_json['hypotheses'] = data['hypotheses'].map {|ut| [ut['utterance'], ut['confidence']] }
- if data.key?('hypotheses') && ['hypotheses'].first
+ if data.key?('hypotheses') && data['hypotheses'].first
self.best_match_text += " " + data['hypotheses'].first['utterance']
self.score += data['hypotheses'].first['confidence']
self.segments += 1

0 comments on commit 557fc26

Please sign in to comment.
Something went wrong with that request. Please try again.