mosesdecoder/moses/XmlOption.h

42 lines
1.3 KiB
C
Raw Normal View History

#ifndef moses_XmlOption_h
#define moses_XmlOption_h
#include <vector>
#include <string>
#include "WordsRange.h"
#include "TargetPhrase.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 {
WordsRange range;
TargetPhrase targetPhrase;
XmlOption(const WordsRange &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=">");
2013-05-29 21:16:15 +04:00
bool ProcessAndStripXMLTags(std::string &line, std::vector<XmlOption*> &res, ReorderingConstraint &reorderingConstraint, std::vector< size_t > &walls,
2013-07-18 20:00:44 +04:00
std::vector< std::pair<size_t, std::string> > &placeholders,
int offset,
2013-05-29 21:16:15 +04:00
const std::string& lbrackStr="<", const std::string& rbrackStr=">");
}
#endif