<commit_before>#include "ktv.h"
/**
 * @brief Default function to compare two values of type #cw_KTV_t.
 *  
 * @param v1
 * @param v2
 * @return 
 */
int cw_ktv_mavlcmp(const void *v1, const void *v2)
{
	char *d1,*d2;
	int l1,l2,rc,i1,i2;
	
	/* Find dots in both keys */
	d1 = strchr(((cw_KTV_t *) v1)->key,'.');
	d2 = strchr(((cw_KTV_t *) v2)->key,'.');
	
	/* if there are no dots, compare keys as normal */
	if (d1==NULL || d2==NULL)
		return strcmp(((cw_KTV_t *) v1)->key, ((cw_KTV_t *) v2)->key);
	
	/* calculate the length of the key till dots */
	l1=d1-((cw_KTV_t *) v1)->key;
	l2=d2-((cw_KTV_t *) v2)->key;
	
	/* if length differs do a normal compare */
	if (l1!=l2){
		return strcmp(((cw_KTV_t *) v1)->key, ((cw_KTV_t *) v2)->key);
	}
	
	
	rc = strncmp(((cw_KTV_t *) v1)->key,((cw_KTV_t *) v2)->key,l1);
	if (rc!=0){
		return rc;
	}
	
	i1 = atoi(d1+1);
	i2 = atoi(d2+1);
	
	return i1-i2;
}<commit_msg>For .num key there can be data after num<commit_after>
#include <ctype.h>

#include "ktv.h"
/**
 * @brief Default function to compare two values of type #cw_KTV_t.
 *  
 * @param v1
 * @param v2
 * @return 
 */
int cw_ktv_mavlcmp(const void *v1, const void *v2)
{
	char *d1,*d2;
	int l1,l2,rc,i1,i2;
	
	/* Find dots in both keys */
	d1 = strchr(((cw_KTV_t *) v1)->key,'.');
	d2 = strchr(((cw_KTV_t *) v2)->key,'.');
	
	/* if there are no dots, compare keys as normal */
	if (d1==NULL || d2==NULL)
		return strcmp(((cw_KTV_t *) v1)->key, ((cw_KTV_t *) v2)->key);
	
	/* calculate the length of the key till dots */
	l1=d1-((cw_KTV_t *) v1)->key;
	l2=d2-((cw_KTV_t *) v2)->key;
	
	/* if length differs do a normal compare */
	if (l1!=l2){
		return strcmp(((cw_KTV_t *) v1)->key, ((cw_KTV_t *) v2)->key);
	}
	
	
	rc = strncmp(((cw_KTV_t *) v1)->key,((cw_KTV_t *) v2)->key,l1);
	if (rc!=0){
		return rc;
	}
	
	d1++;
	d2++;
	i1 = atoi(d1);
	i2 = atoi(d2);
	
	rc = i1-i2;
	if (rc != 0)
		return rc;
	
	while (isdigit(*d1))
		d1++;
	while (isdigit(*d2))
		d2++;
	
	return strcmp(d1,d2);
	
	
}
{'fraction_non_alphanumeric': 0.2131394182547643, 'fraction_numerical': 0.043630892678034106, 'mean_word_length': 3.281115879828326, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 24, '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': '2324381', 'n_tokens_mistral': 1009, 'n_tokens_neox': 954, 'n_words': 218}