diff options
author | Michael Denkowski <mdenkows@amazon.com> | 2016-06-07 20:36:30 +0300 |
---|---|---|
committer | Michael Denkowski <mdenkows@amazon.com> | 2016-08-12 13:05:11 +0300 |
commit | a407452d3993b88d725a7838f7c76522ac11a7c8 (patch) | |
tree | 13a215c26d21d5b684b36672fca686cc884f611e /moses/XmlOption.cpp | |
parent | 7db3fedc3b6a2498fec82ea648661140c56e1040 (diff) |
XML option for sentence coordinates
Diffstat (limited to 'moses/XmlOption.cpp')
-rw-r--r-- | moses/XmlOption.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/moses/XmlOption.cpp b/moses/XmlOption.cpp index 8a517386f..7e65a5443 100644 --- a/moses/XmlOption.cpp +++ b/moses/XmlOption.cpp @@ -163,7 +163,8 @@ ProcessAndStripXMLTags(AllOptions const& opts, string &line, vector<XmlOption const*> &res, ReorderingConstraint &reorderingConstraint, vector< size_t > &walls, - std::vector< std::pair<size_t, std::string> > &placeholders) + std::vector< std::pair<size_t, std::string> > &placeholders, + InputType &input) { //parse XML markup in translation line @@ -401,6 +402,14 @@ ProcessAndStripXMLTags(AllOptions const& opts, string &line, StaticData::InstanceNonConst().SetAllWeights(allWeights); } + // coord: coordinate(s) of the input sentence in some space + // (one or more floats) + else if (tagName == "coord") { + vector<string> toks = Tokenize(ParseXmlTagAttribute(tagContent, "coord")); + input.m_coord.reset(new vector<float>()); + Scan<float>(*(input.m_coord), toks); + } + // default: opening tag that specifies translation options else { if (startPos > endPos) { |