<commit_before><?php
	$dir = dirname(__FILE__).'/..';

	build_sheet(64, null, 32);
	build_sheet(64, null, 20);
	build_sheet(64, null, 16);

	build_sheet(72, 'twitter', 64);
	build_sheet(72, 'twitter', 32);
	build_sheet(72, 'twitter', 20);
	build_sheet(72, 'twitter', 16);

	build_sheet(64, 'hangouts', 32);
	build_sheet(64, 'hangouts', 20);
	build_sheet(64, 'hangouts', 16);

	function build_sheet($src_size, $type, $size){

		global $dir;

		$src = $type ? "sheet_{$type}_{$src_size}.png" : "sheet_{$src_size}.png";
		$dst = $type ? "sheet_{$type}_{$size}.png" : "sheet_{$size}.png";

		# get sheet size
		$ident_out = shell_exec("identify -format \"%w|%h|%m\" {$dir}/{$src} 2>&1");
		$ident_lines = explode("\n", trim($ident_out));
		if (!count($ident_lines)) die("cant ident master sheet");
		list($w, $h, $format) = explode('|', $ident_lines[count($ident_lines)-1]);

		$iw = $w / $src_size;
		$ih = $h / $src_size;

		$pw = $iw * $size;
		$ph = $ih * $size;

		echo "Sheet $src -> $dst : ";

		exec("convert {$dir}/{$src} -resize {$pw}x{$ph} png32:{$dir}/{$dst}", $out, $code);

		if ($code){
			echo "ERROR:\n";<commit_msg>build smaller sized sheets for emojione<commit_after><?php
	$dir = dirname(__FILE__).'/..';

	build_sheet(64, null, 32);
	build_sheet(64, null, 20);
	build_sheet(64, null, 16);

	build_sheet(72, 'twitter', 64);
	build_sheet(72, 'twitter', 32);
	build_sheet(72, 'twitter', 20);
	build_sheet(72, 'twitter', 16);

	build_sheet(64, 'hangouts', 32);
	build_sheet(64, 'hangouts', 20);
	build_sheet(64, 'hangouts', 16);

	build_sheet(64, 'emojione', 32);
	build_sheet(64, 'emojione', 20);
	build_sheet(64, 'emojione', 16);

	function build_sheet($src_size, $type, $size){

		global $dir;

		$src = $type ? "sheet_{$type}_{$src_size}.png" : "sheet_{$src_size}.png";
		$dst = $type ? "sheet_{$type}_{$size}.png" : "sheet_{$size}.png";

		# get sheet size
		$ident_out = shell_exec("identify -format \"%w|%h|%m\" {$dir}/{$src} 2>&1");
		$ident_lines = explode("\n", trim($ident_out));
		if (!count($ident_lines)) die("cant ident master sheet");
		list($w, $h, $format) = explode('|', $ident_lines[count($ident_lines)-1]);

		$iw = $w / $src_size;
		$ih = $h / $src_size;

		$pw = $iw * $size;
		$ph = $ih * $size;

		echo "Sheet $src -> $dst : ";

		exec("convert {$dir}/{$src} -resize {$pw}x{$ph} png32:{$dir}/{$dst}", $out, $code);

		if ($code){
			echo "ERROR:\n";
{'fraction_non_alphanumeric': 0.24005027230833684, 'fraction_numerical': 0.0427314620863008, 'mean_word_length': 4.810218978102189, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '7353628', 'n_tokens_mistral': 1092, 'n_tokens_neox': 956, 'n_words': 207}