<commit_before><?php

/*
 * This file is part of Bens Penhorados, an undergraduate capstone project.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace App\Extractors\Generic;

use App\Extractors\AbstractExtractor;
use App\Helpers\Text;

/**
 * This is the full name extractor class.
 *
 * @author <NAME> <<EMAIL>>
 */
class FullNameExtractor extends AbstractExtractor
{
    const REGEX_FULLNAME = '/^[^(]+(?=$|\s)/ui';

    /**
     * Create a new full name extractor instance.
     *
     * @param array $params
     */
    public function __construct($params)
    {
        $this->str = Text::clean($params[0]);
    }

    /**
     * Extract the full name.
     *
     * @return string|null
     */
    public function extract()
    {
        if (preg_match(self::REGEX_FULLNAME, $this->str, $match)) {
            return $match[0];
        }
    }
}<commit_msg>Full name extractor must return a prettified name<commit_after><?php

/*
 * This file is part of Bens Penhorados, an undergraduate capstone project.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace App\Extractors\Generic;

use App\Extractors\AbstractExtractor;
use App\Helpers\Text;

/**
 * This is the full name extractor class.
 *
 * @author <NAME> <<EMAIL>>
 */
class FullNameExtractor extends AbstractExtractor
{
    const REGEX_FULLNAME = '/^[^(]+(?=$|\s)/ui';

    /**
     * Create a new full name extractor instance.
     *
     * @param array $params
     */
    public function __construct($params)
    {
        $this->str = Text::clean($params[0]);
    }

    /**
     * Extract the full name.
     *
     * @return string|null
     */
    public function extract()
    {
        if (preg_match(self::REGEX_FULLNAME, $this->str, $match)) {
            return Text::prettifyName($match[0]);
        }
    }
}
{'fraction_non_alphanumeric': 0.1341222879684418, 'fraction_numerical': 0.0019723865877712033, 'mean_word_length': 2.675724637681159, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 19, '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': '2263356', 'n_tokens_mistral': 631, 'n_tokens_neox': 627, 'n_words': 181}