kadosu-dev team mailing list archive
-
kadosu-dev team
-
Mailing list archive
-
Message #00016
[Branch ~kadosu-dev/kadosu/main] Rev 106: o add first speech plugin that has no models, configs and trained data
------------------------------------------------------------
revno: 106
committer: Martin Schaaf <mascha@xxxxxxxxxx>
branch nick: kadosu
timestamp: Mon 2009-11-09 20:08:09 +0100
message:
o add first speech plugin that has no models, configs and trained data
o it is meant to be the root for other language specific speech plugins
added:
org.kadosu.plugin.speech/
org.kadosu.plugin.speech/.classpath
org.kadosu.plugin.speech/.project
org.kadosu.plugin.speech/META-INF/
org.kadosu.plugin.speech/META-INF/MANIFEST.MF
org.kadosu.plugin.speech/build.properties
org.kadosu.plugin.speech/src/
org.kadosu.plugin.speech/src/main/
org.kadosu.plugin.speech/src/main/java/
org.kadosu.plugin.speech/src/main/java/org/
org.kadosu.plugin.speech/src/main/java/org/kadosu/
org.kadosu.plugin.speech/src/main/java/org/kadosu/archive/
org.kadosu.plugin.speech/src/main/java/org/kadosu/archive/plugin/
org.kadosu.plugin.speech/src/main/java/org/kadosu/archive/plugin/speech/
org.kadosu.plugin.speech/src/main/java/org/kadosu/document/
org.kadosu.plugin.speech/src/main/java/org/kadosu/document/plugin/
org.kadosu.plugin.speech/src/main/java/org/kadosu/document/plugin/speech/
org.kadosu.plugin.speech/src/main/java/org/kadosu/document/plugin/speech/DocumentSpeech.java
org.kadosu.plugin.speech/src/main/java/org/kadosu/document/plugin/speech/DocumentSpeechHandler.java
org.kadosu.plugin.speech/src/main/java/org/kadosu/document/plugin/speech/IDocumentSpeech.java
org.kadosu.plugin.speech/src/main/java/org/kadosu/plugin/
org.kadosu.plugin.speech/src/main/java/org/kadosu/plugin/speech/
org.kadosu.plugin.speech/src/main/java/org/kadosu/plugin/speech/SpeechPlugin.java
org.kadosu.plugin.speech/src/test/
org.kadosu.plugin.speech/src/test/java/
org.kadosu.plugin.speech/src/test/java/edu/
org.kadosu.plugin.speech/src/test/java/edu/cmu/
org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/
org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/
org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/
org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/
org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/Model.java
org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/ModelLoader.java
org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/PropertiesDumper.java
org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/README
org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/dictionary
org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/fillerdict
org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/license.terms
org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/model.props
org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/wd_dependent_phone.500.mdef
org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/wd_dependent_phone.cd_continuous_8gau/
org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/wd_dependent_phone.cd_continuous_8gau/means
org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/wd_dependent_phone.cd_continuous_8gau/mixture_weights
org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/wd_dependent_phone.cd_continuous_8gau/transition_matrices
org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/wd_dependent_phone.cd_continuous_8gau/variances
org.kadosu.plugin.speech/src/test/java/org/
org.kadosu.plugin.speech/src/test/java/org/kadosu/
org.kadosu.plugin.speech/src/test/java/org/kadosu/document/
org.kadosu.plugin.speech/src/test/java/org/kadosu/document/plugin/
org.kadosu.plugin.speech/src/test/java/org/kadosu/document/plugin/speech/
org.kadosu.plugin.speech/src/test/java/org/kadosu/document/plugin/speech/DocumentSpeechHandlerTest.java
org.kadosu.plugin.speech/src/test/java/org/kadosu/document/plugin/speech/DocumentSpeechTest.java
org.kadosu.plugin.speech/src/test/java/org/kadosu/document/plugin/speech/org/
org.kadosu.plugin.speech/src/test/java/org/kadosu/document/plugin/speech/org/kadosu/
org.kadosu.plugin.speech/src/test/java/org/kadosu/document/plugin/speech/org/kadosu/document/
org.kadosu.plugin.speech/src/test/java/org/kadosu/document/plugin/speech/org/kadosu/document/plugin/
org.kadosu.plugin.speech/src/test/java/org/kadosu/document/plugin/speech/org/kadosu/document/plugin/speech/
org.kadosu.plugin.speech/src/test/resources/
org.kadosu.plugin.speech/src/test/resources/org/
org.kadosu.plugin.speech/src/test/resources/org/kadosu/
org.kadosu.plugin.speech/src/test/resources/org/kadosu/document/
org.kadosu.plugin.speech/src/test/resources/org/kadosu/document/plugin/
org.kadosu.plugin.speech/src/test/resources/org/kadosu/document/plugin/speech/
org.kadosu.plugin.speech/src/test/resources/org/kadosu/document/plugin/speech/digits.gram
org.kadosu.plugin.speech/src/test/resources/speechConfig.xml
--
lp:kadosu
https://code.launchpad.net/~kadosu-dev/kadosu/main
Your team Kadosu Developer is subscribed to branch lp:kadosu.
To unsubscribe from this branch go to https://code.launchpad.net/~kadosu-dev/kadosu/main/+edit-subscription.
=== added directory 'org.kadosu.plugin.speech'
=== added file 'org.kadosu.plugin.speech/.classpath'
--- org.kadosu.plugin.speech/.classpath 1970-01-01 00:00:00 +0000
+++ org.kadosu.plugin.speech/.classpath 2009-11-09 19:08:09 +0000
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" path="src/test/resources"/>
+ <classpathentry kind="src" path="src/test/java"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
=== added file 'org.kadosu.plugin.speech/.project'
--- org.kadosu.plugin.speech/.project 1970-01-01 00:00:00 +0000
+++ org.kadosu.plugin.speech/.project 2009-11-09 19:08:09 +0000
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.kadosu.plugin.speech</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
+ </natures>
+</projectDescription>
=== added directory 'org.kadosu.plugin.speech/META-INF'
=== added file 'org.kadosu.plugin.speech/META-INF/MANIFEST.MF'
--- org.kadosu.plugin.speech/META-INF/MANIFEST.MF 1970-01-01 00:00:00 +0000
+++ org.kadosu.plugin.speech/META-INF/MANIFEST.MF 2009-11-09 19:08:09 +0000
@@ -0,0 +1,12 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Speech Plug-in
+Bundle-SymbolicName: org.kadosu.plugin.speech
+Bundle-Version: 1.0.0
+Bundle-Activator: org.kadosu.plugin.speech.SpeechPlugin
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Import-Package: org.osgi.framework;version="1.3.0"
+Require-Bundle: org.kadosu;bundle-version="0.2.0",
+ edu.cmu.sphinx;bundle-version="1.0.0"
+Export-Package: org.kadosu.document.plugin.speech
=== added file 'org.kadosu.plugin.speech/build.properties'
--- org.kadosu.plugin.speech/build.properties 1970-01-01 00:00:00 +0000
+++ org.kadosu.plugin.speech/build.properties 2009-11-09 19:08:09 +0000
@@ -0,0 +1,11 @@
+bin.includes = META-INF/,\
+ org.kadosu.plugin.speech.jar
+jars.compile.order = org.kadosu.plugin.speech.jar
+source.org.kadosu.plugin.speech.jar = src/main/java/
+output.org.kadosu.plugin.speech.jar = bin/
+src.includes = build.properties,\
+ META-INF/,\
+ src/,\
+ .settings/,\
+ .project,\
+ .classpath
=== added directory 'org.kadosu.plugin.speech/src'
=== added directory 'org.kadosu.plugin.speech/src/main'
=== added directory 'org.kadosu.plugin.speech/src/main/java'
=== added directory 'org.kadosu.plugin.speech/src/main/java/org'
=== added directory 'org.kadosu.plugin.speech/src/main/java/org/kadosu'
=== added directory 'org.kadosu.plugin.speech/src/main/java/org/kadosu/archive'
=== added directory 'org.kadosu.plugin.speech/src/main/java/org/kadosu/archive/plugin'
=== added directory 'org.kadosu.plugin.speech/src/main/java/org/kadosu/archive/plugin/speech'
=== added directory 'org.kadosu.plugin.speech/src/main/java/org/kadosu/document'
=== added directory 'org.kadosu.plugin.speech/src/main/java/org/kadosu/document/plugin'
=== added directory 'org.kadosu.plugin.speech/src/main/java/org/kadosu/document/plugin/speech'
=== added file 'org.kadosu.plugin.speech/src/main/java/org/kadosu/document/plugin/speech/DocumentSpeech.java'
--- org.kadosu.plugin.speech/src/main/java/org/kadosu/document/plugin/speech/DocumentSpeech.java 1970-01-01 00:00:00 +0000
+++ org.kadosu.plugin.speech/src/main/java/org/kadosu/document/plugin/speech/DocumentSpeech.java 2009-11-09 19:08:09 +0000
@@ -0,0 +1,115 @@
+package org.kadosu.document.plugin.speech;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.Reader;
+import java.io.StringReader;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.kadosu.document.IDocument;
+import org.kadosu.exception.KDSAccessException;
+import org.kadosu.misc.Logger;
+import org.kadosu.plugin.speech.SpeechPlugin;
+
+import edu.cmu.sphinx.frontend.util.AudioFileDataSource;
+import edu.cmu.sphinx.recognizer.Recognizer;
+import edu.cmu.sphinx.result.Result;
+import edu.cmu.sphinx.util.props.ConfigurationManager;
+
+public class DocumentSpeech implements IDocument, IDocumentSpeech {
+
+ private static Logger LOG = new Logger( SpeechPlugin.ID);
+
+ private File fPath;
+
+ private String fConfigFile;
+
+ private ConfigurationManager fCm;
+
+ @Override
+ public void close() {
+ fPath = null;
+ }
+
+ @Override
+ public Reader getContent() throws KDSAccessException {
+ try {
+ fCm = getConfigurationManager();
+
+ Recognizer recognizer = (Recognizer) fCm.lookup( "recognizer");
+ recognizer.allocate();
+
+ AudioFileDataSource dataSource = (AudioFileDataSource) fCm.lookup( "audioFileDataSource");
+ dataSource.setAudioFile( fPath, null);
+
+ Result result = recognizer.recognize();
+ String bestFinalResultNoFiller = result.getBestFinalResultNoFiller();
+ return new BufferedReader( new StringReader( bestFinalResultNoFiller));
+ } catch (Exception e) {
+ LOG.error( "Error on access file '" + fPath + "'", e);
+ throw new KDSAccessException( "Error on access file '" + fPath + "'");
+ }
+ }
+
+ @Override
+ public long getDate() {
+ long result = 0;
+ if (null != fPath) {
+ result = fPath.lastModified();
+ }
+ return result;
+ }
+
+ @Override
+ public Map<String, String> getExtra() {
+ return new HashMap<String, String>();
+ }
+
+ @Override
+ public String getPath() {
+ String result = null;
+
+ if (null != fPath) {
+ result = fPath.getAbsolutePath();
+ }
+
+ return result;
+ }
+
+ /**
+ * @throws KDSAccessException
+ */
+ @Override
+ public void setDocument( String path) throws KDSAccessException {
+ fPath = new File( path);
+ if (!fPath.isFile() || !fPath.canRead()) {
+ throw new KDSAccessException( "Cannot read file " + path);
+ }
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.kadosu.document.plugin.speech.IDocumentSpeech#setConfigFile(java.lang.String)
+ */
+ public void setConfigFile( String configFile) {
+ fConfigFile = configFile;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.kadosu.document.plugin.speech.IDocumentSpeech#getConfigFile()
+ */
+ public String getConfigFile() {
+ return fConfigFile;
+ }
+
+ private ConfigurationManager getConfigurationManager() {
+ fCm = new ConfigurationManager( fConfigFile);
+ return fCm;
+
+ }
+
+}
=== added file 'org.kadosu.plugin.speech/src/main/java/org/kadosu/document/plugin/speech/DocumentSpeechHandler.java'
--- org.kadosu.plugin.speech/src/main/java/org/kadosu/document/plugin/speech/DocumentSpeechHandler.java 1970-01-01 00:00:00 +0000
+++ org.kadosu.plugin.speech/src/main/java/org/kadosu/document/plugin/speech/DocumentSpeechHandler.java 2009-11-09 19:08:09 +0000
@@ -0,0 +1,36 @@
+package org.kadosu.document.plugin.speech;
+
+import java.io.File;
+import java.io.IOException;
+
+import javax.sound.sampled.AudioFileFormat;
+import javax.sound.sampled.AudioSystem;
+
+import org.kadosu.document.IDocumentHandler;
+import org.kadosu.exception.KDSAccessException;
+import org.kadosu.misc.Logger;
+import org.kadosu.plugin.speech.SpeechPlugin;
+
+public class DocumentSpeechHandler implements IDocumentHandler {
+
+ private static Logger LOG = new Logger( SpeechPlugin.ID);
+
+ @Override
+ public boolean isDocument( String path) throws KDSAccessException {
+ boolean result = false;
+
+ try {
+ File file = new File( path);
+ AudioFileFormat aff = AudioSystem.getAudioFileFormat( file);
+ if (null != aff) {
+ result = true;
+ }
+ } catch (IOException e) {
+ throw new KDSAccessException( e.getMessage());
+ } catch (Exception e) {
+ LOG.error( "File not supported '" + path + "'", e);
+ }
+
+ return result;
+ }
+}
=== added file 'org.kadosu.plugin.speech/src/main/java/org/kadosu/document/plugin/speech/IDocumentSpeech.java'
--- org.kadosu.plugin.speech/src/main/java/org/kadosu/document/plugin/speech/IDocumentSpeech.java 1970-01-01 00:00:00 +0000
+++ org.kadosu.plugin.speech/src/main/java/org/kadosu/document/plugin/speech/IDocumentSpeech.java 2009-11-09 19:08:09 +0000
@@ -0,0 +1,9 @@
+package org.kadosu.document.plugin.speech;
+
+public interface IDocumentSpeech {
+
+ public abstract void setConfigFile( String configFile);
+
+ public abstract String getConfigFile();
+
+}
=== added directory 'org.kadosu.plugin.speech/src/main/java/org/kadosu/plugin'
=== added directory 'org.kadosu.plugin.speech/src/main/java/org/kadosu/plugin/speech'
=== added file 'org.kadosu.plugin.speech/src/main/java/org/kadosu/plugin/speech/SpeechPlugin.java'
--- org.kadosu.plugin.speech/src/main/java/org/kadosu/plugin/speech/SpeechPlugin.java 1970-01-01 00:00:00 +0000
+++ org.kadosu.plugin.speech/src/main/java/org/kadosu/plugin/speech/SpeechPlugin.java 2009-11-09 19:08:09 +0000
@@ -0,0 +1,26 @@
+package org.kadosu.plugin.speech;
+
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+
+public class SpeechPlugin implements BundleActivator {
+
+ public static final String ID = SpeechPlugin.class.getCanonicalName();
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext )
+ */
+ public void start( BundleContext context) throws Exception {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop( BundleContext context) throws Exception {
+ }
+
+}
=== added directory 'org.kadosu.plugin.speech/src/test'
=== added directory 'org.kadosu.plugin.speech/src/test/java'
=== added directory 'org.kadosu.plugin.speech/src/test/java/edu'
=== added directory 'org.kadosu.plugin.speech/src/test/java/edu/cmu'
=== added directory 'org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx'
=== added directory 'org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model'
=== added directory 'org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic'
=== added directory 'org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz'
=== added file 'org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/Model.java'
--- org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/Model.java 1970-01-01 00:00:00 +0000
+++ org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/Model.java 2009-11-09 19:08:09 +0000
@@ -0,0 +1,610 @@
+/*
+ * Copyright 1999-2002 Carnegie Mellon University.
+ * Portions Copyright 2002 Sun Microsystems, Inc.
+ * Portions Copyright 2002 Mitsubishi Electric Research Laboratories.
+ * All Rights Reserved. Use is subject to license terms.
+ *
+ * See the file "license.terms" for information on usage and
+ * redistribution of this file, and for a DISCLAIMER OF ALL
+ * WARRANTIES.
+ *
+ */
+
+package edu.cmu.sphinx.model.acoustic.TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz;
+
+
+ import edu.cmu.sphinx.linguist.acoustic.tiedstate.*;
+
+
+import edu.cmu.sphinx.linguist.acoustic.*;
+import edu.cmu.sphinx.util.Timer;
+import edu.cmu.sphinx.util.props.*;
+
+import java.io.IOException;
+import java.util.*;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * Loads a tied-state acoustic model generated by the Sphinx-3 trainer.
+ * <p/>
+ * <p/>
+ * It is not the goal of this documentation to provide an explanation about the concept of HMMs. The explanation below
+ * is superficial, and provided only in a way that the files in the acoustic model package make sense.
+ * <p/>
+ * An HMM models a process using a sequence of states. Associated with each state, there is a probability density
+ * function. A popular choice for this function is a Gaussian mixture, that is, a summation of Gaussians. As you may
+ * recall, a single Gaussian is defined by a mean and a variance, or, in the case of a multidimensional Gaussian, by a
+ * mean vector and a covariance matrix, or, under some simplifying assumptions, a variance vector. The "means" and
+ * "variances" files in the "continuous" directory contain exactly this: a table in which each line contains a mean
+ * vector or a variance vector respectively. The dimension of these vectors is the same as the incoming data, the
+ * encoded speech signal. The Gaussian mixture is a summation of Gaussians, with different weights for different
+ * Gaussians. The "mixture_weights" file contains this: each line contains the weights for a combination of Gaussians.
+ * <p/>
+ * The HMM is a model with a set of states. The transitions between states have an associated probability. These
+ * probabilities make up the transition matrices stored in the "transition_matrices" file.
+ * <p/>
+ * The files in the "continuous" directory are, therefore, tables, or pools, of means, variances, mixture weights, and
+ * transition probabilities.
+ * <p/>
+ * The dictionary is a file that maps words to their phonetic transcriptions, that is, it maps words to sequences of
+ * phonemes.
+ * <p/>
+ * The language model contains information about probabilities of words in a language. These probabilities could be for
+ * individual words or for sequences of two or three words.
+ * <p/>
+ * The model definition file in a way ties everything together. If the recognition system models phonemes, there is an
+ * HMM for each phoneme. The model definition file has one line for each phoneme. The phoneme could be in a context
+ * dependent or independent. Each line, therefore, identifies a unique HMM. This line has the phoneme identification,
+ * the non-required left or right context, the index of a transition matrix, and, for each state, the index of a mean
+ * vector, a variance vector, and a set of mixture weights.
+ */
+@SuppressWarnings({"UnnecessaryLocalVariable"})
+public class Model implements AcousticModel {
+
+ /** The property that defines the component used to load the acoustic model */
+ @S4Component(type = Loader.class)
+ public final static String PROP_LOADER = "loader";
+
+ /** The property that defines the unit manager */
+ @S4Component(type = UnitManager.class)
+ public final static String PROP_UNIT_MANAGER = "unitManager";
+
+ /** Controls whether we generate composites or CI units when no context is given during a lookup. */
+ @S4Boolean(defaultValue = true)
+ public final static String PROP_USE_COMPOSITES = "useComposites";
+
+ /** The default value of PROP_USE_COMPOSITES. */
+ public final static boolean PROP_USE_COMPOSITES_DEFAULT = true;
+
+
+ /** Model load timer */
+ protected final static String TIMER_LOAD = "AM_Load";
+
+
+ // -----------------------------
+ // Configured variables
+ // -----------------------------
+ protected String name;
+ private Logger logger;
+ protected Loader loader;
+ protected UnitManager unitManager;
+ private boolean useComposites = false;
+ private Properties properties;
+
+ // ----------------------------
+ // internal variables
+ // -----------------------------
+ transient protected Timer loadTimer;
+ transient private Map<String, SenoneSequence> compositeSenoneSequenceCache = new HashMap<String, SenoneSequence>();
+ private boolean allocated = false;
+
+
+ /* (non-Javadoc)
+ * @see edu.cmu.sphinx.util.props.Configurable#newProperties(edu.cmu.sphinx.util.props.PropertySheet)
+ */
+ public void newProperties(PropertySheet ps) throws PropertyException {
+ loader = (Loader) ps.getComponent(PROP_LOADER);
+ unitManager = (UnitManager) ps.getComponent(PROP_UNIT_MANAGER
+ );
+ useComposites =
+ ps.getBoolean(PROP_USE_COMPOSITES);
+ logger = ps.getLogger();
+ }
+
+
+ /**
+ * initialize this acoustic model with the given name and context.
+ *
+ * @throws IOException if the model could not be loaded
+ */
+ public void allocate() throws IOException {
+ if (!allocated) {
+ this.loadTimer = Timer.getTimer(TIMER_LOAD);
+ loadTimer.start();
+ loader.load();
+ loadTimer.stop();
+ logInfo();
+ allocated = true;
+ }
+ }
+
+
+ /* (non-Javadoc)
+ * @see edu.cmu.sphinx.linguist.acoustic.AcousticModel#deallocate()
+ */
+ public void deallocate() {
+ }
+
+
+ /**
+ * Returns the name of this AcousticModel, or null if it has no name.
+ *
+ * @return the name of this AcousticModel, or null if it has no name
+ */
+ public String getName() {
+ return name;
+ }
+
+
+ /**
+ * Gets a composite HMM for the given unit and context
+ *
+ * @param unit the unit for the hmm
+ * @param position the position of the unit within the word
+ * @return a composite HMM
+ */
+ private HMM getCompositeHMM(Unit unit, HMMPosition position) {
+
+
+ if (true) { // use a true composite
+ Unit ciUnit = unitManager.getUnit(unit.getName(),
+ unit.isFiller(), Context.EMPTY_CONTEXT);
+
+ SenoneSequence compositeSequence =
+ getCompositeSenoneSequence(unit, position);
+
+ SenoneHMM contextIndependentHMM = (SenoneHMM)
+ lookupNearestHMM(ciUnit,
+ HMMPosition.UNDEFINED, true);
+ float[][] tmat = contextIndependentHMM.getTransitionMatrix();
+ return new SenoneHMM(unit, compositeSequence, tmat, position);
+ } else { // BUG: just a test. use CI units instead of composites
+ Unit ciUnit = lookupUnit(unit.getName());
+
+ assert unit.isContextDependent();
+ if (ciUnit == null) {
+ logger.severe("Can't find HMM for " + unit.getName());
+ }
+ assert ciUnit != null;
+ assert !ciUnit.isContextDependent();
+
+ HMMManager mgr = loader.getHMMManager();
+ HMM hmm = mgr.get(HMMPosition.UNDEFINED, ciUnit);
+ return hmm;
+ }
+ }
+
+
+ /**
+ * Given a unit, returns the HMM that best matches the given unit. If exactMatch is false and an exact match is not
+ * found, then different word positions are used. If any of the contexts are non-silence filler units. a silence
+ * filler unit is tried instead.
+ *
+ * @param unit the unit of interest
+ * @param position the position of the unit of interest
+ * @param exactMatch if true, only an exact match is acceptable.
+ * @return the HMM that best matches, or null if no match could be found.
+ */
+ public HMM lookupNearestHMM(Unit unit, HMMPosition position,
+ boolean exactMatch) {
+
+ if (exactMatch) {
+ return lookupHMM(unit, position);
+ } else {
+ HMMManager mgr = loader.getHMMManager();
+ HMM hmm = mgr.get(position, unit);
+
+ if (hmm != null) {
+ return hmm;
+ }
+ // no match, try a composite
+
+ if (useComposites && hmm == null) {
+ if (isComposite(unit)) {
+
+ hmm = getCompositeHMM(unit, position);
+ if (hmm != null) {
+ mgr.put(hmm);
+ }
+ }
+ }
+ // no match, try at other positions
+ if (hmm == null) {
+ hmm = getHMMAtAnyPosition(unit);
+ }
+ // still no match, try different filler
+ if (hmm == null) {
+ hmm = getHMMInSilenceContext(unit, position);
+ }
+
+ // still no match, backoff to base phone
+ if (hmm == null) {
+ Unit ciUnit = lookupUnit(unit.getName());
+
+ assert unit.isContextDependent();
+ if (ciUnit == null) {
+ logger.severe("Can't find HMM for " + unit.getName());
+ }
+ assert ciUnit != null;
+ assert !ciUnit.isContextDependent();
+
+ hmm = mgr.get(HMMPosition.UNDEFINED, ciUnit);
+ }
+
+ assert hmm != null;
+
+ // System.out.println("PROX match for "
+ // + unit + " at " + position + ":" + hmm);
+
+ return hmm;
+ }
+ }
+
+
+ /**
+ * Determines if a unit is a composite unit
+ *
+ * @param unit the unit to test
+ * @return true if the unit is missing a right context
+ */
+ private boolean isComposite(Unit unit) {
+
+ if (unit.isFiller()) {
+ return false;
+ }
+
+ Context context = unit.getContext();
+ if (context instanceof LeftRightContext) {
+ LeftRightContext lrContext = (LeftRightContext) context;
+ if (lrContext.getRightContext() == null) {
+ return true;
+ }
+ if (lrContext.getLeftContext() == null) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+
+ /**
+ * Looks up the context independent unit given the name
+ *
+ * @param name the name of the unit
+ * @return the unit or null if the unit was not found
+ */
+ private Unit lookupUnit(String name) {
+ return loader.getContextIndependentUnits().get(name);
+ }
+
+
+ /**
+ * Returns an iterator that can be used to iterate through all the HMMs of the acoustic model
+ *
+ * @return an iterator that can be used to iterate through all HMMs in the model. The iterator returns objects of
+ * type <code>HMM</code>.
+ */
+ public Iterator getHMMIterator() {
+ return loader.getHMMManager().getIterator();
+ }
+
+
+ /**
+ * Returns an iterator that can be used to iterate through all the CI units in the acoustic model
+ *
+ * @return an iterator that can be used to iterate through all CI units. The iterator returns objects of type
+ * <code>Unit</code>
+ */
+ public Iterator<Unit> getContextIndependentUnitIterator() {
+ return loader.getContextIndependentUnits().values().iterator();
+ }
+
+
+ /**
+ * Get a composite senone sequence given the unit The unit should have a LeftRightContext, where one or two of
+ * 'left' or 'right' may be null to indicate that the match should succeed on any context.
+ *
+ * @param unit the unit
+ */
+ public SenoneSequence getCompositeSenoneSequence(Unit unit,
+ HMMPosition position) {
+ Context context = unit.getContext();
+ SenoneSequence compositeSenoneSequence = null;
+ compositeSenoneSequence = compositeSenoneSequenceCache.get(unit.toString());
+
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("getCompositeSenoneSequence: " + unit.toString()
+ + ((compositeSenoneSequence != null) ? "Cached" : ""));
+ }
+ if (compositeSenoneSequence != null) {
+ return compositeSenoneSequence;
+ }
+
+ // Iterate through all HMMs looking for
+ // a) An hmm with a unit that has the proper base
+ // b) matches the non-null context
+
+ List<SenoneSequence> senoneSequenceList = new ArrayList<SenoneSequence>();
+
+ // collect all senone sequences that match the pattern
+ for (Iterator i = getHMMIterator(); i.hasNext();) {
+ SenoneHMM hmm = (SenoneHMM) i.next();
+ if (hmm.getPosition() == position) {
+ Unit hmmUnit = hmm.getUnit();
+ if (hmmUnit.isPartialMatch(unit.getName(), context)) {
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("collected: " + hmm.getUnit().toString());
+ }
+ senoneSequenceList.add(hmm.getSenoneSequence());
+ }
+ }
+ }
+
+ // couldn't find any matches, so at least include the CI unit
+ if (senoneSequenceList.size() == 0) {
+ Unit ciUnit = unitManager.getUnit(unit.getName(), unit.isFiller());
+ SenoneHMM baseHMM = lookupHMM(ciUnit, HMMPosition.UNDEFINED);
+ senoneSequenceList.add(baseHMM.getSenoneSequence());
+ }
+
+ // Add this point we have all of the senone sequences that
+ // match the base/context pattern collected into the list.
+ // Next we build a CompositeSenone consisting of all of the
+ // senones in each position of the list.
+
+ // First find the longest senone sequence
+
+ int longestSequence = 0;
+ for (int i = 0; i < senoneSequenceList.size(); i++) {
+ SenoneSequence ss = senoneSequenceList.get(i);
+ if (ss.getSenones().length > longestSequence) {
+ longestSequence = ss.getSenones().length;
+ }
+ }
+
+ // now collect all of the senones at each position into
+ // arrays so we can create CompositeSenones from them
+ // QUESTION: is is possible to have different size senone
+ // sequences. For now lets assume the worst case.
+
+ List<CompositeSenone> compositeSenones = new ArrayList<CompositeSenone>();
+ float logWeight = 0.0f;
+ for (int i = 0; i < longestSequence; i++) {
+ Set<Senone> compositeSenoneSet = new HashSet<Senone>();
+ for (int j = 0; j < senoneSequenceList.size(); j++) {
+ SenoneSequence senoneSequence =
+ senoneSequenceList.get(j);
+ if (i < senoneSequence.getSenones().length) {
+ Senone senone = senoneSequence.getSenones()[i];
+ compositeSenoneSet.add(senone);
+ }
+ }
+ compositeSenones.add(CompositeSenone.create(
+ compositeSenoneSet, logWeight));
+ }
+
+ compositeSenoneSequence = SenoneSequence.create(compositeSenones);
+ compositeSenoneSequenceCache.put(unit.toString(),
+ compositeSenoneSequence);
+
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine(unit.toString() + " consists of " +
+ compositeSenones.size() + " composite senones");
+ if (logger.isLoggable(Level.FINEST)) {
+ compositeSenoneSequence.dump("am");
+ }
+ }
+ return compositeSenoneSequence;
+ }
+
+
+ /**
+ * Returns the size of the left context for context dependent units
+ *
+ * @return the left context size
+ */
+ public int getLeftContextSize() {
+ return loader.getLeftContextSize();
+ }
+
+
+ /**
+ * Returns the size of the right context for context dependent units
+ *
+ * @return the left context size
+ */
+ public int getRightContextSize() {
+ return loader.getRightContextSize();
+ }
+
+
+ /**
+ * Given a unit, returns the HMM that exactly matches the given unit.
+ *
+ * @param unit the unit of interest
+ * @param position the position of the unit of interest
+ * @return the HMM that exactly matches, or null if no match could be found.
+ */
+ private SenoneHMM lookupHMM(Unit unit, HMMPosition position) {
+ return (SenoneHMM) loader.getHMMManager().get(position, unit);
+ }
+
+
+ /**
+ * Creates a string useful for tagging a composite senone sequence
+ *
+ * @param base the base unit
+ * @param context the context
+ * @return the tag associated with the composite senone sequence
+ */
+ private String makeTag(Unit base, Context context) {
+ StringBuffer sb = new StringBuffer();
+ sb.append("(");
+ sb.append(base.getName());
+ sb.append("-");
+ sb.append(context.toString());
+ sb.append(")");
+ return sb.toString();
+ }
+
+
+ /** Dumps information about this model to the logger */
+ protected void logInfo() {
+ if (loader != null) {
+ loader.logInfo();
+ }
+ logger.info("CompositeSenoneSequences: " +
+ compositeSenoneSequenceCache.size());
+ }
+
+
+ /**
+ * Searches an hmm at any position
+ *
+ * @param unit the unit to search for
+ * @return hmm the hmm or null if it was not found
+ */
+ private SenoneHMM getHMMAtAnyPosition(Unit unit) {
+ SenoneHMM hmm = null;
+ HMMManager mgr = loader.getHMMManager();
+ for (Iterator i = HMMPosition.iterator();
+ hmm == null && i.hasNext();) {
+ HMMPosition pos = (HMMPosition) i.next();
+ hmm = (SenoneHMM) mgr.get(pos, unit);
+ }
+ return hmm;
+ }
+
+
+ /**
+ * Given a unit, search for the HMM associated with this unit by replacing all non-silence filler contexts with the
+ * silence filler context
+ *
+ * @param unit the unit of interest
+ * @return the associated hmm or null
+ */
+ private SenoneHMM getHMMInSilenceContext(Unit unit, HMMPosition position) {
+ SenoneHMM hmm = null;
+ HMMManager mgr = loader.getHMMManager();
+ Context context = unit.getContext();
+
+ if (context instanceof LeftRightContext) {
+ LeftRightContext lrContext = (LeftRightContext) context;
+
+ Unit[] lc = lrContext.getLeftContext();
+ Unit[] rc = lrContext.getRightContext();
+
+ Unit[] nlc;
+ Unit[] nrc;
+
+ if (hasNonSilenceFiller(lc)) {
+ nlc = replaceNonSilenceFillerWithSilence(lc);
+ } else {
+ nlc = lc;
+ }
+
+ if (hasNonSilenceFiller(rc)) {
+ nrc = replaceNonSilenceFillerWithSilence(rc);
+ } else {
+ nrc = rc;
+ }
+
+ if (nlc != lc || nrc != rc) {
+ Context newContext = LeftRightContext.get(nlc, nrc);
+ Unit newUnit = unitManager.getUnit(unit.getName(),
+ unit.isFiller(), newContext);
+ hmm = (SenoneHMM) mgr.get(position, newUnit);
+ if (hmm == null) {
+ hmm = getHMMAtAnyPosition(newUnit);
+ }
+ }
+ }
+ return hmm;
+ }
+
+
+ /**
+ * Some debugging code that looks for illformed contexts
+ *
+ * @param msg the message associated with the check
+ * @param c the context to check
+ */
+ private void checkNull(String msg, Unit[] c) {
+ for (int i = 0; i < c.length; i++) {
+ if (c[i] == null) {
+ System.out.println("null at index " + i + " of " + msg);
+ }
+ }
+ }
+
+
+ /**
+ * Returns true if the array of units contains a non-silence filler
+ *
+ * @param units the units to check
+ * @return true if the array contains a filler that is not the silence filler
+ */
+ private boolean hasNonSilenceFiller(Unit[] units) {
+ if (units == null) {
+ return false;
+ }
+
+ for (int i = 0; i < units.length; i++) {
+ if (units[i].isFiller() &&
+ !units[i].equals(UnitManager.SILENCE)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+
+ /**
+ * Returns a unit array with all non-silence filler units replaced with the silence filler a non-silence filler
+ *
+ * @param context the context to check
+ * @return true if the array contains a filler that is not the silence filler
+ */
+ private Unit[] replaceNonSilenceFillerWithSilence(Unit[] context) {
+ Unit[] replacementContext = new Unit[context.length];
+ for (int i = 0; i < context.length; i++) {
+ if (context[i].isFiller() &&
+ !context[i].equals(UnitManager.SILENCE)) {
+ replacementContext[i] = UnitManager.SILENCE;
+ } else {
+ replacementContext[i] = context[i];
+ }
+ }
+ return replacementContext;
+ }
+
+
+ /**
+ * Returns the properties of this acoustic model.
+ *
+ * @return the properties of this acoustic model
+ */
+ public Properties getProperties() {
+ if (properties == null) {
+ properties = new Properties();
+ try {
+ properties.load
+ (getClass().getResource("model.props").openStream());
+ } catch (IOException ioe) {
+ ioe.printStackTrace();
+ }
+ }
+ return properties;
+ }
+}
=== added file 'org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/ModelLoader.java'
--- org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/ModelLoader.java 1970-01-01 00:00:00 +0000
+++ org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/ModelLoader.java 2009-11-09 19:08:09 +0000
@@ -0,0 +1,1552 @@
+/*
+ * Copyright 1999-2004 Carnegie Mellon University.
+ * Portions Copyright 2004 Sun Microsystems, Inc.
+ * Portions Copyright 2004 Mitsubishi Electric Research Laboratories.
+ * All Rights Reserved. Use is subject to license terms.
+ *
+ * See the file "license.terms" for information on usage and
+ * redistribution of this file, and for a DISCLAIMER OF ALL
+ * WARRANTIES.
+ *
+ */
+package edu.cmu.sphinx.model.acoustic.TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz;
+
+import edu.cmu.sphinx.linguist.acoustic.tiedstate.*;
+
+import edu.cmu.sphinx.linguist.acoustic.*;
+import edu.cmu.sphinx.util.ExtendedStreamTokenizer;
+import edu.cmu.sphinx.util.LogMath;
+import edu.cmu.sphinx.util.StreamFactory;
+import edu.cmu.sphinx.util.Utilities;
+import edu.cmu.sphinx.util.props.*;
+
+import java.io.*;
+import java.net.URL;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.Properties;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+/**
+ * Loads a tied-state acoustic model generated by the Sphinx-3 trainer. <p/> The acoustic model should be packaged in a
+ * JAR file. The dictionary and language model files are not required to be in the package. You can specify their
+ * locations separately. A text file called "model.props" and the data files that make up the acoustic model are
+ * required. The model.props file is a file of key-value pairs, loadable as a Java Properties file. It should minimally
+ * contain the following properties: <ul> <li><b>dataLocation</b> - this specifies the directory where the actual model
+ * data files are, <i>relative to the model implementation class</i></li> <li><b>modelDefinition</b> - this specifies
+ * the location where the model definition file is, <i>relative to the model implementation class</i></li> </ul> The
+ * actual model data files are named "means", "variances", "transition_matrices", "mixture_weights" for binary versions,
+ * or prepended with ".ascii" for the ASCII versions. </p> <p/> As an example, lets look at the Wall Street Journal
+ * acoustic model JAR file, which is located at the <code>sphinx4/lib</code> directory. If you run <code>"jar tvf
+ * lib/WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz.jar"</code>, you will find that its internal structure looks roughly
+ * like:
+ * <pre>
+ * WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz.jar
+ * |
+ * +- edu
+ * |
+ * +- cmu
+ * |
+ * +- sphinx
+ * |
+ * +- model
+ * |
+ * + acoustic
+ * |
+ * +- model.props
+ * |
+ * +- WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz.class
+ * |
+ * +- WSJLoader.class
+ * |
+ * +- cd_continuous_8gau
+ * | |
+ * | +- means
+ * | +- variances
+ * | +- mixture_weights
+ * | +- transition_matrices
+ * |
+ * +- dict
+ * | |
+ * | +- alpha.dict
+ * | +- cmudict.0.6d
+ * | +- digits.dict
+ * | +- fillerdict
+ * |
+ * +- etc
+ * |
+ * +- WSJ_clean_13dCep_16k_40mel_130Hz_6800Hz.4000.mdef
+ * +- WSJ_clean_13dCep_16k_40mel_130Hz_6800Hz.ci.mdef
+ * +- variables.def
+ * <p/>
+ * </pre>
+ * <p/> The model.props file looks like (note how the 'dataLocation' and 'modelDefinition' properties are defined
+ * relative to the WSJ_clean_13dCep_16k_40mel_130Hz_6800Hz.class): </p>
+ * <pre>
+ * description = Wall Street Journal acoustic models
+ * <p/>
+ * isBinary = true
+ * featureType = cepstra_delta_doubledelta
+ * vectorLength = 39
+ * sparseForm = false
+ * <p/>
+ * numberFftPoints = 512
+ * filters = 40
+ * gaussians = 8
+ * maxFreq = 6800
+ * minFreq. = 130
+ * sampleRate = 16000
+ * <p/>
+ * dataLocation = cd_continuous_8gau
+ * modelDefinition = etc/WSJ_clean_13dCep_16k_40mel_130Hz_6800Hz.4000.mdef
+ * </pre>
+ * <p/> <p/> Note that although most of the properties of this class are already defined in the model.props file, it is
+ * still possible (but not recommended) to override those values by specifying them in the configuration file. </p>
+ */
+public class ModelLoader implements Loader {
+
+ /** The log math component for the system. */
+ @S4Component(type = LogMath.class)
+ public final static String PROP_LOG_MATH = "logMath";
+
+ /** The unit manager */
+ @S4Component(type = UnitManager.class)
+ public final static String PROP_UNIT_MANAGER = "unitManager";
+
+ /** Specifies whether the model to be loaded is in ASCII or binary format */
+ @S4Boolean(defaultValue = true, isNotDefined = true)
+ public final static String PROP_IS_BINARY = "isBinary";
+
+ /** The default value of PROP_IS_BINARY */
+ public final static boolean PROP_IS_BINARY_DEFAULT = true;
+
+ /** The name of the model definition file (contains the HMM data) */
+ @S4String(mandatory = false)
+ public final static String PROP_MODEL = "modelDefinition";
+
+ /** The default value of PROP_MODEL. */
+ public final static String PROP_MODEL_DEFAULT = "model.mdef";
+
+ /** Subdirectory where the acoustic model can be found */
+ @S4String(mandatory = false)
+ public final static String PROP_DATA_LOCATION = "dataLocation";
+
+ /** The default value of PROP_DATA_LOCATION. */
+ public final static String PROP_DATA_LOCATION_DEFAULT = "data";
+
+ /** The SphinxProperty for the name of the acoustic properties file. */
+ @S4String(defaultValue = "model.props")
+ public final static String PROP_PROPERTIES_FILE = "propertiesFile";
+
+ /** The default value of PROP_PROPERTIES_FILE. */
+ public final static String PROP_PROPERTIES_FILE_DEFAULT = "model.props";
+
+ /** The SphinxProperty for the length of feature vectors. */
+ @S4Integer(defaultValue = -1)
+ public final static String PROP_VECTOR_LENGTH = "vectorLength";
+
+ /** The default value of PROP_VECTOR_LENGTH. */
+ public final static int PROP_VECTOR_LENGTH_DEFAULT = 39;
+
+ /**
+ * The SphinxProperty specifying whether the transition matrices of the acoustic model is in sparse form, i.e.,
+ * omitting the zeros of the non-transitioning states.
+ */
+ @S4Boolean(defaultValue = true, isNotDefined = true)
+ public final static String PROP_SPARSE_FORM = "sparseForm";
+
+ /** The default value of PROP_SPARSE_FORM. */
+ public final static boolean PROP_SPARSE_FORM_DEFAULT = true;
+
+ /** The SphinxProperty specifying whether context-dependent units should be used. */
+ public final static boolean PROP_USE_CD_UNITS_DEFAULT = true;
+ @S4Boolean(defaultValue = PROP_USE_CD_UNITS_DEFAULT)
+ public final static String PROP_USE_CD_UNITS = "useCDUnits";
+
+
+ /** Mixture component score floor. */
+ public final static float PROP_MC_FLOOR_DEFAULT = 0.0f;
+ @S4Double(defaultValue = PROP_MC_FLOOR_DEFAULT)
+ public final static String PROP_MC_FLOOR = "MixtureComponentScoreFloor";
+
+ /** Variance floor. */
+ public final static float PROP_VARIANCE_FLOOR_DEFAULT = 0.0001f;
+ @S4Double(defaultValue = PROP_VARIANCE_FLOOR_DEFAULT)
+ public final static String PROP_VARIANCE_FLOOR = "varianceFloor";
+
+ /** Mixture weight floor. */
+ public final static float PROP_MW_FLOOR_DEFAULT = 1e-7f;
+ @S4Double(defaultValue = PROP_MW_FLOOR_DEFAULT)
+ public final static String PROP_MW_FLOOR = "mixtureWeightFloor";
+
+
+
+ protected final static String NUM_SENONES = "num_senones";
+ protected final static String NUM_GAUSSIANS_PER_STATE = "num_gaussians";
+ protected final static String NUM_STREAMS = "num_streams";
+ protected final static String FILLER = "filler";
+ protected final static String SILENCE_CIPHONE = "SIL";
+ protected final static int BYTE_ORDER_MAGIC = 0x11223344;
+ /** Supports this version of the acoustic model */
+ public final static String MODEL_VERSION = "0.3";
+ protected final static int CONTEXT_SIZE = 1;
+ private Pool meansPool;
+ private Pool variancePool;
+ private Pool matrixPool;
+ private Pool meanTransformationMatrixPool;
+ private Pool meanTransformationVectorPool;
+ private Pool varianceTransformationMatrixPool;
+ private Pool varianceTransformationVectorPool;
+ private Pool mixtureWeightsPool;
+ private Pool senonePool;
+ private float[][] transformMatrix;
+ private Map<String, Unit> contextIndependentUnits;
+ private HMMManager hmmManager;
+ private LogMath logMath;
+ private UnitManager unitManager;
+ private Properties properties;
+ private boolean swap;
+ protected final static String DENSITY_FILE_VERSION = "1.0";
+ protected final static String MIXW_FILE_VERSION = "1.0";
+ protected final static String TMAT_FILE_VERSION = "1.0";
+ protected final static String TRANSFORM_FILE_VERSION = "0.1";
+ // --------------------------------------
+ // Configuration variables
+ // --------------------------------------
+ protected Logger logger;
+ private boolean binary;
+ protected boolean sparseForm;
+ private int vectorLength;
+ private String location;
+ private String model;
+ private String dataDir;
+ private String propsFile;
+ private float distFloor;
+ private float mixtureWeightFloor;
+ private float varianceFloor;
+ private boolean useCDUnits;
+ private boolean loaded = false;
+
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see edu.cmu.sphinx.util.props.Configurable#newProperties(edu.cmu.sphinx.util.props.PropertySheet)
+ */
+ public void newProperties(PropertySheet ps) throws PropertyException {
+ logger = ps.getLogger();
+
+ propsFile = ps.getString(PROP_PROPERTIES_FILE);
+ logMath = (LogMath) ps.getComponent(PROP_LOG_MATH);
+ unitManager = (UnitManager) ps.getComponent(PROP_UNIT_MANAGER);
+
+ Boolean isBinary = ps.getBoolean(PROP_IS_BINARY);
+ binary = isBinary != null ? isBinary : getIsBinaryDefault();
+
+ Boolean isSparse = ps.getBoolean(PROP_IS_BINARY);
+ sparseForm = isSparse != null ? isSparse : getSparseFormDefault();
+
+ vectorLength = ps.getInt(PROP_VECTOR_LENGTH);
+ vectorLength = vectorLength > 0 ? vectorLength : getVectorLengthDefault();
+
+ model = ps.getString(PROP_MODEL);
+ model = model == null ? getModelDefault() : model;
+
+ dataDir = ps.getString(PROP_DATA_LOCATION);
+ dataDir = (dataDir == null ? getDataLocationDefault() : dataDir) + "/";
+
+ distFloor = ps.getFloat(PROP_MC_FLOOR);
+ mixtureWeightFloor = ps.getFloat(PROP_MW_FLOOR);
+ varianceFloor = ps.getFloat(PROP_VARIANCE_FLOOR);
+ useCDUnits = ps.getBoolean(PROP_USE_CD_UNITS);
+ }
+
+
+ private void loadProperties() {
+ if (properties == null) {
+ properties = new Properties();
+ try {
+ URL url = getClass().getResource(propsFile);
+ // System.out.println(getClass() + " " + url);
+ properties.load(url.openStream());
+ } catch (IOException ioe) {
+ ioe.printStackTrace();
+ }
+ }
+ }
+
+
+ /**
+ * Returns whether the models are binary by default
+ *
+ * @return true if the models are binary by default
+ */
+ private boolean getIsBinaryDefault() {
+ loadProperties();
+ String binary = (String) properties.get(PROP_IS_BINARY);
+ if (binary != null) {
+ return (Boolean.valueOf(binary).equals(Boolean.TRUE));
+ } else {
+ return PROP_IS_BINARY_DEFAULT;
+ }
+ }
+
+
+ /**
+ * Returns whether the matrices are in sparse form by default.
+ *
+ * @return true if the matrices are in sparse form by default
+ */
+ private boolean getSparseFormDefault() {
+ loadProperties();
+ String sparse = (String) properties.get(PROP_SPARSE_FORM);
+ if (sparse != null) {
+ return (Boolean.valueOf(binary).equals(Boolean.TRUE));
+ } else {
+ return PROP_SPARSE_FORM_DEFAULT;
+ }
+ }
+
+
+ /** Returns the default vector length. */
+ private int getVectorLengthDefault() {
+ loadProperties();
+ String length = (String) properties.get(PROP_VECTOR_LENGTH);
+ if (length != null) {
+ return Integer.parseInt(length);
+ } else {
+ return PROP_VECTOR_LENGTH_DEFAULT;
+ }
+ }
+
+
+ /**
+ * Returns the default model definition file.
+ *
+ * @return the default model definition file
+ */
+ private String getModelDefault() {
+ loadProperties();
+ String mdef = (String) properties.get(PROP_MODEL);
+ if (mdef != null) {
+ return mdef;
+ } else {
+ return PROP_MODEL_DEFAULT;
+ }
+ }
+
+
+ /**
+ * Returns the default data location.
+ *
+ * @return the default data location
+ */
+ private String getDataLocationDefault() {
+ loadProperties();
+ String location = (String) properties.get(PROP_DATA_LOCATION);
+ if (location != null) {
+ return location;
+ } else {
+ return PROP_DATA_LOCATION_DEFAULT;
+ }
+ }
+
+
+ public void load() throws IOException {
+ if (!loaded) {
+ // TODO: what is this all about?
+ hmmManager = new HMMManager();
+ contextIndependentUnits = new LinkedHashMap<String, Unit>();
+ // dummy pools for these elements
+ meanTransformationMatrixPool = createDummyMatrixPool("meanTransformationMatrix");
+ meanTransformationVectorPool = createDummyVectorPool("meanTransformationMatrix");
+ varianceTransformationMatrixPool = createDummyMatrixPool("varianceTransformationMatrix");
+ varianceTransformationVectorPool = createDummyVectorPool("varianceTransformationMatrix");
+ transformMatrix = null;
+ // do the actual acoustic model loading
+ loadModelFiles(model);
+ loaded = true;
+ }
+ }
+
+
+ /**
+ * Return the HmmManager.
+ *
+ * @return the hmmManager
+ */
+ protected HMMManager getHmmManager() {
+ return hmmManager;
+ }
+
+
+ /**
+ * Return the MatrixPool.
+ *
+ * @return the matrixPool
+ */
+ protected Pool getMatrixPool() {
+ return matrixPool;
+ }
+
+
+ /**
+ * Return the MixtureWeightsPool.
+ *
+ * @return the mixtureWeightsPool
+ */
+ protected Pool getMixtureWeightsPool() {
+ return mixtureWeightsPool;
+ }
+
+
+ /**
+ * Return the acoustic model properties.
+ *
+ * @return the acoustic model properties
+ */
+ protected Properties getProperties() {
+ if (properties == null) {
+ loadProperties();
+ }
+ return properties;
+ }
+
+
+ /**
+ * Return the location.
+ *
+ * @return the location
+ */
+ protected String getLocation() {
+ return location;
+ }
+
+
+ /**
+ * Loads the AcousticModel from a directory in the file system.
+ *
+ * @param modelName the name of the acoustic model; if null we just load from the default location
+ */
+ private void loadModelFiles(String modelName) throws IOException {
+
+ logger.config("Loading Sphinx3 acoustic model: " + modelName);
+ logger.config(" Path : " + location);
+ logger.config(" modellName: " + model);
+ logger.config(" dataDir : " + dataDir);
+
+ if (binary) {
+ meansPool = loadDensityFileBinary
+ (dataDir + "means", -Float.MAX_VALUE);
+ variancePool = loadDensityFileBinary
+ (dataDir + "variances", varianceFloor);
+ mixtureWeightsPool = loadMixtureWeightsBinary
+ (dataDir + "mixture_weights", mixtureWeightFloor);
+ matrixPool = loadTransitionMatricesBinary
+ (dataDir + "transition_matrices");
+ transformMatrix = loadTransformMatrix
+ (dataDir + "feature_transform");
+ } else {
+ meansPool = loadDensityFileAscii
+ (dataDir + "means.ascii", -Float.MAX_VALUE);
+ variancePool = loadDensityFileAscii
+ (dataDir + "variances.ascii", varianceFloor);
+ mixtureWeightsPool = loadMixtureWeightsAscii
+ (dataDir + "mixture_weights.ascii", mixtureWeightFloor);
+ matrixPool = loadTransitionMatricesAscii
+ (dataDir + "transition_matrices.ascii");
+ }
+ senonePool = createSenonePool(distFloor, varianceFloor);
+ // load the HMM model file
+ InputStream modelStream = getClass().getResourceAsStream(model);
+ if (modelStream == null) {
+ throw new IOException("can't find model " + model);
+ }
+ loadHMMPool(useCDUnits, modelStream,
+ location + File.separator + model);
+ }
+
+
+ /**
+ * Returns the map of context indepent units. The map can be accessed by unit name.
+ *
+ * @return the map of context independent units.
+ */
+ public Map<String, Unit> getContextIndependentUnits() {
+ return contextIndependentUnits;
+ }
+
+
+ /**
+ * Creates the senone pool from the rest of the pools.
+ *
+ * @param distFloor the lowest allowed score
+ * @param varianceFloor the lowest allowed variance
+ * @return the senone pool
+ */
+ private Pool createSenonePool(float distFloor, float varianceFloor) {
+ Pool pool = new Pool("senones");
+ int numMixtureWeights = mixtureWeightsPool.size();
+
+ int numMeans = meansPool.size();
+ int numVariances = variancePool.size();
+ int numGaussiansPerSenone =
+ mixtureWeightsPool.getFeature(NUM_GAUSSIANS_PER_STATE, 0);
+ int numSenones = mixtureWeightsPool.getFeature(NUM_SENONES, 0);
+ int whichGaussian = 0;
+
+ logger.fine("NG " + numGaussiansPerSenone);
+ logger.fine("NS " + numSenones);
+ logger.fine("NMIX " + numMixtureWeights);
+ logger.fine("NMNS " + numMeans);
+ logger.fine("NMNS " + numVariances);
+
+ assert numGaussiansPerSenone > 0;
+ assert numMixtureWeights == numSenones;
+ assert numVariances == numSenones * numGaussiansPerSenone;
+ assert numMeans == numSenones * numGaussiansPerSenone;
+
+ for (int i = 0; i < numSenones; i++) {
+ MixtureComponent[] mixtureComponents = new
+ MixtureComponent[numGaussiansPerSenone];
+ for (int j = 0; j < numGaussiansPerSenone; j++) {
+ mixtureComponents[j] = new MixtureComponent(
+ logMath,
+ (float[]) meansPool.get(whichGaussian),
+ (float[][]) meanTransformationMatrixPool.get(0),
+ (float[]) meanTransformationVectorPool.get(0),
+ (float[]) variancePool.get(whichGaussian),
+ (float[][]) varianceTransformationMatrixPool.get(0),
+ (float[]) varianceTransformationVectorPool.get(0),
+ distFloor,
+ varianceFloor);
+
+ whichGaussian++;
+ }
+
+ Senone senone = new GaussianMixture(
+ logMath, (float[]) mixtureWeightsPool.get(i),
+ mixtureComponents, i);
+
+ pool.put(i, senone);
+ }
+ return pool;
+ }
+
+
+ /**
+ * Loads the sphinx3 densityfile, a set of density arrays are created and placed in the given pool.
+ *
+ * @param path the name of the data
+ * @param floor the minimum density allowed
+ * @return a pool of loaded densities
+ * @throws FileNotFoundException if a file cannot be found
+ * @throws IOException if an error occurs while loading the data
+ */
+ private Pool loadDensityFileAscii(String path, float floor)
+ throws IOException {
+ int numStates;
+ int numStreams;
+ int numGaussiansPerState;
+
+ InputStream inputStream = getClass().getResourceAsStream(path);
+
+ if (inputStream == null) {
+ throw new FileNotFoundException("Error trying to read file "
+ + location + path);
+ }
+ // 'false' argument refers to EOL is insignificant
+ ExtendedStreamTokenizer est = new ExtendedStreamTokenizer(inputStream,
+ '#', false);
+ Pool pool = new Pool(path);
+ logger.fine("Loading density file from: " + path);
+ est.expectString("param");
+ numStates = est.getInt("numStates");
+ numStreams = est.getInt("numStreams");
+ numGaussiansPerState = est.getInt("numGaussiansPerState");
+ pool.setFeature(NUM_SENONES, numStates);
+ pool.setFeature(NUM_STREAMS, numStreams);
+ pool.setFeature(NUM_GAUSSIANS_PER_STATE, numGaussiansPerState);
+ for (int i = 0; i < numStates; i++) {
+ est.expectString("mgau");
+ est.expectInt("mgau index", i);
+ est.expectString("feat");
+ est.expectInt("feat index", 0);
+ for (int j = 0; j < numGaussiansPerState; j++) {
+ est.expectString("density");
+ est.expectInt("densityValue", j);
+ float[] density = new float[vectorLength];
+ for (int k = 0; k < vectorLength; k++) {
+ density[k] = est.getFloat("val");
+ if (density[k] < floor) {
+ density[k] = floor;
+ }
+ // System.out.println(" " + i + " " + j + " " + k +
+ // " " + density[k]);
+ }
+ int id = i * numGaussiansPerState + j;
+ pool.put(id, density);
+ }
+ }
+ est.close();
+ return pool;
+ }
+
+
+ /**
+ * Loads the sphinx3 densityfile, a set of density arrays are created and placed in the given pool.
+ *
+ * @param path the name of the data
+ * @param floor the minimum density allowed
+ * @return a pool of loaded densities
+ * @throws FileNotFoundException if a file cannot be found
+ * @throws IOException if an error occurs while loading the data
+ */
+ private Pool loadDensityFileBinary(String path, float floor)
+ throws IOException {
+ int numStates;
+ int numStreams;
+ int numGaussiansPerState;
+ Properties props = new Properties();
+ int blockSize = 0;
+
+ DataInputStream dis = readS3BinaryHeader(location, path, props);
+
+ String version = props.getProperty("version");
+ boolean doCheckSum;
+
+ if (version == null || !version.equals(DENSITY_FILE_VERSION)) {
+ throw new IOException("Unsupported version in " + path);
+ }
+
+ String checksum = props.getProperty("chksum0");
+ doCheckSum = (checksum != null && checksum.equals("yes"));
+
+ numStates = readInt(dis);
+ numStreams = readInt(dis);
+ numGaussiansPerState = readInt(dis);
+
+
+ int[] vectorLength = new int[numStreams];
+ for (int i = 0; i < numStreams; i++) {
+ vectorLength[i] = readInt(dis);
+ }
+
+ int rawLength = readInt(dis);
+
+ //System.out.println("Nstates " + numStates);
+ //System.out.println("Nstreams " + numStreams);
+ //System.out.println("NgaussiansPerState " + numGaussiansPerState);
+ //System.out.println("vectorLength " + vectorLength.length);
+ //System.out.println("rawLength " + rawLength);
+
+ for (int i = 0; i < numStreams; i++) {
+ blockSize += vectorLength[i];
+ }
+
+
+ assert rawLength == numGaussiansPerState * blockSize * numStates;
+ assert numStreams == 1;
+
+ Pool pool = new Pool(path);
+ pool.setFeature(NUM_SENONES, numStates);
+ pool.setFeature(NUM_STREAMS, numStreams);
+ pool.setFeature(NUM_GAUSSIANS_PER_STATE, numGaussiansPerState);
+
+ for (int i = 0; i < numStates; i++) {
+ for (int j = 0; j < numStreams; j++) {
+ for (int k = 0; k < numGaussiansPerState; k++) {
+ float[] density = readFloatArray(dis, vectorLength[j]);
+ floorData(density, floor);
+ pool.put(i * numGaussiansPerState + k, density);
+ }
+ }
+ }
+
+ int checkSum = readInt(dis);
+ // BUG: not checking the check sum yet.
+ dis.close();
+ return pool;
+ }
+
+
+ /**
+ * Reads the S3 binary hearder from the given location+path. Adds header information to the given set of
+ * properties.
+ *
+ * @param location the location of the file
+ * @param path the name of the file
+ * @param props the properties
+ * @return the input stream positioned after the header
+ * @throws IOException on error
+ */
+ protected DataInputStream readS3BinaryHeader(String location, String path,
+ Properties props)
+ throws IOException {
+
+ // System.out.println("resource: " + path + ", " + getClass());
+ InputStream inputStream = getClass().getResourceAsStream(path);
+
+ if (inputStream == null) {
+ throw new IOException("Can't open " + path);
+ }
+ DataInputStream dis = new DataInputStream(new BufferedInputStream(
+ inputStream));
+ String id = readWord(dis);
+ if (!id.equals("s3")) {
+ throw new IOException("Not proper s3 binary file " + location
+ + path);
+ }
+ String name;
+ while ((name = readWord(dis)) != null) {
+ if (!name.equals("endhdr")) {
+ String value = readWord(dis);
+ props.setProperty(name, value);
+ } else {
+ break;
+ }
+ }
+ int byteOrderMagic = dis.readInt();
+ if (byteOrderMagic == BYTE_ORDER_MAGIC) {
+ // System.out.println("Not swapping " + path);
+ swap = false;
+ } else if (byteSwap(byteOrderMagic) == BYTE_ORDER_MAGIC) {
+ // System.out.println("SWAPPING " + path);
+ swap = true;
+ } else {
+ throw new IOException("Corrupt S3 file " + location + path);
+ }
+ return dis;
+ }
+
+
+ /**
+ * Reads the next word (text separated by whitespace) from the given stream
+ *
+ * @param dis the input stream
+ * @return the next word
+ * @throws IOException on error
+ */
+ String readWord(DataInputStream dis) throws IOException {
+ StringBuffer sb = new StringBuffer();
+ char c;
+ // skip leading whitespace
+ do {
+ c = readChar(dis);
+ } while (Character.isWhitespace(c));
+ // read the word
+ do {
+ sb.append(c);
+ c = readChar(dis);
+ } while (!Character.isWhitespace(c));
+ return sb.toString();
+ }
+
+
+ /**
+ * Reads a single char from the stream
+ *
+ * @param dis the stream to read
+ * @return the next character on the stream
+ * @throws IOException if an error occurs
+ */
+ private char readChar(DataInputStream dis) throws IOException {
+ return (char) dis.readByte();
+ }
+
+
+ /**
+ * swap a 32 bit word
+ *
+ * @param val the value to swap
+ * @return the swapped value
+ */
+ private int byteSwap(int val) {
+ return ((0xff & (val >> 24)) | (0xff00 & (val >> 8))
+ | (0xff0000 & (val << 8)) | (0xff000000 & (val << 24)));
+ }
+
+
+ /**
+ * Read an integer from the input stream, byte-swapping as necessary
+ *
+ * @param dis the inputstream
+ * @return an integer value
+ * @throws IOException on error
+ */
+ protected int readInt(DataInputStream dis) throws IOException {
+ if (swap) {
+ return Utilities.readLittleEndianInt(dis);
+ } else {
+ return dis.readInt();
+ }
+ }
+
+
+ /**
+ * Read a float from the input stream, byte-swapping as necessary
+ *
+ * @param dis the inputstream
+ * @return a floating pint value
+ * @throws IOException on error
+ */
+ protected float readFloat(DataInputStream dis) throws IOException {
+ float val;
+ if (swap) {
+ val = Utilities.readLittleEndianFloat(dis);
+ } else {
+ val = dis.readFloat();
+ }
+ return val;
+ }
+
+
+ // Do we need the method nonZeroFloor??
+ /**
+ * If a data point is non-zero and below 'floor' make it equal to floor (don't floor zero values though).
+ *
+ * @param data the data to floor
+ * @param floor the floored value
+ */
+ protected void nonZeroFloor(float[] data, float floor) {
+ for (int i = 0; i < data.length; i++) {
+ if (data[i] != 0.0 && data[i] < floor) {
+ data[i] = floor;
+ }
+ }
+ }
+
+
+ /**
+ * If a data point is below 'floor' make it equal to floor.
+ *
+ * @param data the data to floor
+ * @param floor the floored value
+ */
+ private void floorData(float[] data, float floor) {
+ for (int i = 0; i < data.length; i++) {
+ if (data[i] < floor) {
+ data[i] = floor;
+ }
+ }
+ }
+
+
+ /**
+ * Normalize the given data
+ *
+ * @param data the data to normalize
+ */
+ protected void normalize(float[] data) {
+ float sum = 0;
+ for (int i = 0; i < data.length; i++) {
+ sum += data[i];
+ }
+ if (sum != 0.0f) {
+ for (int i = 0; i < data.length; i++) {
+ data[i] = data[i] / sum;
+ }
+ }
+ }
+
+
+ /**
+ * Convert to log math
+ *
+ * @param data the data to normalize
+ */
+ // linearToLog returns a float, so zero values in linear scale
+ // should return -Float.MAX_VALUE.
+ protected void convertToLogMath(float[] data) {
+ for (int i = 0; i < data.length; i++) {
+ data[i] = logMath.linearToLog(data[i]);
+ }
+ }
+
+
+ /**
+ * Reads the given number of floats from the stream and returns them in an array of floats
+ *
+ * @param dis the stream to read data from
+ * @param size the number of floats to read
+ * @return an array of size float elements
+ * @throws IOException if an exception occurs
+ */
+ protected float[] readFloatArray(DataInputStream dis, int size)
+ throws IOException {
+ float[] data = new float[size];
+ for (int i = 0; i < size; i++) {
+ data[i] = readFloat(dis);
+ }
+ return data;
+ }
+
+
+ /**
+ * Loads the sphinx3 densityfile, a set of density arrays are created and placed in the given pool.
+ *
+ * @param useCDUnits if true, loads also the context dependent units
+ * @param inputStream the open input stream to use
+ * @param path the path to a density file
+ * @return a pool of loaded densities
+ * @throws FileNotFoundException if a file cannot be found
+ * @throws IOException if an error occurs while loading the data
+ */
+ protected Pool loadHMMPool(boolean useCDUnits, InputStream inputStream, String path)
+ throws IOException {
+ int numBase;
+ int numTri;
+ int numStateMap;
+ int numTiedState;
+ int numStatePerHMM;
+ int numContextIndependentTiedState;
+ int numTiedTransitionMatrices;
+
+ ExtendedStreamTokenizer est = new ExtendedStreamTokenizer
+ (inputStream, '#', false);
+ Pool pool = new Pool(path);
+
+ logger.fine("Loading HMM file from: " + path);
+
+ est.expectString(MODEL_VERSION);
+
+ numBase = est.getInt("numBase");
+ est.expectString("n_base");
+
+ numTri = est.getInt("numTri");
+ est.expectString("n_tri");
+
+ numStateMap = est.getInt("numStateMap");
+ est.expectString("n_state_map");
+
+ numTiedState = est.getInt("numTiedState");
+ est.expectString("n_tied_state");
+
+ numContextIndependentTiedState =
+ est.getInt("numContextIndependentTiedState");
+ est.expectString("n_tied_ci_state");
+
+ numTiedTransitionMatrices = est.getInt("numTiedTransitionMatrices");
+ est.expectString("n_tied_tmat");
+
+ numStatePerHMM = numStateMap / (numTri + numBase);
+
+ assert numTiedState == mixtureWeightsPool.getFeature(NUM_SENONES, 0);
+ assert numTiedTransitionMatrices == matrixPool.size();
+
+ // Load the base phones
+ for (int i = 0; i < numBase; i++) {
+ String name = est.getString();
+ String left = est.getString();
+ String right = est.getString();
+ String position = est.getString();
+ String attribute = est.getString();
+ int tmat = est.getInt("tmat");
+
+ int[] stid = new int[numStatePerHMM - 1];
+
+ for (int j = 0; j < numStatePerHMM - 1; j++) {
+ stid[j] = est.getInt("j");
+ assert stid[j] >= 0 && stid[j] < numContextIndependentTiedState;
+ }
+ est.expectString("N");
+
+ assert left.equals("-");
+ assert right.equals("-");
+ assert position.equals("-");
+ assert tmat < numTiedTransitionMatrices;
+
+ Unit unit = unitManager.getUnit(name, attribute.equals(FILLER));
+ contextIndependentUnits.put(unit.getName(), unit);
+
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("Loaded " + unit);
+ }
+
+ // The first filler
+ if (unit.isFiller() && unit.getName().equals(SILENCE_CIPHONE)) {
+ unit = UnitManager.SILENCE;
+ }
+
+ float[][] transitionMatrix = (float[][]) matrixPool.get(tmat);
+ SenoneSequence ss = getSenoneSequence(stid);
+
+ HMM hmm = new SenoneHMM(unit, ss,
+ transitionMatrix, HMMPosition.lookup(position));
+ hmmManager.put(hmm);
+ }
+
+ // Load the context dependent phones. If the useCDUnits
+ // property is false, the CD phones will not be created, but
+ // the values still need to be read in from the file.
+
+ String lastUnitName = "";
+ Unit lastUnit = null;
+ int[] lastStid = null;
+ SenoneSequence lastSenoneSequence = null;
+
+ for (int i = 0; i < numTri; i++) {
+ String name = est.getString();
+ String left = est.getString();
+ String right = est.getString();
+ String position = est.getString();
+ String attribute = est.getString();
+ int tmat = est.getInt("tmat");
+
+ int[] stid = new int[numStatePerHMM - 1];
+
+ for (int j = 0; j < numStatePerHMM - 1; j++) {
+ stid[j] = est.getInt("j");
+ assert stid[j] >= numContextIndependentTiedState &&
+ stid[j] < numTiedState;
+ }
+ est.expectString("N");
+
+ assert !left.equals("-");
+ assert !right.equals("-");
+ assert !position.equals("-");
+ assert attribute.equals("n/a");
+ assert tmat < numTiedTransitionMatrices;
+
+ if (useCDUnits) {
+ Unit unit;
+ String unitName = (name + " " + left + " " + right);
+
+ if (unitName.equals(lastUnitName)) {
+ unit = lastUnit;
+ } else {
+ Unit[] leftContext = new Unit[1];
+ leftContext[0] = contextIndependentUnits.get(left);
+
+ Unit[] rightContext = new Unit[1];
+ rightContext[0] = contextIndependentUnits.get(right);
+
+ Context context = LeftRightContext.get(leftContext,
+ rightContext);
+ unit = unitManager.getUnit(name, false, context);
+ }
+ lastUnitName = unitName;
+ lastUnit = unit;
+
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("Loaded " + unit);
+ }
+
+ float[][] transitionMatrix = (float[][]) matrixPool.get(tmat);
+
+ SenoneSequence ss = lastSenoneSequence;
+ if (ss == null || !sameSenoneSequence(stid, lastStid)) {
+ ss = getSenoneSequence(stid);
+ }
+ lastSenoneSequence = ss;
+ lastStid = stid;
+
+ HMM hmm = new SenoneHMM(unit,
+ ss,
+ transitionMatrix,
+ HMMPosition.lookup(position));
+ hmmManager.put(hmm);
+ }
+ }
+
+ est.close();
+ return pool;
+ }
+
+
+ /**
+ * Returns true if the given senone sequence IDs are the same.
+ *
+ * @return true if the given senone sequence IDs are the same, false otherwise
+ */
+ protected boolean sameSenoneSequence(int[] ssid1, int[] ssid2) {
+ if (ssid1.length == ssid2.length) {
+ for (int i = 0; i < ssid1.length; i++) {
+ if (ssid1[i] != ssid2[i]) {
+ return false;
+ }
+ }
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+
+ /**
+ * Gets the senone sequence representing the given senones
+ *
+ * @param stateid is the array of senone state ids
+ * @return the senone sequence associated with the states
+ */
+ protected SenoneSequence getSenoneSequence(int[] stateid) {
+ Senone[] senones = new Senone[stateid.length];
+ for (int i = 0; i < stateid.length; i++) {
+ senones[i] = (Senone) senonePool.get(stateid[i]);
+ }
+ return new SenoneSequence(senones);
+ }
+
+
+ /**
+ * Loads the mixture weights
+ *
+ * @param path the path to the mixture weight file
+ * @param floor the minimum mixture weight allowed
+ * @return a pool of mixture weights
+ * @throws FileNotFoundException if a file cannot be found
+ * @throws IOException if an error occurs while loading the data
+ */
+ private Pool loadMixtureWeightsAscii(String path, float floor)
+ throws IOException {
+ logger.fine("Loading mixture weights from: " + path);
+ int numStates;
+ int numStreams;
+ int numGaussiansPerState;
+ InputStream inputStream = StreamFactory.getInputStream(location, path);
+ Pool pool = new Pool(path);
+ ExtendedStreamTokenizer est = new ExtendedStreamTokenizer(inputStream,
+ '#', false);
+ est.expectString("mixw");
+ numStates = est.getInt("numStates");
+ numStreams = est.getInt("numStreams");
+ numGaussiansPerState = est.getInt("numGaussiansPerState");
+ pool.setFeature(NUM_SENONES, numStates);
+ pool.setFeature(NUM_STREAMS, numStreams);
+ pool.setFeature(NUM_GAUSSIANS_PER_STATE, numGaussiansPerState);
+ for (int i = 0; i < numStates; i++) {
+ est.expectString("mixw");
+ est.expectString("[" + i);
+ est.expectString("0]");
+// float total = est.getFloat("total");
+ float[] logMixtureWeight = new float[numGaussiansPerState];
+ for (int j = 0; j < numGaussiansPerState; j++) {
+ float val = est.getFloat("mixwVal");
+ if (val < floor) {
+ val = floor;
+ }
+ logMixtureWeight[j] = val;
+ }
+ convertToLogMath(logMixtureWeight);
+ pool.put(i, logMixtureWeight);
+ }
+ est.close();
+ return pool;
+ }
+
+
+ /**
+ * Loads the mixture weights (Binary)
+ *
+ * @param path the path to the mixture weight file
+ * @param floor the minimum mixture weight allowed
+ * @return a pool of mixture weights
+ * @throws FileNotFoundException if a file cannot be found
+ * @throws IOException if an error occurs while loading the data
+ */
+ private Pool loadMixtureWeightsBinary(String path,
+ float floor)
+ throws IOException {
+ logger.fine("Loading mixture weights from: " + path);
+
+ int numStates;
+ int numStreams;
+ int numGaussiansPerState;
+ int numValues;
+ Properties props = new Properties();
+
+ DataInputStream dis = readS3BinaryHeader(location, path, props);
+
+ String version = props.getProperty("version");
+ boolean doCheckSum;
+
+ if (version == null || !version.equals(MIXW_FILE_VERSION)) {
+ throw new IOException("Unsupported version in " + path);
+ }
+
+ String checksum = props.getProperty("chksum0");
+ doCheckSum = (checksum != null && checksum.equals("yes"));
+
+ Pool pool = new Pool(path);
+
+ numStates = readInt(dis);
+ numStreams = readInt(dis);
+ numGaussiansPerState = readInt(dis);
+ numValues = readInt(dis);
+
+ assert numValues == numStates * numStreams * numGaussiansPerState;
+ assert numStreams == 1;
+
+
+ pool.setFeature(NUM_SENONES, numStates);
+ pool.setFeature(NUM_STREAMS, numStreams);
+ pool.setFeature(NUM_GAUSSIANS_PER_STATE, numGaussiansPerState);
+
+ for (int i = 0; i < numStates; i++) {
+ float[] logMixtureWeight = readFloatArray(dis, numGaussiansPerState);
+ normalize(logMixtureWeight);
+ floorData(logMixtureWeight, floor);
+ convertToLogMath(logMixtureWeight);
+ pool.put(i, logMixtureWeight);
+ }
+ dis.close();
+ return pool;
+ }
+
+
+ /**
+ * Loads the transition matrices
+ *
+ * @param path the path to the transitions matrices
+ * @return a pool of transition matrices
+ * @throws FileNotFoundException if a file cannot be found
+ * @throws IOException if an error occurs while loading the data
+ */
+ protected Pool loadTransitionMatricesAscii(String path)
+ throws IOException {
+ InputStream inputStream = StreamFactory.getInputStream(location, path);
+ logger.fine("Loading transition matrices from: " + path);
+ int numMatrices;
+ int numStates;
+ Pool pool = new Pool(path);
+ ExtendedStreamTokenizer est = new ExtendedStreamTokenizer(inputStream,
+ '#', false);
+ est.expectString("tmat");
+ numMatrices = est.getInt("numMatrices");
+ numStates = est.getInt("numStates");
+ logger.fine("with " + numMatrices + " and " + numStates +
+ " states, in " + (sparseForm ? "sparse" : "dense") +
+ " form");
+
+ // read in the matrices
+ for (int i = 0; i < numMatrices; i++) {
+ est.expectString("tmat");
+ est.expectString("[" + i + "]");
+ float[][] tmat = new float[numStates][numStates];
+ for (int j = 0; j < numStates; j++) {
+ for (int k = 0; k < numStates; k++) {
+ // the last row is just zeros, so we just do
+ // the first (numStates - 1) rows
+ if (j < numStates - 1) {
+ if (sparseForm) {
+ if (k == j || k == j + 1) {
+ tmat[j][k] = est.getFloat("tmat value");
+ }
+ } else {
+ tmat[j][k] = est.getFloat("tmat value");
+ }
+ }
+ tmat[j][k] = logMath.linearToLog(tmat[j][k]);
+ if (logger.isLoggable(Level.FINE)) {
+ logger.fine("tmat j " + j + " k " + k + " tm "
+ + tmat[j][k]);
+ }
+ }
+ }
+ pool.put(i, tmat);
+ }
+ est.close();
+ return pool;
+ }
+
+
+ /**
+ * Loads the transition matrices (Binary)
+ *
+ * @param path the path to the transitions matrices
+ * @return a pool of transition matrices
+ * @throws FileNotFoundException if a file cannot be found
+ * @throws IOException if an error occurs while loading the data
+ */
+ protected Pool loadTransitionMatricesBinary(String path)
+ throws IOException {
+ logger.fine("Loading transition matrices from: " + path);
+ int numMatrices;
+ int numStates;
+ int numRows;
+ int numValues;
+
+ Properties props = new Properties();
+ DataInputStream dis = readS3BinaryHeader(location, path, props);
+
+ String version = props.getProperty("version");
+ boolean doCheckSum;
+
+ if (version == null || !version.equals(TMAT_FILE_VERSION)) {
+ throw new IOException("Unsupported version in " + path);
+ }
+
+ String checksum = props.getProperty("chksum0");
+ doCheckSum = (checksum != null && checksum.equals("yes"));
+
+ Pool pool = new Pool(path);
+
+ numMatrices = readInt(dis);
+ numRows = readInt(dis);
+ numStates = readInt(dis);
+ numValues = readInt(dis);
+
+ assert numValues == numStates * numRows * numMatrices;
+
+ for (int i = 0; i < numMatrices; i++) {
+ float[][] tmat = new float[numStates][];
+ // last row should be zeros
+ tmat[numStates - 1] = new float[numStates];
+ convertToLogMath(tmat[numStates - 1]);
+
+ for (int j = 0; j < numRows; j++) {
+ tmat[j] = readFloatArray(dis, numStates);
+ nonZeroFloor(tmat[j], 0f);
+ normalize(tmat[j]);
+ convertToLogMath(tmat[j]);
+ }
+ pool.put(i, tmat);
+ }
+ dis.close();
+ return pool;
+ }
+
+
+ /**
+ * Loads the transform matrices (Binary)
+ *
+ * @param path the path to the transform matrix
+ * @return a transform matrix
+ * @throws java.io.FileNotFoundException if a file cannot be found
+ * @throws java.io.IOException if an error occurs while loading the data
+ */
+ protected float[][] loadTransformMatrix(String path)
+ throws IOException {
+ logger.fine("Loading transform matrix from: " + path);
+
+ int numRows;
+ int numValues;
+ int num;
+
+ Properties props = new Properties();
+
+ DataInputStream dis;
+ try {
+ dis = readS3BinaryHeader(location, path, props);
+ } catch (Exception e) {
+ return null;
+ }
+
+ String version = props.getProperty("version");
+ boolean doCheckSum;
+
+ if (version == null || !version.equals(TRANSFORM_FILE_VERSION)) {
+ throw new IOException("Unsupported version in " + path);
+ }
+
+ String checksum = props.getProperty("chksum0");
+ doCheckSum = (checksum != null && checksum.equals("yes"));
+
+ readInt(dis);
+ numRows = readInt(dis);
+ numValues = readInt(dis);
+ num = readInt(dis);
+
+ assert num == numRows * numValues;
+
+ float[][] result = new float[numRows][];
+
+ for (int i = 0; i < numRows; i++) {
+ result[i] = readFloatArray(dis, numValues);
+ }
+ dis.close();
+ return result;
+ }
+
+
+ /**
+ * Creates a pool with a single identity matrix in it.
+ *
+ * @param name the name of the pool
+ * @return the pool with the matrix
+ */
+ private Pool createDummyMatrixPool(String name) {
+ Pool pool = new Pool(name);
+ float[][] matrix = new float[vectorLength][vectorLength];
+ logger.fine("creating dummy matrix pool " + name);
+ for (int i = 0; i < vectorLength; i++) {
+ for (int j = 0; j < vectorLength; j++) {
+ if (i == j) {
+ matrix[i][j] = 1.0F;
+ } else {
+ matrix[i][j] = 0.0F;
+ }
+ }
+ }
+ pool.put(0, matrix);
+ return pool;
+ }
+
+
+ /**
+ * Creates a pool with a single zero vector in it.
+ *
+ * @param name the name of the pool
+ * @return the pool with the vector
+ */
+ private Pool createDummyVectorPool(String name) {
+ logger.fine("creating dummy vector pool " + name);
+ Pool pool = new Pool(name);
+ float[] vector = new float[vectorLength];
+ for (int i = 0; i < vectorLength; i++) {
+ vector[i] = 0.0f;
+ }
+ pool.put(0, vector);
+ return pool;
+ }
+
+
+ /**
+ * Gets the pool of means for this loader
+ *
+ * @return the pool
+ */
+ public Pool getMeansPool() {
+ return meansPool;
+ }
+
+
+ /**
+ * Gets the pool of means transformation matrices for this loader
+ *
+ * @return the pool
+ */
+ public Pool getMeansTransformationMatrixPool() {
+ return meanTransformationMatrixPool;
+ }
+
+
+ /**
+ * Gets the pool of means transformation vectors for this loader
+ *
+ * @return the pool
+ */
+ public Pool getMeansTransformationVectorPool() {
+ return meanTransformationVectorPool;
+ }
+
+
+ /*
+ * Gets the variance pool
+ *
+ * @return the pool
+ */
+ public Pool getVariancePool() {
+ return variancePool;
+ }
+
+
+ /**
+ * Gets the variance transformation matrix pool
+ *
+ * @return the pool
+ */
+ public Pool getVarianceTransformationMatrixPool() {
+ return varianceTransformationMatrixPool;
+ }
+
+
+ /**
+ * Gets the pool of variance transformation vectors for this loader
+ *
+ * @return the pool
+ */
+ public Pool getVarianceTransformationVectorPool() {
+ return varianceTransformationVectorPool;
+ }
+
+
+ /*
+ * Gets the mixture weight pool
+ *
+ * @return the pool
+ */
+ public Pool getMixtureWeightPool() {
+ return mixtureWeightsPool;
+ }
+
+
+ /*
+ * Gets the transition matrix pool
+ *
+ * @return the pool
+ */
+ public Pool getTransitionMatrixPool() {
+ return matrixPool;
+ }
+
+
+ /*
+ * Gets the senone pool for this loader
+ *
+ * @return the pool
+ */
+ public Pool getSenonePool() {
+ return senonePool;
+ }
+
+
+ /*
+ * Gets the transform matrix for this loader
+ *
+ * @return the pool
+ */
+ public float[][] getTransformMatrix() {
+ return transformMatrix;
+ }
+
+
+ /**
+ * Returns the size of the left context for context dependent units
+ *
+ * @return the left context size
+ */
+ public int getLeftContextSize() {
+ return CONTEXT_SIZE;
+ }
+
+
+ /**
+ * Returns the size of the right context for context dependent units
+ *
+ * @return the left context size
+ */
+ public int getRightContextSize() {
+ return CONTEXT_SIZE;
+ }
+
+
+ /**
+ * Returns the hmm manager associated with this loader
+ *
+ * @return the hmm Manager
+ */
+ public HMMManager getHMMManager() {
+ return hmmManager;
+ }
+
+
+ /** Log info about this loader */
+ public void logInfo() {
+ logger.info("ModelLoader");
+ meansPool.logInfo(logger);
+ variancePool.logInfo(logger);
+ matrixPool.logInfo(logger);
+ senonePool.logInfo(logger);
+ meanTransformationMatrixPool.logInfo(logger);
+ meanTransformationVectorPool.logInfo(logger);
+ varianceTransformationMatrixPool.logInfo(logger);
+ varianceTransformationVectorPool.logInfo(logger);
+ mixtureWeightsPool.logInfo(logger);
+ senonePool.logInfo(logger);
+ logger.info("Context Independent Unit Entries: "
+ + contextIndependentUnits.size());
+ hmmManager.logInfo(logger);
+ }
+}
=== added file 'org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/PropertiesDumper.java'
--- org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/PropertiesDumper.java 1970-01-01 00:00:00 +0000
+++ org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/PropertiesDumper.java 2009-11-09 19:08:09 +0000
@@ -0,0 +1,105 @@
+/*
+ * Copyright 1999-2004 Carnegie Mellon University.
+ * Portions Copyright 2004 Sun Microsystems, Inc.
+ * Portions Copyright 2004 Mitsubishi Electric Research Laboratories.
+ * All Rights Reserved. Use is subject to license terms.
+ *
+ * See the file "license.terms" for information on usage and
+ * redistribution of this file, and for a DISCLAIMER OF ALL
+ * WARRANTIES.
+ *
+ */
+
+
+package edu.cmu.sphinx.model.acoustic.TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz;
+
+import java.io.IOException;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+
+/** Dumps out information about an acoustic model. */
+public class PropertiesDumper {
+
+ private Properties props;
+
+
+ /** Dumps the properties file 'model.props' that is in the same directory as this class. */
+ public static void main(String[] argv) {
+ try {
+ PropertiesDumper dumper = new PropertiesDumper("model.props");
+ System.out.println();
+ System.out.println(dumper.toString());
+ } catch (IOException ioe) {
+ ioe.printStackTrace();
+ }
+ }
+
+
+ /**
+ * Constructs a PropertiesDumper of the given acoustic model properties file.
+ *
+ * @param propsFile the properties file to dump
+ */
+ public PropertiesDumper(String propsFile) throws IOException {
+ props = new Properties();
+ props.load(getClass().getResource(propsFile).openStream());
+ }
+
+
+ /**
+ * Constructs a PropertiesDumper of the given acoustic model properties.
+ *
+ * @param properties the Properties object to dump
+ */
+ public PropertiesDumper(Properties properties) throws IOException {
+ props = properties;
+ }
+
+
+ /**
+ * Returns a string of the properties.
+ *
+ * @return a string of the properties
+ */
+ public String toString() {
+ String result = props.get("description") + "\n";
+ List list = Collections.list(props.propertyNames());
+ Collections.sort(list);
+ for (Iterator i = list.iterator(); i.hasNext();) {
+ String key = (String) i.next();
+ String value = (String) props.get(key);
+ result += ("\n\t" + key + ": " + value);
+ }
+ result += "\n";
+ return result;
+ }
+
+
+ /**
+ * Converts strings like "thisIsAString" into "This Is A String".
+ *
+ * @param original the original string
+ * @return a readable form of strings like "thisIsAString"
+ */
+ private String getReadableForm(String original) {
+ if (original.length() > 0) {
+ StringBuffer sb = new StringBuffer(original.length() * 2);
+ int i = 0;
+ sb.append(Character.toUpperCase(original.charAt(i++)));
+ for (; i < original.length(); i++) {
+ char c = original.charAt(i);
+ if (Character.isUpperCase(c)) {
+ sb.append(" ");
+ }
+ sb.append(c);
+ }
+ return sb.toString();
+ } else {
+ return original;
+ }
+ }
+}
+
+
=== added file 'org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/README'
--- org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/README 1970-01-01 00:00:00 +0000
+++ org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/README 2009-11-09 19:08:09 +0000
@@ -0,0 +1,54 @@
+README
+======
+
+Models in this directory were trained with the
+
+"NIST CD-ROM Version of the Texas Instruments-developed Studio Quality
+Speaker-Independent Connected-Digit Corpus".
+
+
+Contents of this directory:
+
+am.props
+--------
+
+Properties file containing the parameters used to train the acoustic model.
+
+wd_dependent_phone.500.mdef
+---------------------------
+Model definition file (ascii) which lists senone-ids and
+HMM compositions
+
+wd_dependent_phone.cd_continuous_4gau/
+--------------------------------------
+
+Directory containing one set of context-dependent acoustic models
+(means, variances, transition_matrices, mixture_weights),
+and the corresponding subvector-quantized models file (ascii)
+with 200 codewords.
+
+wd_dependent_phone.cd_continuous_8gau/
+--------------------------------------
+
+Directory containing one set of context-dependent acoustic models
+(means, variances, transition_matrices, mixture_weights),
+and the corresponding subvector-quantized models file (ascii)
+with 200 codewords.
+
+dictionary
+----------
+The training dictionary
+
+fillerdict
+-----------
+The training filler words dictionary
+
+unigram.lm
+----------
+ARPA format (ascii) unigram language model for the task.
+
+
+Acknowledgments
+===============
+
+This acoustic model is trained from the TIDIGITS corpus, which is the "NIST CD-ROM Version of the Texas Instruments-developed Studio Quality Speaker-Independent Connected-Digit Corpus".
=== added file 'org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/dictionary'
--- org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/dictionary 1970-01-01 00:00:00 +0000
+++ org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/dictionary 2009-11-09 19:08:09 +0000
@@ -0,0 +1,11 @@
+eight EY_eight T_eight
+five F_five AY_five V_five
+four F_four OW_four R_four
+nine N_nine AY_nine N_nine_2
+oh OW_oh
+one W_one AX_one N_one
+seven S_seven EH_seven V_seven E_seven N_seven
+six S_six I_six K_six S_six_2
+three TH_three R_three II_three
+two T_two OO_two
+zero Z_zero II_zero R_zero OW_zero
=== added file 'org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/fillerdict'
--- org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/fillerdict 1970-01-01 00:00:00 +0000
+++ org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/fillerdict 2009-11-09 19:08:09 +0000
@@ -0,0 +1,3 @@
+<s> SIL
+<sil> SIL
+</s> SIL
=== added file 'org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/license.terms'
--- org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/license.terms 1970-01-01 00:00:00 +0000
+++ org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/license.terms 2009-11-09 19:08:09 +0000
@@ -0,0 +1,38 @@
+Copyright 1999-2002 Carnegie Mellon University.
+Portions Copyright 2002 Sun Microsystems, Inc.
+Portions Copyright 2002 Mitsubishi Electronic Research Laboratories.
+All Rights Reserved. Use is subject to license terms.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+
+3. Original authors' names are not deleted.
+
+4. The authors' names are not used to endorse or promote products
+ derived from this software without specific prior written
+ permission.
+
+This work was supported in part by funding from the Defense Advanced
+Research Projects Agency and the National Science Foundation of the
+United States of America, the CMU Sphinx Speech Consortium, and
+Sun Microsystems, Inc.
+
+CARNEGIE MELLON UNIVERSITY, SUN MICROSYSTEMS, INC., MITSUBISHI
+ELECTRONIC RESEARCH LABORATORIES AND THE CONTRIBUTORS TO THIS WORK
+DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
+CARNEGIE MELLON UNIVERSITY, SUN MICROSYSTEMS, INC., MITSUBISHI
+ELECTRONIC RESEARCH LABORATORIES NOR THE CONTRIBUTORS BE LIABLE FOR
+ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
=== added file 'org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/model.props'
--- org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/model.props 1970-01-01 00:00:00 +0000
+++ org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/model.props 2009-11-09 19:08:09 +0000
@@ -0,0 +1,28 @@
+# Copyright 1999-2002 Carnegie Mellon University.
+# Portions Copyright 2002 Sun Microsystems, Inc.
+# Portions Copyright 2002 Mitsubishi Electronic Research Laboratories.
+# All Rights Reserved. Use is subject to license terms.
+#
+# See the file "license.terms" for information on usage and
+# redistribution of this file, and for a DISCLAIMER OF ALL
+# WARRANTIES.
+
+description = TIDIGITS acoustic models
+
+modelClass = edu.cmu.sphinx.model.acoustic.TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz.Model
+modelLoader = edu.cmu.sphinx.model.acoustic.TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz.ModelLoader
+
+isBinary = true
+featureType = 1s_c_d_dd
+vectorLength = 39
+sparseForm = false
+
+numberFftPoints = 512
+numberFilters = 40
+gaussians = 8
+maximumFrequency = 6800
+minimumFrequency = 130
+sampleRate = 16000
+
+dataLocation = wd_dependent_phone.cd_continuous_8gau
+modelDefinition = wd_dependent_phone.500.mdef
=== added file 'org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/wd_dependent_phone.500.mdef'
--- org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/wd_dependent_phone.500.mdef 1970-01-01 00:00:00 +0000
+++ org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/wd_dependent_phone.500.mdef 2009-11-09 19:08:09 +0000
@@ -0,0 +1,440 @@
+0.3
+34 n_base
+396 n_tri
+1720 n_state_map
+602 n_tied_state
+102 n_tied_ci_state
+34 n_tied_tmat
+#
+# Columns definitions
+#base lft rt p attrib tmat ... state id's ...
+AX_one - - - n/a 0 0 1 2 N
+AY_five - - - n/a 1 3 4 5 N
+AY_nine - - - n/a 2 6 7 8 N
+EH_seven - - - n/a 3 9 10 11 N
+EY_eight - - - n/a 4 12 13 14 N
+E_seven - - - n/a 5 15 16 17 N
+F_five - - - n/a 6 18 19 20 N
+F_four - - - n/a 7 21 22 23 N
+II_three - - - n/a 8 24 25 26 N
+II_zero - - - n/a 9 27 28 29 N
+I_six - - - n/a 10 30 31 32 N
+K_six - - - n/a 11 33 34 35 N
+N_nine - - - n/a 12 36 37 38 N
+N_nine_2 - - - n/a 13 39 40 41 N
+N_one - - - n/a 14 42 43 44 N
+N_seven - - - n/a 15 45 46 47 N
+OO_two - - - n/a 16 48 49 50 N
+OW_four - - - n/a 17 51 52 53 N
+OW_oh - - - n/a 18 54 55 56 N
+OW_zero - - - n/a 19 57 58 59 N
+R_four - - - n/a 20 60 61 62 N
+R_three - - - n/a 21 63 64 65 N
+R_zero - - - n/a 22 66 67 68 N
+ SIL - - - filler 23 69 70 71 N
+S_seven - - - n/a 24 72 73 74 N
+S_six - - - n/a 25 75 76 77 N
+S_six_2 - - - n/a 26 78 79 80 N
+TH_three - - - n/a 27 81 82 83 N
+T_eight - - - n/a 28 84 85 86 N
+T_two - - - n/a 29 87 88 89 N
+V_five - - - n/a 30 90 91 92 N
+V_seven - - - n/a 31 93 94 95 N
+W_one - - - n/a 32 96 97 98 N
+Z_zero - - - n/a 33 99 100 101 N
+AX_one W_one N_one i n/a 0 102 103 104 N
+AY_five F_five V_five i n/a 1 105 106 107 N
+AY_nine N_nine N_nine_2 i n/a 2 108 109 110 N
+EH_seven S_seven V_seven i n/a 3 111 112 113 N
+EY_eight II_three T_eight b n/a 4 116 124 132 N
+EY_eight N_nine_2 T_eight b n/a 4 118 126 132 N
+EY_eight N_one T_eight b n/a 4 118 126 132 N
+EY_eight N_seven T_eight b n/a 4 118 126 132 N
+EY_eight OO_two T_eight b n/a 4 121 129 131 N
+EY_eight OW_oh T_eight b n/a 4 120 128 133 N
+EY_eight OW_zero T_eight b n/a 4 120 128 133 N
+EY_eight R_four T_eight b n/a 4 117 127 133 N
+EY_eight SIL T_eight b n/a 4 119 123 130 N
+EY_eight S_six_2 T_eight b n/a 4 114 129 131 N
+EY_eight T_eight T_eight b n/a 4 115 124 132 N
+EY_eight V_five T_eight b n/a 4 122 125 133 N
+E_seven V_seven N_seven i n/a 5 134 135 136 N
+F_five II_three AY_five b n/a 6 140 144 146 N
+F_five N_nine_2 AY_five b n/a 6 139 144 146 N
+F_five N_one AY_five b n/a 6 139 144 146 N
+F_five N_seven AY_five b n/a 6 139 144 146 N
+F_five OO_two AY_five b n/a 6 137 144 145 N
+F_five OW_oh AY_five b n/a 6 138 144 146 N
+F_five OW_zero AY_five b n/a 6 138 144 146 N
+F_five R_four AY_five b n/a 6 138 144 146 N
+F_five SIL AY_five b n/a 6 142 143 147 N
+F_five S_six_2 AY_five b n/a 6 141 143 145 N
+F_five T_eight AY_five b n/a 6 140 144 145 N
+F_five V_five AY_five b n/a 6 141 144 146 N
+F_four II_three OW_four b n/a 7 149 154 157 N
+F_four N_nine_2 OW_four b n/a 7 153 154 157 N
+F_four N_one OW_four b n/a 7 153 154 157 N
+F_four N_seven OW_four b n/a 7 153 154 157 N
+F_four OO_two OW_four b n/a 7 152 154 157 N
+F_four OW_oh OW_four b n/a 7 151 154 157 N
+F_four OW_zero OW_four b n/a 7 151 154 157 N
+F_four R_four OW_four b n/a 7 151 154 157 N
+F_four SIL OW_four b n/a 7 148 155 156 N
+F_four S_six_2 OW_four b n/a 7 150 154 157 N
+F_four T_eight OW_four b n/a 7 149 154 157 N
+F_four V_five OW_four b n/a 7 149 154 157 N
+II_three R_three EY_eight e n/a 8 160 176 187 N
+II_three R_three F_five e n/a 8 161 172 183 N
+II_three R_three F_four e n/a 8 161 172 183 N
+II_three R_three N_nine e n/a 8 164 175 185 N
+II_three R_three OW_oh e n/a 8 159 177 186 N
+II_three R_three SIL e n/a 8 167 168 178 N
+II_three R_three S_seven e n/a 8 162 173 180 N
+II_three R_three S_six e n/a 8 162 173 180 N
+II_three R_three TH_three e n/a 8 163 169 181 N
+II_three R_three T_two e n/a 8 165 170 182 N
+II_three R_three W_one e n/a 8 166 174 184 N
+II_three R_three Z_zero e n/a 8 158 171 179 N
+II_zero Z_zero R_zero i n/a 9 188 189 190 N
+I_six S_six K_six i n/a 10 191 192 193 N
+K_six I_six S_six_2 i n/a 11 194 195 196 N
+N_nine II_three AY_nine b n/a 12 202 207 214 N
+N_nine N_nine_2 AY_nine b n/a 12 200 206 215 N
+N_nine N_one AY_nine b n/a 12 200 206 215 N
+N_nine N_seven AY_nine b n/a 12 200 206 215 N
+N_nine OO_two AY_nine b n/a 12 203 209 214 N
+N_nine OW_oh AY_nine b n/a 12 201 208 212 N
+N_nine OW_zero AY_nine b n/a 12 201 208 212 N
+N_nine R_four AY_nine b n/a 12 203 208 212 N
+N_nine SIL AY_nine b n/a 12 204 205 211 N
+N_nine S_six_2 AY_nine b n/a 12 197 210 213 N
+N_nine T_eight AY_nine b n/a 12 198 210 215 N
+N_nine V_five AY_nine b n/a 12 199 210 212 N
+N_nine_2 AY_nine EY_eight e n/a 13 217 226 234 N
+N_nine_2 AY_nine F_five e n/a 13 218 223 232 N
+N_nine_2 AY_nine F_four e n/a 13 218 223 232 N
+N_nine_2 AY_nine N_nine e n/a 13 220 229 235 N
+N_nine_2 AY_nine OW_oh e n/a 13 217 225 236 N
+N_nine_2 AY_nine SIL e n/a 13 219 228 237 N
+N_nine_2 AY_nine S_seven e n/a 13 216 222 230 N
+N_nine_2 AY_nine S_six e n/a 13 216 222 230 N
+N_nine_2 AY_nine TH_three e n/a 13 216 221 233 N
+N_nine_2 AY_nine T_two e n/a 13 217 221 233 N
+N_nine_2 AY_nine W_one e n/a 13 218 227 238 N
+N_nine_2 AY_nine Z_zero e n/a 13 216 224 231 N
+N_one AX_one EY_eight e n/a 14 240 249 255 N
+N_one AX_one F_five e n/a 14 239 246 257 N
+N_one AX_one F_four e n/a 14 239 246 257 N
+N_one AX_one N_nine e n/a 14 244 254 261 N
+N_one AX_one OW_oh e n/a 14 240 250 256 N
+N_one AX_one SIL e n/a 14 245 252 263 N
+N_one AX_one S_seven e n/a 14 243 248 260 N
+N_one AX_one S_six e n/a 14 243 248 260 N
+N_one AX_one TH_three e n/a 14 243 247 258 N
+N_one AX_one T_two e n/a 14 242 247 258 N
+N_one AX_one W_one e n/a 14 241 251 262 N
+N_one AX_one Z_zero e n/a 14 242 253 259 N
+N_seven E_seven EY_eight e n/a 15 267 273 288 N
+N_seven E_seven F_five e n/a 15 270 276 285 N
+N_seven E_seven F_four e n/a 15 270 276 285 N
+N_seven E_seven N_nine e n/a 15 265 279 289 N
+N_seven E_seven OW_oh e n/a 15 267 273 287 N
+N_seven E_seven SIL e n/a 15 264 280 281 N
+N_seven E_seven S_seven e n/a 15 271 274 282 N
+N_seven E_seven S_six e n/a 15 271 274 282 N
+N_seven E_seven TH_three e n/a 15 268 277 284 N
+N_seven E_seven T_two e n/a 15 269 277 284 N
+N_seven E_seven W_one e n/a 15 266 278 286 N
+N_seven E_seven Z_zero e n/a 15 272 275 283 N
+OO_two T_two EY_eight e n/a 16 293 306 315 N
+OO_two T_two F_five e n/a 16 294 304 313 N
+OO_two T_two F_four e n/a 16 294 304 313 N
+OO_two T_two N_nine e n/a 16 292 301 312 N
+OO_two T_two OW_oh e n/a 16 295 305 316 N
+OO_two T_two SIL e n/a 16 296 303 317 N
+OO_two T_two S_seven e n/a 16 290 298 311 N
+OO_two T_two S_six e n/a 16 290 298 311 N
+OO_two T_two TH_three e n/a 16 291 299 309 N
+OO_two T_two T_two e n/a 16 290 300 308 N
+OO_two T_two W_one e n/a 16 293 307 314 N
+OO_two T_two Z_zero e n/a 16 297 302 310 N
+OW_four F_four R_four i n/a 17 318 319 320 N
+OW_oh II_three EY_eight s n/a 18 321 345 366 N
+OW_oh II_three F_five s n/a 18 321 345 357 N
+OW_oh II_three F_four s n/a 18 321 345 357 N
+OW_oh II_three N_nine s n/a 18 321 342 362 N
+OW_oh II_three OW_oh s n/a 18 322 349 365 N
+OW_oh II_three SIL s n/a 18 321 353 372 N
+OW_oh II_three S_seven s n/a 18 321 342 361 N
+OW_oh II_three S_six s n/a 18 321 342 361 N
+OW_oh II_three TH_three s n/a 18 321 343 358 N
+OW_oh II_three T_two s n/a 18 321 342 359 N
+OW_oh II_three W_one s n/a 18 322 350 368 N
+OW_oh II_three Z_zero s n/a 18 321 342 362 N
+OW_oh N_nine_2 EY_eight s n/a 18 324 345 366 N
+OW_oh N_nine_2 F_five s n/a 18 324 345 357 N
+OW_oh N_nine_2 F_four s n/a 18 324 345 357 N
+OW_oh N_nine_2 N_nine s n/a 18 325 344 362 N
+OW_oh N_nine_2 OW_oh s n/a 18 325 348 364 N
+OW_oh N_nine_2 SIL s n/a 18 324 354 372 N
+OW_oh N_nine_2 S_seven s n/a 18 324 343 360 N
+OW_oh N_nine_2 S_six s n/a 18 324 343 360 N
+OW_oh N_nine_2 TH_three s n/a 18 324 343 358 N
+OW_oh N_nine_2 T_two s n/a 18 324 343 359 N
+OW_oh N_nine_2 W_one s n/a 18 325 350 367 N
+OW_oh N_nine_2 Z_zero s n/a 18 325 345 362 N
+OW_oh N_one EY_eight s n/a 18 324 345 366 N
+OW_oh N_one F_five s n/a 18 324 345 357 N
+OW_oh N_one F_four s n/a 18 324 345 357 N
+OW_oh N_one N_nine s n/a 18 325 344 362 N
+OW_oh N_one OW_oh s n/a 18 325 348 364 N
+OW_oh N_one SIL s n/a 18 324 354 372 N
+OW_oh N_one S_seven s n/a 18 324 343 360 N
+OW_oh N_one S_six s n/a 18 324 343 360 N
+OW_oh N_one TH_three s n/a 18 324 343 358 N
+OW_oh N_one T_two s n/a 18 324 343 359 N
+OW_oh N_one W_one s n/a 18 325 350 367 N
+OW_oh N_one Z_zero s n/a 18 325 345 362 N
+OW_oh N_seven EY_eight s n/a 18 324 345 366 N
+OW_oh N_seven F_five s n/a 18 324 345 357 N
+OW_oh N_seven F_four s n/a 18 324 345 357 N
+OW_oh N_seven N_nine s n/a 18 325 344 362 N
+OW_oh N_seven OW_oh s n/a 18 325 348 364 N
+OW_oh N_seven SIL s n/a 18 324 354 372 N
+OW_oh N_seven S_seven s n/a 18 324 343 360 N
+OW_oh N_seven S_six s n/a 18 324 343 360 N
+OW_oh N_seven TH_three s n/a 18 324 343 358 N
+OW_oh N_seven T_two s n/a 18 324 343 359 N
+OW_oh N_seven W_one s n/a 18 325 350 367 N
+OW_oh N_seven Z_zero s n/a 18 325 345 362 N
+OW_oh OO_two EY_eight s n/a 18 331 345 366 N
+OW_oh OO_two F_five s n/a 18 330 344 357 N
+OW_oh OO_two F_four s n/a 18 330 344 357 N
+OW_oh OO_two N_nine s n/a 18 330 343 363 N
+OW_oh OO_two OW_oh s n/a 18 327 349 365 N
+OW_oh OO_two SIL s n/a 18 330 352 372 N
+OW_oh OO_two S_seven s n/a 18 330 341 361 N
+OW_oh OO_two S_six s n/a 18 330 341 361 N
+OW_oh OO_two TH_three s n/a 18 326 343 358 N
+OW_oh OO_two T_two s n/a 18 331 343 359 N
+OW_oh OO_two W_one s n/a 18 330 347 367 N
+OW_oh OO_two Z_zero s n/a 18 330 341 363 N
+OW_oh OW_oh EY_eight s n/a 18 327 340 366 N
+OW_oh OW_oh F_five s n/a 18 327 340 357 N
+OW_oh OW_oh F_four s n/a 18 327 340 357 N
+OW_oh OW_oh N_nine s n/a 18 327 341 362 N
+OW_oh OW_oh OW_oh s n/a 18 327 349 364 N
+OW_oh OW_oh SIL s n/a 18 327 351 371 N
+OW_oh OW_oh S_seven s n/a 18 327 341 360 N
+OW_oh OW_oh S_six s n/a 18 327 341 360 N
+OW_oh OW_oh TH_three s n/a 18 327 340 358 N
+OW_oh OW_oh T_two s n/a 18 327 341 359 N
+OW_oh OW_oh W_one s n/a 18 327 347 369 N
+OW_oh OW_oh Z_zero s n/a 18 327 341 362 N
+OW_oh OW_zero EY_eight s n/a 18 327 340 366 N
+OW_oh OW_zero F_five s n/a 18 327 340 357 N
+OW_oh OW_zero F_four s n/a 18 327 340 357 N
+OW_oh OW_zero N_nine s n/a 18 327 341 362 N
+OW_oh OW_zero OW_oh s n/a 18 327 349 364 N
+OW_oh OW_zero SIL s n/a 18 327 351 371 N
+OW_oh OW_zero S_seven s n/a 18 327 341 360 N
+OW_oh OW_zero S_six s n/a 18 327 341 360 N
+OW_oh OW_zero TH_three s n/a 18 327 340 358 N
+OW_oh OW_zero T_two s n/a 18 327 341 359 N
+OW_oh OW_zero W_one s n/a 18 327 347 369 N
+OW_oh OW_zero Z_zero s n/a 18 327 341 362 N
+OW_oh R_four EY_eight s n/a 18 323 344 366 N
+OW_oh R_four F_five s n/a 18 323 345 357 N
+OW_oh R_four F_four s n/a 18 323 345 357 N
+OW_oh R_four N_nine s n/a 18 323 343 363 N
+OW_oh R_four OW_oh s n/a 18 323 346 364 N
+OW_oh R_four SIL s n/a 18 323 352 371 N
+OW_oh R_four S_seven s n/a 18 323 343 361 N
+OW_oh R_four S_six s n/a 18 323 343 361 N
+OW_oh R_four TH_three s n/a 18 323 343 358 N
+OW_oh R_four T_two s n/a 18 326 343 359 N
+OW_oh R_four W_one s n/a 18 323 350 368 N
+OW_oh R_four Z_zero s n/a 18 323 343 363 N
+OW_oh SIL EY_eight s n/a 18 333 335 366 N
+OW_oh SIL F_five s n/a 18 333 339 357 N
+OW_oh SIL F_four s n/a 18 333 339 357 N
+OW_oh SIL N_nine s n/a 18 333 339 362 N
+OW_oh SIL OW_oh s n/a 18 333 334 364 N
+OW_oh SIL SIL s n/a 18 332 356 370 N
+OW_oh SIL S_seven s n/a 18 333 338 361 N
+OW_oh SIL S_six s n/a 18 333 338 361 N
+OW_oh SIL TH_three s n/a 18 333 339 358 N
+OW_oh SIL T_two s n/a 18 333 338 359 N
+OW_oh SIL W_one s n/a 18 333 336 369 N
+OW_oh SIL Z_zero s n/a 18 333 338 362 N
+OW_oh S_six_2 EY_eight s n/a 18 329 335 366 N
+OW_oh S_six_2 F_five s n/a 18 329 337 357 N
+OW_oh S_six_2 F_four s n/a 18 329 337 357 N
+OW_oh S_six_2 N_nine s n/a 18 329 337 362 N
+OW_oh S_six_2 OW_oh s n/a 18 329 334 364 N
+OW_oh S_six_2 SIL s n/a 18 329 355 372 N
+OW_oh S_six_2 S_seven s n/a 18 329 337 360 N
+OW_oh S_six_2 S_six s n/a 18 329 337 360 N
+OW_oh S_six_2 TH_three s n/a 18 329 337 358 N
+OW_oh S_six_2 T_two s n/a 18 329 337 359 N
+OW_oh S_six_2 W_one s n/a 18 329 336 368 N
+OW_oh S_six_2 Z_zero s n/a 18 329 337 362 N
+OW_oh T_eight EY_eight s n/a 18 321 335 366 N
+OW_oh T_eight F_five s n/a 18 322 337 357 N
+OW_oh T_eight F_four s n/a 18 322 337 357 N
+OW_oh T_eight N_nine s n/a 18 322 337 362 N
+OW_oh T_eight OW_oh s n/a 18 322 334 364 N
+OW_oh T_eight SIL s n/a 18 321 353 372 N
+OW_oh T_eight S_seven s n/a 18 322 337 361 N
+OW_oh T_eight S_six s n/a 18 322 337 361 N
+OW_oh T_eight TH_three s n/a 18 322 337 358 N
+OW_oh T_eight T_two s n/a 18 322 337 359 N
+OW_oh T_eight W_one s n/a 18 322 335 368 N
+OW_oh T_eight Z_zero s n/a 18 322 337 362 N
+OW_oh V_five EY_eight s n/a 18 328 344 366 N
+OW_oh V_five F_five s n/a 18 328 345 357 N
+OW_oh V_five F_four s n/a 18 328 345 357 N
+OW_oh V_five N_nine s n/a 18 328 344 362 N
+OW_oh V_five OW_oh s n/a 18 328 346 365 N
+OW_oh V_five SIL s n/a 18 328 352 371 N
+OW_oh V_five S_seven s n/a 18 328 341 361 N
+OW_oh V_five S_six s n/a 18 328 341 361 N
+OW_oh V_five TH_three s n/a 18 328 341 358 N
+OW_oh V_five T_two s n/a 18 328 341 359 N
+OW_oh V_five W_one s n/a 18 331 350 368 N
+OW_oh V_five Z_zero s n/a 18 328 344 362 N
+OW_zero R_zero EY_eight e n/a 19 379 381 397 N
+OW_zero R_zero F_five e n/a 19 378 382 392 N
+OW_zero R_zero F_four e n/a 19 378 382 392 N
+OW_zero R_zero N_nine e n/a 19 376 383 398 N
+OW_zero R_zero OW_oh e n/a 19 380 389 391 N
+OW_zero R_zero SIL e n/a 19 377 388 390 N
+OW_zero R_zero S_seven e n/a 19 375 387 396 N
+OW_zero R_zero S_six e n/a 19 375 387 396 N
+OW_zero R_zero TH_three e n/a 19 375 384 394 N
+OW_zero R_zero T_two e n/a 19 374 385 393 N
+OW_zero R_zero W_one e n/a 19 380 389 391 N
+OW_zero R_zero Z_zero e n/a 19 373 386 395 N
+R_four OW_four EY_eight e n/a 20 399 409 420 N
+R_four OW_four F_five e n/a 20 405 413 423 N
+R_four OW_four F_four e n/a 20 405 413 423 N
+R_four OW_four N_nine e n/a 20 400 410 419 N
+R_four OW_four OW_oh e n/a 20 404 414 421 N
+R_four OW_four SIL e n/a 20 406 415 426 N
+R_four OW_four S_seven e n/a 20 402 411 425 N
+R_four OW_four S_six e n/a 20 402 411 425 N
+R_four OW_four TH_three e n/a 20 402 408 417 N
+R_four OW_four T_two e n/a 20 402 407 418 N
+R_four OW_four W_one e n/a 20 403 416 422 N
+R_four OW_four Z_zero e n/a 20 401 412 424 N
+R_three TH_three II_three i n/a 21 427 428 429 N
+R_zero II_zero OW_zero i n/a 22 430 431 432 N
+S_seven II_three EH_seven b n/a 24 436 450 453 N
+S_seven N_nine_2 EH_seven b n/a 24 439 447 454 N
+S_seven N_one EH_seven b n/a 24 439 447 454 N
+S_seven N_seven EH_seven b n/a 24 439 447 454 N
+S_seven OO_two EH_seven b n/a 24 441 449 453 N
+S_seven OW_oh EH_seven b n/a 24 440 448 453 N
+S_seven OW_zero EH_seven b n/a 24 440 448 453 N
+S_seven R_four EH_seven b n/a 24 438 446 456 N
+S_seven SIL EH_seven b n/a 24 433 443 451 N
+S_seven S_six_2 EH_seven b n/a 24 435 445 455 N
+S_seven T_eight EH_seven b n/a 24 434 442 454 N
+S_seven V_five EH_seven b n/a 24 437 444 452 N
+S_six II_three I_six b n/a 25 457 470 473 N
+S_six N_nine_2 I_six b n/a 25 459 467 473 N
+S_six N_one I_six b n/a 25 459 467 473 N
+S_six N_seven I_six b n/a 25 459 467 473 N
+S_six OO_two I_six b n/a 25 461 470 473 N
+S_six OW_oh I_six b n/a 25 462 471 473 N
+S_six OW_zero I_six b n/a 25 462 471 473 N
+S_six R_four I_six b n/a 25 460 469 473 N
+S_six SIL I_six b n/a 25 464 466 472 N
+S_six S_six_2 I_six b n/a 25 465 468 473 N
+S_six T_eight I_six b n/a 25 463 467 473 N
+S_six V_five I_six b n/a 25 458 469 473 N
+S_six_2 K_six EY_eight e n/a 26 477 487 490 N
+S_six_2 K_six F_five e n/a 26 477 484 497 N
+S_six_2 K_six F_four e n/a 26 477 484 497 N
+S_six_2 K_six N_nine e n/a 26 477 481 489 N
+S_six_2 K_six OW_oh e n/a 26 476 486 491 N
+S_six_2 K_six SIL e n/a 26 474 479 495 N
+S_six_2 K_six S_seven e n/a 26 476 483 496 N
+S_six_2 K_six S_six e n/a 26 476 483 496 N
+S_six_2 K_six TH_three e n/a 26 477 482 493 N
+S_six_2 K_six T_two e n/a 26 477 480 494 N
+S_six_2 K_six W_one e n/a 26 475 485 492 N
+S_six_2 K_six Z_zero e n/a 26 476 478 488 N
+TH_three II_three R_three b n/a 27 503 504 508 N
+TH_three N_nine_2 R_three b n/a 27 500 505 508 N
+TH_three N_one R_three b n/a 27 500 505 508 N
+TH_three N_seven R_three b n/a 27 500 505 508 N
+TH_three OO_two R_three b n/a 27 503 504 508 N
+TH_three OW_oh R_three b n/a 27 502 504 508 N
+TH_three OW_zero R_three b n/a 27 502 504 508 N
+TH_three R_four R_three b n/a 27 503 504 508 N
+TH_three SIL R_three b n/a 27 499 507 509 N
+TH_three S_six_2 R_three b n/a 27 499 506 510 N
+TH_three T_eight R_three b n/a 27 501 505 508 N
+TH_three V_five R_three b n/a 27 498 507 508 N
+T_eight EY_eight EY_eight e n/a 28 515 520 528 N
+T_eight EY_eight F_five e n/a 28 515 519 531 N
+T_eight EY_eight F_four e n/a 28 515 519 531 N
+T_eight EY_eight N_nine e n/a 28 513 521 530 N
+T_eight EY_eight OW_oh e n/a 28 515 520 527 N
+T_eight EY_eight SIL e n/a 28 511 516 532 N
+T_eight EY_eight S_seven e n/a 28 512 517 525 N
+T_eight EY_eight S_six e n/a 28 512 517 525 N
+T_eight EY_eight TH_three e n/a 28 512 518 524 N
+T_eight EY_eight T_two e n/a 28 513 518 523 N
+T_eight EY_eight W_one e n/a 28 514 522 529 N
+T_eight EY_eight Z_zero e n/a 28 512 518 526 N
+T_two II_three OO_two b n/a 29 536 540 541 N
+T_two N_nine_2 OO_two b n/a 29 535 539 541 N
+T_two N_one OO_two b n/a 29 535 539 541 N
+T_two N_seven OO_two b n/a 29 535 539 541 N
+T_two OO_two OO_two b n/a 29 536 540 541 N
+T_two OW_oh OO_two b n/a 29 537 540 541 N
+T_two OW_zero OO_two b n/a 29 537 540 541 N
+T_two R_four OO_two b n/a 29 537 540 541 N
+T_two SIL OO_two b n/a 29 533 538 542 N
+T_two S_six_2 OO_two b n/a 29 534 538 542 N
+T_two T_eight OO_two b n/a 29 533 540 541 N
+T_two V_five OO_two b n/a 29 533 540 541 N
+V_five AY_five EY_eight e n/a 30 547 552 559 N
+V_five AY_five F_five e n/a 30 545 550 555 N
+V_five AY_five F_four e n/a 30 545 550 555 N
+V_five AY_five N_nine e n/a 30 547 552 561 N
+V_five AY_five OW_oh e n/a 30 547 552 559 N
+V_five AY_five SIL e n/a 30 543 549 556 N
+V_five AY_five S_seven e n/a 30 548 554 563 N
+V_five AY_five S_six e n/a 30 548 554 563 N
+V_five AY_five TH_three e n/a 30 545 550 557 N
+V_five AY_five T_two e n/a 30 545 550 558 N
+V_five AY_five W_one e n/a 30 544 551 560 N
+V_five AY_five Z_zero e n/a 30 546 553 562 N
+V_seven EH_seven E_seven i n/a 31 564 565 566 N
+W_one II_three AX_one b n/a 32 571 580 584 N
+W_one N_nine_2 AX_one b n/a 32 567 578 585 N
+W_one N_one AX_one b n/a 32 567 578 585 N
+W_one N_seven AX_one b n/a 32 567 578 585 N
+W_one OO_two AX_one b n/a 32 568 580 584 N
+W_one OW_oh AX_one b n/a 32 569 579 583 N
+W_one OW_zero AX_one b n/a 32 569 579 583 N
+W_one R_four AX_one b n/a 32 570 579 583 N
+W_one SIL AX_one b n/a 32 574 576 582 N
+W_one S_six_2 AX_one b n/a 32 575 577 584 N
+W_one T_eight AX_one b n/a 32 573 581 584 N
+W_one V_five AX_one b n/a 32 572 581 584 N
+Z_zero II_three II_zero b n/a 33 592 597 600 N
+Z_zero N_nine_2 II_zero b n/a 33 589 597 600 N
+Z_zero N_one II_zero b n/a 33 589 597 600 N
+Z_zero N_seven II_zero b n/a 33 589 597 600 N
+Z_zero OO_two II_zero b n/a 33 593 597 600 N
+Z_zero OW_oh II_zero b n/a 33 590 597 600 N
+Z_zero OW_zero II_zero b n/a 33 590 597 600 N
+Z_zero R_four II_zero b n/a 33 594 597 600 N
+Z_zero SIL II_zero b n/a 33 588 595 601 N
+Z_zero S_six_2 II_zero b n/a 33 587 596 599 N
+Z_zero T_eight II_zero b n/a 33 586 598 600 N
+Z_zero V_five II_zero b n/a 33 591 597 600 N
=== added directory 'org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/wd_dependent_phone.cd_continuous_8gau'
=== added file 'org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/wd_dependent_phone.cd_continuous_8gau/means'
Binary files org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/wd_dependent_phone.cd_continuous_8gau/means 1970-01-01 00:00:00 +0000 and org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/wd_dependent_phone.cd_continuous_8gau/means 2009-11-09 19:08:09 +0000 differ
=== added file 'org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/wd_dependent_phone.cd_continuous_8gau/mixture_weights'
Binary files org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/wd_dependent_phone.cd_continuous_8gau/mixture_weights 1970-01-01 00:00:00 +0000 and org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/wd_dependent_phone.cd_continuous_8gau/mixture_weights 2009-11-09 19:08:09 +0000 differ
=== added file 'org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/wd_dependent_phone.cd_continuous_8gau/transition_matrices'
Binary files org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/wd_dependent_phone.cd_continuous_8gau/transition_matrices 1970-01-01 00:00:00 +0000 and org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/wd_dependent_phone.cd_continuous_8gau/transition_matrices 2009-11-09 19:08:09 +0000 differ
=== added file 'org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/wd_dependent_phone.cd_continuous_8gau/variances'
Binary files org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/wd_dependent_phone.cd_continuous_8gau/variances 1970-01-01 00:00:00 +0000 and org.kadosu.plugin.speech/src/test/java/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/wd_dependent_phone.cd_continuous_8gau/variances 2009-11-09 19:08:09 +0000 differ
=== added directory 'org.kadosu.plugin.speech/src/test/java/org'
=== added directory 'org.kadosu.plugin.speech/src/test/java/org/kadosu'
=== added directory 'org.kadosu.plugin.speech/src/test/java/org/kadosu/document'
=== added directory 'org.kadosu.plugin.speech/src/test/java/org/kadosu/document/plugin'
=== added directory 'org.kadosu.plugin.speech/src/test/java/org/kadosu/document/plugin/speech'
=== added file 'org.kadosu.plugin.speech/src/test/java/org/kadosu/document/plugin/speech/DocumentSpeechHandlerTest.java'
--- org.kadosu.plugin.speech/src/test/java/org/kadosu/document/plugin/speech/DocumentSpeechHandlerTest.java 1970-01-01 00:00:00 +0000
+++ org.kadosu.plugin.speech/src/test/java/org/kadosu/document/plugin/speech/DocumentSpeechHandlerTest.java 2009-11-09 19:08:09 +0000
@@ -0,0 +1,19 @@
+package org.kadosu.document.plugin.speech;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.kadosu.document.plugin.speech.DocumentSpeechHandler;
+import org.kadosu.exception.KDSAccessException;
+
+public class DocumentSpeechHandlerTest {
+
+ @Test
+ public void testIsDocument() throws KDSAccessException {
+ DocumentSpeechHandler documentSpeechHandler = new DocumentSpeechHandler();
+ Assert.assertTrue( documentSpeechHandler.isDocument( "/home/ms/temp/kadosuTestData/audio/1984.wav"));
+ Assert.assertTrue( documentSpeechHandler.isDocument( "/home/ms/temp/kadosuTestData/audio/1984.au"));
+ Assert.assertTrue( documentSpeechHandler.isDocument( "/home/ms/temp/kadosuTestData/audio/1984.aiff"));
+ Assert.assertFalse( documentSpeechHandler.isDocument( "/home/ms/temp/kadosuTestData/audio/1984.ogg"));
+ }
+
+}
=== added file 'org.kadosu.plugin.speech/src/test/java/org/kadosu/document/plugin/speech/DocumentSpeechTest.java'
--- org.kadosu.plugin.speech/src/test/java/org/kadosu/document/plugin/speech/DocumentSpeechTest.java 1970-01-01 00:00:00 +0000
+++ org.kadosu.plugin.speech/src/test/java/org/kadosu/document/plugin/speech/DocumentSpeechTest.java 2009-11-09 19:08:09 +0000
@@ -0,0 +1,51 @@
+package org.kadosu.document.plugin.speech;
+
+import java.io.IOException;
+import java.io.Reader;
+import java.net.URL;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.kadosu.exception.KDSAccessException;
+
+public class DocumentSpeechTest {
+
+ @Test
+ public void testGetContent() throws KDSAccessException, IOException {
+ DocumentSpeech documentSpeech = new DocumentSpeech();
+ URL resource = DocumentSpeechTest.class.getResource( "/speechConfig.xml");
+ documentSpeech.setConfigFile( resource.getFile());
+ documentSpeech.setDocument( "/home/ms/temp/kadosuTestData/audio/1984.wav");
+ Reader content = documentSpeech.getContent();
+ char[] read = new char[4096];
+ int count = content.read( read);
+ StringBuffer result = new StringBuffer();
+ result.append( read);
+ while (count > -1) {
+ count = content.read( read);
+ result.append( read);
+ }
+ Assert.assertEquals( "one nine eight four", result.toString().substring( 0, 19));
+ }
+
+ @Test
+ public void testGetDate() throws KDSAccessException {
+ DocumentSpeech documentSpeech = new DocumentSpeech();
+ documentSpeech.setDocument( "/home/ms/temp/kadosuTestData/audio/1984.wav");
+ Assert.assertEquals( Long.valueOf( 1234033122000L), Long.valueOf( documentSpeech.getDate()));
+ }
+
+ @Test
+ public void testGetExtra() throws KDSAccessException {
+ DocumentSpeech documentSpeech = new DocumentSpeech();
+ documentSpeech.setDocument( "/home/ms/temp/kadosuTestData/audio/1984.wav");
+ Assert.assertTrue( documentSpeech.getExtra().isEmpty());
+ }
+
+ @Test
+ public void testGetPath() throws KDSAccessException {
+ DocumentSpeech documentSpeech = new DocumentSpeech();
+ documentSpeech.setDocument( "/home/ms/temp/kadosuTestData/audio/1984.wav");
+ Assert.assertEquals( "/home/ms/temp/kadosuTestData/audio/1984.wav", documentSpeech.getPath());
+ }
+}
=== added directory 'org.kadosu.plugin.speech/src/test/java/org/kadosu/document/plugin/speech/org'
=== added directory 'org.kadosu.plugin.speech/src/test/java/org/kadosu/document/plugin/speech/org/kadosu'
=== added directory 'org.kadosu.plugin.speech/src/test/java/org/kadosu/document/plugin/speech/org/kadosu/document'
=== added directory 'org.kadosu.plugin.speech/src/test/java/org/kadosu/document/plugin/speech/org/kadosu/document/plugin'
=== added directory 'org.kadosu.plugin.speech/src/test/java/org/kadosu/document/plugin/speech/org/kadosu/document/plugin/speech'
=== added directory 'org.kadosu.plugin.speech/src/test/resources'
=== added directory 'org.kadosu.plugin.speech/src/test/resources/org'
=== added directory 'org.kadosu.plugin.speech/src/test/resources/org/kadosu'
=== added directory 'org.kadosu.plugin.speech/src/test/resources/org/kadosu/document'
=== added directory 'org.kadosu.plugin.speech/src/test/resources/org/kadosu/document/plugin'
=== added directory 'org.kadosu.plugin.speech/src/test/resources/org/kadosu/document/plugin/speech'
=== added file 'org.kadosu.plugin.speech/src/test/resources/org/kadosu/document/plugin/speech/digits.gram'
--- org.kadosu.plugin.speech/src/test/resources/org/kadosu/document/plugin/speech/digits.gram 1970-01-01 00:00:00 +0000
+++ org.kadosu.plugin.speech/src/test/resources/org/kadosu/document/plugin/speech/digits.gram 2009-11-09 19:08:09 +0000
@@ -0,0 +1,9 @@
+#JSGF V1.0;
+
+/**
+ * JSGF Digits Grammar for Hello World example
+ */
+
+grammar digits;
+
+public <numbers> = (oh | zero | one | two | three | four | five | six | seven | eight | nine) * ;
=== added file 'org.kadosu.plugin.speech/src/test/resources/speechConfig.xml'
--- org.kadosu.plugin.speech/src/test/resources/speechConfig.xml 1970-01-01 00:00:00 +0000
+++ org.kadosu.plugin.speech/src/test/resources/speechConfig.xml 2009-11-09 19:08:09 +0000
@@ -0,0 +1,219 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Sphinx-4 Configuration file
+-->
+
+<!-- ******************************************************** -->
+<!-- tidigits configuration file -->
+<!-- ******************************************************** -->
+
+<config>
+
+
+ <!-- ******************************************************** -->
+ <!-- frequently tuned properties -->
+ <!-- ******************************************************** -->
+
+ <property name="absoluteBeamWidth" value="-1"/>
+ <property name="relativeBeamWidth" value="1E-90"/>
+ <property name="wordInsertionProbability" value="1E-36"/>
+ <property name="languageWeight" value="8"/>
+ <property name="silenceInsertionProbability" value="1"/>
+ <property name="skip" value="0"/>
+ <property name="logLevel" value="WARNING"/>
+
+ <property name="recognizer" value="recognizer"/>
+ <property name="linguist" value="flatLinguist"/>
+ <property name="frontend" value="mfcFrontEnd"/>
+
+
+ <!-- ******************************************************** -->
+ <!-- The connectedDigitsRecognizer configuration -->
+ <!-- ******************************************************** -->
+
+ <component name="recognizer"
+ type="edu.cmu.sphinx.recognizer.Recognizer">
+ <property name="decoder" value="digitsDecoder"/>
+ <propertylist name="monitors">
+ </propertylist>
+ </component>
+
+
+ <!-- ******************************************************** -->
+ <!-- The Decoder configuration -->
+ <!-- ******************************************************** -->
+
+ <component name="digitsDecoder" type="edu.cmu.sphinx.decoder.Decoder">
+ <property name="searchManager" value="searchManager"/>
+ </component>
+
+ <component name="searchManager"
+ type="edu.cmu.sphinx.decoder.search.SimpleBreadthFirstSearchManager">
+ <property name="logMath" value="logMath"/>
+ <property name="linguist" value="${linguist}"/>
+ <property name="pruner" value="trivialPruner"/>
+ <property name="scorer" value="threadedScorer"/>
+ <property name="activeListFactory" value="activeList"/>
+ </component>
+
+
+ <component name="activeList"
+ type="edu.cmu.sphinx.decoder.search.SortingActiveListFactory">
+ <property name="logMath" value="logMath"/>
+ <property name="absoluteBeamWidth" value="${absoluteBeamWidth}"/>
+ <property name="relativeBeamWidth" value="${relativeBeamWidth}"/>
+ </component>
+
+ <component name="trivialPruner"
+ type="edu.cmu.sphinx.decoder.pruner.SimplePruner"/>
+
+ <component name="threadedScorer"
+ type="edu.cmu.sphinx.decoder.scorer.ThreadedAcousticScorer">
+ <property name="frontend" value="${frontend}"/>
+ </component>
+
+ <!-- ******************************************************** -->
+ <!-- The linguist configuration -->
+ <!-- ******************************************************** -->
+
+ <component name="flatLinguist"
+ type="edu.cmu.sphinx.linguist.flat.FlatLinguist">
+ <property name="logMath" value="logMath"/>
+ <property name="grammar" value="jsgfGrammar"/>
+ <property name="acousticModel" value="acousticModel"/>
+ <property name="wordInsertionProbability"
+ value="${wordInsertionProbability}"/>
+ <property name="silenceInsertionProbability"
+ value="${silenceInsertionProbability}"/>
+ <property name="languageWeight" value="${languageWeight}"/>
+ <property name="unitManager" value="unitManager"/>
+ </component>
+
+
+ <!-- ******************************************************** -->
+ <!-- The Grammar configuration -->
+ <!-- ******************************************************** -->
+
+ <component name="jsgfGrammar" type="edu.cmu.sphinx.jsapi.JSGFGrammar">
+ <property name="dictionary" value="dictionary"/>
+ <property name="grammarLocation"
+ value="resource:/org.kadosu.document.plugin.speech.DocumentSpeechTest!/org/kadosu/document/plugin/speech/"/>
+ <property name="grammarName" value="digits"/>
+ <property name="logMath" value="logMath"/>
+ </component>
+
+
+ <!-- ******************************************************** -->
+ <!-- The Dictionary configuration -->
+ <!-- ******************************************************** -->
+
+ <component name="dictionary"
+ type="edu.cmu.sphinx.linguist.dictionary.FullDictionary">
+ <property name="dictionaryPath"
+ value="resource:/edu.cmu.sphinx.model.acoustic.TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz.Model!/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/dictionary"/>
+ <property name="fillerPath"
+ value="resource:/edu.cmu.sphinx.model.acoustic.TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz.Model!/edu/cmu/sphinx/model/acoustic/TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz/fillerdict"/>
+ <property name="addSilEndingPronunciation" value="false"/>
+ <property name="unitManager" value="unitManager"/>
+ </component>
+
+
+ <!-- ******************************************************** -->
+ <!-- The acoustic model configuration -->
+ <!-- ******************************************************** -->
+
+ <component name="acousticModel"
+ type="edu.cmu.sphinx.model.acoustic.TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz.Model">
+ <property name="loader" value="sphinx3Loader"/>
+ <property name="unitManager" value="unitManager"/>
+ </component>
+
+ <component name="sphinx3Loader"
+ type="edu.cmu.sphinx.model.acoustic.TIDIGITS_8gau_13dCep_16k_40mel_130Hz_6800Hz.ModelLoader">
+ <property name="logMath" value="logMath"/>
+ <property name="unitManager" value="unitManager"/>
+ </component>
+
+
+ <!-- ******************************************************** -->
+ <!-- The unit manager configuration -->
+ <!-- ******************************************************** -->
+
+ <component name="unitManager"
+ type="edu.cmu.sphinx.linguist.acoustic.UnitManager"/>
+
+
+ <!-- ******************************************************** -->
+ <!-- The frontend configuration -->
+ <!-- ******************************************************** -->
+
+ <component name="mfcFrontEnd" type="edu.cmu.sphinx.frontend.FrontEnd">
+ <propertylist name="pipeline">
+ <item>audioFileDataSource</item>
+ <item>premphasizer</item>
+ <item>dither</item>
+ <item>windower</item>
+ <item>fft</item>
+ <item>melFilterBank</item>
+ <item>dct</item>
+ <item>batchCMN</item>
+ <item>featureExtraction</item>
+ </propertylist>
+ </component>
+
+
+ <component name="audioFileDataSource" type="edu.cmu.sphinx.frontend.util.AudioFileDataSource"/>
+
+ <component name="premphasizer"
+ type="edu.cmu.sphinx.frontend.filter.Preemphasizer"/>
+
+ <component name="dither"
+ type="edu.cmu.sphinx.frontend.filter.Dither"/>
+
+ <component name="windower"
+ type="edu.cmu.sphinx.frontend.window.RaisedCosineWindower"/>
+
+ <component name="fft"
+ type="edu.cmu.sphinx.frontend.transform.DiscreteFourierTransform"/>
+
+ <component name="melFilterBank"
+ type="edu.cmu.sphinx.frontend.frequencywarp.MelFrequencyFilterBank"/>
+
+ <component name="dct"
+ type="edu.cmu.sphinx.frontend.transform.DiscreteCosineTransform"/>
+
+ <component name="batchCMN"
+ type="edu.cmu.sphinx.frontend.feature.BatchCMN"/>
+
+ <component name="featureExtraction"
+ type="edu.cmu.sphinx.frontend.feature.DeltasFeatureExtractor"/>
+
+
+ <!-- ******************************************************* -->
+ <!-- monitors -->
+ <!-- ******************************************************* -->
+
+ <component name="memoryTracker"
+ type="edu.cmu.sphinx.instrumentation.MemoryTracker">
+ <property name="recognizer" value="${recognizer}"/>
+ </component>
+
+ <component name="speedTracker"
+ type="edu.cmu.sphinx.instrumentation.SpeedTracker">
+ <property name="recognizer" value="${recognizer}"/>
+ <property name="frontend" value="${frontend}"/>
+ <property name="showTimers" value="false"/>
+ </component>
+
+
+ <!-- ******************************************************* -->
+ <!-- Miscellaneous components -->
+ <!-- ******************************************************* -->
+
+ <component name="logMath" type="edu.cmu.sphinx.util.LogMath">
+ <property name="logBase" value="1.0001"/>
+ <property name="useAddTable" value="true"/>
+ </component>
+
+</config>