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.



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

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)


233
234
235
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 233

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.



215
216
217
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 215

def end_time
    @properties['end_time']
end

#inspectObject

Provide a detailed, user friendly representation



251
252
253
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 251

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

#media_channelString

Returns The channel number.

Returns:

  • (String)

    The channel number.



197
198
199
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 197

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.



203
204
205
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 203

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.



227
228
229
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 227

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.



209
210
211
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 209

def start_time
    @properties['start_time']
end

#to_sObject

Provide a user friendly representation



245
246
247
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 245

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

#transcriptString

Returns Transcript text.

Returns:

  • (String)

    Transcript text.



221
222
223
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 221

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.



239
240
241
# File 'lib/twilio-ruby/rest/intelligence/v2/transcript/sentence.rb', line 239

def words
    @properties['words']
end