Package edu.cmu.sphinx.util

Examples of edu.cmu.sphinx.util.NISTAlign$StringRenderer


    *
    * @see edu.cmu.sphinx.decoder.ResultListener#newResult(edu.cmu.sphinx.result.Result)
    */
    @Override
    public void newResult(Result result) {
        NISTAlign aligner = getAligner();
        String ref = result.getReferenceText();
        if (result.isFinal() && (ref != null)) {
            try {
                Path bestPath = null;
                String hyp = "";
                if (result.getBestFinalToken() != null) {
                    ConfidenceResult confidenceResult =
                            confidenceScorer.score(result);
                    bestPath = confidenceResult.getBestHypothesis();
                    hyp = bestPath.getTranscriptionNoFiller();
                }
                aligner.align(ref, hyp);
                if (bestPath != null) {
                    showDetails(bestPath.getTranscription());
                } else {
                    showDetails("");
                }
View Full Code Here


             iae,
             language);
    }
    if ( result==null ) return null;
    result.registerRenderer(Integer.class, new NumberRenderer());
    result.registerRenderer(String.class, new StringRenderer());
    result.setListener(new STErrorListener() {
      @Override
      public void compileTimeError(STMessage msg) {
        reportError(msg);
      }
View Full Code Here

  @Override
  protected STGroup loadTemplates() {
    // override the superclass behavior to put all C# templates in the same folder
    STGroup result = new STGroupFile(CodeGenerator.TEMPLATE_ROOT+"/CSharp/"+getLanguage()+STGroup.GROUP_FILE_EXTENSION);
    result.registerRenderer(Integer.class, new NumberRenderer());
    result.registerRenderer(String.class, new StringRenderer());
    result.setListener(new STErrorListener() {
      @Override
      public void compileTimeError(STMessage msg) {
        reportError(msg);
      }
View Full Code Here

TOP

Related Classes of edu.cmu.sphinx.util.NISTAlign$StringRenderer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.