MCPcopy Create free account
hub / github.com/catboost/catboost / GetPrefix

Method GetPrefix

library/cpp/token/token_iterator.h:179–189  ·  view source on GitHub ↗

called for the first prefix, other prefixes returned as delimiters by GetDelimiter()

Source from the content-addressed store, hash-verified

177 }
178 //! called for the first prefix, other prefixes returned as delimiters by GetDelimiter()
179 void GetPrefix(TWideToken& tok) const {
180 Y_ASSERT(Tokens.empty()); // Next() must NOT be called
181 if (Subtokens.empty() || Subtokens[0].PrefixLen == 0) {
182 tok.Leng = 0;
183 tok.SubTokens.clear();
184 } else {
185 tok.Token = Tok.Token;
186 tok.Leng = Subtokens[0].PrefixLen;
187 tok.SubTokens.clear();
188 }
189 }
190 //! @note NLP type of token is NLP_MISCTEXT;
191 //! prefixes always considered as "misctext";
192 //! suffixes of non-words considered as "misctext";

Callers 1

Calls 2

emptyMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected