protected internal virtual void setInputStream(BatchNISTRecognizer.CTLUtterance utt) { Iterator iterator = this.inputDataProcessors.iterator(); while (iterator.hasNext()) { DataProcessor dataProcessor = (DataProcessor)iterator.next(); if (dataProcessor is StreamDataSource) { ((StreamDataSource)dataProcessor).setInputStream(utt.getInputStream()); } else if (dataProcessor is StreamCepstrumSource) { int bigEndian = Utilities.isCepstraFileBigEndian(utt.getName()) ? 1 : 0; StreamCepstrumSource streamCepstrumSource = (StreamCepstrumSource)dataProcessor; streamCepstrumSource.setInputStream(utt.getInputStream(), bigEndian != 0); } } }
public virtual void decode() { try { this.utteranceId = 0; DataOutputStream @out = new DataOutputStream(new FileOutputStream(this.ctmFile)); this.recognizer.allocate(); BatchNISTRecognizer.CTLIterator ctliterator = new BatchNISTRecognizer.CTLIterator(this); while (ctliterator.hasNext()) { BatchNISTRecognizer.CTLUtterance ctlutterance = (BatchNISTRecognizer.CTLUtterance)ctliterator.next(); this.setInputStream(ctlutterance); Result result = this.recognizer.recognize(); [email protected](new StringBuilder().append("Utterance ").append(this.utteranceId).append(": ").append(ctlutterance.getName()).toString()); [email protected](new StringBuilder().append("Reference: ").append(ctlutterance.getRef()).toString()); [email protected](new StringBuilder().append("Result : ").append(result).toString()); this.logger.info(new StringBuilder().append("Utterance ").append(this.utteranceId).append(": ").append(ctlutterance.getName()).toString()); this.logger.info(new StringBuilder().append("Result : ").append(result).toString()); this.handleResult(@out, ctlutterance, result); this.utteranceId++; } this.recognizer.deallocate(); } catch (IOException ex) { this.logger.severe(new StringBuilder().append("I/O error during decoding: ").append(Throwable.instancehelper_getMessage(ex)).toString()); } this.logger.info(new StringBuilder().append("BatchCTLDecoder: ").append(this.utteranceId).append(" utterances decoded").toString()); }
protected internal override void setInputStream(BatchNISTRecognizer.CTLUtterance utt) { base.setInputStream(utt); this.bfaGrammar.setUtterance(utt.getName()); }