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

Function DumpSearchTokens

generator/dumper.cpp:171–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169}
170
171void DumpSearchTokens(string const & fPath, size_t maxTokensToShow)
172{
173 using Value = Uint64IndexValue;
174
175 FilesContainerR container(std::make_unique<FileReader>(fPath));
176 feature::DataHeader header(container);
177
178 auto const trieRoot = trie::ReadTrie<ModelReaderPtr, ValueList<Value>>(container.GetReader(SEARCH_INDEX_FILE_TAG),
179 SingleValueSerializer<Value>());
180
181 SearchTokensCollector<Value> f;
182 trie::ForEachRef(*trieRoot, f, strings::UniString());
183 f.Finish();
184
185 for (size_t i = 0; i < std::min(maxTokensToShow, f.m_tokens.size()); ++i)
186 {
187 auto const & s = f.m_tokens[i].second;
188 cout << f.m_tokens[i].first << " " << strings::ToUtf8(s) << endl;
189 }
190}
191
192void DumpFeatureNames(string const & fPath, string const & lang)
193{

Callers 1

generator_tool.cppFile · 0.85

Calls 6

ForEachRefFunction · 0.85
UniStringClass · 0.50
ToUtf8Function · 0.50
GetReaderMethod · 0.45
FinishMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected