<commit_before><?php
namespace SPHERE\Application\Contact\Mail;

use SPHERE\Application\Contact\Mail\Service\Entity\TblToCompany;
use SPHERE\Application\Contact\Mail\Service\Entity\TblToPerson;
use SPHERE\Application\Corporation\Company\Company;
use SPHERE\Application\Corporation\Company\Service\Entity\TblCompany;
use SPHERE\Application\People\Person\Person;
use SPHERE\Application\People\Person\Service\Entity\TblPerson;
use SPHERE\Common\Frontend\Form\Repository\Button\Primary;
use SPHERE\Common\Frontend\Form\Repository\Field\AutoCompleter;
use SPHERE\Common\Frontend\Form\Repository\Field\SelectBox;
use SPHERE\Common\Frontend\Form\Repository\Field\TextArea;
use SPHERE\Common\Frontend\Form\Structure\Form;
use SPHERE\Common\Frontend\Form\Structure\FormColumn;
use SPHERE\Common\Frontend\Form\Structure\FormGroup;
use SPHERE\Common\Frontend\Form\Structure\FormRow;
use SPHERE\Common\Frontend\Icon\Repository\Building;
use SPHERE\Common\Frontend\Icon\Repository\ChevronLeft;
use SPHERE\Common\Frontend\Icon\Repository\Disable;
use SPHERE\Common\Frontend\Icon\Repository\Mail as MailIcon;
use SPHERE\Common\Frontend\Icon\Repository\Ok;
use SPHERE\Common\Frontend\Icon\Repository\Pencil;
use SPHERE\Common\Frontend\Icon\Repository\Person as PersonIcon;
use SPHERE\Common\Frontend\Icon\Repository\Question;
use SPHERE\Common\Frontend\Icon\Repository\Remove;
use SPHERE\Common\Frontend\Icon\Repository\TileBig;
use SPHERE\Common\Frontend\IFrontendInterface;
use SPHERE\Common\Frontend\Layout\Repository\Panel;
use SPHERE\Common\Frontend\Layout\Structure\Layout;
use SPHERE\Common\Frontend\Layout\Structure\LayoutColumn;
use SPHERE\Common\Frontend\Layout\Structure\LayoutGroup;
use SPHERE\Common\Frontend\Layout\Structure\LayoutRow;
use SPHERE\Common\Frontend\Link\Repository\Standard;
use SPHERE\Common\Frontend\Message\Repository\Danger;
use SPHERE\Common\Frontend\Message\Repository\Success;
use SPHERE\Common\Frontend\Message\Repository\Warning;
use SPHERE\Common\Frontend\Text\Repository\Muted;
use SPHERE\Common\Frontend\Text\Repository\Small;
use SPHERE\Common\Window\Redirect;
use SPHERE\Common\Window\Stage;
use SPHERE\System\Extension\Extension;

/**
 * Class Frontend
 *
 * @package SPHERE\Application\Contact\Mail
 */
class Frontend extends Extension implements IFrontendInterface
{

    /**
     * @param int    $Id
     * @param string $Address
     * @param array  $Type
     *
     * @return Stage
     */
    public function frontendCreateToPerson($Id, $Address, $Type)
    {

        $Stage = new Stage('E-Mail Adresse', 'Hinzufügen');
        $Stage->setMessage('Eine E-Mail Adresse zur gewählten Person hinzufügen');

        $tblPerson = Person::useService()->getPersonById($Id);

        $Stage->setContent(
            new Layout(array(
                new LayoutGroup(array(
                    new LayoutRow(
                        new LayoutColumn(
                            new Panel(new PersonIcon().' Person',
                                $tblPerson->getFullName(),
                                Panel::PANEL_TYPE_SUCCESS,
                                new Standard('Zurück zur Person', '/People/Person', new ChevronLeft(),
                                    array('Id' => $tblPerson->getId())
                                )
                            )
                        )
                    ),
                )),
                new LayoutGroup(array(
                    new LayoutRow(
                        new LayoutColumn(
                            Mail::useService()->createMailToPerson(
                                $this->formAddress()
                                    ->appendFormButton(new Primary('E-Mail Adresse hinzufügen'))
                                    ->setConfirm('Eventuelle Änderungen wurden noch nicht gespeichert')
                                , $tblPerson, $Address, $Type
                            )
                        )
                    )
                )),
            ))
        );

        return $Stage;
    }

