<commit_before><?php
namespace GitPrettyStats;

use Carbon\Carbon;
use Gitter\Client;

/**
 * Class Repository
 * @author <NAME> <<EMAIL>>
 */
class Repository
{
    /** @var \Gitter\Repository */
    public $gitter;

    /** @var \Gitter\Client */
    public $client;

    /** @var array Storage for "raw" commits */
    public $commits = array();

    /** @var array Storage for commits by date */
    public $commitsByDate = array();

    /** @var array Storage for commits by hour */
    public $commitsByHour = array();

    /** @var array Storage for commits by hour */
    public $commitsByDay = array();

    /** @var array Storage for commits by contributor */
    public $commitsByContributor = array();

    /** @var PrettyGitStats\Statistics */
    public $statistics;

    /**
     * Constructor
     *
     * @param \Gitter\Client $client  Git client
     * @return void
     */
    public function __construct($path)
    {
        $this->client     = new Client;
        $this->gitter     = $this->client->getRepository($path);
        $this->statistics = new Statistics($this);
    }

    /**
     * @return \PHPGit_Repository
     */
    public function getClient()
    {
        return $this->client;
    }

    /**
     * Get name of repository (top level directory)
     *
     * @return string
     */
    public function getName ()
    {
        $path = $this->getClient()->run($this->gitter, 'rev-parse --show-toplevel');
        $name = substr($path, strrpos($path, '/') + 1);

        return trim($name);<commit_msg>Get repository name from top level dir and clean ‘.git’ away from the end<commit_after><?php
namespace GitPrettyStats;

use Carbon\Carbon;
use Gitter\Client;

/**
 * Class Repository
 * @author <NAME> <<EMAIL>>
 */
class Repository
{
    /** @var \Gitter\Repository */
    public $gitter;

    /** @var \Gitter\Client */
    public $client;

    /** @var array Storage for "raw" commits */
    public $commits = array();

    /** @var array Storage for commits by date */
    public $commitsByDate = array();

    /** @var array Storage for commits by hour */
    public $commitsByHour = array();

    /** @var array Storage for commits by hour */
    public $commitsByDay = array();

    /** @var array Storage for commits by contributor */
    public $commitsByContributor = array();

    /** @var PrettyGitStats\Statistics */
    public $statistics;

    /**
     * Constructor
     *
     * @param \Gitter\Client $client  Git client
     * @return void
     */
    public function __construct($path)
    {
        $this->client     = new Client;
        $this->gitter     = $this->client->getRepository($path);
        $this->statistics = new Statistics($this);
    }

    /**
     * @return \PHPGit_Repository
     */
    public function getClient()
    {
        return $this->client;
    }

    /**
     * Get name of repository (top level directory)
     *
     * @return string
     */
    public function getName ()
    {
        $path = $this->gitter->getPath();
        $name = substr($path, strrpos($path, '/') + 1);

        if (substr($name, -4) == '.git') {
            $name = substr($name, 0, strlen($name) - 4);
        }

        return trim($name);
{'fraction_non_alphanumeric': 0.14672897196261683, 'fraction_numerical': 0.001557632398753894, 'mean_word_length': 2.25, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 26, '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': '226719', 'n_tokens_mistral': 984, 'n_tokens_neox': 940, 'n_words': 265}