Package edu.cmu.sphinx.linguist.acoustic

Examples of edu.cmu.sphinx.linguist.acoustic.Unit


     * Gets the unit associated with this point in the grammar
     *
     * @return the unit, or null if there is no unit associated with this point in the grammar
     */
    private Unit getUnit() {
        Unit unit = null;
        Word[][] alternatives = node.getAlternatives();
        if (alternativeIndex != -1 && alternativeIndex < alternatives.length) {
            Word[] words = alternatives[alternativeIndex];
            if (wordIndex < words.length) {
                Pronunciation[] pronunciations =
View Full Code Here


     * Gets the unit associated with this point in the grammar. If there is no unit, return filler
     *
     * @return the unit for this grammar node or a filler unit
     */
    private Unit getUnitOrFill() {
        Unit unit = getUnit();
        if (unit == null) {
            unit = UnitManager.SILENCE;
        }
        return unit;
    }
View Full Code Here

                WordSearchState wordState = (WordSearchState) searchState;
                Word word = wordState.getPronunciation().getWord();
                sb.insert(0, ' ' + word.getSpelling());
            } else if (searchState instanceof UnitSearchState) {
                UnitSearchState unitState = (UnitSearchState) searchState;
                Unit unit = unitState.getUnit();
                sb.insert(0, ' ' + unit.getName());
            }
            token = token.getPredecessor();
        }
        return sb.toString().trim();
    }
View Full Code Here

        Graph hmmGraph = new Graph();

        hmmGraph.copyGraph(cdGraph);

        for (Node node : hmmGraph.nodeToArray()) {
          Unit unit = null;
            if (node.getType().equals(NodeType.PHONE)) {
                unit = unitManager.getUnit(node.getID());
            } else if (node.getType().equals(NodeType.SILENCE_WITH_LOOPBACK)) {
              unit = unitManager.getUnit("SIL");
            } else {
View Full Code Here

TOP

Related Classes of edu.cmu.sphinx.linguist.acoustic.Unit

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.