    /**
     * @return Form
     */
    private function formAddress()
    {

        $tblMailAll = Mail::useService()->getMailAll();
        $tblTypeAll = Mail::useService()->getTypeAll();

        return new Form(
            new FormGroup(array(
                new FormRow(array(
                    new FormColumn(
                        new Panel('E-Mail Adresse',
                            array(
                                new SelectBox('Type[Type]', 'Typ',
                                    array('{{ Name }} {{ Description }}' => $tblTypeAll), new TileBig()
                                ),
                                new AutoCompleter('Address', 'E-Mail Adresse', 'E-Mail Adresse',
                                    array('Address' => $tblMailAll), new MailIcon()
                                )
                            ), Panel::PANEL_TYPE_INFO
                        ), 6),
                    new FormColumn(
                        new Panel('Sonstiges',
                            new TextArea('Type[Remark]', 'Bemerkungen', 'Bemerkungen', new Pencil())
                            , Panel::PANEL_TYPE_INFO
                        ), 6),
                )),
            ))
        );
    }

    /**
     * @param int    $Id
     * @param string $Address
     * @param array  $Type
     *
     * @return Stage
     */
    public function frontendCreateToCompany($Id, $Address, $Type)
    {

        $Stage = new Stage('E-Mail Adresse', 'Hinzufügen');
        $Stage->setMessage('Eine E-Mail Adresse zur gewählten Firma hinzufügen');

        $tblCompany = Company::useService()->getCompanyById($Id);

        $Stage->setContent(
            new Layout(array(
                new LayoutGroup(array(
                    new LayoutRow(
                        new LayoutColumn(
                            new Panel(new PersonIcon().' Firma',
                                $tblCompany->getName(),
                                Panel::PANEL_TYPE_SUCCESS,
                                new Standard('Zurück zur Firma', '/Corporation/Company', new ChevronLeft(),
                                    array('Id' => $tblCompany->getId())
                                )
                            )
                        )
                    ),
                )),
                new LayoutGroup(array(
                    new LayoutRow(
                        new LayoutColumn(
                            Mail::useService()->createMailToCompany(
                                $this->formAddress()
                                    ->appendFormButton(new Primary('E-Mail Adresse hinzufügen'))
                                    ->setConfirm('Eventuelle Änderungen wurden noch nicht gespeichert')
                                , $tblCompany, $Address, $Type
                            )
                        )
                    )
                )),
            ))
        );

        return $Stage;
    }

    /**
     * @param int    $Id
     * @param string $Address
     * @param array  $Type
     *
     * @return Stage
     */
    public function frontendUpdateToPerson($Id, $Address, $Type)
    {

        $Stage = new Stage('E-Mail Adresse', 'Bearbeiten');
        $Stage->setMessage('Die E-Mail Adresse der gewählten Person ändern');

        $tblToPerson = Mail::useService()->getMailToPersonById($Id);

        $Global = $this->getGlobal();
        if (!isset( $Global->POST['Address'] )) {
            $Global->POST['Address'] = $tblToPerson->getTblMail()->getAddress();
            $Global->POST['Type']['Type'] = $tblToPerson->getTblType()->getId();
            $Global->POST['Type']['Remark'] = $tblToPerson->getRemark();
            $Global->savePost();
        }

        $Stage->setContent(
            new Layout(array(
                new LayoutGroup(array(
                    new LayoutRow(
                        new LayoutColumn(
                            new Panel(new PersonIcon().' Person',
                                $tblToPerson->getServiceTblPerson()->getFullName(),
                                Panel::PANEL_TYPE_SUCCESS,
                                new Standard('Zurück zur Person', '/People/Person', new ChevronLeft(),
                                    array('Id' => $tblToPerson->getServiceTblPerson()->getId())
                                )
                            )
                        )
                    ),
                )),
                new LayoutGroup(array(
                    new LayoutRow(
                        new LayoutColumn(
                            Mail::useService()->updateMailToPerson(
                                $this->formAddress()
                                    ->appendFormButton(new Primary('Änderungen speichern'))
                                    ->setConfirm('Eventuelle Änderungen wurden noch nicht gespeichert')
                                , $tblToPerson, $Address, $Type
                            )
                        )
                    )
                )),
            ))
        );

        return $Stage;
    }

    /**
     * @param int    $Id
     * @param string $Address
     * @param array  $Type
     *
     * @return Stage
     */
    public function frontendUpdateToCompany($Id, $Address, $Type)
    {

        $Stage = new Stage('E-Mail Adresse', 'Bearbeiten');
        $Stage->setMessage('Die E-Mail Adresse der gewählten Firma ändern');

        $tblToCompany = Mail::useService()->getMailToCompanyById($Id);

        $Global = $this->getGlobal();
        if (!isset( $Global->POST['Address'] )) {
            $Global->POST['Address'] = $tblToCompany->getTblMail()->getAddress();
            $Global->POST['Type']['Type'] = $tblToCompany->getTblType()->getId();
            $Global->POST['Type']['Remark'] = $tblToCompany->getRemark();
            $Global->savePost();
        }

        $Stage->setContent(
            new Layout(array(
                new LayoutGroup(array(
                    new LayoutRow(
                        new LayoutColumn(
                            new Panel(new Building().' Firma',
                                $tblToCompany->getServiceTblCompany()->getName(),
                                Panel::PANEL_TYPE_SUCCESS,
                                new Standard('Zurück zur Firma', '/Corporation/Company', new ChevronLeft(),
                                    array('Id' => $tblToCompany->getServiceTblCompany()->getId())
                                )
                            )
                        )
                    ),
                )),
                new LayoutGroup(array(
                    new LayoutRow(
                        new LayoutColumn(
                            Mail::useService()->updateMailToCompany(
                                $this->formAddress()
                                    ->appendFormButton(new Primary('Änderungen speichern'))
                                    ->setConfirm('Eventuelle Änderungen wurden noch nicht gespeichert')
                                , $tblToCompany, $Address, $Type
                            )
                        )
                    )
                )),
            ))
        );

        return $Stage;
    }

