<commit_before>#include <iostream>
#include <vector>
#include <string>

using namespace std;

class Term {
public:
    // virtual ~Term() {}
    // virtual Term() {}
};

class Rule {
private:
    Term* _lhs;
    Term* _rhs;
public:    
    Rule(Term* lhs, Term* rhs) {
        _lhs = lhs;
        _rhs = rhs;
    }
    std::string AsXML() {
        return std::string("a rule\n");
    }
};


class RuleSet {
private:
    std::vector<Rule>* _rules;
public:    
    RuleSet(std::vector<Rule>* rules) {
        _rules = rules;
    }
    std::string AsXML() {
        std::string retval = std::string("<?xml version=\"1.0\"?>\n");
        for(std::vector<Rule>::iterator it = _rules->begin(); it != _rules->end(); ++it) {
            retval.append((*it).AsXML());
        }
        return retval;
    }
};

class Function : public Term {
private:
    std::string _name;
    std::vector<Term>* _children;
public:
    // Function(const char* name) {
    //     _name = std::string(name);
    //     _children = new std::vector<Term>();
    // }
    Function(const char* name, std::vector<Term>* children = new std::vector<Term>()) {
        _name = std::string(name);
        _children = children;<commit_msg>sort of printing out multiple rules<commit_after>#include <iostream>
#include <vector>
#include <string>

using namespace std;

class Term {
public:
    // virtual ~Term() {}
    // virtual Term() {}
};

class Rule {
private:
    Term* _lhs;
    Term* _rhs;
public:    
    Rule(Term* lhs, Term* rhs) {
        _lhs = lhs;
        _rhs = rhs;
    }
    std::string AsXML() {
        return std::string("a rule\n");
    }
};

static std::string wrapWith(std::string s, const char* name) {
    std::string retval = std::string("<");
    retval.append(name);
    retval.append(">");
    retval.append(s);
    retval.append("</");
    retval.append(name);
    retval.append(">\n");
    return retval;
}

class RuleSet {
private:
    std::vector<Rule>* _rules;
public:    
    RuleSet(std::vector<Rule>* rules) {
        _rules = rules;
    }
    std::string AsXML() {
        std::string retval = std::string("<?xml version=\"1.0\"?>\n");

        std::string rules = std::string("");
        for(std::vector<Rule>::iterator it = _rules->begin(); it != _rules->end(); ++it) {
            rules.append((*it).AsXML());
        }

        retval.append(wrapWith(rules, "Rules"));
        return retval;
    }
};

class Function : public Term {
private:
    std::string _name;
    std::vector<Term>* _children;
public:
    // Function(const char* name) {
    //     _name = std::string(name);
    //     _children = new std::vector<Term>();
    // }
    Function(const char* name, std::vector<Term>* children = new std::vector<Term>()) {
        _name = std::string(name);
        _children = children;
{'fraction_non_alphanumeric': 0.1801930639971398, 'fraction_numerical': 0.0014301036825169824, 'mean_word_length': 2.578005115089514, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 2, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '5673069', 'n_tokens_mistral': 922, 'n_tokens_neox': 929, 'n_words': 209}