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:
authorresec <resec0109@gmail.com>2017-07-20 05:10:16 +0300
committerGitHub <noreply@github.com>2017-07-20 05:10:16 +0300
commitf3255348797ded71d2a4e38de6a2d903c6c7883b (patch)
treebc3416a7eb8df2edf4e585b4975d03f8493447c0
parent8ff52671f25003ef058c94f6ae9f6b662a4dc95c (diff)
Add std::istream variant to Load and LoadOrDie
Added for SentencePieceProcessor: virtual bool Load(std::istream &istream); virtual void LoadOrDie(std::istream &istream);
-rw-r--r--src/sentencepiece_processor.h8
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);