MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / Sorted

Function Sorted

external/sentencepiece/src/trainer_interface.h:36–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34
35template <typename K, typename V>
36std::vector<std::pair<K, V>> Sorted(const std::vector<std::pair<K, V>> &m) {
37 std::vector<std::pair<K, V>> v = m;
38 std::sort(v.begin(), v.end(),
39 [](const std::pair<K, V> &p1, const std::pair<K, V> &p2) {
40 return (p1.second > p2.second ||
41 (p1.second == p2.second && p1.first < p2.first));
42 });
43 return v;
44}
45
46template <typename K, typename V>
47std::vector<std::pair<K, V>> Sorted(const absl::flat_hash_map<K, V> &m) {

Callers 9

PruneSentencePiecesMethod · 0.85
TrainMethod · 0.85
mainFunction · 0.85
TrainMethod · 0.85
LoadSentencesMethod · 0.85
TrainMethod · 0.85

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected