<commit_before><?php namespace Landscape;

    if(file_exists("vendor/landscape/landscape.php.model/fields.php") === false)
    {
        print("## Using local fileds file\n");
        require_once('fields.php');
    }
    else
        require_once("vendor/landscape/landscape.php.model/fields.php");

    abstract class DatabaseModel
    {
        protected $fields  = [];
        protected $version = 1;
        protected $database = "landscape.db";

        public $keys; // This variable must be set by the user

        public final function __construct($op="", $args=NULL) //op -> operation e.g. find ; args = arguments for op, e.g. { name => test }
        {
            foreach($this->keys as $key => $value)
            {
                $this->fields[$key] = new $value($key, []);
            }
            $this->checkTable();
        }

        protected final function checkTable()
        {
            $querry = "CREATE TABLE IF NOT EXISTS ".explode("\\",static::class)[1]." (\nID INTEGER PRIMARY KEY AUTOINCREMENT,\n";
            $first = true;
            foreach($this->keys as $key => $value)
            {
                if($first == false)
                {
                    $querry = $querry.",\n";
                }
                else
                    $first = false;

                $sql = $this->fields[$key].getSQLDefinition();
                $querry = $querry." ".$key." ".$sql;
            }
            print($querry);
            print_r($this);
        }
    }

?><commit_msg>Fixed stupid typo<commit_after><?php namespace Landscape;

    if(file_exists("vendor/landscape/landscape.php.model/fields.php") === false)
    {
        print("## Using local fileds file\n");
        require_once('fields.php');
    }
    else
        require_once("vendor/landscape/landscape.php.model/fields.php");

    abstract class DatabaseModel
    {
        protected $fields  = [];
        protected $version = 1;
        protected $database = "landscape.db";

        public $keys; // This variable must be set by the user

        public final function __construct($op="", $args=NULL) //op -> operation e.g. find ; args = arguments for op, e.g. { name => test }
        {
            foreach($this->keys as $key => $value)
            {
                $this->fields[$key] = new $value($key, []);
            }
            $this->checkTable();
        }

        protected final function checkTable()
        {
            $querry = "CREATE TABLE IF NOT EXISTS ".explode("\\",static::class)[1]." (\nID INTEGER PRIMARY KEY AUTOINCREMENT,\n";
            $first = true;
            foreach($this->keys as $key => $value)
            {
                if($first == false)
                {
                    $querry = $querry.",\n";
                }
                else
                    $first = false;

                $sql = $this->fields[$key]->getSQLDefinition();
                $querry = $querry." ".$key." ".$sql;
            }
            $querry = $querry."\n);";
            print($querry);
        }
    }

?>
{'fraction_non_alphanumeric': 0.14837864395676384, 'fraction_numerical': 0.0013101867016049786, 'mean_word_length': 1.5386533665835411, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 24, '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': '6370414', 'n_tokens_mistral': 876, 'n_tokens_neox': 835, 'n_words': 193}