Ejemplo n.º 1
0
        /*
         * (non-Javadoc)
         *
         * @see edu.cmu.sphinx.decoder.ResultListener#newResult(edu.cmu.sphinx.result.Result)
         */
        public override void newResult(Result result)
        {
            NISTAlign aligner = getAligner();
            String    @ref    = result.getReferenceText();

            if (result.isFinal() && (@ref != null))
            {
                try
                {
                    IPath  bestPath = null;
                    String hyp      = "";
                    if (result.getBestFinalToken() != null)
                    {
                        IConfidenceResult confidenceResult =
                            confidenceScorer.score(result);
                        bestPath = confidenceResult.getBestHypothesis();
                        hyp      = bestPath.getTranscriptionNoFiller();
                    }
                    aligner.align(@ref, hyp);
                    if (bestPath != null)
                    {
                        showDetails(bestPath.getTranscription());
                    }
                    else
                    {
                        showDetails("");
                    }
                }
                catch (Exception e)
                {
                    Debug.WriteLine(e);
                }
            }
        }
Ejemplo n.º 2
0
        public AccuracyTracker(Recognizer recognizer, bool showSummary, bool showDetails, bool showResults, bool showAlignedResults, bool showRawResults)
        {
            Aligner = new NISTAlign(false, false);

            InitRecognizer(recognizer);

            _showSummary        = showSummary;
            _showDetails        = showDetails;
            _showResults        = showResults;
            _showAlignedResults = showAlignedResults;

            _showRaw = showRawResults;

            Aligner.SetShowResults(showResults);
            Aligner.SetShowAlignedResults(showAlignedResults);
        }
Ejemplo n.º 3
0
 public AccuracyTracker()
 {
     Aligner = new NISTAlign(false, false);
 }