<commit_before>var cheerio = require('cheerio');

module.exports = function (file, classLibrary, idLibrary) {
    var $ = cheerio.load(file);
    var c = $('[ng-class]');
        var allmatches = [];
        c.each(function(i, el){
            var t = $(el).attr('ng-class');
            var r = t.match(/".*?"/g);
            for (var j in r){
                allmatches.push(r[j].replace(/"/g, ''));
            }
        })
    var f = file;
    for(var i in allmatches){
        f = f.replace(new RegExp(allmatches[i], 'g'), function(attr){
            return classLibrary.get(attr);
        });
    }
    return f;    
};<commit_msg>changes<commit_after>module.exports = function (file, classLibrary, idLibrary) {
    var myRegexp = /ng-class="(.*?)"/g;
    var match = myRegexp.exec(file);
    var allmatches = [];
    while (match != null) {
        console.log(match);
        var r = match[1].match(/'.*?'/g);
        for (var j in r){
            allmatches.push(r[j].replace(/'/g, ''));
        }
        match = myRegexp.exec(file);
    }
    var f = file;
    for(var i in allmatches){
        f = f.replace(new RegExp(allmatches[i], 'g'), function(attr){
            return classLibrary.get(attr);
        });
    }
    return f;    
};
{'fraction_non_alphanumeric': 0.1808, 'fraction_numerical': 0.0008, 'mean_word_length': 1.9574468085106382, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3759543', 'n_tokens_mistral': 416, 'n_tokens_neox': 412, 'n_words': 89}