Package edu.cmu.sphinx.util.props

Examples of edu.cmu.sphinx.util.props.ConfigurationManager.lookup()


            recorder.initialize();
            audio = new AudioData();

            frontEnd = (FrontEnd) cm.lookup(FRONT_END);
            dataSource = (StreamDataSource) cm.lookup(DATA_SOURCE);
            cepstrumFrontEnd = (FrontEnd) cm.lookup(CESPTRUM_FRONT_END);
            cepstrumDataSource = (StreamDataSource) cm.lookup(CEPSTRUM_DATA_SOURCE);


            PropertySheet ps = cm.getPropertySheet(WINDOWER);
            float windowShiftInMs = ps.getFloat(RaisedCosineWindower.PROP_WINDOW_SHIFT_MS);
View Full Code Here


            audio = new AudioData();

            frontEnd = (FrontEnd) cm.lookup(FRONT_END);
            dataSource = (StreamDataSource) cm.lookup(DATA_SOURCE);
            cepstrumFrontEnd = (FrontEnd) cm.lookup(CESPTRUM_FRONT_END);
            cepstrumDataSource = (StreamDataSource) cm.lookup(CEPSTRUM_DATA_SOURCE);


            PropertySheet ps = cm.getPropertySheet(WINDOWER);
            float windowShiftInMs = ps.getFloat(RaisedCosineWindower.PROP_WINDOW_SHIFT_MS);
View Full Code Here

                url = FeatureFileDumper.class
                        .getResource("frontend.config.xml");
            }
            ConfigurationManager cm = new ConfigurationManager(url);
           
            if(cm.lookup(frontEndName) == null) {
              throw new RuntimeException("No such frontend: " + frontEndName);
            }
           
            FeatureFileDumper dumper = new FeatureFileDumper(cm, frontEndName);
View Full Code Here

        if (!configFile.exists())
            Assert.fail("can not find configuration file to be used for test");

        ConfigurationManager cm = new ConfigurationManager(configFile.toURI().toURL());

        DummyComp dc = (DummyComp) cm.lookup("duco");

        Assert.assertEquals(dc.getBeamWidth(), 123);
        Assert.assertEquals(9.99, dc.getAlpha(), 1E-10);

        Assert.assertTrue(dc.getFrontEnd() != null);
View Full Code Here

        ConfigurationManager cm = new ConfigurationManager(configFile.toURI().toURL());

        int newBeamWidth = 4711;
        ConfigurationManagerUtils.setProperty(cm, "beamWidth", String.valueOf(newBeamWidth));

        DummyComp dummyComp = (DummyComp) cm.lookup("duco");
        Assert.assertEquals(newBeamWidth, dummyComp.getBeamWidth());
    }
}
View Full Code Here

    public void testElement(String frontendName, String name)
            throws IOException {
        URL url = getClass().getResource("frontend.xml");
        ConfigurationManager cm = new ConfigurationManager(url);

        AudioFileDataSource ds = cm.lookup("audioFileDataSource");
        ds.setAudioFile(getClass().getResource("test-feat.wav"), null);

        FrontEnd frontend = cm.lookup(frontendName);
        compareDump(frontend, name);
    }
View Full Code Here

        ConfigurationManager cm = new ConfigurationManager(url);

        AudioFileDataSource ds = cm.lookup("audioFileDataSource");
        ds.setAudioFile(getClass().getResource("test-feat.wav"), null);

        FrontEnd frontend = cm.lookup(frontendName);
        compareDump(frontend, name);
    }

    private void compareDump(FrontEnd frontend, String name)
            throws NumberFormatException, DataProcessingException, IOException {
View Full Code Here

            ConfigurationManager cm = new ConfigurationManager();

            String instanceName = "testconf";
            cm.addConfigurable(TestConfigurable.class, instanceName);

            cm.lookup(instanceName);
            Assert.fail("add didn't fail without given default frontend");
        } catch (NullPointerException e) {
        } catch (PropertyException e) {
        }
    }
View Full Code Here

        URL lm = getClass().getResource("hellongram.trigram.lm");

        ConfigurationManager cm = new ConfigurationManager(configURL);
        setProperty(cm, "trigramModel", "location", lm.toString());

        Recognizer recognizer = cm.lookup("recognizer");
        StreamDataSource dataSource = cm.lookup(StreamDataSource.class);

        AudioInputStream ais = getAudioInputStream(audioFileURL);
        dataSource.setInputStream(ais);
View Full Code Here

        ConfigurationManager cm = new ConfigurationManager(configURL);
        setProperty(cm, "trigramModel", "location", lm.toString());

        Recognizer recognizer = cm.lookup("recognizer");
        StreamDataSource dataSource = cm.lookup(StreamDataSource.class);

        AudioInputStream ais = getAudioInputStream(audioFileURL);
        dataSource.setInputStream(ais);

        recognizer.allocate();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.