<commit_before>#pragma once

#include <iostream>
#include <string>

template<class T>
const T& j(const T& x) {
  return x;
}

template<>
const std::string& j<std::string>(const std::string& x) {
  static std::string S; // so evil
  S = "\"";
  S += x;
  S += "\"";
  return S;
}

template<class T>
class JsonPair {
public:
  JsonPair(const std::string& key, const T& val, bool first): Key(key), Value(val), First(first) {}

  const std::string& Key;
  const T& Value;
  bool First;
};

template<class T><commit_msg>Do JSON quoting of const char* strings, too.<commit_after>#pragma once

#include <iostream>
#include <string>

template<class T>
const T& j(const T& x) {
  return x;
}

template<class T>
const T* j(const T* x) {
  return x;
}

template<>
const std::string& j<std::string>(const std::string& x) {
  static std::string S; // so evil
  S = "\"";
  S += x;
  S += "\"";
  return S;
}

template<>
const char* j(const char* x) {
  return (j<std::string>(std::string(x))).c_str();
}

template<class T>
class JsonPair {
public:
  JsonPair(const std::string& key, const T& val, bool first): Key(key), Value(val), First(first) {}

  const std::string& Key;
  const T& Value;
  bool First;
};

template<class T>
{'fraction_non_alphanumeric': 0.1794238683127572, 'fraction_numerical': 0.0, 'mean_word_length': 4.1308016877637135, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 20, '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': '7269905', 'n_tokens_mistral': 459, 'n_tokens_neox': 454, 'n_words': 139}