<commit_before>//
// Created by manu343726 on 4/08/15.
//

#ifndef CTTI_STRING_HPP
#define CTTI_STRING_HPP

#include <ostream>
#include <array>

#include "hash.hpp"
#include "array.hpp"

namespace ctti
{
    namespace detail
    {
#ifdef CTTI_STRING_MAX_LENGTH
		constexpr std::size_t max_string_length = CTTI_STRING_MAX_LENGTH;
#else
		constexpr std::size_t max_string_length = 1024;
#endif
        struct string
        {
            template<typename Head, typename... Tail>
			explicit constexpr string(Head&& head, Tail&&... tail) :
				str_{std::forward<Head>(head), std::forward<Tail>(tail)...},
				length_{sizeof...(Tail) + 1},
				hash_{ sid_hash(length_, str_.data()) }
			{}

            constexpr hash_t hash() const
            {
                return hash_;
            }

            constexpr const char* c_str() const<commit_msg>Change max string length using CTTI_STRING_MAX_LENGTH macro only<commit_after>//
// Created by manu343726 on 4/08/15.
//

#ifndef CTTI_STRING_HPP
#define CTTI_STRING_HPP

#include <ostream>
#include <array>

#include "hash.hpp"
#include "array.hpp"

namespace ctti
{
    namespace detail
    {
#ifdef CTTI_STRING_MAX_LENGTH
		constexpr std::size_t max_string_length = CTTI_STRING_MAX_LENGTH;
#else
		constexpr std::size_t max_string_length = 256;
#endif
        struct string
        {
            template<typename Head, typename... Tail>
			explicit constexpr string(Head&& head, Tail&&... tail) :
				str_{std::forward<Head>(head), std::forward<Tail>(tail)...},
				length_{sizeof...(Tail) + 1},
				hash_{ sid_hash(length_, str_.data()) }
			{}

            constexpr hash_t hash() const
            {
                return hash_;
            }

            constexpr const char* c_str() const
{'fraction_non_alphanumeric': 0.12027491408934708, 'fraction_numerical': 0.017754868270332187, 'mean_word_length': 2.7650862068965516, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '6062166', 'n_tokens_mistral': 624, 'n_tokens_neox': 565, 'n_words': 134}