Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHieu Hoang <hieuhoang@gmail.com>2014-06-14 11:38:20 +0400
committerHieu Hoang <hieuhoang@gmail.com>2014-06-14 11:38:20 +0400
commiteba3dc36260137370af8b52894497d7f2eb39fa7 (patch)
treedfc309758d10d1a09bf3832ca22d9e026928463d /contrib/other-builds/extract-mixed-syntax
parentb5d3592a06d4300cbe34434177b519d17ada7b69 (diff)
escape
Diffstat (limited to 'contrib/other-builds/extract-mixed-syntax')
-rw-r--r--contrib/other-builds/extract-mixed-syntax/AlignedSentenceSyntax.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/contrib/other-builds/extract-mixed-syntax/AlignedSentenceSyntax.cpp b/contrib/other-builds/extract-mixed-syntax/AlignedSentenceSyntax.cpp
index a1f7c3acf..3d63ed044 100644
--- a/contrib/other-builds/extract-mixed-syntax/AlignedSentenceSyntax.cpp
+++ b/contrib/other-builds/extract-mixed-syntax/AlignedSentenceSyntax.cpp
@@ -66,10 +66,14 @@ void AlignedSentenceSyntax::Create(const Parameter &params)
void Escape(string &text)
{
+ text = Moses::Replace(text, "&", "&amp;");
+ text = Moses::Replace(text, "|", "&#124;");
text = Moses::Replace(text, "<", "&lt;");
text = Moses::Replace(text, ">", "&gt;");
text = Moses::Replace(text, "'", "&apos;");
text = Moses::Replace(text, "\"", "&quot;");
+ text = Moses::Replace(text, "[", "&#91;");
+ text = Moses::Replace(text, "]", "&#93;");
}