Class: Lara::Models::AudioTextResult
- Defined in:
- lib/lara/models/audio.rb
Overview
Audio text result for transcript translation
Instance Attribute Summary collapse
-
#duration ⇒ Object
readonly
Returns the value of attribute duration.
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#segments ⇒ Object
readonly
Returns the value of attribute segments.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#translation ⇒ Object
readonly
Returns the value of attribute translation.
Instance Method Summary collapse
-
#initialize(id: nil, source: nil, target: nil, filename: nil, duration: nil, text: nil, translation: nil, segments: nil, **_kwargs) ⇒ AudioTextResult
constructor
A new instance of AudioTextResult.
Methods inherited from Base
Constructor Details
#initialize(id: nil, source: nil, target: nil, filename: nil, duration: nil, text: nil, translation: nil, segments: nil, **_kwargs) ⇒ AudioTextResult
Returns a new instance of AudioTextResult.
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/lara/models/audio.rb', line 77 def initialize(id: nil, source: nil, target: nil, filename: nil, duration: nil, text: nil, translation: nil, segments: nil, **_kwargs) super() @id = id @source = source @target = target @filename = filename @duration = duration @text = text @translation = translation @segments = Array(segments).map do |seg| if seg.is_a?(Hash) AudioTextSegment.new( id: seg["id"] || seg[:id], start: seg["start"] || seg[:start], end_time: seg["end"] || seg[:end], text: seg["text"] || seg[:text], translation: seg["translation"] || seg[:translation] ) else seg end end end |
Instance Attribute Details
#duration ⇒ Object (readonly)
Returns the value of attribute duration.
75 76 77 |
# File 'lib/lara/models/audio.rb', line 75 def duration @duration end |
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
75 76 77 |
# File 'lib/lara/models/audio.rb', line 75 def filename @filename end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
75 76 77 |
# File 'lib/lara/models/audio.rb', line 75 def id @id end |
#segments ⇒ Object (readonly)
Returns the value of attribute segments.
75 76 77 |
# File 'lib/lara/models/audio.rb', line 75 def segments @segments end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
75 76 77 |
# File 'lib/lara/models/audio.rb', line 75 def source @source end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
75 76 77 |
# File 'lib/lara/models/audio.rb', line 75 def target @target end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
75 76 77 |
# File 'lib/lara/models/audio.rb', line 75 def text @text end |
#translation ⇒ Object (readonly)
Returns the value of attribute translation.
75 76 77 |
# File 'lib/lara/models/audio.rb', line 75 def translation @translation end |