<commit_before>// Replaces latex labels and references
// Compile with g++ -O3 cpp98texnumber.cpp -o cpp98texnumber
// Use the -DDO_NOT_IGNORE_COMMENTS flag
// if you do not want to ignore the comments (ignored by default)

#include <algorithm>
#include <cstddef>
#include <cstdlib>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <sstream>
#include <string>
#include <vector>

#define DEBUG_PRINT(x) std::cout << (x) << std::endl

// structures
typedef std::map<std::string, std::size_t> label_idx_map;
typedef std::map<std::size_t, std::string> idx_label_map;
typedef std::pair<std::string, std::size_t> label_idx_pair;
typedef std::vector<std::string>::const_iterator vector_string_const_it;

// iterators
typedef label_idx_map::const_iterator label_idx_map_const_it;
typedef idx_label_map::const_iterator idx_label_map_const_it;
typedef std::string::size_type str_size_type;

// builds a map sorted by value from a standard map sorted by key
idx_label_map by_value(const label_idx_map& labels)
{
    idx_label_map result;
    for (label_idx_map_const_it it = labels.begin();
            it != labels.end(); ++it)
    {
        result[it -> second] = it -> first;
    }
    return result;<commit_msg>the C++98 version<commit_after>// Replaces latex labels and references
// Compile with g++ -O3 cpp98texnumber.cpp -o cpp98texnumber
// Use the -DDO_NOT_IGNORE_COMMENTS flag
// if you do not want to ignore the comments (ignored by default)

#include <algorithm>
#include <cstddef>
#include <cstdlib>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <sstream>
#include <string>
#include <vector>

#define DEBUG_PRINT(x) std::cout << (x) << std::endl

// structures
typedef std::map<std::string, std::size_t> label_idx_map;
typedef std::map<std::size_t, std::string> idx_label_map;
typedef std::vector<std::string>::const_iterator vector_string_const_it;

// iterators
typedef label_idx_map::const_iterator label_idx_map_const_it;
typedef idx_label_map::const_iterator idx_label_map_const_it;
typedef std::string::size_type str_size_type;

// builds a map sorted by value from a standard map sorted by key
idx_label_map by_value(const label_idx_map& labels)
{
    idx_label_map result;
    for (label_idx_map_const_it it = labels.begin();
            it != labels.end(); ++it)
    {
        result[it -> second] = it -> first;
    }
    return result;
{'fraction_non_alphanumeric': 0.11993382961124896, 'fraction_numerical': 0.004962779156327543, 'mean_word_length': 5.250645994832041, 'pattern_counts': {'":': 0, '<': 38, '<?xml version=': 0, '>': 34, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5129652', 'n_tokens_mistral': 854, 'n_tokens_neox': 811, 'n_words': 221}