| 138 | static size_t constexpr MIN_OCCURRENCE = 3; |
| 139 | |
| 140 | void 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 | |
| 163 | void DumpPrefixes(string const & fPath) |
| 164 | { |
no test coverage detected