Skip to content

Commit

Permalink
different method name for word ngrams
Browse files Browse the repository at this point in the history
Summary:
This diff attemps to rename the method names related to word ngrams to
names that are easier to understand.

Reviewed By: EdouardGrave

Differential Revision: D5031486

fbshipit-source-id: d9d3073163b2b72780f5f1a8b76069765492e1cd
  • Loading branch information
cpuhrsch authored and facebook-github-bot committed Jul 4, 2017
1 parent 9e4de66 commit dc28e74
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/dictionary.cc
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ std::vector<int64_t> Dictionary::getCounts(entry_type type) const {
return counts;
}

void Dictionary::addNgrams(std::vector<int32_t>& line,
void Dictionary::addWordNgrams(std::vector<int32_t>& line,
const std::vector<int32_t>& hashes,
int32_t n) const {
if (pruneidx_size_ == 0) return;
Expand Down Expand Up @@ -338,7 +338,7 @@ int32_t Dictionary::getLine(std::istream& in,
std::vector<int32_t> word_hashes;
int32_t ntokens = getLine(in, words, word_hashes, labels, rng);
if (args_->model == model_name::sup ) {
addNgrams(words, word_hashes, args_->wordNgrams);
addWordNgrams(words, word_hashes, args_->wordNgrams);
}
return ntokens;
}
Expand Down
2 changes: 1 addition & 1 deletion src/dictionary.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class Dictionary {

int64_t pruneidx_size_ = -1;
std::unordered_map<int32_t, int32_t> pruneidx_;
void addNgrams(
void addWordNgrams(
std::vector<int32_t>& line,
const std::vector<int32_t>& hashes,
int32_t n) const;
Expand Down

0 comments on commit dc28e74

Please sign in to comment.