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

class Parser {
public:
	using Constraint = std::function<bool(std::vector<std::string>)>;

	Parser(int argc, char **argv);

	void add_arg(std::string longhand, std::vector<Constraint> constraints={}, std::string shorthand="", bool required = false, std::string description="");
	
    bool check_validity(std::string *const err_msg = nullptr);

    template <typename T>
    T get(std::string hand) const;
    
    template <typename T>
    T get_shorthand(std::string shorthand) const;
    
    template <typename T>
    T get_longhand(std::string longhand) const;
     
	std::string get_raw() const;
private:

	struct Arg {
		std::vector<Constraint> constraints;
		std::string shorthand;
		std::string longhand;
		std::string description;
        bool required;        
        std::vector<std::string> arguments; //arguments to the argument to the program
	};

	std::vector<std::string> _raw_args;
	std::vector<Arg> _args;
};<commit_msg>rewhitespaced Parser.cpp<commit_after>#include <iostream>
#include <string>
#include <vector>
#include <functional>
#include <sstream>

class Parser {
public:
	using Constraint = std::function<bool(std::vector<std::string>)>;

	Parser(int argc, char **argv);

	void add_arg(std::string longhand, std::vector<Constraint> constraints={}, std::string shorthand="", bool required = false, std::string description="");
		
	bool check_validity(std::string *const err_msg = nullptr);

	template <typename T>
	T get(std::string hand) const;
    
	template <typename T>
	T get_shorthand(std::string shorthand) const;
    
	template <typename T>
	T get_longhand(std::string longhand) const;
     
	std::string get_raw() const;
private:

	struct Arg {
		std::vector<Constraint> constraints;
		std::string shorthand;
		std::string longhand;
		std::string description;
		bool required;        
		std::vector<std::string> arguments; //arguments to the argument to the program
	};

	std::vector<std::string> _raw_args;
	std::vector<Arg> _args;
};
{'fraction_non_alphanumeric': 0.13682189150264043, 'fraction_numerical': 0.0, 'mean_word_length': 5.040579710144928, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, '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': '6142459', 'n_tokens_mistral': 682, 'n_tokens_neox': 648, 'n_words': 175}