Sfoglia il codice sorgente

different method name for word ngrams

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
Christian Puhrsch 8 anni fa
parent
commit
dc28e74324
2 ha cambiato i file con 3 aggiunte e 3 eliminazioni
  1. 2 2
      src/dictionary.cc
  2. 1 1
      src/dictionary.h

+ 2 - 2
src/dictionary.cc

@@ -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;
@@ -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;
 }

+ 1 - 1
src/dictionary.h

@@ -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;