<commit_before><?php

namespace AppBundle\Twig;

use AppBundle\Utils\Markdown;

class AppExtension extends \Twig_Extension
{
    private $parser;

    public function __construct(Markdown $parser)
    {
        $this->parser = $parser;
    }

    public function getFilters()
    {
        return array(
            new \Twig_SimpleFilter(
                'md2html',
                array($this, 'markdownToHtml'),
                array('is_safe' => array('html'))
            ),
             new \Twig_SimpleFilter(
                'pl2ascii',
                array($this, 'pl2asciiFiletr'),
            ),           
            
        );
    }

    public function markdownToHtml($content)
    {
        return $this->parser->toHtml($content);
    }
    
    public function pl2asciiFiletr($content)
    {
        $search  = array('ą','ć','ę','ł','ń','ó','ś','ż','ź','Ą','Ć','Ę','Ł','Ń','Ó','Ś','Ż','Ź',);
        $replace = array('a','c','e','l','n','o','s','z','z','A','C','E','L','N','O','S','Z','Z',);
        $subject = 'A';
        return str_replace($search, $replace, $content);        
    }    

    public function getName()
    {
        return 'app_extension';
    }
}
<commit_msg>Filter<commit_after><?php

namespace AppBundle\Twig;

use AppBundle\Utils\Markdown;

class AppExtension extends \Twig_Extension
{
    private $parser;

    public function __construct(Markdown $parser)
    {
        $this->parser = $parser;
    }

    public function getFilters()
    {
        return array(
            new \Twig_SimpleFilter(
                'md2html',
                array($this, 'markdownToHtml'),
                array('is_safe' => array('html'))
            ),
             new \Twig_SimpleFilter(
                'pl2ascii',
                array($this, 'pl2asciiFilter'),
            ),           
            
        );
    }

    public function markdownToHtml($content)
    {
        return $this->parser->toHtml($content);
    }
    
    public function pl2asciiFilter($content)
    {
        $search  = array('ą','ć','ę','ł','ń','ó','ś','ż','ź','Ą','Ć','Ę','Ł','Ń','Ó','Ś','Ż','Ź',);
        $replace = array('a','c','e','l','n','o','s','z','z','A','C','E','L','N','O','S','Z','Z',);
        $subject = 'A';
        return str_replace($search, $replace, $content);        
    }    

    public function getName()
    {
        return 'app_extension';
    }
}

{'fraction_non_alphanumeric': 0.19071518193224593, 'fraction_numerical': 0.003345880384776244, 'mean_word_length': 1.986267166042447, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '347909', 'n_tokens_mistral': 759, 'n_tokens_neox': 752, 'n_words': 114}