Class: IBMWatson::RecognizeCallback
- Inherits:
-
Object
- Object
- IBMWatson::RecognizeCallback
- Defined in:
- lib/ibm_watson/websocket/recognize_callback.rb
Overview
Abstract class for Recognize Callbacks
Instance Method Summary collapse
-
#initialize ⇒ RecognizeCallback
constructor
A new instance of RecognizeCallback.
-
#on_connected ⇒ Object
Called when a WebSocket connection is made.
-
#on_data(data:) ⇒ Object
Called when the service returns results.
-
#on_error(error:) ⇒ Object
Called when there is an error in the WebSocket connection.
-
#on_hypothesis(hypothesis:) ⇒ Object
Called when the service returns the final hypothesis.
-
#on_inactivity_timeout(error:) ⇒ Object
Called when there is an inactivity timeout.
-
#on_listening ⇒ Object
Called when the service is listening for audio.
-
#on_transcription(transcript:) ⇒ Object
Called when an interim result is received.
-
#on_transcription_complete ⇒ Object
Called after the service returns the final result for the transcription.
Constructor Details
#initialize ⇒ RecognizeCallback
Returns a new instance of RecognizeCallback.
6 |
# File 'lib/ibm_watson/websocket/recognize_callback.rb', line 6 def initialize(*); end |
Instance Method Details
#on_connected ⇒ Object
Called when a WebSocket connection is made
12 |
# File 'lib/ibm_watson/websocket/recognize_callback.rb', line 12 def on_connected; end |
#on_data(data:) ⇒ Object
Called when the service returns results. The data is returned unparsed
30 |
# File 'lib/ibm_watson/websocket/recognize_callback.rb', line 30 def on_data(data:); end |
#on_error(error:) ⇒ Object
Called when there is an error in the WebSocket connection
15 |
# File 'lib/ibm_watson/websocket/recognize_callback.rb', line 15 def on_error(error:); end |
#on_hypothesis(hypothesis:) ⇒ Object
Called when the service returns the final hypothesis
27 |
# File 'lib/ibm_watson/websocket/recognize_callback.rb', line 27 def on_hypothesis(hypothesis:); end |
#on_inactivity_timeout(error:) ⇒ Object
Called when there is an inactivity timeout
18 |
# File 'lib/ibm_watson/websocket/recognize_callback.rb', line 18 def on_inactivity_timeout(error:); end |
#on_listening ⇒ Object
Called when the service is listening for audio
21 |
# File 'lib/ibm_watson/websocket/recognize_callback.rb', line 21 def on_listening; end |
#on_transcription(transcript:) ⇒ Object
Called when an interim result is received
9 |
# File 'lib/ibm_watson/websocket/recognize_callback.rb', line 9 def on_transcription(transcript:); end |
#on_transcription_complete ⇒ Object
Called after the service returns the final result for the transcription
24 |
# File 'lib/ibm_watson/websocket/recognize_callback.rb', line 24 def on_transcription_complete; end |