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

Method ProcessMultitoken

library/cpp/tokenizer/nlpparser.cpp:61–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61void TNlpParser::ProcessMultitoken(const wchar16* ts, const wchar16* te) {
62 Base.AddLastToken(ts, te);
63 const wchar16* p = ts;
64 size_t prevEnd = 0;
65 size_t tokenCount = Base.GetTokenCount();
66 for (size_t i = 0; i < tokenCount; ++i) {
67 TParserToken& tok = Base.GetToken(i);
68 if (i) {
69 size_t n = tok.GetStart() - prevEnd;
70 if (n) {
71 MakeEntry(p, n, NLP_MISCTEXT);
72 p += n;
73 }
74 }
75 prevEnd = tok.GetEnd();
76 MakeMultitokenEntry(tok, p);
77 p = ts + prevEnd;
78 }
79 Base.ResetTokens();
80}
81
82template<> void TVersionedNlpParser<2>::MakeMultitokenEntry(TParserToken& token, const wchar16* entry) {
83 size_t entryLen = token.GetLength();

Callers

nothing calls this directly

Calls 7

MakeEntryFunction · 0.85
GetTokenCountMethod · 0.80
ResetTokensMethod · 0.80
AddLastTokenMethod · 0.45
GetTokenMethod · 0.45
GetStartMethod · 0.45
GetEndMethod · 0.45

Tested by

no test coverage detected