class IBMWatson::RecognizeCallback
Abstract class for Recognize Callbacks
Public Class Methods
new(*)
click to toggle source
# File lib/ibm_watson/websocket/recognize_callback.rb, line 6 def initialize(*); end
Public Instance Methods
on_connected()
click to toggle source
Called when a WebSocket connection is made
# File lib/ibm_watson/websocket/recognize_callback.rb, line 12 def on_connected; end
on_data(data:)
click to toggle source
Called when the service returns results. The data is returned unparsed
# File lib/ibm_watson/websocket/recognize_callback.rb, line 30 def on_data(data:); end
on_error(error:)
click to toggle source
Called when there is an error in the WebSocket connection
# File lib/ibm_watson/websocket/recognize_callback.rb, line 15 def on_error(error:); end
on_hypothesis(hypothesis:)
click to toggle source
Called when the service returns the final hypothesis
# File lib/ibm_watson/websocket/recognize_callback.rb, line 27 def on_hypothesis(hypothesis:); end
on_inactivity_timeout(error:)
click to toggle source
Called when there is an inactivity timeout
# File lib/ibm_watson/websocket/recognize_callback.rb, line 18 def on_inactivity_timeout(error:); end
on_listening()
click to toggle source
Called when the service is listening for audio
# File lib/ibm_watson/websocket/recognize_callback.rb, line 21 def on_listening; end
on_transcription(transcript:)
click to toggle source
Called when an interim result is received
# File lib/ibm_watson/websocket/recognize_callback.rb, line 9 def on_transcription(transcript:); end
on_transcription_complete()
click to toggle source
Called after the service returns the final result for the transcription
# File lib/ibm_watson/websocket/recognize_callback.rb, line 24 def on_transcription_complete; end