diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2012-11-12 23:56:18 +0400 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2012-11-12 23:56:18 +0400 |
commit | 5e3ef23cef6101d2c098eb3445f562e8f595655b (patch) | |
tree | b8c332b6fa82bae84ea4910967a10ba1b08a7107 /moses/XmlOption.h | |
parent | 8c785cff2b1be3cccd76ea9026f71b649762dfc3 (diff) |
move moses/src/* to moses/
Diffstat (limited to 'moses/XmlOption.h')
-rw-r--r-- | moses/XmlOption.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/moses/XmlOption.h b/moses/XmlOption.h new file mode 100644 index 000000000..45989c841 --- /dev/null +++ b/moses/XmlOption.h @@ -0,0 +1,39 @@ +#ifndef moses_XmlOption_h +#define moses_XmlOption_h + +#include <vector> +#include <string> +#include "WordsRange.h" +#include "TargetPhrase.h" +#include "ReorderingConstraint.h" + +namespace Moses +{ + +class TranslationOption; + +/** 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); +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=">"); + +bool ProcessAndStripXMLTags(std::string &line, std::vector<XmlOption*> &res, ReorderingConstraint &reorderingConstraint, std::vector< size_t > &walls, + const std::string& lbrackStr="<", const std::string& rbrackStr=">"); + +} + +#endif + |