diff options
-rw-r--r-- | phrase-extract/PhraseExtractionOptions.h | 2 | ||||
-rw-r--r-- | phrase-extract/extract-ordering-main.cpp | 16 |
2 files changed, 11 insertions, 7 deletions
diff --git a/phrase-extract/PhraseExtractionOptions.h b/phrase-extract/PhraseExtractionOptions.h index 8c277b7c6..87712d6d3 100644 --- a/phrase-extract/PhraseExtractionOptions.h +++ b/phrase-extract/PhraseExtractionOptions.h @@ -35,6 +35,7 @@ class PhraseExtractionOptions public: int maxPhraseLength; int minPhraseLength; + std::string separator; private: bool allModelsOutputFlag; @@ -59,6 +60,7 @@ public: PhraseExtractionOptions(const int initmaxPhraseLength): maxPhraseLength(initmaxPhraseLength), minPhraseLength(3), + separator("|||"), allModelsOutputFlag(false), wordModel(false), wordType(REO_MSD), diff --git a/phrase-extract/extract-ordering-main.cpp b/phrase-extract/extract-ordering-main.cpp index bff7fbb65..104457b01 100644 --- a/phrase-extract/extract-ordering-main.cpp +++ b/phrase-extract/extract-ordering-main.cpp @@ -154,6 +154,8 @@ int main(int argc, char* argv[]) options.debug = true; } else if (strcmp(argv[i], "--MinPhraseLength") == 0) { options.minPhraseLength = atoi(argv[++i]); + } else if (strcmp(argv[i], "--Separator") == 0) { + options.separator = argv[++i]; } else if(strcmp(argv[i],"--model") == 0) { if (i+1 >= argc) { cerr << "extract: syntax error, no model's information provided to the option --model " << endl; @@ -622,24 +624,26 @@ void ExtractTask::addPhrase( SentenceAlignment &sentence, int startE, int endE, return; } - m_extractFileOrientation << sentence.sentenceID << " ||| "; - m_extractFileOrientation << getClass(orientationInfo) << " ||| "; + const string &sep = m_options.separator; + + m_extractFileOrientation << sentence.sentenceID << " " << sep << " "; + m_extractFileOrientation << getClass(orientationInfo) << " " << sep << " "; // position - m_extractFileOrientation << startF << " " << endF << " ||| "; + m_extractFileOrientation << startF << " " << endF << " " << sep << " "; // start m_extractFileOrientation << "<s> "; for(int fi=0; fi<startF; fi++) { m_extractFileOrientation << sentence.source[fi] << " "; } - m_extractFileOrientation << "||| "; + m_extractFileOrientation << sep << " "; // middle for(int fi=startF; fi<=endF; fi++) { m_extractFileOrientation << sentence.source[fi] << " "; } - m_extractFileOrientation << "||| "; + m_extractFileOrientation << sep << " "; // end for(int fi=endF+1; fi<sentence.source.size(); fi++) { @@ -647,8 +651,6 @@ void ExtractTask::addPhrase( SentenceAlignment &sentence, int startE, int endE, } m_extractFileOrientation << "</s> "; - m_extractFileOrientation << "||| "; - // target /* |