<commit_before>#include "hext/pattern/capture-pattern.h"


namespace hext {


capture_pattern::capture_pattern(
  const std::string& result_name,
  const std::string& regex
)
: name(result_name)
, rx(regex.empty() ? nullptr : make_unique<boost::regex>(regex))
{
}

capture_pattern::~capture_pattern()
{
}

std::string capture_pattern::regex_filter(const char * str) const
{
  assert(this->rx);
  if( !this->rx )
    return str;
<commit_msg>add missing capture_pattern constructor implementation<commit_after>#include "hext/pattern/capture-pattern.h"


namespace hext {


capture_pattern::capture_pattern(const std::string& result_name)
: name(result_name)
, rx(nullptr)
{
}

capture_pattern::capture_pattern(
  const std::string& result_name,
  const std::string& regex
)
: name(result_name)
, rx(regex.empty() ? nullptr : make_unique<boost::regex>(regex))
{
}

capture_pattern::~capture_pattern()
{
}

std::string capture_pattern::regex_filter(const char * str) const
{
  assert(this->rx);
  if( !this->rx )
    return str;

{'fraction_non_alphanumeric': 0.14536585365853658, 'fraction_numerical': 0.0, 'mean_word_length': 6.174825174825175, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '2999030', 'n_tokens_mistral': 348, 'n_tokens_neox': 346, 'n_words': 61}