Package edu.cmu.sphinx.linguist.dictionary

Examples of edu.cmu.sphinx.linguist.dictionary.Dictionary


    public void testNgram() throws IOException {
        URL dictUrl = getClass().getResource("100.dict");
        URL noisedictUrl = getClass()
                .getResource("/edu/cmu/sphinx/models/acoustic/wsj/noisedict");

        Dictionary dictionary = new FullDictionary(dictUrl,
                                                   noisedictUrl,
                                                   null,
                                                   false,
                                                   null,
                                                   false,
                                                   false,
                                                   new UnitManager());

        URL lm = getClass().getResource("100.arpa.dmp");
        LargeTrigramModel model = new LargeTrigramModel("",
                                                        lm,
                                                        null,
                                                        100,
                                                        100,
                                                        false,
                                                        3,
                                                        dictionary,
                                                        false,
                                                        1.0f,
                                                        1.0f,
                                                        1.0f,
                                                        false);
        dictionary.allocate();
        model.allocate();
        assertThat(model.getMaxDepth(), equalTo(3));

        Word[] words = {
            new Word("huggins", null, false),
View Full Code Here


    public void testForcedAlignerGrammar() throws IOException, URISyntaxException {
        URL dictionaryUrl = getClass().getResource("FSTGrammarTest.dic");
        URL noisedictUrl = getClass()
                .getResource("/edu/cmu/sphinx/models/acoustic/wsj/noisedict");

        Dictionary dictionary = new FastDictionary(dictionaryUrl,
                                                   noisedictUrl,
                                                   null,
                                                   false,
                                                   null,
                                                   false,
View Full Code Here

                .getResource(
                             "/edu/cmu/sphinx/models/acoustic/wsj/dict/digits.dict");
        URL noisedictUrl = getClass()
                .getResource("/edu/cmu/sphinx/models/acoustic/wsj/noisedict");

        Dictionary dictionary = new FastDictionary(dictionaryUrl,
                                                   noisedictUrl,
                                                   null,
                                                   false,
                                                   null,
                                                   false,
View Full Code Here

    /*
    * Build a word graph from this transcript
    */
    private Graph buildWordGraph(Transcript transcript) {
        Graph graph;
        Dictionary transcriptDict = transcript.getDictionary();
        // Make sure the dictionary is a TrainerDictionary before we cast
        assert
                transcriptDict.getClass().getName().endsWith("TrainerDictionary");
        dictionary = (TrainerDictionary) transcriptDict;

        transcript.startWordIterator();
        /* Shouldn't node and edge be part of the graph class? */

 
View Full Code Here

TOP

Related Classes of edu.cmu.sphinx.linguist.dictionary.Dictionary

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.