<commit_before>#include "StringTesting.h"


TestString CreateTestString(std::string input_string, uint8_t input_key) {
	TestString t;
	t.s = input_string;
	t.key = input_key;
	return t;
}

uint8_t TestForNonPrintable(std::string input) {
	for (uint16_t x = 0; x < input.size(); x++) {
		if (input[x] > 126 || input[x] < 32) {
			return 0;
		}
	}
	
	return 1;
}

std::vector<TestString> FilterNonPrintable(std::vector<TestString> input_strings) {
	std::vector<TestString> output_strings;
	
	for (uint16_t i = 0; i < input_strings.size(); i++) {
		if (TestForNonPrintable(input_strings[i].s) == 1) {
			output_strings.push_back(input_strings[i]);
		}
	}<commit_msg>Fix TestForNonPrintable to not reject new line, tab and carriage return<commit_after>#include "StringTesting.h"


TestString CreateTestString(std::string input_string, uint8_t input_key) {
	TestString t;
	t.s = input_string;
	t.key = input_key;
	return t;
}

uint8_t TestForNonPrintable(std::string input) {
	for (uint16_t x = 0; x < input.size(); x++) {
		if (input[x] > 126 || input[x] < 32) {
			if (input[x] != 9 || input[x] != 10 || input[x] != 11 || input[x] != 13) {
				return 0;
			}
		}
	}
	
	return 1;
}

std::vector<TestString> FilterNonPrintable(std::vector<TestString> input_strings) {
	std::vector<TestString> output_strings;
	
	for (uint16_t i = 0; i < input_strings.size(); i++) {
		if (TestForNonPrintable(input_strings[i].s) == 1) {
			output_strings.push_back(input_strings[i]);
		}
	}
{'fraction_non_alphanumeric': 0.15599455040871935, 'fraction_numerical': 0.02656675749318801, 'mean_word_length': 4.6937984496124034, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 11, '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': '3364786', 'n_tokens_mistral': 624, 'n_tokens_neox': 560, 'n_words': 119}