Store document-level translation meta-information provided in the input on the Sentence object.

This commit is contained in:
Ulrich Germann 2015-10-24 01:37:50 +01:00
parent fc6b000e88
commit 6b54eb44a2
2 changed files with 10 additions and 2 deletions

View File

@ -122,8 +122,9 @@ aux_interpret_dlt(string& line) // whatever DLT means ... --- UG
{
using namespace std;
typedef map<string, string> str2str_map;
vector<str2str_map> meta = ProcessAndStripDLT(line);
BOOST_FOREACH(str2str_map const& M, meta) {
m_dlt_meta = ProcessAndStripDLT(line);
// what's happening below is most likely not thread-safe! UG
BOOST_FOREACH(str2str_map const& M, m_dlt_meta) {
str2str_map::const_iterator i,j;
if ((i = M.find("type")) != M.end()) {
j = M.find("id");

View File

@ -60,6 +60,8 @@ protected:
void ProcessPlaceholders(const std::vector< std::pair<size_t, std::string> > &placeholders);
// "Document Level Translation" instructions, see aux_interpret_dlt
std::vector<std::map<std::string,std::string> > m_dlt_meta;
public:
Sentence();
@ -114,6 +116,11 @@ public:
void
init(std::string line, std::vector<FactorType> const& factorOrder);
std::vector<std::map<std::string,std::string> > const&
GetDltMeta() const {
return m_dlt_meta;
}
private:
// auxliliary functions for Sentence initialization
// void aux_interpret_sgml_markup(std::string& line);