diff options
Diffstat (limited to 'phrase-extract/score-main.cpp')
-rw-r--r-- | phrase-extract/score-main.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/phrase-extract/score-main.cpp b/phrase-extract/score-main.cpp index 9095df01b..081ee8ef1 100644 --- a/phrase-extract/score-main.cpp +++ b/phrase-extract/score-main.cpp @@ -68,6 +68,7 @@ bool spanLength = false; bool ruleLength = false; bool nonTermContext = false; bool nonTermContextTarget = false; +bool targetConstituentBoundariesFlag = false; int countOfCounts[COC_MAX+1]; int totalDistinct = 0; @@ -286,6 +287,9 @@ int main(int argc, char* argv[]) } else if (strcmp(argv[i],"--NonTermContextTarget") == 0) { nonTermContextTarget = true; std::cerr << "non-term context (target)" << std::endl; + } else if (strcmp(argv[i],"--TargetConstituentBoundaries") == 0) { + targetConstituentBoundariesFlag = true; + std::cerr << "including target constituent boundaries information" << std::endl; } else { featureArgs.push_back(argv[i]); ++i; @@ -957,6 +961,18 @@ void outputPhrasePair(const ExtractionPhrasePair &phrasePair, } } + // target constituent boundaries + if (targetConstituentBoundariesFlag && !inverseFlag) { + const std::string targetConstituentBoundariesLeftValues = phrasePair.CollectAllPropertyValues("TargetConstituentBoundariesLeft"); + if (!targetConstituentBoundariesLeftValues.empty()) { + phraseTableFile << " {{TargetConstituentBoundariesLeft " << targetConstituentBoundariesLeftValues << "}}"; + } + const std::string targetConstituentBoundariesRightAdjacentValues = phrasePair.CollectAllPropertyValues("TargetConstituentBoundariesRightAdjacent"); + if (!targetConstituentBoundariesRightAdjacentValues.empty()) { + phraseTableFile << " {{TargetConstituentBoundariesRightAdjacent " << targetConstituentBoundariesRightAdjacentValues << "}}"; + } + } + phraseTableFile << std::endl; } |