<commit_before>/*
 * =====================================================================================
 *
 *       Filename:  utils.c
 *
 *    Description:  
 *
 *        Version:  1.0
 *        Created:  05/16/2015 10:04:48 PM
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  @gurpinars, 
 *   Organization:  
 *
 * =====================================================================================
 */

#include "utils.h"


const char* get_filename_ext(char* filename) {
    const char *dot = strrchr(filename, '.') + 1;
	if(!dot) 
		return "";
    return dot;
}


const char* lookup(const char* extension){
    if(!strcasecmp(extension, "html"))
		return "text/html";
    else if(!strcasecmp(extension, "jpg"))
		return "image/jpeg";
	else
		return NULL;
}<commit_msg>added some extra mimes<commit_after>/*
 * =====================================================================================
 *
 *       Filename:  utils.c
 *
 *    Description:  
 *
 *        Version:  1.0
 *        Created:  05/16/2015 10:04:48 PM
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  @gurpinars, 
 *   Organization:  
 *
 * =====================================================================================
 */

#include "utils.h"


const char* get_filename_ext(char* filename) {
    const char *dot = strrchr(filename, '.') + 1;
	if(!dot) 
		return "";
    return dot;
}


const char* lookup(const char* extension){
    if(!strcasecmp(extension, "html"))
		return "text/html";
    else if(!strcasecmp(extension, "jpg"))
		return "image/jpeg";
	else if(!strcasecmp(extension,"css"))
		return "text/css";
	else if(!strcasecmp(extension, "gif"))
		return "image/gif";
	else if(!strcasecmp(extension, "ico"))
		return "image/x-icon";
	else if(!strcasecmp(extension, "png"))
		return "image/gif";
	else if(!strcasecmp(extension, "js"))
		return "image/javascript";
	else
		return NULL;
}
{'fraction_non_alphanumeric': 0.30757261410788383, 'fraction_numerical': 0.017634854771784232, 'mean_word_length': 3.5602836879432624, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5019470', 'n_tokens_mistral': 641, 'n_tokens_neox': 572, 'n_words': 125}