|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinpro.sphinx.instrumentation.LabelWriter
public class LabelWriter
inspects the current results and writes the phone-alignment to stdout or to a file
| Field Summary | |
|---|---|
private java.lang.String |
fileBaseName
|
private boolean |
fileOutput
|
protected boolean |
finalResult
|
(package private) int |
fixedLag
|
protected boolean |
intermediateResults
|
private int |
nBest
|
protected boolean |
phoneAlignment
|
private java.io.PrintStream |
phoneAlignmentStream
|
static java.lang.String |
PROP_FILE_BASE_NAME
|
static java.lang.String |
PROP_FILE_OUTPUT
|
static java.lang.String |
PROP_FINAL_RESULT
|
static java.lang.String |
PROP_FIXED_LAG
|
static java.lang.String |
PROP_INTERMEDIATE_RESULTS
|
static java.lang.String |
PROP_N_BEST
|
static java.lang.String |
PROP_PHONE_ALIGNMENT
|
static java.lang.String |
PROP_RECOGNIZER
A Sphinx property that defines which recognizer to monitor |
static java.lang.String |
PROP_STEP_WIDTH
|
static java.lang.String |
PROP_WORD_ALIGNMENT
|
private edu.cmu.sphinx.recognizer.Recognizer |
recognizer
|
protected int |
step
counts the number of recognition steps |
protected int |
stepWidth
|
protected boolean |
wordAlignment
|
private java.io.PrintStream |
wordAlignmentStream
|
| Constructor Summary | |
|---|---|
LabelWriter()
|
|
| Method Summary | |
|---|---|
private static java.util.List<edu.cmu.sphinx.decoder.search.Token> |
getAllBestTokens(edu.cmu.sphinx.result.Result result)
get all tokens on the best path |
protected static java.util.List<edu.cmu.sphinx.decoder.search.Token> |
getBestPhoneTokens(edu.cmu.sphinx.decoder.search.Token token)
get the phone-tokens on the best path |
protected java.util.List<edu.cmu.sphinx.decoder.search.Token> |
getBestWordTokens(edu.cmu.sphinx.decoder.search.Token token)
get the word-tokens on the best path |
void |
newProperties(edu.cmu.sphinx.util.props.PropertySheet ps)
|
void |
newResult(edu.cmu.sphinx.result.Result result)
|
void |
reset()
|
private java.io.PrintStream |
setStream(java.lang.String extension)
|
void |
statusChanged(edu.cmu.sphinx.recognizer.Recognizer.State status)
|
static java.lang.String |
tokenListToAlignment(java.util.List<edu.cmu.sphinx.decoder.search.Token> list,
int lastFrame)
convert a token list to an alignment string |
private java.lang.String |
writeAlignment(java.util.List<edu.cmu.sphinx.decoder.search.Token> list,
java.io.PrintStream stream,
boolean timestamp)
write labels of aligned segments or words to stream <! |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
@S4Component(type=edu.cmu.sphinx.recognizer.Recognizer.class) public static final java.lang.String PROP_RECOGNIZER
@S4Boolean(defaultValue=false) public static final java.lang.String PROP_INTERMEDIATE_RESULTS
@S4Boolean(defaultValue=true) public static final java.lang.String PROP_FINAL_RESULT
@S4Integer(defaultValue=1) public static final java.lang.String PROP_STEP_WIDTH
@S4Boolean(defaultValue=false) public static final java.lang.String PROP_WORD_ALIGNMENT
@S4Boolean(defaultValue=false) public static final java.lang.String PROP_PHONE_ALIGNMENT
@S4Boolean(defaultValue=false) public static final java.lang.String PROP_FILE_OUTPUT
@S4String(defaultValue="") public static final java.lang.String PROP_FILE_BASE_NAME
@S4Integer(defaultValue=1) public static final java.lang.String PROP_N_BEST
@S4Integer(defaultValue=0) public static final java.lang.String PROP_FIXED_LAG
int fixedLag
private edu.cmu.sphinx.recognizer.Recognizer recognizer
protected boolean intermediateResults
protected boolean finalResult
private boolean fileOutput
private java.lang.String fileBaseName
private int nBest
protected boolean wordAlignment
protected boolean phoneAlignment
private java.io.PrintStream wordAlignmentStream
private java.io.PrintStream phoneAlignmentStream
protected int step
protected int stepWidth
| Constructor Detail |
|---|
public LabelWriter()
| 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.Configurableedu.cmu.sphinx.util.props.PropertyExceptionpublic void reset()
reset in interface edu.cmu.sphinx.instrumentation.Resetableprivate java.io.PrintStream setStream(java.lang.String extension)
protected java.util.List<edu.cmu.sphinx.decoder.search.Token> getBestWordTokens(edu.cmu.sphinx.decoder.search.Token token)
token - the result to analyse
protected static java.util.List<edu.cmu.sphinx.decoder.search.Token> getBestPhoneTokens(edu.cmu.sphinx.decoder.search.Token token)
token - the result to analyse
private static java.util.List<edu.cmu.sphinx.decoder.search.Token> getAllBestTokens(edu.cmu.sphinx.result.Result result)
result - the result to analyse
public static java.lang.String tokenListToAlignment(java.util.List<edu.cmu.sphinx.decoder.search.Token> list,
int lastFrame)
list - list of tokens
private java.lang.String writeAlignment(java.util.List<edu.cmu.sphinx.decoder.search.Token> list,
java.io.PrintStream stream,
boolean timestamp)
list - stream - timestamp - public void newResult(edu.cmu.sphinx.result.Result result)
newResult in interface edu.cmu.sphinx.decoder.ResultListenerpublic void statusChanged(edu.cmu.sphinx.recognizer.Recognizer.State status)
statusChanged in interface edu.cmu.sphinx.recognizer.StateListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||