summaryrefslogtreecommitdiff
path: root/extractor
diff options
context:
space:
mode:
Diffstat (limited to 'extractor')
-rw-r--r--extractor/rule_factory.cc2
-rw-r--r--extractor/run_extractor.cc8
-rw-r--r--extractor/vocabulary.cc5
-rw-r--r--extractor/vocabulary.h2
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;