mosesdecoder/moses/XmlOption.h

45 lines
1.3 KiB
C
Raw Normal View History

#ifndef moses_XmlOption_h
#define moses_XmlOption_h
#include <vector>
#include <string>
2015-10-25 16:37:59 +03:00
#include "Range.h"
#include "TargetPhrase.h"
2015-11-03 22:36:43 +03:00
#include "parameters/AllOptions.h"
namespace Moses
{
class TranslationOption;
2013-09-22 20:24:32 +04:00
class ReorderingConstraint;
/** This struct is used for storing XML force translation data for a given range in the sentence
*/
struct XmlOption {
2015-10-25 16:37:59 +03:00
Range range;
TargetPhrase targetPhrase;
2015-10-25 16:37:59 +03:00
XmlOption(const Range &r, const TargetPhrase &tp)
: range(r), targetPhrase(tp) {
}
};
std::string ParseXmlTagAttribute(const std::string& tag,const std::string& attributeName);
2011-11-16 14:22:29 +04:00
std::string TrimXml(const std::string& str, const std::string& lbrackStr="<", const std::string& rbrackStr=">") ;
bool isXmlTag(const std::string& tag, const std::string& lbrackStr="<", const std::string& rbrackStr=">");
std::vector<std::string> TokenizeXml(const std::string& str, const std::string& lbrackStr="<", const std::string& rbrackStr=">");
2015-11-12 03:00:40 +03:00
bool ProcessAndStripXMLTags(AllOptions const& opts,
std::string &line, std::vector<XmlOption const*> &res,
2015-12-11 03:00:33 +03:00
ReorderingConstraint &reorderingConstraint,
std::vector< size_t > &walls,
2016-06-07 20:36:30 +03:00
std::vector< std::pair<size_t, std::string> > &placeholders,
InputType &input);
2015-12-10 06:17:36 +03:00
}
#endif