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 (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String)

    The SID of the Account that created this Sentence resource.

  • sid (String)

    The SID of the Call resource to fetch.



181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 181

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

#confidenceFloat

Returns:

  • (Float)


236
237
238
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 236

def confidence
    @properties['confidence']
end

#end_timeFloat

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

Returns:

  • (Float)

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



218
219
220
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 218

def end_time
    @properties['end_time']
end

#inspectObject

Provide a detailed, user friendly representation



254
255
256
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 254

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

#media_channelString

Returns The channel number.

Returns:

  • (String)

    The channel number.



200
201
202
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 200

def media_channel
    @properties['media_channel']
end

#sentence_indexString

Returns The index of the sentence in the transcript.

Returns:

  • (String)

    The index of the sentence in the transcript.



206
207
208
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 206

def sentence_index
    @properties['sentence_index']
end

#sidString

Returns A 34 character string that uniquely identifies this Sentence.

Returns:

  • (String)

    A 34 character string that uniquely identifies this Sentence.



230
231
232
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 230

def sid
    @properties['sid']
end

#start_timeFloat

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

Returns:

  • (Float)

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



212
213
214
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 212

def start_time
    @properties['start_time']
end

#to_sObject

Provide a user friendly representation



248
249
250
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 248

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

#transcriptString

Returns Transcript text.

Returns:

  • (String)

    Transcript text.



224
225
226
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 224

def transcript
    @properties['transcript']
end

#wordsArray<Hash>

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

Returns:

  • (Array<Hash>)

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



242
243
244
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 242

def words
    @properties['words']
end