    /**
     * @param TblPerson $tblPerson
     *
     * @return Layout
     */
    public function frontendLayoutPerson(TblPerson $tblPerson)
    {

        $tblMailAll = Mail::useService()->getMailAllByPerson($tblPerson);
        if ($tblMailAll !== false) {
            array_walk($tblMailAll, function (TblToPerson &$tblToPerson) {

                $Panel = array($tblToPerson->getTblMail()->getAddress());
                if ($tblToPerson->getRemark()) {
                    array_push($Panel, new Muted(new Small($tblToPerson->getRemark())));
                }

                $tblToPerson = new LayoutColumn(
                    new Panel(
                        new MailIcon().' '.$tblToPerson->getTblType()->getName(), $Panel, Panel::PANEL_TYPE_SUCCESS,

                        new Standard(
                            '', '/People/Person/Mail/Edit', new Pencil(),
                            array('Id' => $tblToPerson->getId()),
                            'Bearbeiten'
                        )
                        .new Standard(
                            '', '/People/Person/Mail/Destroy', new Remove(),
                            array('Id' => $tblToPerson->getId()), 'Löschen'
                        )
                    )
                    , 3);
            });
        } else {
            $tblMailAll = array(
                new LayoutColumn(
                    new Warning('Keine E-Mail Adressen hinterlegt')<commit_msg>Mail -> Anzeige von alle in Beziehung stehenden Personen (nur wo Person serviceTblPersonTo)<commit_after><?php
namespace SPHERE\Application\Contact\Mail;

use SPHERE\Application\Contact\Mail\Service\Entity\TblToCompany;
use SPHERE\Application\Contact\Mail\Service\Entity\TblToPerson;
use SPHERE\Application\Corporation\Company\Company;
use SPHERE\Application\Corporation\Company\Service\Entity\TblCompany;
use SPHERE\Application\People\Person\Person;
use SPHERE\Application\People\Person\Service\Entity\TblPerson;
use SPHERE\Application\People\Relationship\Relationship;
use SPHERE\Common\Frontend\Form\Repository\Button\Primary;
use SPHERE\Common\Frontend\Form\Repository\Field\AutoCompleter;
use SPHERE\Common\Frontend\Form\Repository\Field\SelectBox;
use SPHERE\Common\Frontend\Form\Repository\Field\TextArea;
use SPHERE\Common\Frontend\Form\Structure\Form;
use SPHERE\Common\Frontend\Form\Structure\FormColumn;
use SPHERE\Common\Frontend\Form\Structure\FormGroup;
use SPHERE\Common\Frontend\Form\Structure\FormRow;
use SPHERE\Common\Frontend\Icon\Repository\Building;
use SPHERE\Common\Frontend\Icon\Repository\ChevronLeft;
use SPHERE\Common\Frontend\Icon\Repository\Disable;
use SPHERE\Common\Frontend\Icon\Repository\Mail as MailIcon;
use SPHERE\Common\Frontend\Icon\Repository\Ok;
use SPHERE\Common\Frontend\Icon\Repository\Pencil;
use SPHERE\Common\Frontend\Icon\Repository\Person as PersonIcon;
use SPHERE\Common\Frontend\Icon\Repository\Question;
use SPHERE\Common\Frontend\Icon\Repository\Remove;
use SPHERE\Common\Frontend\Icon\Repository\TileBig;
use SPHERE\Common\Frontend\IFrontendInterface;
use SPHERE\Common\Frontend\Layout\Repository\Panel;
use SPHERE\Common\Frontend\Layout\Structure\Layout;
use SPHERE\Common\Frontend\Layout\Structure\LayoutColumn;
use SPHERE\Common\Frontend\Layout\Structure\LayoutGroup;
use SPHERE\Common\Frontend\Layout\Structure\LayoutRow;
use SPHERE\Common\Frontend\Link\Repository\Standard;
use SPHERE\Common\Frontend\Message\Repository\Danger;
use SPHERE\Common\Frontend\Message\Repository\Success;
use SPHERE\Common\Frontend\Message\Repository\Warning;
use SPHERE\Common\Frontend\Text\Repository\Muted;
use SPHERE\Common\Frontend\Text\Repository\Small;
use SPHERE\Common\Window\Redirect;
use SPHERE\Common\Window\Stage;
use SPHERE\System\Extension\Extension;

/**
 * Class Frontend
 *
 * @package SPHERE\Application\Contact\Mail
 */
class Frontend extends Extension implements IFrontendInterface
{

    /**
     * @param int    $Id
     * @param string $Address
     * @param array  $Type
     *
     * @return Stage
     */
    public function frontendCreateToPerson($Id, $Address, $Type)
    {

        $Stage = new Stage('E-Mail Adresse', 'Hinzufügen');
        $Stage->setMessage('Eine E-Mail Adresse zur gewählten Person hinzufügen');

        $tblPerson = Person::useService()->getPersonById($Id);

        $Stage->setContent(
            new Layout(array(
                new LayoutGroup(array(
                    new LayoutRow(
                        new LayoutColumn(
                            new Panel(new PersonIcon().' Person',
                                $tblPerson->getFullName(),
                                Panel::PANEL_TYPE_SUCCESS,
                                new Standard('Zurück zur Person', '/People/Person', new ChevronLeft(),
                                    array('Id' => $tblPerson->getId())
                                )
                            )
                        )
                    ),
                )),
                new LayoutGroup(array(
                    new LayoutRow(
                        new LayoutColumn(
                            Mail::useService()->createMailToPerson(
                                $this->formAddress()
                                    ->appendFormButton(new Primary('E-Mail Adresse hinzufügen'))
                                    ->setConfirm('Eventuelle Änderungen wurden noch nicht gespeichert')
                                , $tblPerson, $Address, $Type
                            )
                        )
                    )
                )),
            ))
        );

        return $Stage;
    }

    /**
     * @return Form
     */
    private function formAddress()
    {

        $tblMailAll = Mail::useService()->getMailAll();
        $tblTypeAll = Mail::useService()->getTypeAll();

        return new Form(
            new FormGroup(array(
                new FormRow(array(
                    new FormColumn(
                        new Panel('E-Mail Adresse',
                            array(
                                new SelectBox('Type[Type]', 'Typ',
                                    array('{{ Name }} {{ Description }}' => $tblTypeAll), new TileBig()
                                ),
                                new AutoCompleter('Address', 'E-Mail Adresse', 'E-Mail Adresse',
                                    array('Address' => $tblMailAll), new MailIcon()
                                )
                            ), Panel::PANEL_TYPE_INFO
                        ), 6),
                    new FormColumn(
                        new Panel('Sonstiges',
                            new TextArea('Type[Remark]', 'Bemerkungen', 'Bemerkungen', new Pencil())
                            , Panel::PANEL_TYPE_INFO
                        ), 6),
                )),
            ))
        );
    }

    /**
     * @param int    $Id
     * @param string $Address
     * @param array  $Type
     *
     * @return Stage
     */
    public function frontendCreateToCompany($Id, $Address, $Type)
    {

        $Stage = new Stage('E-Mail Adresse', 'Hinzufügen');
        $Stage->setMessage('Eine E-Mail Adresse zur gewählten Firma hinzufügen');

        $tblCompany = Company::useService()->getCompanyById($Id);

        $Stage->setContent(
            new Layout(array(
                new LayoutGroup(array(
                    new LayoutRow(
                        new LayoutColumn(
                            new Panel(new PersonIcon().' Firma',
                                $tblCompany->getName(),
                                Panel::PANEL_TYPE_SUCCESS,
                                new Standard('Zurück zur Firma', '/Corporation/Company', new ChevronLeft(),
                                    array('Id' => $tblCompany->getId())
                                )
                            )
                        )
                    ),
                )),
                new LayoutGroup(array(
                    new LayoutRow(
                        new LayoutColumn(
                            Mail::useService()->createMailToCompany(
                                $this->formAddress()
                                    ->appendFormButton(new Primary('E-Mail Adresse hinzufügen'))
                                    ->setConfirm('Eventuelle Änderungen wurden noch nicht gespeichert')
                                , $tblCompany, $Address, $Type
                            )
                        )
                    )
                )),
            ))
        );

        return $Stage;
    }

    /**
     * @param int    $Id
     * @param string $Address
     * @param array  $Type
     *
     * @return Stage
     */
    public function frontendUpdateToPerson($Id, $Address, $Type)
    {

        $Stage = new Stage('E-Mail Adresse', 'Bearbeiten');
        $Stage->setMessage('Die E-Mail Adresse der gewählten Person ändern');

        $tblToPerson = Mail::useService()->getMailToPersonById($Id);

        $Global = $this->getGlobal();
        if (!isset( $Global->POST['Address'] )) {
            $Global->POST['Address'] = $tblToPerson->getTblMail()->getAddress();
            $Global->POST['Type']['Type'] = $tblToPerson->getTblType()->getId();
            $Global->POST['Type']['Remark'] = $tblToPerson->getRemark();
            $Global->savePost();
        }

        $Stage->setContent(
            new Layout(array(
                new LayoutGroup(array(
                    new LayoutRow(
                        new LayoutColumn(
                            new Panel(new PersonIcon().' Person',
                                $tblToPerson->getServiceTblPerson()->getFullName(),
                                Panel::PANEL_TYPE_SUCCESS,
                                new Standard('Zurück zur Person', '/People/Person', new ChevronLeft(),
                                    array('Id' => $tblToPerson->getServiceTblPerson()->getId())
                                )
                            )
                        )
                    ),
                )),
                new LayoutGroup(array(
                    new LayoutRow(
                        new LayoutColumn(
                            Mail::useService()->updateMailToPerson(
                                $this->formAddress()
                                    ->appendFormButton(new Primary('Änderungen speichern'))
                                    ->setConfirm('Eventuelle Änderungen wurden noch nicht gespeichert')
                                , $tblToPerson, $Address, $Type
                            )
                        )
                    )
                )),
            ))
        );

        return $Stage;
    }

    /**
     * @param int    $Id
     * @param string $Address
     * @param array  $Type
     *
     * @return Stage
     */
    public function frontendUpdateToCompany($Id, $Address, $Type)
    {

        $Stage = new Stage('E-Mail Adresse', 'Bearbeiten');
        $Stage->setMessage('Die E-Mail Adresse der gewählten Firma ändern');

        $tblToCompany = Mail::useService()->getMailToCompanyById($Id);

        $Global = $this->getGlobal();
        if (!isset( $Global->POST['Address'] )) {
            $Global->POST['Address'] = $tblToCompany->getTblMail()->getAddress();
            $Global->POST['Type']['Type'] = $tblToCompany->getTblType()->getId();
            $Global->POST['Type']['Remark'] = $tblToCompany->getRemark();
            $Global->savePost();
        }

        $Stage->setContent(
            new Layout(array(
                new LayoutGroup(array(
                    new LayoutRow(
                        new LayoutColumn(
                            new Panel(new Building().' Firma',
                                $tblToCompany->getServiceTblCompany()->getName(),
                                Panel::PANEL_TYPE_SUCCESS,
                                new Standard('Zurück zur Firma', '/Corporation/Company', new ChevronLeft(),
                                    array('Id' => $tblToCompany->getServiceTblCompany()->getId())
                                )
                            )
                        )
                    ),
                )),
                new LayoutGroup(array(
                    new LayoutRow(
                        new LayoutColumn(
                            Mail::useService()->updateMailToCompany(
                                $this->formAddress()
                                    ->appendFormButton(new Primary('Änderungen speichern'))
                                    ->setConfirm('Eventuelle Änderungen wurden noch nicht gespeichert')
                                , $tblToCompany, $Address, $Type
                            )
                        )
                    )
                )),
            ))
        );

        return $Stage;
    }

    /**
     * @param TblPerson $tblPerson
     *
     * @return Layout
     */
    public function frontendLayoutPerson(TblPerson $tblPerson)
    {

        $tblMailAll = Mail::useService()->getMailAllByPerson($tblPerson);
        if ($tblMailAll !== false) {
            array_walk($tblMailAll, function (TblToPerson &$tblToPerson) {

                $Panel = array($tblToPerson->getTblMail()->getAddress());
                if ($tblToPerson->getRemark()) {
                    array_push($Panel, new Muted(new Small($tblToPerson->getRemark())));
                }

                $tblToPerson = new LayoutColumn(
                    new Panel(
                        new MailIcon().' '.$tblToPerson->getTblType()->getName(), $Panel, Panel::PANEL_TYPE_SUCCESS,

                        new Standard(
                            '', '/People/Person/Mail/Edit', new Pencil(),
                            array('Id' => $tblToPerson->getId()),
                            'Bearbeiten'
                        )
                        .new Standard(
                            '', '/People/Person/Mail/Destroy', new Remove(),
                            array('Id' => $tblToPerson->getId()), 'Löschen'
                        )
                    )
                    , 3);
            });
        }

        $tblRelationshipAll = Relationship::useService()->getPersonRelationshipAllByPerson($tblPerson);
        if ($tblRelationshipAll) {
            foreach ($tblRelationshipAll as $tblRelationship) {
                if ($tblRelationship->getServiceTblPersonTo() && $tblRelationship->getServiceTblPersonFrom()) {
                    if ($tblPerson->getId() != $tblRelationship->getServiceTblPersonFrom()->getId()) {
                        $tblRelationshipMailAll = Mail::useService()->getMailAllByPerson($tblRelationship->getServiceTblPersonFrom());
                        if ($tblRelationshipMailAll) {
                            foreach ($tblRelationshipMailAll as $tblMail) {

                                $Panel = array($tblMail->getTblMail()->getAddress());
                                if ($tblMail->getRemark()) {
                                    array_push($Panel, new Muted(new Small($tblMail->getRemark())));
                                }

                                $tblMail = new LayoutColumn(
                                    new Panel(
                                        new MailIcon().' '.$tblMail->getTblType()->getName(), $Panel, Panel::PANEL_TYPE_DEFAULT,
                                        $tblRelationship->getServiceTblPersonFrom()->getFullName()
                                        . ' (' . $tblRelationship->getTblType()->getName() . ')'
                                    )
                                    , 3);

                                if ($tblMailAll !== false) {
                                    $tblMailAll[] = $tblMail;
                                } else {
                                    $tblMailAll = array();
                                    $tblMailAll[] = $tblMail;
                                }

                            }
                        }
                    }
                }
            }
        }

        if ($tblMailAll === false) {
            $tblMailAll = array(
                new LayoutColumn(
                    new Warning('Keine E-Mail Adressen hinterlegt')
{'fraction_non_alphanumeric': 0.11076443057722309, 'fraction_numerical': 0.0002539636469179697, 'mean_word_length': 1.3381117991347866, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 184, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 63, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2999313', 'n_tokens_mistral': 7055, 'n_tokens_neox': 6745, 'n_words': 1153}