Permalink
Browse files

fix a bug when no hypothesis is returned

  • Loading branch information...
1 parent a3bce5e commit 7b0b05f329063cf6b8902035484bf86d8b8c6f10 @Ases Ases committed Oct 26, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 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 7b0b05f

Please sign in to comment.