edu.ucsb.nmsl.tools
Class Transcript

java.lang.Object
  extended by edu.ucsb.nmsl.tools.Transcript

public class Transcript
extends java.lang.Object

This class represents the basic abstraction of a Transcript: a collection of text segments and a time stamp representing when the first word of the collection segment was spoken. The responsibility of this class is to provide the user with a mechanism for storing the text of spoken media and to map these spoken words to the time they were spoken. This responsibility necessarily implies that the class provides an interface to randomly access any segment of the transcript and the time the segment was spoken.

At a lower level the Transcript class also provides a mechanism for iterating through each chunk of the transcript. While these chunks usually represent the individual words of each segment, any specialization of the class can chose a different level of atomicity for the individual transcript chunks. Also provided by this class an iterator functionality that allows the user to treat the trascript as one large stream of transcript chunks with the time-stamp for each chunk.

For the purposes of AutoCap, this implementation of the Transcript abstraction breaks the transcript into segments as provided in the input file and further breaks these segments into each individual word. Each segment can then be thought of as a caption and usually includes a single sentence or serveral sentences. Each chunk of these segements are words. Both levels of organization include a times stamp of when speach started and ended.

Version:
1.0

Nested Class Summary
protected  class Transcript.TranscriptIterator
          The responsibility of this inner class is to provide an iterator interface to the transcript class for the purpose of breaking a transcript into its individual chunks.
 
Field Summary
protected  java.util.LinkedList captions
          The individual segments, or caption, that make up the Transcript.
protected  StatisticsPackage Stats
          The statistics package associated with an instance of a Transcript.
 
Constructor Summary
Transcript()
          This default contructor creates a default instance of a Transcript.
Transcript(java.util.Collection c)
          This contructor creates an instance of a Transcript and creates a segment for each element of the Collection object passed to it.
 
Method Summary
 java.util.ListIterator captionIterator(int index)
          This method returns a ListIterator instance that allows for bidirectional sequential access to each of the segments within a transcript.
 java.util.ListIterator chunkIterator(int index)
          This method returns an Iterator instance that allows the sequential access to each chunk of a Transcript rather than each segment.
 java.lang.String getAsText()
          This method returns the entire transcript, minus time-stamps, as text to the caller.
 Caption getCaption(int i)
          This method returns the ith segment, or caption, withing the Transcript.
 StatisticsPackage getStatisticsPackage()
          This method returns the StatisticsPackage instance associated with an instance of a Transcript class.
 java.util.Iterator iterator()
          This method returns an Iterator instance that can be used to sequentially access each segment of the Transcript instance.
static void main(java.lang.String[] args)
          This main method is for testing purposes only.
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

captions

protected java.util.LinkedList captions
The individual segments, or caption, that make up the Transcript.


Stats

protected StatisticsPackage Stats
The statistics package associated with an instance of a Transcript.

Constructor Detail

Transcript

public Transcript()
This default contructor creates a default instance of a Transcript.


Transcript

public Transcript(java.util.Collection c)
This contructor creates an instance of a Transcript and creates a segment for each element of the Collection object passed to it.

Parameters:
c - - A Collection instance that contains segments of a transcript.
Method Detail

iterator

public java.util.Iterator iterator()
This method returns an Iterator instance that can be used to sequentially access each segment of the Transcript instance.

Returns:
An iterator that allows sequential access to each segment of a transcript.

chunkIterator

public java.util.ListIterator chunkIterator(int index)
This method returns an Iterator instance that allows the sequential access to each chunk of a Transcript rather than each segment.

Parameters:
index - - The index of a chunk within the trasncript. Subsequent calls to previous() or next() will be relative to this chunk.
Returns:
A ListIterator instance that points to the indexth chunk.

captionIterator

public java.util.ListIterator captionIterator(int index)
This method returns a ListIterator instance that allows for bidirectional sequential access to each of the segments within a transcript.

Parameters:
index - - The index of a segment withing the transcript. Subsequent calls to previous() or next() will be relative to the indexth segment.
Returns:
A ListIterator instance that points to the indexth segment.

size

public int size()

getCaption

public Caption getCaption(int i)
This method returns the ith segment, or caption, withing the Transcript.

Parameters:
i - - The index of the desired segment or caption.
Returns:
The ith Caption instance from the Transcript.

getAsText

public java.lang.String getAsText()
This method returns the entire transcript, minus time-stamps, as text to the caller.

Returns:
A string with the text from each segment of the Transcript instance.

getStatisticsPackage

public StatisticsPackage getStatisticsPackage()
This method returns the StatisticsPackage instance associated with an instance of a Transcript class. The StatiticsPackage object is used for research purposes and is not necessary for normal use of AutoCap.

Returns:
A StatisticsPackage object that contains data indicating the accuracy of the alignment process.

main

public static void main(java.lang.String[] args)
This main method is for testing purposes only. It is not needed during the normal execution of AutoCap.