File tree Expand file tree Collapse file tree 1 file changed +0
-27
lines changed Expand file tree Collapse file tree 1 file changed +0
-27
lines changed Original file line number Diff line number Diff line change @@ -47,33 +47,6 @@ function isAnalyzed(corporaList: GeneratedSpeechToTextV1.Corpora): boolean {
4747 return corporaList . corpora . some ( record => record [ 'status' ] === 'analyzed' ) ;
4848}
4949
50- /**
51- * @private
52- * @param chunk
53- * @return {any }
54- */
55- function formatChunk ( chunk : string ) {
56- // Convert the string into an array
57- let result = chunk ;
58-
59- // Check if in the stream doesn't have
60- // two results together and parse them
61- if ( ! result || result . indexOf ( '}{' ) === - 1 ) {
62- return JSON . parse ( result ) ;
63- }
64-
65- // Check if we can parse the response
66- try {
67- result = '[' + result . replace ( / } { / g, '},{' ) + ']' ;
68- result = JSON . parse ( result ) ;
69- return result [ result . length - 1 ] ;
70- } catch ( e ) {
71- // if it fails, then this isn't valid json (or a concatenated list of valid json) - just return the original string
72- }
73-
74- return result ;
75- }
76-
7750class SpeechToTextV1 extends GeneratedSpeechToTextV1 {
7851 static ERR_NO_CORPORA = 'ERR_NO_CORPORA' ;
7952 static ERR_TIMEOUT = 'ERR_TIMEOUT' ;
You can’t perform that action at this time.
0 commit comments