[Freeswitch-trunk] [commit] r13910 - in freeswitch/trunk: conf/autoload_configs src/mod/asr_tts/mod_pocketsphinx
FreeSWITCH SVN
brian at freeswitch.org
Tue Jun 23 10:28:01 PDT 2009
Author: brian
Date: Tue Jun 23 12:28:00 2009
New Revision: 13910
Log:
add language weight to pocketsphinx
Modified:
freeswitch/trunk/conf/autoload_configs/pocketsphinx.conf.xml
freeswitch/trunk/src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.c
Modified: freeswitch/trunk/conf/autoload_configs/pocketsphinx.conf.xml
==============================================================================
--- freeswitch/trunk/conf/autoload_configs/pocketsphinx.conf.xml (original)
+++ freeswitch/trunk/conf/autoload_configs/pocketsphinx.conf.xml Tue Jun 23 12:28:00 2009
@@ -4,6 +4,7 @@
<param name="silence-hits" value="25"/>
<param name="listen-hits" value="1"/>
<param name="auto-reload" value="true"/>
+ <!--<param name="language-weight" value="1"/>-->
<!--<param name="narrowband-model" value="communicator"/>-->
<!--<param name="wideband-model" value="wsj1"/>-->
<!--<param name="dictionary" value="default.dic"/>-->
Modified: freeswitch/trunk/src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.c
==============================================================================
--- freeswitch/trunk/src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.c (original)
+++ freeswitch/trunk/src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.c Tue Jun 23 12:28:00 2009
@@ -46,6 +46,7 @@
char *model8k;
char *model16k;
char *dictionary;
+ char *language_weight;
uint32_t thresh;
uint32_t silence_hits;
uint32_t listen_hits;
@@ -160,6 +161,7 @@
"-samprate", rate,
"-hmm", model,
"-jsgf", jsgf,
+ "-lw", globals.language_weight,
"-dict", dic,
"-frate", "50",
"-silprob", "0.005",
@@ -433,6 +435,8 @@
globals.thresh = atoi(val);
} else if (!strcasecmp(var, "silence-hits")) {
globals.silence_hits = atoi(val);
+ } else if (!strcasecmp(var, "language-weight")) {
+ globals.language_weight = switch_core_strdup(globals.pool, val);
} else if (!strcasecmp(var, "listen-hits")) {
globals.listen_hits = atoi(val);
} else if (!strcasecmp(var, "auto-reload")) {
@@ -459,6 +463,10 @@
globals.dictionary = switch_core_strdup(globals.pool, "default.dic");
}
+ if (!globals.language_weight) {
+ globals.language_weight = switch_core_strdup(globals.pool, "6.5");
+ }
+
done:
if (xml) {
switch_xml_free(xml);
More information about the Freeswitch-trunk
mailing list