<commit_before><?php
include_once 'db_queries.php';
if(!isset($_REQUEST['region'])) {
  $rregion = ''; 
} else {
  $rregion = $_REQUEST['region'];
}

if($_REQUEST["report"] == "total") {
	echo json_encode(getTotalReport());	
} else {
	echo json_encode(getReport($_REQUEST["report"], $rregion));
}

?><commit_msg>Fix link<commit_after><?php
include_once 'db_queries.php';
if(!isset($_REQUEST['region'])) {
  $rregion = ''; 
} else {
  $rregion = $_REQUEST['region'];
}

header("Content-Description: Json report");
header("Content-Disposition: attachment; filename=report-$rregion-".$_REQUEST["month"].".json");
header("Content-Type: mime/type");
if($_REQUEST["report"] == "total") {
	echo json_encode(getTotalReport());	
} else {
	echo json_encode(getReport($_REQUEST["report"], $rregion));
}

?>
{'fraction_non_alphanumeric': 0.22264150943396227, 'fraction_numerical': 0.0, 'mean_word_length': 7.206185567010309, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '7574654', 'n_tokens_mistral': 267, 'n_tokens_neox': 268, 'n_words': 41}