<commit_before><?php

class Roma
{
    private $value = 0;

    const CODES = array(
        "M" => 1000,
        "CM" => 900,
        "D" => 500,
        "CD" => 400,
        "C" => 100,
        "XC" => 90,
        "L" => 50,
        "XL" => 40,
        "X" => 10,
        "IX" => 9,
        "V" => 5,
        "IV" => 4,
        "I" => 1
    );

    function __construct($value)
    {
        $invalidExeption = new InvalidArgumentException(
            "Paramter for new Roma have to be an positive Integer, a Roma String or an instance of Roma"
        );
        // can be integer
        // can be String
        // can be a Roma Instance
        // if invalid -> throw Exception
        if (is_int($value) && $value > 0) {
            $this->value = $value;
        } elseif (is_string($value)) {
            $codes = self::romanCodes();
            for ($i = 0; $i < strlen($value); $i++) {
                if (in_array($value[$i], $codes) === false) {
                    throw $invalidExeption;
                }
            }
            $this->value = self::deromanize($value);
        } elseif ($value instanceof self) {
            $this->value = $value->getNumber();
        } else {
            throw $invalidExeption;
        }
    }

    private static function romanCodes()
    {
        $array = array_keys(self::CODES);
        foreach ($array as $elementKey => $element) {
            if (strlen($element) === 2) {
                unset($array[$elementKey]);
            }
        }

        return $array;<commit_msg>fix words<commit_after><?php

class Roma
{
    private $value = 0;

    const CODES = array(
        "M" => 1000,
        "CM" => 900,
        "D" => 500,
        "CD" => 400,
        "C" => 100,
        "XC" => 90,
        "L" => 50,
        "XL" => 40,
        "X" => 10,
        "IX" => 9,
        "V" => 5,
        "IV" => 4,
        "I" => 1
    );

    function __construct($value)
    {
        $invalidException = new InvalidArgumentException(
            "Parameter for new Roma have to be an positive Integer, a Roma String or an instance of Roma"
        );
        // can be integer
        // can be String
        // can be a Roma Instance
        // if invalid -> throw Exception
        if (is_int($value) && $value > 0) {
            $this->value = $value;
        } elseif (is_string($value)) {
            $codes = self::romanCodes();
            for ($i = 0; $i < strlen($value); $i++) {
                if (in_array($value[$i], $codes) === false) {
                    throw $invalidException;
                }
            }
            $this->value = self::deromanize($value);
        } elseif ($value instanceof self) {
            $this->value = $value->getNumber();
        } else {
            throw $invalidException;
        }
    }

    private static function romanCodes()
    {
        $array = array_keys(self::CODES);
        foreach ($array as $elementKey => $element) {
            if (strlen($element) === 2) {
                unset($array[$elementKey]);
            }
        }

        return $array;
{'fraction_non_alphanumeric': 0.15009746588693956, 'fraction_numerical': 0.02079272254710851, 'mean_word_length': 1.40546875, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 43, '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': '7167589', 'n_tokens_mistral': 979, 'n_tokens_neox': 913, 'n_words': 246}