]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
changing to standard XML format
authorBrian West <brian@freeswitch.org>
Tue, 23 Jun 2009 15:22:20 +0000 (15:22 +0000)
committerBrian West <brian@freeswitch.org>
Tue, 23 Jun 2009 15:22:20 +0000 (15:22 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13908 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/asr_tts/mod_pocketsphinx/mod_pocketsphinx.c

index beccf9b489d9a65f0f1a16a7b4a0a46fe49b9bd4..94cd6db7e7bb45b216883ae5b456cbfacd8a4c14 100644 (file)
@@ -383,20 +383,17 @@ static switch_status_t pocketsphinx_asr_get_results(switch_asr_handle_t *ah, cha
                        ps->confidence = 0;
                }
 
-               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Recognized: %s, Score: %d\n", ps->hyp, ps->confidence);
+               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Recognized: %s, Confidence: %d\n", ps->hyp, ps->confidence);
                switch_mutex_unlock(ps->flag_mutex); 
 
-               *xmlstr = switch_mprintf("<interpretation grammar=\"%s\" score=\"%d\">\n"
-                                                                "  <result name=\"%s\">%s</result>\n"
-                                                                "  <input>%s</input>\n"
-                                                                "</interpretation>",
-                                                                ps->grammar, ps->confidence,
-                                                               "match", 
-                                                                ps->hyp, 
-                                                                ps->hyp
-                                                                );
+               *xmlstr = switch_mprintf("<?xml version=\"1.0\"?>\n"
+                                                                "<result grammar=\"%s\">\n"
+                                                                "  <interpretation grammar=\"%s\" confidence=\"%d\">\n"
+                                                                "    <input mode=\"speech\">%s</input>\n"
+                                                                "  </interpretation>\n"
+                                                                "</result>\n",
+                                                                ps->grammar, ps->grammar, ps->confidence, ps->hyp);
 
-               
                if (switch_test_flag(ps, SWITCH_ASR_FLAG_AUTO_RESUME)) {
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Auto Resuming\n");
                        switch_set_flag(ps, PSFLAG_READY);