Class: Twilio::REST::Intelligence::V2::TranscriptContext::SentenceInstance

Inherits:
Twilio::REST::InstanceResource show all
Defined in:
lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, transcript_sid: nil) ⇒ SentenceInstance

Initialize the SentenceInstance

Parameters:

  • Version that contains the resource

  • payload that contains response from Twilio

  • The SID of the Account that created this Sentence resource.

  • The SID of the Call resource to fetch.



269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 269

def initialize(version, payload , transcript_sid: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'media_channel' => payload['media_channel'] == nil ? payload['media_channel'] : payload['media_channel'].to_i,
        'sentence_index' => payload['sentence_index'] == nil ? payload['sentence_index'] : payload['sentence_index'].to_i,
        'start_time' => payload['start_time'],
        'end_time' => payload['end_time'],
        'transcript' => payload['transcript'],
        'sid' => payload['sid'],
        'confidence' => payload['confidence'],
        'words' => payload['words'],
    }
end

Instance Method Details

#confidenceString

Returns:



325
326
327
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 325

def confidence
    @properties['confidence']
end

#end_timeString

Returns Offset from the beginning of the transcript when this sentence ends.

Returns:

  • Offset from the beginning of the transcript when this sentence ends.



307
308
309
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 307

def end_time
    @properties['end_time']
end

#inspectObject

Provide a detailed, user friendly representation



343
344
345
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 343

def inspect
    "<Twilio.Intelligence.V2.SentenceInstance>"
end

#media_channelString

Returns The channel number.

Returns:

  • The channel number.



289
290
291
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 289

def media_channel
    @properties['media_channel']
end

#sentence_indexString

Returns The index of the sentence in the transcript.

Returns:

  • The index of the sentence in the transcript.



295
296
297
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 295

def sentence_index
    @properties['sentence_index']
end

#sidString

Returns A 34 character string that uniquely identifies this Sentence.

Returns:

  • A 34 character string that uniquely identifies this Sentence.



319
320
321
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 319

def sid
    @properties['sid']
end

#start_timeString

Returns Offset from the beginning of the transcript when this sentence starts.

Returns:

  • Offset from the beginning of the transcript when this sentence starts.



301
302
303
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 301

def start_time
    @properties['start_time']
end

#to_sObject

Provide a user friendly representation



337
338
339
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 337

def to_s
    "<Twilio.Intelligence.V2.SentenceInstance>"
end

#transcriptString

Returns Transcript text.

Returns:

  • Transcript text.



313
314
315
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 313

def transcript
    @properties['transcript']
end

#wordsArray<Hash>

Returns Detailed information for each of the words of the given Sentence.

Returns:

  • Detailed information for each of the words of the given Sentence.



331
332
333
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 331

def words
    @properties['words']
end