<commit_before><?php

declare(strict_types=1);

namespace Onion\Framework\Console\Router;

use Onion\Framework\Console\Interfaces\ArgumentParserInterface;

class ArgumentParser implements ArgumentParserInterface
{
    private const TYPE_MAP = [
        'int' => '/^-?\d+$/',
        'integer' => '/^-?\d+$/i',
        'float' => '/^(([-+])?[.,]\b(\d+)(?:[Ee]([+-])?(\d+)?)?\b)|(?:([+-])?\b(\d+)(?:[.,]?(\d+))?(?:[Ee]([+-])?(\d+)?)?\b)$/',
        'double' => '/^(([-+])?[.,]\b(\d+)(?:[Ee]([+-])?(\d+)?)?\b)|(?:([+-])?\b(\d+)(?:[.,]?(\d+))?(?:[Ee]([+-])?(\d+)?)?\b)$/',
        'bool' => '/^(?:true|yes|1|on|off|0|no|false)$/',
    ];

    public function parse(array &$arguments, array $parameters = []): array
    {
        $result = [];

        foreach ($parameters as $parameter) {
            $aliases = array_map('trim', explode('|', $parameter['name']));
            $name = trim($aliases[0], '-');

            foreach ($aliases as $alias) {
                $i = array_search($alias, $arguments);
                if ($i === false) {<commit_msg>add regex for string type<commit_after><?php

declare(strict_types=1);

namespace Onion\Framework\Console\Router;

use Onion\Framework\Console\Interfaces\ArgumentParserInterface;

class ArgumentParser implements ArgumentParserInterface
{
    private const TYPE_MAP = [
        'int' => '/^-?\d+$/',
        'integer' => '/^-?\d+$/i',
        'float' => '/^(([-+])?[.,]\b(\d+)(?:[Ee]([+-])?(\d+)?)?\b)|(?:([+-])?\b(\d+)(?:[.,]?(\d+))?(?:[Ee]([+-])?(\d+)?)?\b)$/',
        'double' => '/^(([-+])?[.,]\b(\d+)(?:[Ee]([+-])?(\d+)?)?\b)|(?:([+-])?\b(\d+)(?:[.,]?(\d+))?(?:[Ee]([+-])?(\d+)?)?\b)$/',
        'bool' => '/^(?:true|yes|1|on|off|0|no|false)$/',
        'string' => '/^(.*)$/',
    ];

    public function parse(array &$arguments, array $parameters = []): array
    {
        $result = [];

        foreach ($parameters as $parameter) {
            $aliases = array_map('trim', explode('|', $parameter['name']));
            $name = trim($aliases[0], '-');

            foreach ($aliases as $alias) {
                $i = array_search($alias, $arguments);
                if ($i === false) {
{'fraction_non_alphanumeric': 0.330074487895717, 'fraction_numerical': 0.0037243947858473, 'mean_word_length': 2.8306595365418894, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 14, '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': '6486060', 'n_tokens_mistral': 814, 'n_tokens_neox': 793, 'n_words': 107}