mirror of
https://github.com/moses-smt/mosesdecoder.git
synced 2024-09-11 19:27:11 +03:00
Hiero phrase orientation: write phrase property to glue grammar
This commit is contained in:
parent
a11ee97722
commit
a950605795
@ -1154,10 +1154,14 @@ void writeGlueGrammar( const string & fileName, RuleExtractionOptions &options,
|
|||||||
{
|
{
|
||||||
ofstream grammarFile;
|
ofstream grammarFile;
|
||||||
grammarFile.open(fileName.c_str());
|
grammarFile.open(fileName.c_str());
|
||||||
|
std::string glueRulesPhraseProperty = "";
|
||||||
|
if (options.phraseOrientation) {
|
||||||
|
glueRulesPhraseProperty.append(" ||| ||| {{Orientation 0.25 0.25 0.25 0.25 0.25 0.25 0.25 0.25}}");
|
||||||
|
}
|
||||||
if (!options.targetSyntax) {
|
if (!options.targetSyntax) {
|
||||||
grammarFile << "<s> [X] ||| <s> [S] ||| 1 ||| 0-0 ||| 0" << endl
|
grammarFile << "<s> [X] ||| <s> [S] ||| 1 ||| 0-0 ||| 0" << glueRulesPhraseProperty << endl
|
||||||
<< "[X][S] </s> [X] ||| [X][S] </s> [S] ||| 1 ||| 0-0 1-1 ||| 0" << endl
|
<< "[X][S] </s> [X] ||| [X][S] </s> [S] ||| 1 ||| 0-0 1-1 ||| 0" << glueRulesPhraseProperty << endl
|
||||||
<< "[X][S] [X][X] [X] ||| [X][S] [X][X] [S] ||| 2.718 ||| 0-0 1-1 ||| 0" << endl;
|
<< "[X][S] [X][X] [X] ||| [X][S] [X][X] [S] ||| 2.718 ||| 0-0 1-1 ||| 0" << glueRulesPhraseProperty << endl;
|
||||||
} else {
|
} else {
|
||||||
// chose a top label that is not already a label
|
// chose a top label that is not already a label
|
||||||
string topLabel = "QQQQQQ";
|
string topLabel = "QQQQQQ";
|
||||||
|
Loading…
Reference in New Issue
Block a user