     private let failure: (NSError -> Void)?
     private let success: [SpeechToTextResult] -> Void
 
+    /**
+     Create a `SpeechToTextWebSocket` object to communicate with Speech to Text.
+
+     - parameter authStrategy: An `AuthenticationStrategy` that defines how to authenticate
+        with the Watson Developer Cloud's Speech to Text service. The `AuthenticationStrategy`
+        is used internally to obtain tokens, refresh expired tokens, and maintain information
+        about authentication state.
+     - parameter settings: The configuration for this transcription request.
+     - parameter failure: A function executed whenever an error occurs.
+     - parameter success: A function executed with all transcription results whenever
+        a final or interim transcription is received.
+
+     - returns: A `SpeechToTextWebSocket` object that can communicate with Speech to Text.
+     */
     init?(
         authStrategy: AuthenticationStrategy,
         settings: SpeechToTextSettings,


import Foundation

class SpeechToTextWebSocket {

    private let socket: WatsonWebSocket

        }
    }

    /**
     Process a data payload from Speech to Text.
    
     - parameter data: The data payload from Speech to Text.
     */
    private func onData(data: NSData) {
        return
    }

    /**
     Handle a socket error generated by the connection to Speech to Text.

     - parameter error: The error that occurred.
     */
    private func onSocketError(error: NSError) {
        failure?(error)
    }

    // MARK: Helper Functions: Parse Generic Response

    /**
     Handle a state message from Speech to Text.

     - parameter state: The state of the Speech to Text recognition request.
     */
    private func onState(state: SpeechToTextState) {
        return
    }

    /**
     Handle transcription results from Speech to Text.

     - parameter wrapper: A `SpeechToTextResultWrapper` that encapsulates the new or updated
        transcriptions along with state information to update the internal `results` array.
     */
    private func onResults(wrapper: SpeechToTextResultWrapper) {
        updateResultsArray(wrapper)
        success(results)
    }

    /**
     Update the `results` array with new or updated transcription results from Speech to Text.

     - parameter wrapper: A `SpeechToTextResultWrapper` that encapsulates the new or updated
        transcriptions along with state information to update the internal `results` array.
     */
    private func updateResultsArray(wrapper: SpeechToTextResultWrapper) {
        var localIndex = wrapper.resultIndex
        var wrapperIndex = 0
