<commit_before>import { TagClass } from './manager.interfaces';
import { Tag } from './tag.class';
import { Entity } from './entity.class';
import { QueryExecutor } from './executor.class';
import { Query } from './query.class';
import * as _ from 'underscore';

export class Manager {
    public queryEntities(query: Query): Entity[] {
        return this.exeutor.execute(query);
    }

    public createEntity(): Entity {
        let lEntity = new Entity(_.uniqueId('ent'));
        this.entities.push(lEntity);
        return lEntity;
    }

    public createTag<T>(defaultValue?: T): TagClass<T> {
        let lIdentifier = _.uniqueId('tag');
        // @TODO: register tag class within the tree
        return this.generateTagClass(lIdentifier, defaultValue);
    }



    private entities: Entity[] = [];
    private exeutor: QueryExecutor = new QueryExecutor(this.entities);

    private generateTagClass<T>(identifier: string, defaultValue?: T): TagClass<T> {
        // tslint:disable:max-classes-per-file
        return class extends Tag<T> {
            public static toString(): string { return identifier; }<commit_msg>minor improvements<commit_after>import { TagClass } from './manager.interfaces';
import { Tag } from './tag.class';
import { Entity } from './entity.class';
import { QueryExecutor } from './executor.class';
import { Query } from './query.class';
import * as _ from 'underscore';



export class Manager {
    public queryEntities(query: Query): Entity[] {
        return this.executor.execute(query);
    }

    public createEntity(): Entity {
        return this.entities[this.entities.push(new Entity(_.uniqueId('ent'))) - 1];
    }

    public createTag<T>(defaultValue?: T): TagClass<T> {
        let lIdentifier = _.uniqueId('tag');
        // @TODO: register tag class within the tree
        return this.generateTagClass(lIdentifier, defaultValue);
    }



    private entities: Entity[] = [];
    private executor: QueryExecutor = new QueryExecutor(this.entities);

    private generateTagClass<T>(identifier: string, defaultValue?: T): TagClass<T> {
        // tslint:disable:max-classes-per-file
        return class extends Tag<T> {
            public static toString(): string { return identifier; }
{'fraction_non_alphanumeric': 0.13324420677361853, 'fraction_numerical': 0.000445632798573975, 'mean_word_length': 3.2438563327032135, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '3584479', 'n_tokens_mistral': 624, 'n_tokens_neox': 611, 'n_words': 168}