|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinpro.incremental.PushBuffer
inpro.incremental.IUModule
done.inpro.system.completion.TurnCompleter
public class TurnCompleter
Nested Class Summary | |
---|---|
static interface |
TurnCompleter.CompletionAdapter
|
private class |
TurnCompleter.CompletionEvalAdapter
|
private class |
TurnCompleter.CompletionPlayer
completions will only be played if they don't start with a pause |
Nested classes/interfaces inherited from class inpro.incremental.IUModule |
---|
IUModule.RightBuffer |
Field Summary | |
---|---|
private IUList<WordIU> |
committedWords
history of words that have previously been recognized |
private java.util.List<TurnCompleter.CompletionAdapter> |
compAdapters
|
(package private) int |
currentFrame
|
(package private) CompletionInstallmentIU.FuzzyMatchResult |
fmatch
fuzzy match of the full input against the expected full installment |
(package private) java.util.List<WordIU> |
fullInput
full user input at one point in time: words that have been committed + currently hypothesized words |
private CompletionInstallmentIU |
fullInstallment
|
private static double |
OUTPUT_BUFFER_DELAY
in seconds, very rough estimate |
static java.lang.String |
PROP_DISPATCHER
|
static java.lang.String |
PROP_EVALUATOR
|
static java.lang.String |
PROP_FULL_UTTERANCE
|
private java.util.HashSet<WordIU> |
wordsTriggered
words from fullInstallment that have been output are stored here |
Fields inherited from class inpro.incremental.IUModule |
---|
iulisteners, logger, PROP_HYP_CHANGE_LISTENERS, PROP_LOG_TO_TEDVIEW, PROP_TEDVIEW_LOG_ADDRESS, PROP_TEDVIEW_LOG_PORT, rightBuffer, tedLogAdapter |
Constructor Summary | |
---|---|
TurnCompleter()
|
Method Summary | ||
---|---|---|
private void |
doComplete()
|
|
private double |
estimateSpeechRate()
estimate the correction factor relative to the TTS's speech rate |
|
private double |
extrapolateStart(double estimatedSpeechRate)
extrapolate the start time of the next word from a list of previously spoken words |
|
private static double |
getDurationWithoutPauses(java.util.List<WordIU> words)
time spanned by all non-silent words |
|
private boolean |
hasFiredForTrigger()
find out whether we have already fired for a word, to avoid stuttering; initial experiments shows that the first prediction for a word is as good as any later prediction so there's no value in trying repeatedly |
|
private static
|
lastElement(java.util.List<T> list)
utility which unfortunately is not part of java.util. |
|
protected void |
leftBufferUpdate(java.util.Collection<? extends IU> ius,
java.util.List<? extends EditMessage<? extends IU>> edits)
the method that IU modules must implement |
|
void |
newProperties(edu.cmu.sphinx.util.props.PropertySheet ps)
|
|
void |
setCurrentFrame(int frame)
|
|
private boolean |
shouldFire()
determine whether we should complete the utterance based on the words heard so far |
Methods inherited from class inpro.incremental.IUModule |
---|
getTime, hypChange, logToTedView |
Methods inherited from class inpro.incremental.PushBuffer |
---|
reset |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
@S4Component(type=DispatchStream.class, mandatory=false) public static final java.lang.String PROP_DISPATCHER
@S4Component(type=CompletionEvaluator.class, mandatory=false) public static final java.lang.String PROP_EVALUATOR
private java.util.List<TurnCompleter.CompletionAdapter> compAdapters
@S4String(defaultValue="eins zwei drei vier f\u00fcnf sechs sieben") public static final java.lang.String PROP_FULL_UTTERANCE
private static double OUTPUT_BUFFER_DELAY
private CompletionInstallmentIU fullInstallment
private IUList<WordIU> committedWords
java.util.List<WordIU> fullInput
CompletionInstallmentIU.FuzzyMatchResult fmatch
private java.util.HashSet<WordIU> wordsTriggered
int currentFrame
Constructor Detail |
---|
public TurnCompleter()
Method Detail |
---|
public void newProperties(edu.cmu.sphinx.util.props.PropertySheet ps) throws edu.cmu.sphinx.util.props.PropertyException
newProperties
in interface edu.cmu.sphinx.util.props.Configurable
newProperties
in class IUModule
edu.cmu.sphinx.util.props.PropertyException
protected void leftBufferUpdate(java.util.Collection<? extends IU> ius, java.util.List<? extends EditMessage<? extends IU>> edits)
IUModule
leftBufferUpdate
in class IUModule
ius
- list of IUs that make up the current hypothesisedits
- a list of edits since the last callprivate boolean shouldFire()
private boolean hasFiredForTrigger()
private void doComplete()
private double extrapolateStart(double estimatedSpeechRate)
private double estimateSpeechRate()
private static double getDurationWithoutPauses(java.util.List<WordIU> words)
public void setCurrentFrame(int frame)
setCurrentFrame
in interface FrameAware
private static <T> T lastElement(java.util.List<T> list)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |