<commit_before>#pragma once

#include <string>
#include <iostream>
#include <vector>
#include <cppformat/posix.h>


template<typename T>
struct is_literal { enum{value = false}; };

template<>
struct is_literal<char> { enum{value = true}; };

template<>
struct is_literal<uint8_t> { enum{value = true}; };

class NString
{
	friend class Tokenizer;

private:
	class Tokenizer
	{
		friend class NString;

	public:
		const int length() { return _tokens.size(); }
		const char* length(int idx) { return idx < length() ? _tokens[idx].second : -1; }
		const char* token(int idx) { return idx < length() ? _tokens[idx].first : nullptr; }
		const char* operator[](int idx) { return token(idx); }
		std::string str(int idx) { return std::string(token(idx)); }

		template <typename T>
		T from_int(int idx)
		{
			const char* buffer = token(idx);
			T value = 0;
			if (buffer)
			{
				while (*buffer >= '0' && *buffer <= '9')<commit_msg>Fix last commit<commit_after>#pragma once

#include <string>
#include <iostream>
#include <vector>
#include <cppformat/posix.h>


template<typename T>
struct is_literal { enum{value = false}; };

template<>
struct is_literal<char> { enum{value = true}; };

template<>
struct is_literal<uint8_t> { enum{value = true}; };

class NString
{
	friend class Tokenizer;

private:
	class Tokenizer
	{
		friend class NString;

	public:
		const int length() { return _tokens.size(); }
		const int length(int idx) { return idx < length() ? _tokens[idx].second : -1; }
		const char* token(int idx) { return idx < length() ? _tokens[idx].first : nullptr; }
		const char* operator[](int idx) { return token(idx); }
		std::string str(int idx) { return std::string(token(idx)); }

		template <typename T>
		T from_int(int idx)
		{
			const char* buffer = token(idx);
			T value = 0;
			if (buffer)
			{
				while (*buffer >= '0' && *buffer <= '9')
{'fraction_non_alphanumeric': 0.1543010752688172, 'fraction_numerical': 0.005376344086021506, 'mean_word_length': 4.183844011142061, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 25, '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': '1169148', 'n_tokens_mistral': 678, 'n_tokens_neox': 629, 'n_words': 185}