Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/marian-nmt/sentencepiece.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaku Kudo <taku@google.com>2018-06-06 10:47:59 +0300
committerTaku Kudo <taku@google.com>2018-06-06 10:47:59 +0300
commite437e30bb478d5841e41feeb10346296448bff2b (patch)
treee568af539f7b3c3dca1a2c8ee0e6ee514c415954 /src/unigram_model_trainer.h
parentc6e84aebc903a84758afeafcbeea54c2bc3f641e (diff)
Support vocab restriction feature
Diffstat (limited to 'src/unigram_model_trainer.h')
-rw-r--r--src/unigram_model_trainer.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/unigram_model_trainer.h b/src/unigram_model_trainer.h
index 6850d93..e761d80 100644
--- a/src/unigram_model_trainer.h
+++ b/src/unigram_model_trainer.h
@@ -55,6 +55,16 @@ class TrainerModel : public ModelBase {
return sentencepieces_[index].second;
}
+ std::string IdToPiece(int id) const override {
+ return sentencepieces_[id].first;
+ }
+
+ bool IsControl(int id) const override { return false; }
+
+ bool IsUnknown(int id) const override { return false; }
+
+ bool IsUnused(int id) const override { return false; }
+
EncodeResult Encode(StringPiece normalized) const override { return {}; }
private: