class Typingpool::Transcript

This is the model class for Typingpool's final and most important output, a transcript of the Project audio in HTML format, with embedded audio. A Transcript instance is actually an enumerable container for Transcript::Chunk instances. Each Transcript::Chunk corresponds to an Amazon::HIT and to an audio “chunk” (file) that has been transcribed and which is part of a larger recording.

This class is likey to be done away with in the next few point versions of Typingpool. Functionality and data unique to Transcipt::Chunk can probably be rolled into Amazon::HIT. Transcript itself can probably be folded into Project, which would become a HIT container, and then we'd pass Project instances to the output template.

Attributes

subtitle[RW]

Get/set the subtitle of the transcript, corresponds to Project#local#subtitle (a.k.a data/subtitle.txt in the project dir)

title[RW]

Get/set the title of the transcript, typically corresponds to the name of the associated Project

Public Class Methods

new(title=nil, chunks=[]) click to toggle source

Constructor. Takes an optional title (see above for explanation of title) and an optional array of Transcript::Chunk instances.

# File lib/typingpool/transcript.rb, line 28
def initialize(title=nil, chunks=[])
  @title = title
  @chunks = chunks
end

Public Instance Methods

[](index) click to toggle source

Takes an index, returns the Transcript::Chunk at that index.

# File lib/typingpool/transcript.rb, line 41
def [](index)
  @chunks[index]
end
add_chunk(chunk) click to toggle source

Takes a Transcript::Chunk instance and adds it to the Transcript instance.

# File lib/typingpool/transcript.rb, line 51
def add_chunk(chunk)
  @chunks.push(chunk)
end
each() { |chunk| ... } click to toggle source

Iterate of the Transcript::Chunk instances

# File lib/typingpool/transcript.rb, line 34
def each
  @chunks.each do |chunk|
    yield chunk
  end
end
to_s() click to toggle source

Returns chunks joined by double newlines

# File lib/typingpool/transcript.rb, line 46
def to_s
  @chunks.join("\n\n")
end