<commit_before>var templateManager = function(fs) {

    //Private members
    var _fs = fs;
    var templatePath = "";
    var viewsPath = "";
    var templateContent = null;
    var fileEncoding = "utf-8";

    //Loads template html content from cache or fom file
    function loadTemplate() {
        return _fs.readFileSync(templatePath, fileEncoding);
    }

    function loadView(viewName, callback) {
        _fs.readFile(viewsPath + viewName,fileEncoding, function(err, content) {
            if (err) throw err;
            callback(content);
        });
    }

    //public members
    this.init = function(template, viewsFolder) {
        templatePath = template;
        viewsPath = viewsFolder;
        templateContent = loadTemplate();
    }

    this.processView = function(viewName, params) {

        if (templatePath.length <= 0) {
            throw "template not specified";
        }

        if (viewsPath.length <= 0) {
            throw "view directory not specified";
        }

        var templatePattern = /@[[a-zA-Z0-9]+]/g;
        var viewPattern = />>[A-Za-z0-9]+:\n{1}(.+\n)*<</g;
        var templatePlaceholders = templateContent.match(templatePattern);
        
        loadView(viewName,function(viewContent){
            debugger;
            var viewTags = viewContent.match(viewPattern);
            debugger;
        });<commit_msg>cdpace: fixed viewpattern<commit_after>var templateManager = function(fs) {

    //Private members
    var _fs = fs;
    var templatePath = "";
    var viewsPath = "";
    var templateContent = null;
    var fileEncoding = "utf-8";

    //Loads template html content from cache or fom file
    function loadTemplate() {
        return _fs.readFileSync(templatePath, fileEncoding);
    }

    function loadView(viewName, callback) {
        _fs.readFile(viewsPath + viewName,fileEncoding, function(err, content) {
            if (err) throw err;
            callback(content);
        });
    }

    //public members
    this.init = function(template, viewsFolder) {
        templatePath = template;
        viewsPath = viewsFolder;
        templateContent = loadTemplate();
    }

    this.processView = function(viewName, params) {

        if (templatePath.length <= 0) {
            throw "template not specified";
        }

        if (viewsPath.length <= 0) {
            throw "view directory not specified";
        }

        var templatePattern = /@[[a-zA-Z0-9]+]/g;
        var templatePlaceholders = templateContent.match(templatePattern);
        
        loadView(viewName,function(viewContent){
            debugger;
            var viewPattern = />>[A-Za-z0-9]+:(\r\n){1}(.+\r\n)*<</g;
            var viewTags = viewContent.match(viewPattern);
            debugger;
        });
{'fraction_non_alphanumeric': 0.11749819233550253, 'fraction_numerical': 0.005784526391901663, 'mean_word_length': 2.176808266360505, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 7, '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': '3445210', 'n_tokens_mistral': 787, 'n_tokens_neox': 760, 'n_words': 178}