diff options
author | mjdenkowski <michael.j.denkowski@gmail.com> | 2014-04-18 15:16:02 -0400 |
---|---|---|
committer | mjdenkowski <michael.j.denkowski@gmail.com> | 2014-04-18 15:16:02 -0400 |
commit | 5d3585f705bdba1852540f4ed6edde3846ebb83b (patch) | |
tree | 0ff727588c1c8c0b7dded79bf5a63c0de6cd8d21 /decoder/t2s_test.cc | |
parent | f31a19b243885d4382e23ad1df84a7f00034b269 (diff) | |
parent | a3434180474e832eeea7d775893ce85244f8145c (diff) |
Merge branch 'master' of github.com:redpony/cdec
Diffstat (limited to 'decoder/t2s_test.cc')
-rw-r--r-- | decoder/t2s_test.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/decoder/t2s_test.cc b/decoder/t2s_test.cc index 3c46ea89..5ebb2662 100644 --- a/decoder/t2s_test.cc +++ b/decoder/t2s_test.cc @@ -15,8 +15,11 @@ BOOST_AUTO_TEST_CASE(TestTreeFragments) { vector<WordID> aw, bw; cerr << "TREE1: " << tree << endl; cerr << "TREE2: " << tree2 << endl; - for (auto& sym : tree) + for (auto& sym : tree) { + if (cdec::IsLHS(sym)) cerr << "("; + cerr << TD::Convert(sym & cdec::ALL_MASK) << endl; if (cdec::IsTerminal(sym)) aw.push_back(sym); else a.push_back(sym); + } for (auto& sym : tree2) if (cdec::IsTerminal(sym)) bw.push_back(sym); else b.push_back(sym); BOOST_CHECK_EQUAL(a.size(), b.size()); @@ -38,11 +41,12 @@ BOOST_AUTO_TEST_CASE(TestTreeFragments) { if (cdec::IsFrontier(*it)) nts += "*"; } } + cerr << "Truncated: " << nts << endl; BOOST_CHECK_EQUAL(nts, "(S NP* VP*"); nts.clear(); int ntc = 0; - for (cdec::TreeFragment::iterator it = tree.begin(); it != tree.end(); ++it) { + for (auto it = tree.bfs_begin(); it != tree.bfs_end(); ++it) { if (cdec::IsNT(*it)) { if (cdec::IsRHS(*it)) { ++ntc; |