diff options
author | Phil Williams <philip.williams@mac.com> | 2013-09-20 12:42:13 +0400 |
---|---|---|
committer | Phil Williams <philip.williams@mac.com> | 2013-09-20 12:42:13 +0400 |
commit | ab863d1f161dbb7ad3d2a5363dfc051130483921 (patch) | |
tree | b91700653fe58c7b1bf9335c5b019e235c9e5bf3 /phrase-extract/consolidate-main.cpp | |
parent | a6d172e0f130970de72570632fc950300eed714e (diff) |
consolidate: write key-value field to rule table
Diffstat (limited to 'phrase-extract/consolidate-main.cpp')
-rw-r--r-- | phrase-extract/consolidate-main.cpp | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/phrase-extract/consolidate-main.cpp b/phrase-extract/consolidate-main.cpp index b0e2c8594..5fe3d05d9 100644 --- a/phrase-extract/consolidate-main.cpp +++ b/phrase-extract/consolidate-main.cpp @@ -313,33 +313,32 @@ void processFiles( char* fileNameDirect, char* fileNameIndirect, char* fileNameC fileConsolidated << "||| " << countE << " " << countF << " " << countEF; // count bin feature (as a sparse feature) - if (sparseCountBinFeatureFlag || - directSparseScores.compare("") != 0 || - indirectSparseScores.compare("") != 0) { - fileConsolidated << " |||"; - if (directSparseScores.compare("") != 0) - fileConsolidated << " " << directSparseScores; - if (indirectSparseScores.compare("") != 0) - fileConsolidated << " " << indirectSparseScores; - if (sparseCountBinFeatureFlag) { - bool foundBin = false; - for(size_t i=0; i < countBin.size(); i++) { - if (!foundBin && countEF <= countBin[i]) { - fileConsolidated << " cb_"; - if (i == 0 && countBin[i] > 1) - fileConsolidated << "1_"; - else if (i > 0 && countBin[i-1]+1 < countBin[i]) - fileConsolidated << (countBin[i-1]+1) << "_"; - fileConsolidated << countBin[i] << " 1"; - foundBin = true; - } - } - if (!foundBin) { - fileConsolidated << " cb_max 1"; + fileConsolidated << " |||"; + if (directSparseScores.compare("") != 0) + fileConsolidated << " " << directSparseScores; + if (indirectSparseScores.compare("") != 0) + fileConsolidated << " " << indirectSparseScores; + if (sparseCountBinFeatureFlag) { + bool foundBin = false; + for(size_t i=0; i < countBin.size(); i++) { + if (!foundBin && countEF <= countBin[i]) { + fileConsolidated << " cb_"; + if (i == 0 && countBin[i] > 1) + fileConsolidated << "1_"; + else if (i > 0 && countBin[i-1]+1 < countBin[i]) + fileConsolidated << (countBin[i-1]+1) << "_"; + fileConsolidated << countBin[i] << " 1"; + foundBin = true; } } + if (!foundBin) { + fileConsolidated << " cb_max 1"; + } } + // arbitrary key-value pairs + fileConsolidated << " ||| " << itemDirect[5]; + fileConsolidated << endl; } fileDirect.Close(); |