<commit_before>#include <config.h>
#include <iostream>
#include <fstream>
#include "../src/VelbusMessage/VelbusMessage.hpp"

int main(int argc, char* argv[]) {
	char buffer[32];
	std::cin.read(buffer,sizeof(buffer));

	std::string data(buffer, std::cin.gcount() );

	try {
		std::auto_ptr<VelbusMessage::VelbusMessage> m( VelbusMessage::parse_and_consume( data ) );
		std::cout << m->string() << "\n";

	} catch( VelbusMessage::InsufficientData &e ) {
		std::cout << "InsufficientData\n";

	} catch( VelbusMessage::FormError &e ) {
		std::cout << "FormError: " << e.details() << "\n";
	}
}<commit_msg>Added composing check to parsers<commit_after>#include <config.h>
#include <iostream>
#include <fstream>
#include "../src/VelbusMessage/VelbusMessage.hpp"

int main(int argc, char* argv[]) {
	char buffer[32];
	std::cin.read(buffer,sizeof(buffer));

	std::string data(buffer, std::cin.gcount() );
	std::string data_copy(data);

	try {
		std::auto_ptr<VelbusMessage::VelbusMessage> m( VelbusMessage::parse_and_consume( data ) );
		std::cout << m->string() << "\n";

		std::string b = m->message();
		if( b.compare(data_copy) != 0 ) {
			std::cout << "message() does not return same data as passed in\n";
			return 1;
		}

	} catch( VelbusMessage::InsufficientData &e ) {
		std::cout << "InsufficientData\n";

	} catch( VelbusMessage::FormError &e ) {
		std::cout << "FormError: " << e.details() << "\n";
	}
}
{'fraction_non_alphanumeric': 0.1968727789623312, 'fraction_numerical': 0.0042643923240938165, 'mean_word_length': 5.068965517241379, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 14, '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': '7171962', 'n_tokens_mistral': 532, 'n_tokens_neox': 500, 'n_words': 102}