<commit_before><?php
namespace DrdPlus\Tables\Races;

use DrdPlus\Properties\Base\Agility;
use DrdPlus\Properties\Base\Charisma;
use DrdPlus\Properties\Base\Intelligence;
use DrdPlus\Properties\Base\Knack;
use DrdPlus\Properties\Base\Strength;
use DrdPlus\Properties\Base\Will;
use DrdPlus\Properties\Derived\Endurance;
use DrdPlus\Properties\Derived\Senses;

class RacesTable extends AbstractTable
{

    /**
     * @return string
     */
    protected function getDataFileName()
    {
        return __DIR__ . '/data/races.csv';
    }

    const SUBRACE = 'Subrace';
    const STRENGTH = 'Strength';
    const AGILITY = 'Agility';
    const KNACK = 'Knack';
    const WILL = 'Will';
    const INTELLIGENCE = 'Intelligence';
    const CHARISMA = 'Charisma';
    const ENDURANCE = 'Endurance';
    const INFRAVISION = 'Infravision';
    const NATIVE_REGENERATION = 'Native regeneration';
    const SENSES = 'Senses';
    const REQUIRES_DM_AGREEMENT = 'Requires DM agreement';

    /**
     * @return array|string
     */
    protected function getExpectedHorizontalHeader()
    {
        return [
            [
                self::STRENGTH,
                self::AGILITY,
                self::KNACK,
                self::WILL,
                self::INTELLIGENCE,
                self::CHARISMA,
                self::ENDURANCE,
                self::INFRAVISION,
                self::NATIVE_REGENERATION,
                self::SENSES,
                self::REQUIRES_DM_AGREEMENT,
            ]
        ];
    }

    const RACE = 'Race';

    /**
     * @return array
     */
    protected function getExpectedVerticalHeader()
    {
        return [
            [
                self::RACE,
                self::SUBRACE
            ]
        ];
    }

    const HUMAN = 'Human';
    const COMMON = 'Common';

    public function getCommonHumanModifiers()
    {
        return $this->getRaceModifiers(self::HUMAN, self::COMMON);
    }

    private function getRaceModifiers($race, $subrace)
    {
        return [
            self::STRENGTH => Strength::getIt($this->getValue([$race, $subrace], [self::STRENGTH])),
            self::AGILITY => Agility::getIt($this->getValue([$race, $subrace], [self::AGILITY])),
            self::KNACK => Knack::getIt($this->getValue([$race, $subrace], [self::KNACK])),
            self::WILL => Will::getIt($this->getValue([$race, $subrace], [self::WILL])),
            self::INTELLIGENCE => Intelligence::getIt($this->getValue([$race, $subrace], [self::INTELLIGENCE])),
            self::CHARISMA => Charisma::getIt($this->getValue([$race, $subrace], [self::CHARISMA])),
            self::ENDURANCE => new Endurance($this->getValue([$race, $subrace], [self::ENDURANCE])),
            self::INFRAVISION => $this->getValue([$race, $subrace], [self::INFRAVISION]),
            self::NATIVE_REGENERATION => $this->getValue([$race, $subrace], [self::NATIVE_REGENERATION]),
            self::SENSES => Senses::getIt($this->getValue([$race, $subrace], [self::SENSES])),
            self::REQUIRES_DM_AGREEMENT => $this->getValue([$race, $subrace], [self::REQUIRES_DM_AGREEMENT]),
        ];
    }

    const HIGHLANDER = 'Highlander';

    public function getHighlanderModifiers()
    {
        return $this->getRaceModifiers(self::HUMAN, self::HIGHLANDER);
    }

    const ELF = 'Elf';

    public function getCommonElfModifiers()
    {
        return $this->getRaceModifiers(self::ELF, self::COMMON);
    }

    const DARK = 'Dark';

    public function getDarkElfModifiers()
    {
        return $this->getRaceModifiers(self::ELF, self::DARK);
    }

    const GREEN = 'Green';

