summaryrefslogtreecommitdiff
path: root/extractor
diff options
context:
space:
mode:
authorChris Dyer <redpony@gmail.com>2013-11-13 11:34:59 -0800
committerChris Dyer <redpony@gmail.com>2013-11-13 11:34:59 -0800
commit9972fc6db6bd816f464dff90741c36f6be137f96 (patch)
tree1faba46366e929aec478e868efa77c113421637f /extractor
parent9be8d89b5a4065a81b26d8af1f3443d152e7922a (diff)
parentd32361ce37f794ae92f852ae2c7c3e6ef440ff07 (diff)
Merge pull request #28 from pks/master
fix
Diffstat (limited to 'extractor')
-rw-r--r--extractor/grammar_extractor.cc2
-rw-r--r--extractor/grammar_extractor.h2
-rw-r--r--extractor/rule_factory.cc2
-rw-r--r--extractor/rule_factory.h2
-rw-r--r--extractor/sampler.cc2
-rw-r--r--extractor/sampler.h2
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();