<commit_before>#include "text.h"
#include <cctype>

namespace ncv
{
        namespace
        {
                template
                <
                        typename tcomparator
                >
                bool impl_ends_with(const std::string& str, const std::string& token, const tcomparator& op)
                {
                        if (str.size() < token.size())
                        {
                                return false;
                        }
                        else
                        {
                                bool ret = true;
                                for (std::size_t i = 0, istr = str.size() - token.size(); i < token.size() && ret; i ++)
                                {
                                        ret = op(token[i], str[istr + i]);
                                }

                                return ret;
                        }
                }
        }
<commit_msg>simplify implementation<commit_after>#include "text.h"
#include <cctype>

namespace ncv
{
        namespace
        {
                template
                <
                        typename tcomparator
                >
                bool impl_ends_with(const std::string& str, const std::string& token, const tcomparator& op)
                {
                        if (str.size() < token.size())
                        {
                                return false;
                        }
                        else
                        {
                                return std::equal(token.rbegin(), token.rend(), str.rbegin(), op);
                        }
                }
        }

{'fraction_non_alphanumeric': 0.08368200836820083, 'fraction_numerical': 0.0005977286312014345, 'mean_word_length': 0.6706586826347305, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2589804', 'n_tokens_mistral': 391, 'n_tokens_neox': 354, 'n_words': 78}