<commit_before><?php
// src/Mondel/CuentaloBundle/Twig/Extensions/MondelCuentaloExtension.php

namespace Mondel\CuentaloBundle\Twig\Extensions;

class MondelCuentaloExtension extends \Twig_Extension
{
    public function getFilters()
    {
        return array(
            'created_ago' 	=> new \Twig_Filter_Method($this, 'createdAgo'),
			'cut_title' 	=> new \Twig_Filter_Method($this, 'cutTitle'),        		
        );
    }

    public function cutTitle($title)
    {
    	$title = trim($title);
    	$pattern = '/(http:\/\/|www\.).*/i';
    	if (preg_match($pattern, $title))
    		$title = preg_replace($pattern, '', $title);
    	if (strlen($title) > 50)
    		return substr($title, 0, 47) . '...';
    	else if (strlen($title) == 0)
    		$title = "Una Red Social Diferente, Desahogate Y Comparte Lo Que Te Gusta Anonimamente";
    	return $title;	
    }
    
    public function createdAgo(\DateTime $dateTime)
    {
        $delta = time() - $dateTime->getTimestamp();
        if ($delta < 0)
            throw new \Exception("createdAgo is unable to handle dates in the future");

        $duration = "";
        if ($delta < 60)
        {<commit_msg>modificado titulo luego de arreglar el publicar videos<commit_after><?php
// src/Mondel/CuentaloBundle/Twig/Extensions/MondelCuentaloExtension.php

namespace Mondel\CuentaloBundle\Twig\Extensions;

class MondelCuentaloExtension extends \Twig_Extension
{
    public function getFilters()
    {
        return array(
            'created_ago' 	=> new \Twig_Filter_Method($this, 'createdAgo'),
			'cut_title' 	=> new \Twig_Filter_Method($this, 'cutTitle'),        		
        );
    }

    public function cutTitle($title)
    {
    	$title = trim($title);
    	$title_length = strlen($title);
    	if ($title_length > 50)
    		$title = substr($title, 0, 47) . '...';
    	else if ($title_length == 0)
    		$title = "Una Red Social Diferente, Desahogate Y Comparte Lo Que Te Gusta Anonimamente";
    	return $title;	
    }
    
    public function createdAgo(\DateTime $dateTime)
    {
        $delta = time() - $dateTime->getTimestamp();
        if ($delta < 0)
            throw new \Exception("createdAgo is unable to handle dates in the future");

        $duration = "";
        if ($delta < 60)
        {
{'fraction_non_alphanumeric': 0.13259911894273127, 'fraction_numerical': 0.007929515418502203, 'mean_word_length': 2.5876777251184833, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, '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': '4045588', 'n_tokens_mistral': 769, 'n_tokens_neox': 741, 'n_words': 171}