diff options
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 e8b93f83..4908dac0 100644 --- a/extractor/rule_factory.cc +++ b/extractor/rule_factory.cc @@ -197,6 +197,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 d73f77cd..36dbd7a0 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; | 
