diff options
author | Paul Baltescu <pauldb89@gmail.com> | 2013-02-22 16:50:29 +0000 |
---|---|---|
committer | Paul Baltescu <pauldb89@gmail.com> | 2013-02-22 16:50:29 +0000 |
commit | bb79fdc140a5593124d3943769a644c6cc3d87f6 (patch) | |
tree | d98608bc7b8dd23069b7683ec50ddf7d337abc42 /extractor | |
parent | 5f08d976c857c1353ac623f0adbbe5597800d644 (diff) |
Memory analysis pointless code.
Diffstat (limited to 'extractor')
-rw-r--r-- | extractor/rule_factory.cc | 2 | ||||
-rw-r--r-- | extractor/run_extractor.cc | 8 | ||||
-rw-r--r-- | extractor/vocabulary.cc | 5 | ||||
-rw-r--r-- | extractor/vocabulary.h | 2 |
4 files changed, 17 insertions, 0 deletions
diff --git a/extractor/rule_factory.cc b/extractor/rule_factory.cc index 4101fcfa..fbdc7cce 100644 --- a/extractor/rule_factory.cc +++ b/extractor/rule_factory.cc @@ -220,6 +220,8 @@ Grammar HieroCachingRuleFactory::GetGrammar(const vector<int>& word_ids) { } } + cerr << "Vocabulary size = " << vocabulary->Size() << endl; + Clock::time_point stop_time = Clock::now(); cerr << "Total time for rule lookup, extraction, and scoring = " << GetDuration(start_time, stop_time) << " seconds" << endl; diff --git a/extractor/run_extractor.cc b/extractor/run_extractor.cc index 38f10a5f..2b01e832 100644 --- a/extractor/run_extractor.cc +++ b/extractor/run_extractor.cc @@ -31,6 +31,14 @@ namespace fs = boost::filesystem; namespace po = boost::program_options; using namespace std; +void my_pause() { + cerr << "pausing..." << endl; + for (int i = 0; i < 10000000; ++i) { + cerr << endl; + } + cerr << "end pause" << endl; +} + int main(int argc, char** argv) { // TODO(pauldb): Also take arguments from config file. po::options_description desc("Command line options"); diff --git a/extractor/vocabulary.cc b/extractor/vocabulary.cc index 5c379a29..b68d76a9 100644 --- a/extractor/vocabulary.cc +++ b/extractor/vocabulary.cc @@ -24,3 +24,8 @@ bool Vocabulary::IsTerminal(int symbol) { string Vocabulary::GetTerminalValue(int symbol) { return words[symbol]; } + +int Vocabulary::Size() { + return words.size(); +} + diff --git a/extractor/vocabulary.h b/extractor/vocabulary.h index c6a8b3e8..ff3e7a63 100644 --- a/extractor/vocabulary.h +++ b/extractor/vocabulary.h @@ -19,6 +19,8 @@ class Vocabulary { virtual string GetTerminalValue(int symbol); + int Size(); + private: unordered_map<string, int> dictionary; vector<string> words; |