<commit_before>#ifndef HEXT_ATTRIBUTE_MATCH_H
#define HEXT_ATTRIBUTE_MATCH_H

#include <string>
#include <iostream>
#include <memory>

#include <gumbo.h>

#include "hext/pattern/value-test.h"
#include "hext/pattern/match-pattern.h"


namespace hext {


/// An AttributeMatch is a MatchPattern that checks whether an html-node has
/// any attribute called attr_name.
class AttributeMatch : public MatchPattern
{
public:
  AttributeMatch(
    const std::string& attr_name,
    std::unique_ptr<ValueTest> value_test
  );
  MatchResult matches(const GumboNode * node) const final;
  void print(std::ostream& out = std::cout) const final;

protected:
  const std::string attr_;
};


} // namespace hext


#endif // HEXT_ATTRIBUTE_MATCH_H

<commit_msg>expand comment for AttributeMatch<commit_after>#ifndef HEXT_ATTRIBUTE_MATCH_H
#define HEXT_ATTRIBUTE_MATCH_H

#include <string>
#include <iostream>
#include <memory>

#include <gumbo.h>

#include "hext/pattern/value-test.h"
#include "hext/pattern/match-pattern.h"


namespace hext {


/// An AttributeMatch is a MatchPattern that checks whether an html-node has
/// any attribute called attr_name which matches value_test.
class AttributeMatch : public MatchPattern
{
public:
  AttributeMatch(
    const std::string& attr_name,
    std::unique_ptr<ValueTest> value_test
  );
  MatchResult matches(const GumboNode * node) const final;
  void print(std::ostream& out = std::cout) const final;

protected:
  const std::string attr_;
};


} // namespace hext


#endif // HEXT_ATTRIBUTE_MATCH_H


{'fraction_non_alphanumeric': 0.10409889394925179, 'fraction_numerical': 0.0, 'mean_word_length': 4.847908745247148, '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': '6419537', 'n_tokens_mistral': 512, 'n_tokens_neox': 498, 'n_words': 134}