<commit_before><?php
/*
	@license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt
	
	Copyright (C) 2016 SabineWren
	
	GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007
	https://www.gnu.org/licenses/agpl-3.0.html
	
	@license-end
*/
function queryAPI_closure(){
	$path = __dir__ . '/../sc_api';
	if(!$path)die("unable to locate sc_api\n\n");
	$path = $path . '/index.php';
	
	return function(&$queryString) use($path){
		for($failCounter = 0; $failCounter < 4; ++$failCounter){
			$lines = shell_exec("php5 $path '$queryString'");
			if(!$lines){
				sleep(1);
				continue;//try again
			}
		
			$dataArray = json_decode($lines, true);//json to php associated array
			if($dataArray == false){
				echo "failed to decode\n";
				var_dump($path);
				var_dump($lines);
				var_dump($dataArray);
				return -1;
			}<commit_msg>changed php5 to php for greater server compatibility<commit_after><?php
/*
	@license magnet:?xt=urn:btih:0b31508aeb0634b347b8270c7bee4d411b5d4109&dn=agpl-3.0.txt
	
	Copyright (C) 2016 SabineWren
	
	GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007
	https://www.gnu.org/licenses/agpl-3.0.html
	
	@license-end
*/
function queryAPI_closure(){
	$path = __dir__ . '/../sc_api';
	if(!$path)die("unable to locate sc_api\n\n");
	$path = $path . '/index.php';
	
	return function(&$queryString) use($path){
		for($failCounter = 0; $failCounter < 4; ++$failCounter){
			$lines = shell_exec("php $path '$queryString'");
			if(!$lines){
				sleep(1);
				continue;//try again
			}
		
			$dataArray = json_decode($lines, true);//json to php associated array
			if($dataArray == false){
				echo "failed to decode\n";
				var_dump($path);
				var_dump($lines);
				var_dump($dataArray);
				return -1;
			}
{'fraction_non_alphanumeric': 0.16402714932126697, 'fraction_numerical': 0.053167420814479636, 'mean_word_length': 3.9138888888888888, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '1413976', 'n_tokens_mistral': 798, 'n_tokens_neox': 646, 'n_words': 137}