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:
authorMatthias Huck <huck@i6.informatik.rwth-aachen.de>2015-03-05 02:05:45 +0300
committerMatthias Huck <huck@i6.informatik.rwth-aachen.de>2015-03-05 02:05:45 +0300
commit773a16b5fd3e60110b3ca42681b70510ce95e627 (patch)
treecf846a815827ea7d169ec69deb8c0d4dd0c9aea8 /phrase-extract
parent638e9c3f60ee6f3c3a29ce339979dde7dbc193bf (diff)
POS property in glue rules
Diffstat (limited to 'phrase-extract')
-rw-r--r--phrase-extract/extract-ghkm/ExtractGHKM.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/phrase-extract/extract-ghkm/ExtractGHKM.cpp b/phrase-extract/extract-ghkm/ExtractGHKM.cpp
index af8153bfe..04b626e42 100644
--- a/phrase-extract/extract-ghkm/ExtractGHKM.cpp
+++ b/phrase-extract/extract-ghkm/ExtractGHKM.cpp
@@ -672,6 +672,8 @@ void ExtractGHKM::WriteGlueGrammar(
const size_t sourceLabelGlueX = 1;
const size_t sourceLabelSentenceStart = 2;
const size_t sourceLabelSentenceEnd = 3;
+ const size_t partOfSpeechSentenceStart = 0;
+ const size_t partOfSpeechSentenceEnd = 1;
// basic rules
out << "<s> [X] ||| <s> [" << topLabel << "] ||| 1 ||| 0-0 ||| ||| |||";
@@ -679,7 +681,7 @@ void ExtractGHKM::WriteGlueGrammar(
out << " {{Tree [" << topLabel << " [SSTART <s>]]}}";
}
if (options.partsOfSpeech) {
- out << " {{POS SSTART}}";
+ out << " {{POS " << partOfSpeechSentenceStart << "}}";
}
if (options.sourceLabels) {
out << " {{SourceLabels 2 1 " << sourceLabelSentenceStart << " 1 1 " << sourceLabelGlueTop << " 1}}";
@@ -694,7 +696,7 @@ void ExtractGHKM::WriteGlueGrammar(
out << " {{Tree [" << topLabel << " [" << topLabel << "] [SEND </s>]]}}";
}
if (options.partsOfSpeech) {
- out << " {{POS SEND}}";
+ out << " {{POS " << partOfSpeechSentenceEnd << "}}";
}
if (options.sourceLabels) {
out << " {{SourceLabels 4 1 " << sourceLabelSentenceStart << " " << sourceLabelGlueTop << " " << sourceLabelSentenceEnd << " 1 1 " << sourceLabelGlueTop << " 1}}";
@@ -712,7 +714,7 @@ void ExtractGHKM::WriteGlueGrammar(
out << " {{Tree [" << topLabel << " [SSTART <s>] [" << i->first << "] [SEND </s>]]}}";
}
if (options.partsOfSpeech) {
- out << " {{POS SSTART SEND}}";
+ out << " {{POS " << partOfSpeechSentenceStart << " " << partOfSpeechSentenceEnd << "}}";
}
if (options.sourceLabels) {
out << " {{SourceLabels 4 1 " << sourceLabelSentenceStart << " " << sourceLabelGlueX << " " << sourceLabelSentenceEnd << " 1 1 " << sourceLabelGlueTop << " 1}}";