<commit_before>#include <stdio.h>
#include <string.h>
//Levenshtein edit distance
int editDistance(const char* S, const char* T, int sLength, int tLength) {
	int minimum, first, second, third, conditional;
	//Maximum
	if(sLength == 0) {
		return tLength;
	}
	if(tLength == 0) {
		return sLength;
	}
	if(S[sLength-1] != T[tLength - 1]) {
		conditional = 1;
	} else {
		conditional = 0;
	}

	//Minimum
	first = editDistance(S, T, sLength - 1, tLength) + 1;
	second = editDistance(S, T, sLength, tLength - 1) + 1;
	third = editDistance(S, T, sLength - 1, tLength - 1) + conditional;

	if(first > second) {
		minimum = second;
	} else if (second > third) {
		minimum = third;
	} else {
		minimum = first;
	}
	return minimum;
}

//test
int main() {
	const char *A = "GCGGCAGGAAGGCGCACCCCCCC";
	const char *B = "ACGCGAAGGGAGCCCACCAAAAA";

	printf("%d\n", editDistance(A, B, strlen(A), strlen(B)));

	return 0;
}<commit_msg>editDistance.c<commit_after>#include <stdio.h>
#include <string.h>
//Levenshtein edit distance
int editDistance(const char* S, const char* T, int sLength, int tLength) {
	int minimum, first, second, third, conditional;
	//Maximum
	if(sLength == 0) {
		return tLength;
	}
	if(tLength == 0) {
		return sLength;
	}
	if(S[sLength-1] != T[tLength - 1]) {
		conditional = 1;
	} else {
		conditional = 0;
	}

	//Minimum
	first = editDistance(S, T, sLength - 1, tLength) + 1;
	second = editDistance(S, T, sLength, tLength - 1) + 1;
	third = editDistance(S, T, sLength - 1, tLength - 1) + conditional;

	minimum = first;
	if(first > second) {
		minimum = second;
	} 
	if (second > third) {
		minimum = third;
	}

	return minimum;
}

//test
int main() {
	const char *A = "GCGGCAGGAAGGCGCACCCCCCC";
	const char *B = "ACGCGAAGGGAGCCCACCAAAAA";

	printf("%d\n", editDistance(A, B, strlen(A), strlen(B)));

	return 0;
}
{'fraction_non_alphanumeric': 0.1575192096597146, 'fraction_numerical': 0.014270032930845226, 'mean_word_length': 3.6863753213367607, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '227257', 'n_tokens_mistral': 781, 'n_tokens_neox': 700, 'n_words': 192}