diff options
author | resec <resec0109@gmail.com> | 2017-07-20 05:10:16 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-20 05:10:16 +0300 |
commit | f3255348797ded71d2a4e38de6a2d903c6c7883b (patch) | |
tree | bc3416a7eb8df2edf4e585b4975d03f8493447c0 /src | |
parent | 8ff52671f25003ef058c94f6ae9f6b662a4dc95c (diff) |
Add std::istream variant to Load and LoadOrDie
Added for SentencePieceProcessor:
virtual bool Load(std::istream &istream);
virtual void LoadOrDie(std::istream &istream);
Diffstat (limited to 'src')
-rw-r--r-- | src/sentencepiece_processor.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/sentencepiece_processor.h b/src/sentencepiece_processor.h index df1022a..213fdf8 100644 --- a/src/sentencepiece_processor.h +++ b/src/sentencepiece_processor.h @@ -92,10 +92,18 @@ class SentencePieceProcessor { // Returns false if |filename| cannot be loaded. virtual bool Load(const std::string &filename); + // Loads model from |istream|. + // Returns false if |istream| cannot be loaded. + virtual bool Load(std::istream &istream); + // Loads model from |filename|. // Dies if |filename| cannot be loaded. virtual void LoadOrDie(const std::string &filename); + // Loads model from |istream|. + // Dies if |istream| cannot be loaded. + virtual void LoadOrDie(std::istream &istream); + // Sets encode extra_option sequence. virtual void SetEncodeExtraOptions(const std::string &extra_option); |