Package edu.cmu.sphinx.util

Examples of edu.cmu.sphinx.util.Timer


        allocateAcousticModel();
        grammar.allocate();
        hmmPool = new HMMPool(acousticModel, logger, unitManager);
        nodeToNextUnitArrayMap = new HashMap<GrammarNode, int[]>();
        nodeToUnitSetMap = new HashMap<GrammarNode, Set<Unit>>();
        Timer timer = TimerPool.getTimer(this, "compileGrammar");
        timer.start();
        compileGrammar();
        timer.stop();
        logger.info("Done allocating  DFLAT");
    }
View Full Code Here


    public void allocate() throws IOException {
        if (!allocated) {
            dictionary = new HashMap<String, String>();
            wordDictionary = new HashMap<String, Word>();

            Timer loadTimer = TimerPool.getTimer(this, "Load Dictionary");
            fillerWords = new HashSet<String>();

            loadTimer.start();

            logger.info("Loading dictionary from: " + wordDictionaryFile);

            loadDictionary(wordDictionaryFile.openStream(), false);

            loadCustomDictionaries(addendaUrlList);

            logger.info("Loading filler dictionary from: "
                    + fillerDictionaryFile);

            loadDictionary(fillerDictionaryFile.openStream(), true);

            if (g2pModelFile != null && !g2pModelFile.getPath().equals("")) {
                g2pDecoder = new G2PConverter(g2pModelFile);
            }
            loadTimer.stop();
        }

    }
View Full Code Here

    /** Create the grammar
     * @throws java.io.IOException*/
    public void allocate() throws IOException {
        dictionary.allocate();
        newGrammar();
        Timer timer = TimerPool.getTimer(this, "grammarLoad");
        timer.start();
        initialNode = createGrammar();
        timer.stop();
    }
View Full Code Here

    allocateAcousticModel();
    grammar.allocate();
    hmmPool = new HMMPool(acousticModel, logger, unitManager);
    nodeToNextUnitArrayMap = new HashMap<GrammarNode, int[]>();
    nodeToUnitSetMap = new HashMap<GrammarNode, Set<Unit>>();
    Timer timer = TimerPool.getTimer(this, "compileGrammar");
    timer.start();
    compileGrammar();
    timer.stop();
    logger.info("Done allocating  DFLAT");
  }
View Full Code Here

        // this test invokes the linguist using access patterns that
        // are similar to a real search. It allows for timing and
        // profiling of the linguist, independent of the search
        // or scoring
        Random random = new Random(1000);
        Timer frameTimer = TimerPool.getTimer(this, "frameTimer");
        Timer totalTimer = TimerPool.getTimer(this, "totalTimer");
        // Note: this comparator imposes orderings that are
        // inconsistent with equals.
        System.out.println("TestLinguist: runs " + numRuns + " frames "
                + numFrames + " beam " + maxBeam);
        totalTimer.start();
        for (int runs = 0; runs < numRuns; runs++) {
            int level = 0;
            List<SearchState> activeList = new ArrayList<SearchState>();
            activeList.add(linguist.getSearchGraph().getInitialState());
            linguist.startRecognition();
            for (int i = 0; i < numFrames; i++) {
                List<SearchState> oldList = activeList;
                activeList = new ArrayList<SearchState>(maxBeam * 10);
                frameTimer.start();
                for (SearchState nextStates : oldList) {
                    expandState(level, activeList, nextStates);
                }
                frameTimer.stop();
                Collections.shuffle(activeList, random);
                if (activeList.size() > maxBeam) {
                    activeList = activeList.subList(0, maxBeam);
                }
            }
            linguist.stopRecognition();
            frameTimer.dump();
        }
        totalTimer.stop();
        System.out.println(" MaxSuccessors : " + maxSuccessors);
        System.out.println(" TotalStates   : " + totalStates);
        System.out.println(" TotalEmitting : " + totalEmittingStates);
        System.out.println("   NonEmitting : " + totalNonEmittingStates);
        System.out.println("  Final States : " + totalFinalStates);
View Full Code Here

TOP

Related Classes of edu.cmu.sphinx.util.Timer

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.