<commit_before><?php

namespace Nails\Common\Console\Seed;

class Base
{
    /**
     * The database object
     * @var \Nails\Console\Database;
     */
    protected $oDb;

    // --------------------------------------------------------------------------

    /**
     * Base constructor.
     *
     * @param $oDb
     */
    public function __construct($oDb)
    {
        $this->oDb = $oDb;
    }

    // --------------------------------------------------------------------------

    /**
     * Execute any pre-seed setup in here
     */
    public function pre()
    {
    }

    // --------------------------------------------------------------------------

    /**
     * The main seeding method
     */
    public function execute()
    {
    }

    // --------------------------------------------------------------------------

    /**
     * Perform any post-seed cleaning up here
     */
    public function post()
    {
    }
}<commit_msg>Added some Lorem Ipsum generators<commit_after><?php

namespace Nails\Common\Console\Seed;

class Base
{
    /**
     * The database object
     * @var \Nails\Console\Database;
     */
    protected $oDb;

    // --------------------------------------------------------------------------

    /**
     * Base constructor.
     *
     * @param $oDb
     */
    public function __construct($oDb)
    {
        $this->oDb = $oDb;
    }

    // --------------------------------------------------------------------------

    /**
     * Execute any pre-seed setup in here
     */
    public function pre()
    {
    }

    // --------------------------------------------------------------------------

    /**
     * The main seeding method
     */
    public function execute()
    {
    }

    // --------------------------------------------------------------------------

    /**
     * Perform any post-seed cleaning up here
     */
    public function post()
    {
    }

    // --------------------------------------------------------------------------

    /**
     * Generate some random Lorem Ipsum words
     *
     * @param int $iNumWords The number of words to generate
     * @return string
     */
    protected function loremWord($iNumWords = 5)
    {
        $aWords = [
            'lorem', 'ipsum', 'dolor', 'sit', 'amet', 'consectetur', 'adipiscing', 'elit', 'mauris', 'venenatis',
            'metus', 'volutpat', 'hendrerit', 'interdum', 'nisi', 'odio', 'finibus', 'ex', 'eu', 'congue', 'mauris',
            'nisi', 'in', 'magna', 'ut', 'gravida', 'neque', 'at', 'nulla', 'viverra', 'egestas', 'vel', 'et', 'ante',
            'maecenas', 'hendrerit', 'sit', 'amet', 'urna', 'posuere', 'ultrices', 'aenean', 'quis', 'velit', 'velit',
            'suspendisse', 'sit', 'amet', 'egestas', 'tortor'
        ];

        $aOut = [];

        for ($i = 0; $i < $iNumWords; $i++) {
            $aOut[] = $aWords[array_rand($aWords)];
        }

        return implode(' ', $aOut);
    }

    // --------------------------------------------------------------------------

    /**
     * Generate some random Lorem Ipsum sentences
     *
     * @param int $iNumSentences The number of sentences to generate
     * @return string
     */
    protected function loremSentence($iNumSentences = 1)
    {
        $aOut = [];
        $aLengths = [5, 6, 8, 10, 12];

        for ($i = 0; $i < $iNumSentences; $i++) {
            $iLength = $aLengths[array_rand($aLengths)];
            $aOut[]  = ucfirst($this->loremWord($iLength));
        }

        return implode('. ', $aOut) . '.';
    }

    // --------------------------------------------------------------------------

    /**
     * Generate some random Lorem Ipsum paragraphs
     *
     * @param int $iNumParagraphs The number of paragraphs to generate
     * @return string
     */
    protected function loremParagraph($iNumParagraphs = 1)
    {
        $aOut = [];
        $aLengths = [5, 6, 8, 10, 12];

        for ($i = 0; $i < $iNumParagraphs; $i++) {
            $iLength = $aLengths[array_rand($aLengths)];
            $aOut[]  = $this->loremSentence($iLength);
        }

        return implode("\n\n", $aOut);
    }
}
{'fraction_non_alphanumeric': 0.32778180062756457, 'fraction_numerical': 0.004827419744146753, 'mean_word_length': 1.0423854115327749, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 7, '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': '906499', 'n_tokens_mistral': 1201, 'n_tokens_neox': 1138, 'n_words': 262}