summaryrefslogtreecommitdiff
path: root/klm/lm/vocab.hh
diff options
context:
space:
mode:
Diffstat (limited to 'klm/lm/vocab.hh')
-rw-r--r--klm/lm/vocab.hh7
1 files changed, 5 insertions, 2 deletions
diff --git a/klm/lm/vocab.hh b/klm/lm/vocab.hh
index bb5d789b..8c99d797 100644
--- a/klm/lm/vocab.hh
+++ b/klm/lm/vocab.hh
@@ -27,15 +27,18 @@ inline uint64_t HashForVocab(const StringPiece &str) {
class WriteWordsWrapper : public EnumerateVocab {
public:
- WriteWordsWrapper(EnumerateVocab *inner, int fd);
+ WriteWordsWrapper(EnumerateVocab *inner);
~WriteWordsWrapper();
void Add(WordIndex index, const StringPiece &str);
+ void Write(int fd);
+
private:
EnumerateVocab *inner_;
- int fd_;
+
+ std::string buffer_;
};
// Vocabulary based on sorted uniform find storing only uint64_t values and using their offsets as indices.