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

Function GetOption

library/cpp/text_processing/dictionary/options.cpp:48–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46
47 template <typename TType>
48 static void GetOption(const NJson::TJsonValue& optionsJson, const TString& name, TType* result) {
49 if (optionsJson.Has(name)) {
50 TStringBuf value = (optionsJson[name]).GetString();
51 const bool isParsed = TryFromString<TType>(value, *result);
52 Y_ABORT_UNLESS(isParsed, "Couldn't parse option \"%s\" with value = %s", name.data(), value.data());
53 }
54 }
55
56 void JsonToDictionaryOptions(const NJson::TJsonValue& optionsJson, TDictionaryOptions* options) {
57 GetOption(optionsJson, TOKEN_LEVEL_TYPE, &options->TokenLevelType);

Callers 2

JsonToDictionaryOptionsFunction · 0.70

Calls 3

HasMethod · 0.45
GetStringMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected