From ac02065ebd2ab8cc66dd3632b93cd3cea5295c33 Mon Sep 17 00:00:00 2001 From: nshmyrev Date: Fri, 3 Jan 2014 20:41:02 +0000 Subject: [PATCH] Fixes testsuite git-svn-id: svn+ssh://svn.code.sf.net/p/cmusphinx/code/trunk/pocketsphinx@12148 94700074-3cef-4d97-a70e-9c8c206c02f5 --- src/programs/Makefile.am | 9 ++------ test/data/wsj/test-hub4-n800-fwdtree.match | 14 ++++++------- test/unit/ps_test.c | 24 +++++++++++----------- test/unit/test_fwdflat.c | 2 +- test/unit/test_fwdtree.c | 2 +- test/unit/test_fwdtree_bestpath.c | 4 ++-- test/unit/test_fwdtree_fwdflat.c | 2 +- test/unit/test_fwdtree_nbest.c | 16 ++++++++------- test/unit/test_ps_fwdflat.c | 3 ++- test/unit/test_ps_fwdtree.c | 2 +- test/unit/test_ps_fwdtree_bestpath.c | 2 +- test/unit/test_ps_fwdtree_fwdflat.c | 4 +++- test/unit/test_senfh.c | 4 ++-- 13 files changed, 44 insertions(+), 44 deletions(-) diff --git a/src/programs/Makefile.am b/src/programs/Makefile.am index 776c3e22..d3303788 100644 --- a/src/programs/Makefile.am +++ b/src/programs/Makefile.am @@ -11,8 +11,8 @@ pocketsphinx_mdef_convert_LDADD = \ pocketsphinx_batch_SOURCES = batch.c pocketsphinx_batch_LDADD = \ $(top_builddir)/src/libpocketsphinx/libpocketsphinx.la - -pocketsphinx_kws_SOURCES = pocketsphinx_kws.c + +pocketsphinx_kws_SOURCES = kws.c pocketsphinx_kws_LDADD = \ $(top_builddir)/src/libpocketsphinx/libpocketsphinx.la @@ -20,11 +20,6 @@ pocketsphinx_continuous_SOURCES = continuous.c pocketsphinx_continuous_LDADD = \ $(top_builddir)/src/libpocketsphinx/libpocketsphinx.la -lsphinxad -pocketsphinx_kws_SOURCES = kws.c -pocketsphinx_kws_LDADD = \ - $(top_builddir)/src/libpocketsphinx/libpocketsphinx.la -lsphinxad - - INCLUDES = -I$(top_srcdir)/include \ -I$(top_srcdir)/src/libpocketsphinx \ -I$(top_builddir)/include diff --git a/test/data/wsj/test-hub4-n800-fwdtree.match b/test/data/wsj/test-hub4-n800-fwdtree.match index bf86f629..7cf10bd9 100644 --- a/test/data/wsj/test-hub4-n800-fwdtree.match +++ b/test/data/wsj/test-hub4-n800-fwdtree.match @@ -1,7 +1,7 @@ -at n. e. c. is the need for international managers will keep rising (n800_440c0201 -52810) -the company has five hundred japanese managers have received most of them in key positions in expects the number to rise sixty %percent of the next five years (n800_440c0202 -97294) -about half of these managers are in the u. s. (n800_440c0203 -36755) -r. l. i. corporation a jury illinois based insurance holding company will begin trading friday on the big board under the symbol r. l. i. (n800_440c0204 -106143) -the company previously traded over the counter (n800_440c0205 -40976) -two other issues began trading recently on the big board (n800_440c0206 -46332) -the agency is unlikely to take any action until the union's rank and file puts on the contract in two to three weeks (n800_440c0207 -73803) +at n. e. c. is needed for international managers will keep rising (n800_440c0201 -49565) +the company has five hundred japanese managers in overseas most of them in key positions in expects the number to rise sixteen %percent to the next five years (n800_440c0202 -91117) +about half of these managers are in the u. s. (n800_440c0203 -33870) +r. l. i. corporation a jury illinois based insurance holding company will begin trading friday on the big board under the symbol r. l. i. (n800_440c0204 -97451) +the company previously traded over the counter (n800_440c0205 -37088) +two other issues began trading recently on the big board (n800_440c0206 -42394) +the agency is unlikely that take any action until the union's rank and file for a summit contract in two to three weeks (n800_440c0207 -69401) diff --git a/test/unit/ps_test.c b/test/unit/ps_test.c index 3ed3229e..73611888 100644 --- a/test/unit/ps_test.c +++ b/test/unit/ps_test.c @@ -7,19 +7,19 @@ #include "test_macros.h" static const mfcc_t prior[13] = { - FLOAT2MFCC(31.61), - FLOAT2MFCC(-1.42), - FLOAT2MFCC(0.82), - FLOAT2MFCC(0.48), - FLOAT2MFCC(-0.72), - FLOAT2MFCC(0.19), - FLOAT2MFCC(-0.06), - FLOAT2MFCC(0.31), - FLOAT2MFCC(0.42), - FLOAT2MFCC(0.58), + FLOAT2MFCC(33.89), + FLOAT2MFCC(-1.13), + FLOAT2MFCC(0.83), + FLOAT2MFCC(0.49), + FLOAT2MFCC(-0.65), + FLOAT2MFCC(0.12), + FLOAT2MFCC(-0.03), + FLOAT2MFCC(0.28), + FLOAT2MFCC(0.41), + FLOAT2MFCC(0.59), FLOAT2MFCC(0.11), - FLOAT2MFCC(-0.24), - FLOAT2MFCC(0.18) + FLOAT2MFCC(-0.20), + FLOAT2MFCC(0.17) }; int diff --git a/test/unit/test_fwdflat.c b/test/unit/test_fwdflat.c index 90058d18..aa25791f 100644 --- a/test/unit/test_fwdflat.c +++ b/test/unit/test_fwdflat.c @@ -60,7 +60,7 @@ main(int argc, char *argv[]) TEST_ASSERT(acmod_end_utt(acmod) >= 0); fclose(rawfh); } - TEST_EQUAL(0, strcmp("go forward in the shares", + TEST_EQUAL(0, strcmp("go forward and readers", ngram_search_bp_hyp(ngs, ngram_search_find_exit(ngs, -1, NULL, NULL)))); c = clock() - c; printf("2 * fwdflat search in %.2f sec\n", diff --git a/test/unit/test_fwdtree.c b/test/unit/test_fwdtree.c index 1a4be54c..6ab29eb1 100644 --- a/test/unit/test_fwdtree.c +++ b/test/unit/test_fwdtree.c @@ -61,7 +61,7 @@ main(int argc, char *argv[]) TEST_ASSERT(acmod_end_utt(acmod) >= 0); fclose(rawfh); } - TEST_EQUAL(0, strcmp("go forward to any leaders", + TEST_EQUAL(0, strcmp("go forward to any shares", ngram_search_bp_hyp(ngs, ngram_search_find_exit(ngs, -1, NULL, NULL)))); c = clock() - c; printf("5 * fwdtree search in %.2f sec\n", diff --git a/test/unit/test_fwdtree_bestpath.c b/test/unit/test_fwdtree_bestpath.c index 8a717ce8..87329067 100644 --- a/test/unit/test_fwdtree_bestpath.c +++ b/test/unit/test_fwdtree_bestpath.c @@ -78,11 +78,11 @@ main(int argc, char *argv[]) ps_lattice_hyp(dag, ps_lattice_bestpath(dag, ngs->lmset, 1.461538, 15.0))); } printf("%s\n", ngram_search_bp_hyp(ngs, ngram_search_find_exit(ngs, -1, NULL, NULL))); - TEST_EQUAL(0, strcmp("go forward to any leaders", + TEST_EQUAL(0, strcmp("go forward to any shares", ngram_search_bp_hyp(ngs, ngram_search_find_exit(ngs, -1, NULL, NULL)))); printf("%s\n", ps_lattice_hyp(dag, ps_lattice_bestpath(dag, ngs->lmset, 1.461538, 15.0))); - TEST_EQUAL(0, strcmp("go forward ten readers", + TEST_EQUAL(0, strcmp("go forward to any shares", ps_lattice_hyp(dag, ps_lattice_bestpath(dag, ngs->lmset, 1.461538, 15.0)))); c = clock() - c; diff --git a/test/unit/test_fwdtree_fwdflat.c b/test/unit/test_fwdtree_fwdflat.c index 2dc4a260..cbd6fc4a 100644 --- a/test/unit/test_fwdtree_fwdflat.c +++ b/test/unit/test_fwdtree_fwdflat.c @@ -83,7 +83,7 @@ main(int argc, char *argv[]) printf("FWDFLAT: %s\n", ngram_search_bp_hyp(ngs, ngram_search_find_exit(ngs, -1, NULL, NULL))); } - TEST_EQUAL(0, strcmp("go forward to ten readers", + TEST_EQUAL(0, strcmp("go forward and readers", ngram_search_bp_hyp(ngs, ngram_search_find_exit(ngs, -1, NULL, NULL)))); c = clock() - c; printf("5 * fwdtree + fwdflat search in %.2f sec\n", diff --git a/test/unit/test_fwdtree_nbest.c b/test/unit/test_fwdtree_nbest.c index 73a270d7..ca0bb752 100644 --- a/test/unit/test_fwdtree_nbest.c +++ b/test/unit/test_fwdtree_nbest.c @@ -79,23 +79,25 @@ main(int argc, char *argv[]) } besthyp = ckd_salloc (ps_lattice_hyp(dag, ps_lattice_bestpath - (dag, ngs->lmset, 1.461538, 15.0))); + (dag, ngs->lmset, 6.5, 1.0))); printf("BESTPATH: %s\n", besthyp); - TEST_ASSERT(nbest = ps_astar_start(dag, ngs->lmset, 1.461538, 0, -1, -1, -1)); + TEST_ASSERT(nbest = ps_astar_start(dag, ngs->lmset, 6.5, 0, -1, -1, -1)); i = 0; while ((path = ps_astar_next(nbest))) { - if (i == 0) - TEST_EQUAL(0, - strcmp(besthyp, ps_astar_hyp(nbest, path))); - if (i++ < 10) + if (i < 10) printf("NBEST %d: %s\n", i, ps_astar_hyp(nbest, path)); + if (i == 0) { + TEST_EQUAL(0, + strcmp(besthyp, ps_astar_hyp(nbest, path))); + } + i++; } ps_astar_finish(nbest); ckd_free(besthyp); } - TEST_EQUAL(0, strcmp("go forward to any leaders", + TEST_EQUAL(0, strcmp("go forward to any shares", ngram_search_bp_hyp(ngs, ngram_search_find_exit(ngs, -1, NULL, NULL)))); c = clock() - c; printf("5 * fwdtree + bestpath + N-best search in %.2f sec\n", diff --git a/test/unit/test_ps_fwdflat.c b/test/unit/test_ps_fwdflat.c index ce4614fd..e9547e4f 100644 --- a/test/unit/test_ps_fwdflat.c +++ b/test/unit/test_ps_fwdflat.c @@ -16,10 +16,11 @@ main(int argc, char *argv[]) "-hmm", MODELDIR "/hmm/en_US/hub4wsj_sc_8k", "-lm", MODELDIR "/lm/en_US/wsj0vp.5000.DMP", "-dict", MODELDIR "/lm/en_US/cmu07a.dic", + "-fwdflatlw", "6.5", "-fwdtree", "no", "-fwdflat", "yes", "-bestpath", "no", "-input_endian", "little", "-samprate", "16000", NULL)); - return ps_decoder_test(config, "FWDFLAT", "go forward to ten readers"); + return ps_decoder_test(config, "FWDFLAT", "go forward ten readers"); } diff --git a/test/unit/test_ps_fwdtree.c b/test/unit/test_ps_fwdtree.c index d08e2e9c..35c3be82 100644 --- a/test/unit/test_ps_fwdtree.c +++ b/test/unit/test_ps_fwdtree.c @@ -21,5 +21,5 @@ main(int argc, char *argv[]) "-bestpath", "no", "-input_endian", "little", "-samprate", "16000", NULL)); - return ps_decoder_test(config, "FWDTREE", "go forward ten readers"); + return ps_decoder_test(config, "FWDTREE", "go forward to any shares"); } diff --git a/test/unit/test_ps_fwdtree_bestpath.c b/test/unit/test_ps_fwdtree_bestpath.c index 44722398..24941fbb 100644 --- a/test/unit/test_ps_fwdtree_bestpath.c +++ b/test/unit/test_ps_fwdtree_bestpath.c @@ -21,5 +21,5 @@ main(int argc, char *argv[]) "-bestpath", "yes", "-input_endian", "little", "-samprate", "16000", NULL)); - return ps_decoder_test(config, "BESTPATH", "go forward ten readers"); + return ps_decoder_test(config, "BESTPATH", "go forward to any shares"); } diff --git a/test/unit/test_ps_fwdtree_fwdflat.c b/test/unit/test_ps_fwdtree_fwdflat.c index 23879c78..b004c06f 100644 --- a/test/unit/test_ps_fwdtree_fwdflat.c +++ b/test/unit/test_ps_fwdtree_fwdflat.c @@ -16,10 +16,12 @@ main(int argc, char *argv[]) "-hmm", MODELDIR "/hmm/en_US/hub4wsj_sc_8k", "-lm", MODELDIR "/lm/en_US/wsj0vp.5000.DMP", "-dict", MODELDIR "/lm/en_US/cmu07a.dic", + "-lw", "6.5", + "-fwdflatlw", "6.5", "-fwdtree", "yes", "-fwdflat", "yes", "-bestpath", "no", "-input_endian", "little", "-samprate", "16000", NULL)); - return ps_decoder_test(config, "FWDFLAT", "go forward to ten readers"); + return ps_decoder_test(config, "FWDFLAT", "go forward ten readers"); } diff --git a/test/unit/test_senfh.c b/test/unit/test_senfh.c index 4f15ef76..07b30842 100644 --- a/test/unit/test_senfh.c +++ b/test/unit/test_senfh.c @@ -59,7 +59,7 @@ main(int argc, char *argv[]) TEST_ASSERT(acmod_end_utt(acmod) >= 0); fclose(rawfh); - TEST_EQUAL(0, strcmp("go forward in the shares", + TEST_EQUAL(0, strcmp("go forward and readers", ngram_search_bp_hyp(ngs, ngram_search_find_exit(ngs, -1, NULL, NULL)))); @@ -79,7 +79,7 @@ main(int argc, char *argv[]) ngram_search_bp_hyp(ngs, ngram_search_find_exit(ngs, -1, NULL, NULL))); TEST_ASSERT(acmod_end_utt(acmod) >= 0); - TEST_EQUAL(0, strcmp("go forward in the shares", + TEST_EQUAL(0, strcmp("go forward and readers", ngram_search_bp_hyp(ngs, ngram_search_find_exit(ngs, -1, NULL, NULL)))); fclose(senfh);