diff options
author | MosesAdmin <moses-support-owner@mit.edu> | 2015-06-25 02:00:42 +0300 |
---|---|---|
committer | MosesAdmin <moses-support-owner@mit.edu> | 2015-06-25 02:00:42 +0300 |
commit | 4ec69fbfdff104218db16c9c1ba8c8c381c331c3 (patch) | |
tree | 009981e6bad44d36e904a65eb9cd67f4812f7ccf /misc | |
parent | dce0f33270bd6e169850a9337141c5af39f3f765 (diff) |
daily automatic beautifier
Diffstat (limited to 'misc')
-rw-r--r-- | misc/pruneGeneration.cpp | 10 | ||||
-rw-r--r-- | misc/pruneGeneration.h | 8 |
2 files changed, 9 insertions, 9 deletions
diff --git a/misc/pruneGeneration.cpp b/misc/pruneGeneration.cpp index 19ae2184f..8207e287f 100644 --- a/misc/pruneGeneration.cpp +++ b/misc/pruneGeneration.cpp @@ -12,7 +12,7 @@ int main(int argc, char **argv) { cerr << "Starting" << endl; int limit = atoi(argv[1]); - + vector<Rec> records; string prevInWord; string line; @@ -20,12 +20,12 @@ int main(int argc, char **argv) vector<string> toks; Tokenize(toks, line); assert(toks.size() == 4); - + if (prevInWord != toks[0]) { Output(limit, records); records.clear(); } - + // add new record float prob = atof(toks[2].c_str()); records.push_back(Rec(prob, line)); @@ -37,13 +37,13 @@ int main(int argc, char **argv) Output(limit, records); records.clear(); - cerr << "Finished" << endl; + cerr << "Finished" << endl; } void Output(int limit, vector<Rec> &records) { std::sort(records.rbegin(), records.rend()); - + for (size_t i = 0; i < limit && i < records.size(); ++i) { const Rec &rec = records[i]; cout << rec.line << endl; diff --git a/misc/pruneGeneration.h b/misc/pruneGeneration.h index 470e607d4..dae5958f8 100644 --- a/misc/pruneGeneration.h +++ b/misc/pruneGeneration.h @@ -7,12 +7,12 @@ class Rec public: float prob; std::string line; - + Rec(float aprob, const std::string &aline) - :prob(aprob) - ,line(aline) + :prob(aprob) + ,line(aline) {} - + inline bool operator< (const Rec &compare) const { return prob < compare.prob; } |