<commit_before><?php declare(strict_types=1);
namespace HandbookAPI;

require_once($_SERVER['DOCUMENT_ROOT'] . '/settings.php');
require_once($BASEPATH . '/vendor/autoload.php');
require_once($BASEPATH . '/v0.9/internal/exceptions/NotFoundException.php');

@_API_EXEC === 1 or die('Restricted access.');

class Helper // Helper functions
{
	public static function parseUuid(string $id, string $resourceName) : \Ramsey\Uuid\UuidInterface
	{
		try
		{
			return \Ramsey\Uuid\Uuid::fromString($id);
		}
		catch(\Ramsey\Uuid\Exception\InvalidUuidStringException $e)
		{
			throw new NotFoundException($resourceName);
		}
	}

	public static function xssSanitize(string $input) : string
	{
		return htmlspecialchars($input, ENT_QUOTES | ENT_HTML5, 'UTF-8');
	}

	function urlEscape(string $str) : string
	{
		$lookupTable = [
			['base' => 'A', 'letters' => '[\x{0041}\x{24B6}\x{FF21}\x{00C0}\x{00C1}\x{00C2}\x{1EA6}\x{1EA4}\x{1EAA}\x{1EA8}\x{00C3}\x{0100}\x{0102}\x{1EB0}\x{1EAE}\x{1EB4}\x{1EB2}\x{0226}\x{01E0}\x{00C4}\x{01DE}\x{1EA2}\x{00C5}\x{01FA}\x{01CD}\x{0200}\x{0202}\x{1EA0}\x{1EAC}\x{1EB6}\x{1E00}\x{0104}\x{023A}\x{2C6F}]'],
			['base' => 'AA', 'letters' => '[\x{A732}]'],
			['base' => 'AE', 'letters' => '[\x{00C6}\x{01FC}\x{01E2}]'],
			['base' => 'AO', 'letters' => '[\x{A734}]'],
			['base' => 'AU', 'letters' => '[\x{A736}]'],
			['base' => 'AV', 'letters' => '[\x{A738}\x{A73A}]'],
			['base' => 'AY', 'letters' => '[\x{A73C}]'],
			['base' => 'B', 'letters' => '[\x{0042}\x{24B7}\x{FF22}\x{1E02}\x{1E04}\x{1E06}\x{0243}\x{0182}\x{0181}]'],
			['base' => 'C', 'letters' => '[\x{0043}\x{24B8}\x{FF23}\x{0106}\x{0108}\x{010A}\x{010C}\x{00C7}\x{1E08}\x{0187}\x{023B}\x{A73E}]'],
			['base' => 'D', 'letters' => '[\x{0044}\x{24B9}\x{FF24}\x{1E0A}\x{010E}\x{1E0C}\x{1E10}\x{1E12}\x{1E0E}\x{0110}\x{018B}\x{018A}\x{0189}\x{A779}]'],
			['base' => 'DZ', 'letters' => '[\x{01F1}\x{01C4}]'],
			['base' => 'Dz', 'letters' => '[\x{01F2}\x{01C5}]'],
			['base' => 'E', 'letters' => '[\x{0045}\x{24BA}\x{FF25}\x{00C8}\x{00C9}\x{00CA}\x{1EC0}\x{1EBE}\x{1EC4}\x{1EC2}\x{1EBC}\x{0112}\x{1E14}\x{1E16}\x{0114}\x{0116}\x{00CB}\x{1EBA}\x{011A}\x{0204}\x{0206}\x{1EB8}\x{1EC6}\x{0228}\x{1E1C}\x{0118}\x{1E18}\x{1E1A}\x{0190}\x{018E}]'],
			['base' => 'F', 'letters' => '[\x{0046}\x{24BB}\x{FF26}\x{1E1E}\x{0191}\x{A77B}]'],
			['base' => 'G', 'letters' => '[\x{0047}\x{24BC}\x{FF27}\x{01F4}\x{011C}\x{1E20}\x{011E}\x{0120}\x{01E6}\x{0122}\x{01E4}\x{0193}\x{A7A0}\x{A77D}\x{A77E}]'],
			['base' => 'H', 'letters' => '[\x{0048}\x{24BD}\x{FF28}\x{0124}\x{1E22}\x{1E26}\x{021E}\x{1E24}\x{1E28}\x{1E2A}\x{0126}\x{2C67}\x{2C75}\x{A78D}]'],
			['base' => 'I', 'letters' => '[\x{0049}\x{24BE}\x{FF29}\x{00CC}\x{00CD}\x{00CE}\x{0128}\x{012A}\x{012C}\x{0130}\x{00CF}\x{1E2E}\x{1EC8}\x{01CF}\x{0208}\x{020A}\x{1ECA}\x{012E}\x{1E2C}\x{0197}]'],
			['base' => 'J', 'letters' => '[\x{004A}\x{24BF}\x{FF2A}\x{0134}\x{0248}]'],
			['base' => 'K', 'letters' => '[\x{004B}\x{24C0}\x{FF2B}\x{1E30}\x{01E8}\x{1E32}\x{0136}\x{1E34}\x{0198}\x{2C69}\x{A740}\x{A742}\x{A744}\x{A7A2}]'],
			['base' => 'L', 'letters' => '[\x{004C}\x{24C1}\x{FF2C}\x{013F}\x{0139}\x{013D}\x{1E36}\x{1E38}\x{013B}\x{1E3C}\x{1E3A}\x{0141}\x{023D}\x{2C62}\x{2C60}\x{A748}\x{A746}\x{A780}]'],
			['base' => 'LJ', 'letters' => '[\x{01C7}]'],
			['base' => 'Lj', 'letters' => '[\x{01C8}]'],
			['base' => 'M', 'letters' => '[\x{004D}\x{24C2}\x{FF2D}\x{1E3E}\x{1E40}\x{1E42}\x{2C6E}\x{019C}]'],
			['base' => 'N', 'letters' => '[\x{004E}\x{24C3}\x{FF2E}\x{01F8}\x{0143}\x{00D1}\x{1E44}\x{0147}\x{1E46}\x{0145}\x{1E4A}\x{1E48}\x{0220}\x{019D}\x{A790}\x{A7A4}]'],
			['base' => 'NJ', 'letters' => '[\x{01CA}]'],
			['base' => 'Nj', 'letters' => '[\x{01CB}]'],
			['base' => 'O', 'letters' => '[\x{004F}\x{24C4}\x{FF2F}\x{00D2}\x{00D3}\x{00D4}\x{1ED2}\x{1ED0}\x{1ED6}\x{1ED4}\x{00D5}\x{1E4C}\x{022C}\x{1E4E}\x{014C}\x{1E50}\x{1E52}\x{014E}\x{022E}\x{0230}\x{00D6}\x{022A}\x{1ECE}\x{0150}\x{01D1}\x{020C}\x{020E}\x{01A0}\x{1EDC}\x{1EDA}\x{1EE0}\x{1EDE}\x{1EE2}\x{1ECC}\x{1ED8}\x{01EA}\x{01EC}\x{00D8}\x{01FE}\x{0186}\x{019F}\x{A74A}\x{A74C}]'],
			['base' => 'OE', 'letters' => '[\x{0152}]'],
			['base' => 'OI', 'letters' => '[\x{01A2}]'],<commit_msg>Fixed missing function visibility<commit_after><?php declare(strict_types=1);
namespace HandbookAPI;

require_once($_SERVER['DOCUMENT_ROOT'] . '/settings.php');
require_once($BASEPATH . '/vendor/autoload.php');
require_once($BASEPATH . '/v0.9/internal/exceptions/NotFoundException.php');

@_API_EXEC === 1 or die('Restricted access.');

class Helper // Helper functions
{
	public static function parseUuid(string $id, string $resourceName) : \Ramsey\Uuid\UuidInterface
	{
		try
		{
			return \Ramsey\Uuid\Uuid::fromString($id);
		}
		catch(\Ramsey\Uuid\Exception\InvalidUuidStringException $e)
		{
			throw new NotFoundException($resourceName);
		}
	}

	public static function xssSanitize(string $input) : string
	{
		return htmlspecialchars($input, ENT_QUOTES | ENT_HTML5, 'UTF-8');
	}

	public static function urlEscape(string $str) : string
	{
		$lookupTable = [
			['base' => 'A', 'letters' => '[\x{0041}\x{24B6}\x{FF21}\x{00C0}\x{00C1}\x{00C2}\x{1EA6}\x{1EA4}\x{1EAA}\x{1EA8}\x{00C3}\x{0100}\x{0102}\x{1EB0}\x{1EAE}\x{1EB4}\x{1EB2}\x{0226}\x{01E0}\x{00C4}\x{01DE}\x{1EA2}\x{00C5}\x{01FA}\x{01CD}\x{0200}\x{0202}\x{1EA0}\x{1EAC}\x{1EB6}\x{1E00}\x{0104}\x{023A}\x{2C6F}]'],
			['base' => 'AA', 'letters' => '[\x{A732}]'],
			['base' => 'AE', 'letters' => '[\x{00C6}\x{01FC}\x{01E2}]'],
			['base' => 'AO', 'letters' => '[\x{A734}]'],
			['base' => 'AU', 'letters' => '[\x{A736}]'],
			['base' => 'AV', 'letters' => '[\x{A738}\x{A73A}]'],
			['base' => 'AY', 'letters' => '[\x{A73C}]'],
			['base' => 'B', 'letters' => '[\x{0042}\x{24B7}\x{FF22}\x{1E02}\x{1E04}\x{1E06}\x{0243}\x{0182}\x{0181}]'],
			['base' => 'C', 'letters' => '[\x{0043}\x{24B8}\x{FF23}\x{0106}\x{0108}\x{010A}\x{010C}\x{00C7}\x{1E08}\x{0187}\x{023B}\x{A73E}]'],
			['base' => 'D', 'letters' => '[\x{0044}\x{24B9}\x{FF24}\x{1E0A}\x{010E}\x{1E0C}\x{1E10}\x{1E12}\x{1E0E}\x{0110}\x{018B}\x{018A}\x{0189}\x{A779}]'],
			['base' => 'DZ', 'letters' => '[\x{01F1}\x{01C4}]'],
			['base' => 'Dz', 'letters' => '[\x{01F2}\x{01C5}]'],
			['base' => 'E', 'letters' => '[\x{0045}\x{24BA}\x{FF25}\x{00C8}\x{00C9}\x{00CA}\x{1EC0}\x{1EBE}\x{1EC4}\x{1EC2}\x{1EBC}\x{0112}\x{1E14}\x{1E16}\x{0114}\x{0116}\x{00CB}\x{1EBA}\x{011A}\x{0204}\x{0206}\x{1EB8}\x{1EC6}\x{0228}\x{1E1C}\x{0118}\x{1E18}\x{1E1A}\x{0190}\x{018E}]'],
			['base' => 'F', 'letters' => '[\x{0046}\x{24BB}\x{FF26}\x{1E1E}\x{0191}\x{A77B}]'],
			['base' => 'G', 'letters' => '[\x{0047}\x{24BC}\x{FF27}\x{01F4}\x{011C}\x{1E20}\x{011E}\x{0120}\x{01E6}\x{0122}\x{01E4}\x{0193}\x{A7A0}\x{A77D}\x{A77E}]'],
			['base' => 'H', 'letters' => '[\x{0048}\x{24BD}\x{FF28}\x{0124}\x{1E22}\x{1E26}\x{021E}\x{1E24}\x{1E28}\x{1E2A}\x{0126}\x{2C67}\x{2C75}\x{A78D}]'],
			['base' => 'I', 'letters' => '[\x{0049}\x{24BE}\x{FF29}\x{00CC}\x{00CD}\x{00CE}\x{0128}\x{012A}\x{012C}\x{0130}\x{00CF}\x{1E2E}\x{1EC8}\x{01CF}\x{0208}\x{020A}\x{1ECA}\x{012E}\x{1E2C}\x{0197}]'],
			['base' => 'J', 'letters' => '[\x{004A}\x{24BF}\x{FF2A}\x{0134}\x{0248}]'],
			['base' => 'K', 'letters' => '[\x{004B}\x{24C0}\x{FF2B}\x{1E30}\x{01E8}\x{1E32}\x{0136}\x{1E34}\x{0198}\x{2C69}\x{A740}\x{A742}\x{A744}\x{A7A2}]'],
			['base' => 'L', 'letters' => '[\x{004C}\x{24C1}\x{FF2C}\x{013F}\x{0139}\x{013D}\x{1E36}\x{1E38}\x{013B}\x{1E3C}\x{1E3A}\x{0141}\x{023D}\x{2C62}\x{2C60}\x{A748}\x{A746}\x{A780}]'],
			['base' => 'LJ', 'letters' => '[\x{01C7}]'],
			['base' => 'Lj', 'letters' => '[\x{01C8}]'],
			['base' => 'M', 'letters' => '[\x{004D}\x{24C2}\x{FF2D}\x{1E3E}\x{1E40}\x{1E42}\x{2C6E}\x{019C}]'],
			['base' => 'N', 'letters' => '[\x{004E}\x{24C3}\x{FF2E}\x{01F8}\x{0143}\x{00D1}\x{1E44}\x{0147}\x{1E46}\x{0145}\x{1E4A}\x{1E48}\x{0220}\x{019D}\x{A790}\x{A7A4}]'],
			['base' => 'NJ', 'letters' => '[\x{01CA}]'],
			['base' => 'Nj', 'letters' => '[\x{01CB}]'],
			['base' => 'O', 'letters' => '[\x{004F}\x{24C4}\x{FF2F}\x{00D2}\x{00D3}\x{00D4}\x{1ED2}\x{1ED0}\x{1ED6}\x{1ED4}\x{00D5}\x{1E4C}\x{022C}\x{1E4E}\x{014C}\x{1E50}\x{1E52}\x{014E}\x{022E}\x{0230}\x{00D6}\x{022A}\x{1ECE}\x{0150}\x{01D1}\x{020C}\x{020E}\x{01A0}\x{1EDC}\x{1EDA}\x{1EE0}\x{1EDE}\x{1EE2}\x{1ECC}\x{1ED8}\x{01EA}\x{01EC}\x{00D8}\x{01FE}\x{0186}\x{019F}\x{A74A}\x{A74C}]'],
			['base' => 'OE', 'letters' => '[\x{0152}]'],
			['base' => 'OI', 'letters' => '[\x{01A2}]'],
{'fraction_non_alphanumeric': 0.34948918983131383, 'fraction_numerical': 0.18389166072701355, 'mean_word_length': 5.236296296296296, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 119, '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': '5496868', 'n_tokens_mistral': 5464, 'n_tokens_neox': 4611, 'n_words': 338}