<commit_before>//
//  Copyright (c) 2015 <NAME>
//
//  Distributed under the MIT License
//  See accompanying file LICENSE.md
//

#include <iostream>
#include <boost/tokenizer.hpp>
#include <boost/regex.hpp>
#include <core/protocol/net_parse_routines.hpp>

namespace proto_net
{
    namespace protocol
    {
        bool
        search_pattern(const std::string& str,
                       const std::string& pat)
        {
            boost::regex exp(pat);
            boost::smatch match;

            return boost::regex_search(str, match, exp);
        }

        bool
        search_pattern(const std::string& str,
                       const std::string& pat,
                       size_t& count)
        {
            boost::regex exp(pat);

            boost::sregex_token_iterator itr(str.begin(), str.end(), exp, 0);
            boost::sregex_token_iterator end;

            count = 0;
            for (; itr != end; ++itr)
                count++;

            return count;
        }

        bool
        search_pattern(const std::string& str,
                       const std::string& pat,
                       matches_t& matches)
        {<commit_msg>Fixed bool type cast issue.<commit_after>//
//  Copyright (c) 2015 <NAME>
//
//  Distributed under the MIT License
//  See accompanying file LICENSE.md
//

#include <iostream>
#include <boost/tokenizer.hpp>
#include <boost/regex.hpp>
#include <core/protocol/net_parse_routines.hpp>

namespace proto_net
{
    namespace protocol
    {
        bool
        search_pattern(const std::string& str,
                       const std::string& pat)
        {
            boost::regex exp(pat);
            boost::smatch match;

            return boost::regex_search(str, match, exp);
        }

        bool
        search_pattern(const std::string& str,
                       const std::string& pat,
                       size_t& count)
        {
            boost::regex exp(pat);

            boost::sregex_token_iterator itr(str.begin(), str.end(), exp, 0);
            boost::sregex_token_iterator end;

            count = 0;
            for (; itr != end; ++itr)
                count++;

            return bool(count);
        }

        bool
        search_pattern(const std::string& str,
                       const std::string& pat,
                       matches_t& matches)
        {
{'fraction_non_alphanumeric': 0.10946745562130178, 'fraction_numerical': 0.00507185122569738, 'mean_word_length': 1.5616883116883118, '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': '5520076', 'n_tokens_mistral': 675, 'n_tokens_neox': 636, 'n_words': 158}