<commit_before><?php

require_once TRIPOD_DIR . 'mongo/MongoTripodConstants.php';
require_once TRIPOD_DIR . 'mongo/base/MongoTripodBase.class.php';

class MongoTripodTables extends MongoTripodBase implements SplObserver
{
    /**
     * Modifier config - list of allowed functions and their attributes that can be passed through in tablespecs.json
     * Note about the "true" value - this is so that the keys are defined as keys rather than values. If we move to
     * a json schema we could define the types of attribute and whether they are required or not
     * @var array
     * @static
     */
    public static $predicateModifiers = array(
        'join' => array(
            'glue' => true,
            'predicates' => true
        ),
        'lowercase' => array(
            'predicates' => true
        ),
        'date' => array(
            'predicates' => true
        )
    );

    /**
     * Computed field config - A list of valid functions to write dynamic table row field values
     *
     * @var array
     * @static
     */
    public static $computedFieldFunctions = array('_conditional_', "_replace_", "_arithmetic_");

    /**
     * Computed conditional config - list of allowed conditional operators
     *
     * @var array
     * @static
     */
    public static $conditionalOperators = array(
        ">","<",">=", "<=", "==", "!=", "contains", "not contains"
    );

    public static $arithmeticOperators = array(
        "+", "-", "*", "/", "%"
    );

    /**
     * Construct accepts actual objects rather than strings as this class is a delegate of
     * MongoTripod and should inherit connections set up there
     * @param string $storeName
     * @param MongoCollection $collection
     * @param $defaultContext
     * @param $stat
     */
    function __construct($storeName,MongoCollection $collection,$defaultContext,$stat=null)
    {
        $this->labeller = new MongoTripodLabeller();
        $this->storeName = $storeName;
        $this->collection = $collection;
        $this->podName = $collection->getName();
        $this->config = MongoTripodConfig::getInstance();
        $this->defaultContext = $this->labeller->uri_to_alias($defaultContext); // make sure default context is qnamed if applicable
        $this->stat = $stat;
    }

    /**
     * (PHP 5 &gt;= 5.1.0)<br/>
     * Receive update from subject
     * @link http://php.net/manual/en/splobserver.update.php
     * @param SplSubject $subject <p>
     * The <b>SplSubject</b> notifying the observer of an update.
     * </p>
     * @return void
     */<commit_msg>Formatting/docs<commit_after><?php

require_once TRIPOD_DIR . 'mongo/MongoTripodConstants.php';
require_once TRIPOD_DIR . 'mongo/base/MongoTripodBase.class.php';

class MongoTripodTables extends MongoTripodBase implements SplObserver
{
    /**
     * Modifier config - list of allowed functions and their attributes that can be passed through in tablespecs.json
     * Note about the "true" value - this is so that the keys are defined as keys rather than values. If we move to
     * a json schema we could define the types of attribute and whether they are required or not
     * @var array
     * @static
     */
    public static $predicateModifiers = array(
        'join' => array(
            'glue' => true,
            'predicates' => true
        ),
        'lowercase' => array(
            'predicates' => true
        ),
        'date' => array(
            'predicates' => true
        )
    );

    /**
     * Computed field config - A list of valid functions to write dynamic table row field values
     *
     * @var array
     * @static
     */
    public static $computedFieldFunctions = array('_conditional_', "_replace_", "_arithmetic_");

    /**
     * Computed conditional config - list of allowed conditional operators
     *
     * @var array
     * @static
     */
    public static $conditionalOperators = array(">","<",">=", "<=", "==", "!=", "contains", "not contains");

    /**
     * Computed arithmetic config - list of allowed arithmetic operators
     *
     * @var array
     * @static
     */
    public static $arithmeticOperators = array("+", "-", "*", "/", "%");

    /**
     * Construct accepts actual objects rather than strings as this class is a delegate of
     * MongoTripod and should inherit connections set up there
     * @param string $storeName
     * @param MongoCollection $collection
     * @param $defaultContext
     * @param $stat
     */
    function __construct($storeName,MongoCollection $collection,$defaultContext,$stat=null)
    {
        $this->labeller = new MongoTripodLabeller();
        $this->storeName = $storeName;
        $this->collection = $collection;
        $this->podName = $collection->getName();
        $this->config = MongoTripodConfig::getInstance();
        $this->defaultContext = $this->labeller->uri_to_alias($defaultContext); // make sure default context is qnamed if applicable
        $this->stat = $stat;
    }

    /**
     * (PHP 5 &gt;= 5.1.0)<br/>
     * Receive update from subject
     * @link http://php.net/manual/en/splobserver.update.php
     * @param SplSubject $subject <p>
     * The <b>SplSubject</b> notifying the observer of an update.
     * </p>
     * @return void
     */
{'fraction_non_alphanumeric': 0.12208088095690146, 'fraction_numerical': 0.0015188912094171254, 'mean_word_length': 2.512, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 51, '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': '407204', 'n_tokens_mistral': 1520, 'n_tokens_neox': 1470, 'n_words': 447}