<commit_before>#ifndef _CSVWRITER_H_
#define _CSVWRITER_H_

#include <string>
#include <istream>
#include <stdexcept>

namespace CSV {
    class Writer {
        public:
            /**
             * Construct a CSV::Writer that uses ',' as value separator.
             */
            Writer(std::ostream& output);
            /**
             * Construct a CSV::Writer that uses the given separator.
             */
            Writer(std::ostream& output, const char separator);

            /**
             * Write the given value to the csv file
             */
            Writer operator<< (const std::string& data);
            /**
             * Advance to the next line
             */
            Writer next();

        protected:
            /**
             * Clean up (escape) the given value to be used in this object.
             * Note: This is called internally in operator<<(const std::string&)
             */
            std::string clean(const std::string& data);

        private:
            std::ostream& output;
            char separator;
            bool isFirstValue;
    };
}

#endif<commit_msg>Properly initialise isFirstValue to true<commit_after>#ifndef _CSVWRITER_H_
#define _CSVWRITER_H_

#include <string>
#include <istream>
#include <stdexcept>

namespace CSV {
    class Writer {
        public:
            /**
             * Construct a CSV::Writer that uses ',' as value separator.
             */
            Writer(std::ostream& output);
            /**
             * Construct a CSV::Writer that uses the given separator.
             */
            Writer(std::ostream& output, const char separator);

            /**
             * Write the given value to the csv file
             */
            Writer operator<< (const std::string& data);
            /**
             * Advance to the next line
             */
            Writer next();

        protected:
            /**
             * Clean up (escape) the given value to be used in this object.
             * Note: This is called internally in operator<<(const std::string&)
             */
            std::string clean(const std::string& data);

        private:
            std::ostream& output;
            char separator;
            bool isFirstValue{true};
    };
}

#endif
{'fraction_non_alphanumeric': 0.09864687909209952, 'fraction_numerical': 0.0, 'mean_word_length': 1.4724919093851132, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 9, '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': '5197078', 'n_tokens_mistral': 586, 'n_tokens_neox': 559, 'n_words': 185}