diff options
author | Chris Dyer <redpony@gmail.com> | 2013-11-13 11:34:59 -0800 |
---|---|---|
committer | Chris Dyer <redpony@gmail.com> | 2013-11-13 11:34:59 -0800 |
commit | 776b91c04bca9747adf5b056eb13af563aaa5edf (patch) | |
tree | 04e3d9637387fee39045689926c4751b95787b3c | |
parent | 1b39e848903743990ca16e2323235b31db20178c (diff) | |
parent | dd73eb6adb58769dbd2ff2834faccad2cabb59b7 (diff) |
Merge pull request #28 from pks/master
fix
-rw-r--r-- | extractor/grammar_extractor.cc | 2 | ||||
-rw-r--r-- | extractor/grammar_extractor.h | 2 | ||||
-rw-r--r-- | extractor/rule_factory.cc | 2 | ||||
-rw-r--r-- | extractor/rule_factory.h | 2 | ||||
-rw-r--r-- | extractor/sampler.cc | 2 | ||||
-rw-r--r-- | extractor/sampler.h | 2 |
6 files changed, 6 insertions, 6 deletions
diff --git a/extractor/grammar_extractor.cc b/extractor/grammar_extractor.cc index 1fbdee5b..487abcaf 100644 --- a/extractor/grammar_extractor.cc +++ b/extractor/grammar_extractor.cc @@ -34,7 +34,7 @@ GrammarExtractor::GrammarExtractor( vocabulary(vocabulary), rule_factory(rule_factory) {} -Grammar GrammarExtractor::GetGrammar(const string& sentence, const unordered_set<int> blacklisted_sentence_ids, const shared_ptr<DataArray> source_data_array) { +Grammar GrammarExtractor::GetGrammar(const string& sentence, const unordered_set<int>& blacklisted_sentence_ids, const shared_ptr<DataArray> source_data_array) { vector<string> words = TokenizeSentence(sentence); vector<int> word_ids = AnnotateWords(words); return rule_factory->GetGrammar(word_ids, blacklisted_sentence_ids, source_data_array); diff --git a/extractor/grammar_extractor.h b/extractor/grammar_extractor.h index 6c0aafbf..ae407b47 100644 --- a/extractor/grammar_extractor.h +++ b/extractor/grammar_extractor.h @@ -45,7 +45,7 @@ class GrammarExtractor { // Converts the sentence to a vector of word ids and uses the RuleFactory to // extract the SCFG rules which may be used to decode the sentence. - Grammar GetGrammar(const string& sentence, const unordered_set<int> blacklisted_sentence_ids, const shared_ptr<DataArray> source_data_array); + Grammar GetGrammar(const string& sentence, const unordered_set<int>& blacklisted_sentence_ids, const shared_ptr<DataArray> source_data_array); private: // Splits the sentence in a vector of words. diff --git a/extractor/rule_factory.cc b/extractor/rule_factory.cc index e52019ae..6ae2d792 100644 --- a/extractor/rule_factory.cc +++ b/extractor/rule_factory.cc @@ -101,7 +101,7 @@ HieroCachingRuleFactory::HieroCachingRuleFactory() {} HieroCachingRuleFactory::~HieroCachingRuleFactory() {} -Grammar HieroCachingRuleFactory::GetGrammar(const vector<int>& word_ids, const unordered_set<int> blacklisted_sentence_ids, const shared_ptr<DataArray> source_data_array) { +Grammar HieroCachingRuleFactory::GetGrammar(const vector<int>& word_ids, const unordered_set<int>& blacklisted_sentence_ids, const shared_ptr<DataArray> source_data_array) { Clock::time_point start_time = Clock::now(); double total_extract_time = 0; double total_intersect_time = 0; diff --git a/extractor/rule_factory.h b/extractor/rule_factory.h index c7332720..df63a9d8 100644 --- a/extractor/rule_factory.h +++ b/extractor/rule_factory.h @@ -72,7 +72,7 @@ class HieroCachingRuleFactory { // Constructs SCFG rules for a given sentence. // (See class description for more details.) - virtual Grammar GetGrammar(const vector<int>& word_ids, const unordered_set<int> blacklisted_sentence_ids, const shared_ptr<DataArray> source_data_array); + virtual Grammar GetGrammar(const vector<int>& word_ids, const unordered_set<int>& blacklisted_sentence_ids, const shared_ptr<DataArray> source_data_array); protected: HieroCachingRuleFactory(); diff --git a/extractor/sampler.cc b/extractor/sampler.cc index d332dd90..963afa7a 100644 --- a/extractor/sampler.cc +++ b/extractor/sampler.cc @@ -12,7 +12,7 @@ Sampler::Sampler() {} Sampler::~Sampler() {} -PhraseLocation Sampler::Sample(const PhraseLocation& location, unordered_set<int> blacklisted_sentence_ids, const shared_ptr<DataArray> source_data_array) const { +PhraseLocation Sampler::Sample(const PhraseLocation& location, const unordered_set<int>& blacklisted_sentence_ids, const shared_ptr<DataArray> source_data_array) const { vector<int> sample; int num_subpatterns; if (location.matchings == NULL) { diff --git a/extractor/sampler.h b/extractor/sampler.h index 30e747fd..de450c48 100644 --- a/extractor/sampler.h +++ b/extractor/sampler.h @@ -23,7 +23,7 @@ class Sampler { virtual ~Sampler(); // Samples uniformly at most max_samples phrase occurrences. - virtual PhraseLocation Sample(const PhraseLocation& location, const unordered_set<int> blacklisted_sentence_ids, const shared_ptr<DataArray> source_data_array) const; + virtual PhraseLocation Sample(const PhraseLocation& location, const unordered_set<int>& blacklisted_sentence_ids, const shared_ptr<DataArray> source_data_array) const; protected: Sampler(); |