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

namespace StackGuru\Core\Utils;


abstract class StringParser
{
    /**<commit_msg>Implemented utf8 parsed way to extract a char from string<commit_after><?php
declare(strict_types=1);

namespace StackGuru\Core\Utils;


abstract class StringParser
{

	/**
	 * Returns a correctly parsed char, using utf8
	 * @param  int    $start [description]
	 * @param  int    $stop  [description]
	 * @return [type]        [description]
	 */
	public static function getCharAt(int $pos, string $str) : string
	{
		if ($pos + 1 >= strlen($str)) {
			return '';
		}

		return mb_substr($str, $pos, $pos + 1, "utf-8");
	}


    /**
{'fraction_non_alphanumeric': 0.1361573373676248, 'fraction_numerical': 0.01059001512859304, 'mean_word_length': 3.5972222222222223, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 4, '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': '2739825', 'n_tokens_mistral': 231, 'n_tokens_neox': 212, 'n_words': 60}