Skip to content
Snippets Groups Projects
Commit 1771a56c authored by Adam Radziszewski's avatar Adam Radziszewski
Browse files

prevent whole doc reader from reporting 'unexpected' rel XML tags

parent 6d1447fc
Branches
No related merge requests found
......@@ -309,6 +309,8 @@ void CclReader::set_option(const std::string& option)
impl_->set_autogen_sent_id(true);
} else if (option == "autogen_chunk_id") {
impl_->set_autogen_chunk_id(true);
} else if (option == "no_warn_unexpected_xml") {
impl_->set_warn_on_unexpected(false);
}
else {
BufferedChunkReader::set_option(option);
......@@ -320,11 +322,13 @@ std::string CclReader::get_option(const std::string& option) const
if (option == "disamb_only") {
return impl_->get_disamb_only() ? option : "";
} else if (option == "no_warn_inconsistent") {
return impl_->get_warn_on_inconsistent() ? option : "";
return impl_->get_warn_on_inconsistent() ? "" : option;
} else if (option == "autogen_sent_id") {
return impl_->get_autogen_sent_id() ? "autogen_sent_id" : "";
return impl_->get_autogen_sent_id() ? option : "";
} else if (option == "autogen_chunk_id") {
return impl_->get_autogen_chunk_id() ? "autogen_chunk_id" : "";
return impl_->get_autogen_chunk_id() ? option : "";
} else if (option == "no_warn_unexpected_xml") {
return impl_->get_warn_on_unexpected() ? "" : option;
}
return BufferedChunkReader::get_option(option);
}
......
......@@ -31,6 +31,10 @@ namespace whole {
const std::string &annot_path, const std::string &rela_path)
{
ccl_reader_ = boost::make_shared<CclReader>(tagset, annot_path);
// prevent the underlying CCL reader from complaining about
// relation XML tags unknown to the reader itself
// (in case annot_path and rela_path poin to the same file)
ccl_reader_->set_option("no_warn_unexpected_xml");
rel_reader_ = boost::make_shared<RelationReader>(rela_path);
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment