#include <algorithm>
#include "absl/memory/memory.h"
#include "absl/strings/str_format.h"
#include "model_interface.h"
#include "sentencepiece_model.pb.h"
#include "util.h"
namespace sentencepiece {
ModelInterface::ModelInterface(const ModelProto& model_proto)
: … { … }
ModelInterface::~ModelInterface() { … }
#define RETURN_PIECE …
absl::string_view ModelInterface::unk_piece() const { … }
absl::string_view ModelInterface::bos_piece() const { … }
absl::string_view ModelInterface::eos_piece() const { … }
absl::string_view ModelInterface::pad_piece() const { … }
#undef RETURN_PIECE
int ModelInterface::PieceToId(absl::string_view piece) const { … }
void ModelInterface::InitializePieces() { … }
std::vector<absl::string_view> SplitIntoWords(absl::string_view text,
bool treat_ws_as_suffix,
bool allow_ws_only_pieces) { … }
std::string ByteToPiece(unsigned char c) { … }
int PieceToByte(absl::string_view piece) { … }
}