<commit_before>#ifndef VAST_CONCEPT_PARSEABLE_CORE_MAYBE_H
#define VAST_CONCEPT_PARSEABLE_CORE_MAYBE_H

#include "vast/concept/parseable/core/parser.h"

namespace vast {

/// Like ::optional_parser, but exposes `T` instead of `optional<T>` as
/// attribute. In the parser does not match, it leaves the attribute untouched.
template <typename Parser>
class maybe_parser : public parser<maybe_parser<Parser>> {
public:
  using attribute = typename Parser::attribute;

  explicit maybe_parser(Parser p)
    : parser_{std::move(p)} {
  }

  template <typename Iterator>
  bool parse(Iterator& f, Iterator const& l, unused_type) const {
    parser_.parse(f, l, unused);
    return true;
  }

  template <typename Iterator, typename Attribute>
  bool parse(Iterator& f, Iterator const& l, Attribute& a) const {
    parser_.parse(f, l, a);
    return true;
  }

private:
  Parser parser_;
};
<commit_msg>Remove redundant overload<commit_after>#ifndef VAST_CONCEPT_PARSEABLE_CORE_MAYBE_H
#define VAST_CONCEPT_PARSEABLE_CORE_MAYBE_H

#include "vast/concept/parseable/core/parser.h"

namespace vast {

/// Like ::optional_parser, but exposes `T` instead of `optional<T>` as
/// attribute.
template <typename Parser>
class maybe_parser : public parser<maybe_parser<Parser>> {
public:
  using attribute = typename Parser::attribute;

  explicit maybe_parser(Parser p)
    : parser_{std::move(p)} {
  }

  template <typename Iterator, typename Attribute>
  bool parse(Iterator& f, Iterator const& l, Attribute& a) const {
    parser_.parse(f, l, a);
    return true;
  }

private:
  Parser parser_;
};

{'fraction_non_alphanumeric': 0.10887350534927627, 'fraction_numerical': 0.0, 'mean_word_length': 4.781818181818182, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, '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': '5381990', 'n_tokens_mistral': 533, 'n_tokens_neox': 510, 'n_words': 141}