<commit_before>#include <iostream>
#include <string.h>
//#include <sys/types.h>
//#include <sys/stat.h>
#include <fcntl.h> //needed for (file) open()
#include <stdlib.h> //needed for exit()
//#include <pthread.h>
//#include <termios.h>
#include <stdio.h>
#include <unistd.h> //for (file) read()

void printUsageAndQuit(char* cmd) {
    std::cerr << "usage: " << cmd << " ttyFile" << std::endl;
    exit(1);
}

std::string readLine(int fd) {
	std::string r;
	char chr;
	while(read(fd, &chr, 1) == 1 && chr != '\n') {
		if (chr != '\r') {
			r += chr;
			printf("c: %c\n", chr);
		}
	}
	return r;
}
void readLoop(int fd) {
	std::string cmd;
	//while ((cmd=readLine(fd)).length()) {
	while (1) {
		cmd = readLine(fd);
		printf("command: %s\n", cmd.c_str());
	}
}

int main(int argc, char** argv) {<commit_msg>Added test response to serial commands<commit_after>#include <iostream>
#include <string.h>
//#include <sys/types.h>
//#include <sys/stat.h>
#include <fcntl.h> //needed for (file) open()
#include <stdlib.h> //needed for exit()
//#include <pthread.h>
//#include <termios.h>
#include <stdio.h>
#include <unistd.h> //for (file) read()

void printUsageAndQuit(char* cmd) {
    std::cerr << "usage: " << cmd << " ttyFile" << std::endl;
    exit(1);
}

std::string readLine(int fd) {
	std::string r;
	char chr;
	while(read(fd, &chr, 1) == 1 && chr != '\n') {
		if (chr != '\r') {
			r += chr;
			//printf("c: %c\n", chr);
		}
	}
	return r;
}

void readLoop(int fd) {
	std::string cmd;
	std::string resp = "TEST\n";
	while (1) {
		cmd = readLine(fd);
		printf("command: %s\n", cmd.c_str());
		write(fd, resp.c_str(), resp.length());
	}
}

int main(int argc, char** argv) {
{'fraction_non_alphanumeric': 0.23159784560143626, 'fraction_numerical': 0.0047875523638539795, 'mean_word_length': 3.6315789473684212, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 23, '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': '1750096', 'n_tokens_mistral': 722, 'n_tokens_neox': 692, 'n_words': 171}