diff options
author | MosesAdmin <moses-support-owner@mit.edu> | 2016-01-10 03:00:35 +0300 |
---|---|---|
committer | MosesAdmin <moses-support-owner@mit.edu> | 2016-01-10 03:00:35 +0300 |
commit | 4825b9e08a44b97910addb762844fc2b0f34f2dc (patch) | |
tree | d29a9fa8b52f61655d6933fff047a039f7075c40 /phrase-extract | |
parent | 1d3feba8d04645fb0111fb23e4561dc0ea13d2a0 (diff) |
daily automatic beautifier
Diffstat (limited to 'phrase-extract')
-rw-r--r-- | phrase-extract/PropertiesConsolidator.h | 4 | ||||
-rw-r--r-- | phrase-extract/extract-rules-main.cpp | 24 | ||||
-rw-r--r-- | phrase-extract/score-main.cpp | 16 |
3 files changed, 22 insertions, 22 deletions
diff --git a/phrase-extract/PropertiesConsolidator.h b/phrase-extract/PropertiesConsolidator.h index 69a046d8f..8b69f848f 100644 --- a/phrase-extract/PropertiesConsolidator.h +++ b/phrase-extract/PropertiesConsolidator.h @@ -34,8 +34,8 @@ class PropertiesConsolidator { public: - PropertiesConsolidator() - : m_sourceLabelsFlag(false) + PropertiesConsolidator() + : m_sourceLabelsFlag(false) , m_partsOfSpeechFlag(false) , m_targetSyntacticPreferencesFlag(false) {}; diff --git a/phrase-extract/extract-rules-main.cpp b/phrase-extract/extract-rules-main.cpp index 5319bcc6e..cbaa06923 100644 --- a/phrase-extract/extract-rules-main.cpp +++ b/phrase-extract/extract-rules-main.cpp @@ -694,19 +694,19 @@ void ExtractTask::saveTargetSyntacticPreference( const HoleCollection &holeColl, iterHoleList != holeColl.GetHoles().end(); ++iterHoleList) { - const Hole &hole = *iterHoleList; + const Hole &hole = *iterHoleList; - int labelI = labelIndex[ 2+holeCount ]; - string targetLabel = "X"; - int startT = hole.GetStart(1); - int endT = hole.GetEnd(1); - if (m_sentence.targetTree.HasNode(startT,endT)) { - rule.targetSyntacticPreference += m_sentence.targetTree.GetNodes(startT,endT)[labelI]->label; - rule.targetSyntacticPreference += " "; - } else { - rule.targetSyntacticPreference += "X "; - } - ++holeCount; + int labelI = labelIndex[ 2+holeCount ]; + string targetLabel = "X"; + int startT = hole.GetStart(1); + int endT = hole.GetEnd(1); + if (m_sentence.targetTree.HasNode(startT,endT)) { + rule.targetSyntacticPreference += m_sentence.targetTree.GetNodes(startT,endT)[labelI]->label; + rule.targetSyntacticPreference += " "; + } else { + rule.targetSyntacticPreference += "X "; + } + ++holeCount; } rule.targetSyntacticPreference.erase(rule.targetSyntacticPreference.size()-1); diff --git a/phrase-extract/score-main.cpp b/phrase-extract/score-main.cpp index 1feb6b7f2..9095df01b 100644 --- a/phrase-extract/score-main.cpp +++ b/phrase-extract/score-main.cpp @@ -212,10 +212,10 @@ int main(int argc, char* argv[]) std::cerr << "writing target syntactic preferences label set to file " << fileNameTargetSyntacticPreferencesLabelSet << std::endl; fileNameLeftHandSideTargetSyntacticPreferencesLabelCounts = std::string(fileNamePhraseTable) + ".tgtpref.lhs"; fileNameLeftHandSideRuleTargetTargetSyntacticPreferencesLabelCounts = std::string(fileNamePhraseTable) + ".tgt-tgtpref.lhs"; - std::cerr << "counting left-hand side target syntactic preferences labels and writing them to files " - << fileNameLeftHandSideTargetSyntacticPreferencesLabelCounts - << " and " - << fileNameLeftHandSideRuleTargetTargetSyntacticPreferencesLabelCounts + std::cerr << "counting left-hand side target syntactic preferences labels and writing them to files " + << fileNameLeftHandSideTargetSyntacticPreferencesLabelCounts + << " and " + << fileNameLeftHandSideRuleTargetTargetSyntacticPreferencesLabelCounts << std::endl; } else if (strcmp(argv[i],"--UnpairedExtractFormat") == 0) { unpairedExtractFormatFlag = true; @@ -905,10 +905,10 @@ void outputPhrasePair(const ExtractionPhrasePair &phrasePair, if (targetSyntacticPreferencesFlag) { std::string targetSyntacticPreferencesLabelCounts; targetSyntacticPreferencesLabelCounts = phrasePair.CollectAllLabelsSeparateLHSAndRHS("TargetPreferences", - targetSyntacticPreferencesLabelSet, - targetSyntacticPreferencesLHSCounts, - ruleTargetLHSAndTargetSyntacticPreferencesLHSJointCounts, - vcbT); + targetSyntacticPreferencesLabelSet, + targetSyntacticPreferencesLHSCounts, + ruleTargetLHSAndTargetSyntacticPreferencesLHSJointCounts, + vcbT); if (!targetSyntacticPreferencesLabelCounts.empty()) { phraseTableFile << " {{TargetPreferences " << nNTs // for convenience: number of non-terminal symbols in this rule (incl. left hand side NT) |