    public function getGreenElfModifiers()
    {<commit_msg>Races TODO added<commit_after><?php
namespace DrdPlus\Tables\Races;

use DrdPlus\Properties\Base\Agility;
use DrdPlus\Properties\Base\Charisma;
use DrdPlus\Properties\Base\Intelligence;
use DrdPlus\Properties\Base\Knack;
use DrdPlus\Properties\Base\Strength;
use DrdPlus\Properties\Base\Will;
use DrdPlus\Properties\Derived\Endurance;
use DrdPlus\Properties\Derived\Senses;

class RacesTable extends AbstractTable
{

    /**
     * @return string
     */
    protected function getDataFileName()
    {
        return __DIR__ . '/data/races.csv';
    }

    const SUBRACE = 'Subrace';
    const STRENGTH = 'Strength';
    const AGILITY = 'Agility';
    const KNACK = 'Knack';
    const WILL = 'Will';
    const INTELLIGENCE = 'Intelligence';
    const CHARISMA = 'Charisma';
    const ENDURANCE = 'Endurance';
    const INFRAVISION = 'Infravision';
    const NATIVE_REGENERATION = 'Native regeneration';
    const SENSES = 'Senses';
    const REQUIRES_DM_AGREEMENT = 'Requires DM agreement';

    /**
     * @return array|string
     */
    protected function getExpectedHorizontalHeader()
    {
        return [
            [
                self::STRENGTH,
                self::AGILITY,
                self::KNACK,
                self::WILL,
                self::INTELLIGENCE,
                self::CHARISMA,
                self::ENDURANCE,
                self::INFRAVISION,
                self::NATIVE_REGENERATION,
                self::SENSES,
                self::REQUIRES_DM_AGREEMENT,
            ]
        ];
    }

    const RACE = 'Race';

    /**
     * @return array
     */
    protected function getExpectedVerticalHeader()
    {
        return [
            [
                self::RACE,
                self::SUBRACE
            ]
        ];
    }

    const HUMAN = 'Human';
    const COMMON = 'Common';

    public function getCommonHumanModifiers()
    {
        return $this->getRaceModifiers(self::HUMAN, self::COMMON);
    }

    private function getRaceModifiers($race, $subrace)
    {
        return [
            self::STRENGTH => Strength::getIt($this->getValue([$race, $subrace], [self::STRENGTH])),
            self::AGILITY => Agility::getIt($this->getValue([$race, $subrace], [self::AGILITY])),
            self::KNACK => Knack::getIt($this->getValue([$race, $subrace], [self::KNACK])),
            self::WILL => Will::getIt($this->getValue([$race, $subrace], [self::WILL])),
            self::INTELLIGENCE => Intelligence::getIt($this->getValue([$race, $subrace], [self::INTELLIGENCE])),
            self::CHARISMA => Charisma::getIt($this->getValue([$race, $subrace], [self::CHARISMA])),
            // TODO give Endurance a getIt factory
            self::ENDURANCE => new Endurance($this->getValue([$race, $subrace], [self::ENDURANCE])),
            // TODO provide Infravision as a boolean enum property
            self::INFRAVISION => $this->getValue([$race, $subrace], [self::INFRAVISION]),
            // TODO provide NativeRegeneration as a boolean enum property
            self::NATIVE_REGENERATION => $this->getValue([$race, $subrace], [self::NATIVE_REGENERATION]),
            // TODO provide Senses as a boolean enum property
            self::SENSES => Senses::getIt($this->getValue([$race, $subrace], [self::SENSES])),
            // TODO provide RequiresDMAgreement as a local boolean enum property
            self::REQUIRES_DM_AGREEMENT => $this->getValue([$race, $subrace], [self::REQUIRES_DM_AGREEMENT]),
        ];
    }

    const HIGHLANDER = 'Highlander';

    public function getHighlanderModifiers()
    {
        return $this->getRaceModifiers(self::HUMAN, self::HIGHLANDER);
    }

    const ELF = 'Elf';

    public function getCommonElfModifiers()
    {
        return $this->getRaceModifiers(self::ELF, self::COMMON);
    }

    const DARK = 'Dark';

    public function getDarkElfModifiers()
    {
        return $this->getRaceModifiers(self::ELF, self::DARK);
    }

    const GREEN = 'Green';

    public function getGreenElfModifiers()
    {
{'fraction_non_alphanumeric': 0.13880946191837795, 'fraction_numerical': 0.0, 'mean_word_length': 2.544449562413634, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 55, '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': '7538830', 'n_tokens_mistral': 2515, 'n_tokens_neox': 2364, 'n_words': 427}