<commit_before>/*
 * algorithm.hpp
 *  some functions to comply with the concpet of STL, like <algorithm>
 *
 *  written by janus_wel<<EMAIL>>
 *  This source code is in public domain, and has NO WARRANTY.
 * */

#ifndef ALGORITHM_HPP
#define ALGORITHM_HPP

#include <algorithm>
#include <iterator>
#include <vector>

namespace util {
    namespace algorithm {
        // functor to delete objects
        // usage:
        //      std::for_each(array.begin(), array.end(), sweeper());
        struct sweeper {
            template<typename T>
            void operator()(T* p) { delete p; }
        };

        // for binary operation
        struct raw_type { char c; };
        std::istream& operator >>(std::istream& in, raw_type& r) {
            return in.get(r.c);
        }
        std::ostream& operator <<(std::ostream& out, const raw_type& r) {<commit_msg>Add the keyword "inline" to extractor and inserter of raw_type<commit_after>/*
 * algorithm.hpp
 *  some functions to comply with the concpet of STL, like <algorithm>
 *
 *  written by janus_wel<<EMAIL>>
 *  This source code is in public domain, and has NO WARRANTY.
 * */

#ifndef ALGORITHM_HPP
#define ALGORITHM_HPP

#include <algorithm>
#include <iterator>
#include <vector>

namespace util {
    namespace algorithm {
        // functor to delete objects
        // usage:
        //      std::for_each(array.begin(), array.end(), sweeper());
        struct sweeper {
            template<typename T>
            void operator()(T* p) { delete p; }
        };

        // for binary operation
        struct raw_type { char c; };
        inline std::istream& operator >>(std::istream& in, raw_type& r) {
            return in.get(r.c);
        }
        inline std::ostream& operator <<(std::ostream& out, const raw_type& r) {
{'fraction_non_alphanumeric': 0.12242626599888703, 'fraction_numerical': 0.0, 'mean_word_length': 2.4444444444444446, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '3996435', 'n_tokens_mistral': 547, 'n_tokens_neox': 538, 'n_words': 171}