MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / Encode

Method Encode

external/sentencepiece/src/word_model.cc:28–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26Model::~Model() {}
27
28EncodeResult Model::Encode(absl::string_view normalized) const {
29 if (!status().ok() || normalized.empty()) {
30 return {};
31 }
32
33 EncodeResult output;
34 for (const auto &w : SplitIntoWords(normalized)) {
35 output.emplace_back(w, PieceToId(w));
36 }
37
38 return output;
39}
40
41} // namespace word
42} // namespace sentencepiece

Callers

nothing calls this directly

Calls 3

SplitIntoWordsFunction · 0.85
okMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected