MCPcopy Create free account
hub / github.com/comaps/comaps / GetRawTypeSecond

Function GetRawTypeSecond

libs/indexer/feature_utils.cpp:31–44  ·  view source on GitHub ↗

Filters types with |checker|, returns vector of raw type second components. For example for types {"cuisine-sushi", "cuisine-pizza", "cuisine-seafood"} vector of second components is {"sushi", "pizza", "seafood"}.

Source from the content-addressed store, hash-verified

29// For example for types {"cuisine-sushi", "cuisine-pizza", "cuisine-seafood"} vector
30// of second components is {"sushi", "pizza", "seafood"}.
31vector<string> GetRawTypeSecond(ftypes::BaseChecker const & checker, TypesHolder const & types)
32{
33 auto const & c = classif();
34 vector<string> res;
35 for (auto const t : types)
36 {
37 if (!checker(t))
38 continue;
39 auto path = c.GetFullObjectNamePath(t);
40 CHECK_EQUAL(path.size(), 2, (path));
41 res.push_back(std::move(path[1]));
42 }
43 return res;
44}
45
46vector<string> GetLocalizedTypes(ftypes::BaseChecker const & checker, TypesHolder const & types)
47{

Callers 1

GetCuisinesFunction · 0.85

Calls 3

GetFullObjectNamePathMethod · 0.80
sizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected