MCPcopy Create free account
hub / github.com/comaps/comaps / operator()

Method operator()

generator/dumper.cpp:116–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114 TokensContainerT m_stats;
115
116 void operator()(int8_t langCode, std::string_view name)
117 {
118 CHECK(!name.empty(), ("Feature name is empty"));
119
120 auto const tokens = search::NormalizeAndTokenizeString(name);
121 for (size_t i = 1; i < tokens.size(); ++i)
122 {
123 strings::UniString s;
124 for (size_t numTokens = 0; numTokens < i; ++numTokens)
125 {
126 s.append(tokens[numTokens].begin(), tokens[numTokens].end());
127 s.push_back(' ');
128 }
129 auto [iter, found] = m_stats[langCode].emplace(s, std::make_pair(1U, name));
130 if (!found)
131 iter->second.first++;
132 }
133 }
134
135 void operator()(FeatureType & f, uint32_t) { f.ForEachName(*this); }
136};

Callers

nothing calls this directly

Calls 9

emptyMethod · 0.45
sizeMethod · 0.45
appendMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45
emplaceMethod · 0.45
ForEachNameMethod · 0.45

Tested by

no test coverage detected