Skip to content
Snippets Groups Projects
Commit 76df4c19 authored by ilor's avatar ilor
Browse files

fix data rule test ccl file loading

parent 885398e5
No related branches found
No related tags found
No related merge requests found
......@@ -150,9 +150,15 @@ void test_one_rule_item_actual(const rule_compare_test& c)
if (!chunk) {
BOOST_ERROR("Empty chunk loaded");
}
Corpus2::XcesReader xr(tagset, c.output_corpus.string());
xr.set_option("loose");
boost::shared_ptr<Corpus2::Chunk> expected = xr.get_next_chunk();
boost::shared_ptr<Corpus2::TokenReader> reader;
std::string ofn = c.output_corpus.filename();
if (ofn.find("ccl") != ofn.npos) {
reader = Corpus2::TokenReader::create_path_reader("ccl", tagset, c.output_corpus.string());
} else {
reader = Corpus2::TokenReader::create_path_reader("xces", tagset, c.output_corpus.string());
}
reader->set_option("loose");
boost::shared_ptr<Corpus2::Chunk> expected = reader->get_next_chunk();
BOOST_REQUIRE_EQUAL(chunk->sentences().size(), expected->sentences().size());
Wccl::Parser parser(tagset);
std::string rf = c.rule_file.string();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment