summaryrefslogtreecommitdiff
path: root/decoder/cfg_test.cc
diff options
context:
space:
mode:
authorgraehl@gmail.com <graehl@gmail.com@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-08-15 08:50:14 +0000
committergraehl@gmail.com <graehl@gmail.com@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-08-15 08:50:14 +0000
commitc7f1a4e30a42ad0c03ac6c439e04e6aa7efafefe (patch)
treeb98b35e5c5a0fb3039a307efb9f5b91911824b20 /decoder/cfg_test.cc
parent6d3cf2f3aeaa5d008f5031f70da8d728181486bc (diff)
files required for test
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@556 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'decoder/cfg_test.cc')
-rwxr-xr-xdecoder/cfg_test.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/decoder/cfg_test.cc b/decoder/cfg_test.cc
index cde4706c..c61f9f2c 100755
--- a/decoder/cfg_test.cc
+++ b/decoder/cfg_test.cc
@@ -3,6 +3,7 @@
#include "cfg.h"
#include "hg_test.h"
#include "cfg_options.h"
+#include "show.h"
/* TODO: easiest way to get meaningful confirmations that things work: implement conversion back to hg, and compare viterbi/inside etc. stats for equality to original hg. or you can define CSHOW_V and see lots of output */
@@ -60,8 +61,11 @@ TEST_P(CFGTest,Binarize) {
CSHOWDO(cerr<<"\nUniqing: "<<nrules<<"\n");
int nrem=cfgu.UniqRules();
cerr<<"\nCFG "<<hgfile<<" Uniqed - remaining: "<<nrem<<" of "<<nrules<<"\n";
- if (nrem==nrules)
+ if (nrem==nrules) {
EXPECT_EQ(cfgu,cfg);
+ //TODO - check that 1best is still the same (that we removed only worse edges)
+ }
+
for (int i=-1;i<8;++i) {
bool uniq;
if (i>=0) {
@@ -75,6 +79,7 @@ TEST_P(CFGTest,Binarize) {
CFG cc=uniq?cfgu:cfg;
CSHOW("\nBinarizing "<<(uniq?"uniqued ":"")<<": "<<i<<" "<<b);
cc.Binarize(b);
+ cerr<<"Binarized "<<b<<" rules size "<<cfg.rules_size()<<" => "<<cc.rules_size()<<"\n";
CSHOWDO(cc.Print(cerr,form);cerr<<"\n\n";);
}
}