|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.ucsb.nmsl.tools.Transcript
public class Transcript
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.
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 |
---|
protected java.util.LinkedList captions
protected StatisticsPackage Stats
Constructor Detail |
---|
public Transcript()
public Transcript(java.util.Collection c)
c
- - A Collection instance that contains segments of a transcript.Method Detail |
---|
public java.util.Iterator iterator()
public java.util.ListIterator chunkIterator(int index)
index
- - The index of a chunk within the trasncript. Subsequent calls
to previous() or next() will be relative to this chunk.
public java.util.ListIterator captionIterator(int index)
index
- - The index of a segment withing the transcript. Subsequent
calls to previous() or next() will be relative to the indexth
segment.
public int size()
public Caption getCaption(int i)
i
- - The index of the desired segment or caption.
public java.lang.String getAsText()
public StatisticsPackage getStatisticsPackage()
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |