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

Function CreateFromListImpl

library/cpp/langmask/langmask.cpp:55–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53
54 template <typename T>
55 TLangMask CreateFromListImpl(const TString& list, T langGetter) {
56 TLangMask result;
57 TVector<TString> langVector;
58 StringSplitter(list).Split(',').SkipEmpty().Collect(&langVector);
59 for (const auto& i : langVector) {
60 ELanguage lang = langGetter(Strip(i).data());
61 if (lang == LANG_MAX)
62 ythrow yexception() << "Unknown language: " << i;
63 result.SafeSet(lang);
64 }
65 return result;
66 }
67
68 TLangMask CreateFromList(const TString& list) {
69 return CreateFromListImpl(list, LanguageByNameStrict);

Callers 2

CreateFromListFunction · 0.85
SafeCreateFromListFunction · 0.85

Calls 7

StringSplitterFunction · 0.85
yexceptionClass · 0.85
CollectMethod · 0.80
SkipEmptyMethod · 0.80
StripFunction · 0.50
SplitMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected