|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.ucsb.nmsl.tools.Caption
public class Caption
This class represents the basic components of a Transcritp, captions. For the purposes of AutoCap, a caption is defined as a segment of a transcript that has a time-stamp. The purpose of this time stamp is to mark the point in time that the beginning of a caption was spoken. Furthermore, these captions may represent different levels of organization within the transcript. For example, the transcripts for QAD Inc.'s media materials represented groups of related sentences. The number of these sentences is usually between two and three. Other levels of organization are also possible to use such as sentences or parts of sentences. It is not the responsibility of the Caption or Transcript classes to segment the transcripts. The organization of transcripts is expressed within the transcript files themselves.
Each Caption object is responsible for storing and providing acess to both the text of the caption and a time-stamp. Each caption is further broken into caption chunks. The size of these chunks is one word per chunk. Furthermore, each chunk keeps the time-stamp of when the word begins and ends withing the media file. This organization of captions allows for the user of the class to iterate through each word of the caption which facilitates the estimation phase of the AutoCap process. Specialized instances of this class may choose a different level of organization.
see edu.ucsb.nmsl.tools.Transcript Transcript
Nested Class Summary | |
---|---|
class |
Caption.CaptionChunk
This inner class is responsible for storing the individual caption chunks that make up a caption. |
Field Summary | |
---|---|
protected java.lang.StringBuffer |
caption
The entire text of the caption. |
protected java.util.LinkedList |
captions
A list of each caption chunk that makes up the entire caption |
protected static double[] |
factors
Multiplication factors for parsing a time from a string. |
Constructor Summary | |
---|---|
Caption()
This default contructor creates a default instance of a caption with the start and finish time-stamps set to -1 and the caption text set to the empty string. |
|
Caption(double s,
double f,
java.lang.String c)
This constructor creates an instance with the given caption text, given start time-stamp and given finish time-stamp. |
|
Caption(double t,
java.lang.String c)
This constructor creates an instance with the given caption text and given start time-stamp. |
|
Caption(java.lang.String t,
java.lang.String c)
This contructor creates an instance with the given caption text and given start time-stamp, which is in string form. |
|
Caption(java.lang.String s,
java.lang.String f,
java.lang.String c)
This contructor creates an instance with the given caption text, given start and finish time-stamps, which are in string form. |
Method Summary | |
---|---|
void |
appendCaption(double s,
double f,
java.lang.String c)
This method appends another caption chunk on the end of a Caption with the given start and finish time-stamps. |
java.lang.String |
getCaption()
This accessor method returns the all the caption chunks as a String. |
double |
getFinishTime()
This mutator method sets the finish time-stamp for the caption. |
Caption.CaptionChunk |
getFirstChunk()
This accessor method returns the first caption chunk, which should be a word of the caption. |
Caption.CaptionChunk |
getLastChunk()
This accessor method returns the last caption chunk, which should be a word of the caption. |
double |
getMaxError()
This accessor function returns the maximum caption error associated with the start time-stamp of the caption. |
double |
getTime()
This accessor method returns the start time-stamp for the caption. |
java.util.Iterator |
iterator()
This method returns an Iterator that allows for the sequential access to each chunk of the caption. |
java.util.ListIterator |
listIterator(int idx)
This method returns an Iterator that allows for the sequential access to each chunk of the caption. |
protected double |
parseTime(java.lang.String t)
This method is a helper function that parses a time-stamp of the form "HH:MM:SS" from a string and returns the number of seconds rempresented by the string. |
void |
setFinishTime(double time)
This accessor method returns the finish time-stamp for the caption. |
void |
setMaxError(double d)
This mutator method sets the maximum error associated with the caption. |
void |
setStartTime(double time)
This mutator method sets the start time-stamp for the caption. |
int |
size()
This method returns the number of chunks, or words in the caption. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.StringBuffer caption
protected java.util.LinkedList captions
protected static final double[] factors
Constructor Detail |
---|
public Caption()
public Caption(double t, java.lang.String c)
t
- The start time-stamp associated with the caption.c
- The caption text as a String. This caption chunk should be a word.public Caption(double s, double f, java.lang.String c)
s
- The start time-stamp associated with the caption.f
- The finish time-stamp associated with the caption.c
- The caption text as a String. This caption chunk should be a word.public Caption(java.lang.String t, java.lang.String c)
t
- The start time-stamp of the caption given as a string.c
- The caption text as a String. This caption chunk should be a word.public Caption(java.lang.String s, java.lang.String f, java.lang.String c)
s
- The start time-stamp of the caption given as a string.f
- The finish time-stamp of the caption given as a string.c
- The caption text as a String. This caption chunk should be a word.Method Detail |
---|
protected double parseTime(java.lang.String t)
t
- The time-stamp string as read from a file.
public void appendCaption(double s, double f, java.lang.String c)
s
- The start time-stamp associated with the caption.f
- The finish time-stamp associated with the caption.c
- The caption text as a String. This caption chunk should be a word.public double getTime()
public void setStartTime(double time)
time
- The start time-stamp of the caption in seconds.public void setFinishTime(double time)
time
- The finish time-stamp of the caption in seconds.public double getFinishTime()
public double getMaxError()
public void setMaxError(double d)
d
- The maximum caption error in seconds.public Caption.CaptionChunk getFirstChunk()
public Caption.CaptionChunk getLastChunk()
public java.lang.String getCaption()
public java.util.Iterator iterator()
public java.util.ListIterator listIterator(int idx)
public int size()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |