kinetic.util
Class LineSegmenter

java.lang.Object
  |
  +--kinetic.util.Segmenter
        |
        +--kinetic.util.LineSegmenter
All Implemented Interfaces:
java.io.Serializable

public class LineSegmenter
extends Segmenter

Segments text base on sentence on end line delimiters (\n\r\f)

See Also:
Serialized Form

Field Summary
protected  double BaseDuration
          base duration for a segment
protected  double CommaDelay
          delay inserted for commas
protected  int currentOffset
          current time offset
protected  double EndCharacterDelay
          delays inserted for sentence end punctuation characters
protected  java.util.StringTokenizer tokenizer
          string tokenizer
protected  double UnitDelay
          duration per "unit" used when calculating a the full delay based on square root of the number of characters
 
Fields inherited from class kinetic.util.Segmenter
document, documentLength, documentStart, text
 
Constructor Summary
LineSegmenter()
          creates a new intance of the line segmenter
LineSegmenter(kinetic.util.Segment seg)
          creates a new instance of the segmenter with an optionally decorated segment object
LineSegmenter(java.lang.String t)
          creates a new instance of the line segmenter from a string of text
 
Method Summary
 kinetic.util.Segment getNextSegment()
          gets the next segment from the text
 void segmentText(java.lang.String t)
          sets the text string that will be segmented
 
Methods inherited from class kinetic.util.Segmenter
hasMoreSegements, segmentSegment
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tokenizer

protected java.util.StringTokenizer tokenizer
string tokenizer


BaseDuration

protected double BaseDuration
base duration for a segment


UnitDelay

protected double UnitDelay
duration per "unit" used when calculating a the full delay based on square root of the number of characters


EndCharacterDelay

protected double EndCharacterDelay
delays inserted for sentence end punctuation characters


CommaDelay

protected double CommaDelay
delay inserted for commas


currentOffset

protected int currentOffset
current time offset

Constructor Detail

LineSegmenter

public LineSegmenter()
creates a new intance of the line segmenter


LineSegmenter

public LineSegmenter(java.lang.String t)
creates a new instance of the line segmenter from a string of text

Parameters:
t - text string

LineSegmenter

public LineSegmenter(kinetic.util.Segment seg)
creates a new instance of the segmenter with an optionally decorated segment object

Parameters:
seg - segment object
Method Detail

segmentText

public void segmentText(java.lang.String t)
sets the text string that will be segmented

Specified by:
segmentText in class Segmenter
Parameters:
t - text string

getNextSegment

public kinetic.util.Segment getNextSegment()
                                    throws java.util.NoSuchElementException
gets the next segment from the text

Specified by:
getNextSegment in class Segmenter
Returns:
the next segment
Throws:
java.util.NoSuchElementException - thorws this if no more segments are available