<commit_before><?php
namespace LILPLP\IBA;

use Illuminate\Support\Facades\Storage;
use Illuminate\Http\Request;

use Illuminate\Support\Facades\Auth;
use App\Http\Middleware\EncryptCookies;
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
use Illuminate\Session\Middleware\StartSession;

use ParsedownExtra;

use Symfony\Component\Yaml\Yaml;

class Leaf {
	public $type;
    public $uri;
    protected $slug;
    public $base;
    
    function __construct($uri)
    {
	    $this->uri = $this->exists($uri);
// 	    dd($this->uri);
	    if ( $this->uri )
	    {
		    $uri_parts = explode('/', $uri);
			$uri_base = $uri_parts[0] . '/index.md';
			
			$this->constructBase();
			$this->menu = $this->constructMenu($uri_parts[0]);
	    }
	    return $this->uri;
    }
    
    public function exists($uri)
	{
		$file = rtrim($uri,'/') . ".md";
		$directory = $uri . "/index.md";
		$asset = $uri;
		if ( Storage::disk('leaves')->exists($file) ) {
			$this->type = "file";
			return $file;
		}
		if ( Storage::disk('leaves')->exists($directory) ) {
			$this->type = "directory";
			return $directory;
		}
		if ( Storage::disk('leaves')->exists($asset) ) {
			$this->type = "asset";
			return $asset;
		}
		return false;
	}
	
	public function constructBase()
	{
		$uri_parts = explode('/', $this->uri);
		$base = $uri_parts[0];
		if ( File::exists($base) )
		{
			$this->base = $this->retriveMetas($this->base['slug'], 'leaves');
			$this->base['slug'] = $uri_parts[0];
		}
	}
	
	
	public function cssStandards($content)
	{
		if ( !empty(config('iba.short_keys')) )
		{
			$cssStandards = config('iba.short_keys');
	        $keys = $values = array();
	        foreach ($cssStandards as $key => $value) {
			    $keys[] = '%' . $key . '%';
			    $values[] = $value;
	        }
	        return str_replace($keys, $values, $content);
        }
        return $content;
	}
    <commit_msg>corrections<commit_after><?php
namespace LILPLP\IBA;

use Illuminate\Support\Facades\Storage;
use Illuminate\Http\Request;

use Illuminate\Support\Facades\Auth;
use App\Http\Middleware\EncryptCookies;
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
use Illuminate\Session\Middleware\StartSession;

use ParsedownExtra;

use Symfony\Component\Yaml\Yaml;

class Leaf {
	public $type;
    public $uri;
    protected $slug;
    public $base;
    
    function __construct($uri)
    {
	    $this->uri = $this->exists($uri);
// 	    dd($this->uri);
	    if ( $this->uri )
	    {
		    $uri_parts = explode('/', $uri);
			$uri_base = $uri_parts[0] . '/index.md';
			
			$this->constructBase();
			$this->menu = $this->constructMenu($uri_parts[0]);
	    }
	    return $this->uri;
    }
    
    public function exists($uri)
	{
		$file = rtrim($uri,'/') . ".md";
		$directory = $uri . "/index.md";
		$asset = $uri;
		if ( Storage::disk('leaves')->exists($file) ) {
			$this->type = "file";
			return $file;
		}
		if ( Storage::disk('leaves')->exists($directory) ) {
			$this->type = "directory";
			return $directory;
		}
		if ( Storage::disk('leaves')->exists($asset) ) {
			$this->type = "asset";
			return $asset;
		}
		return false;
	}
	
	public function constructBase()
	{
		$uri_parts = explode('/', $this->uri);
		$base = $uri_parts[0];
		if ( File::exists($base) )
		{
			$this->base = $this->retriveMetas($base, 'leaves');
			$this->base['slug'] = $base;
		}
	}
	
	
	public function cssStandards($content)
	{
		if ( !empty(config('iba.short_keys')) )
		{
			$cssStandards = config('iba.short_keys');
	        $keys = $values = array();
	        foreach ($cssStandards as $key => $value) {
			    $keys[] = '%' . $key . '%';
			    $values[] = $value;
	        }
	        return str_replace($keys, $values, $content);
        }
        return $content;
	}
    
{'fraction_non_alphanumeric': 0.18799787573021773, 'fraction_numerical': 0.0018587360594795538, 'mean_word_length': 2.956932773109244, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 42, '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': '2520497', 'n_tokens_mistral': 1455, 'n_tokens_neox': 1344, 'n_words': 236}