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

Function Print

generator/dumper.cpp:140–161  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138static size_t constexpr MIN_OCCURRENCE = 3;
139
140void Print(int8_t langCode, TokensContainerT::mapped_type const & container)
141{
142 typedef pair<strings::UniString, pair<unsigned int, string>> NameElemT;
143 typedef vector<NameElemT> VecToSortT;
144
145 VecToSortT v(container.begin(), container.end());
146 std::sort(v.begin(), v.end(), &SortFunc<NameElemT>);
147
148 // do not display prefixes with low occurrences
149 if (v[0].second.first > MIN_OCCURRENCE)
150 {
151 cout << "Language code: " << localisation::ConvertLanguageIndexToLanguageCode(langCode) << endl;
152
153 for (auto const & el : v)
154 {
155 if (el.second.first <= MIN_OCCURRENCE)
156 break;
157 cout << el.second.first << " " << strings::ToUtf8(el.first);
158 cout << " \"" << el.second.second << "\"" << endl;
159 }
160 }
161}
162
163void DumpPrefixes(string const & fPath)
164{

Callers 1

DumpPrefixesFunction · 0.70

Calls 4

ToUtf8Function · 0.50
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected