mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 11:25:40 +03:00
Store document-level translation meta-information provided in the input on the Sentence object.
This commit is contained in:
parent
fc6b000e88
commit
6b54eb44a2
@ -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");
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user