<commit_before>'use strict';
var process=require('./process.js');
var Util=require('./util.js');


function transmittance(experiment, reference) {
    var results=[];
    for (var i=0; i<experiment.length; i++) {
        var result=-Math.log10(experiment[i]/reference[i])*100;
        results.push(result);
    }
    return results;
}

function absorbance(experiment, reference) {
    var results=[];
    for (var i=0; i<experiment.length; i++) {
        var result=experiment[i]/reference[i]*100;
        results.push(result);
    }
    return results;
}



var difference=['r','q','p','o','n','m','l','k','j','%','J','K','L','M','N','O','P','Q','R'];

function parseData(lines) {
    var y=[];
    var currentValue=0;
    for (var i=0; i<lines.length; i++) {
        var line=lines[i];
        var fields=lines[i].split(/( ?(?=[a-zA-Z%])| +(?=[^a-zA-Z%]))/);
        for (var j=0; j<fields.length; j++) {
            var field=fields[j];
            if (field.trim().length>0) {
                // we check if we convert the first character
                if (field.match(/^[j-rJ-R%]/)) {
                    var firstChar=field.substring(0,1);
                    var value=difference.indexOf(firstChar)-9;
                    currentValue+=(value+field.substr(1))>>0;
                } else {
                    currentValue=fields[j]>>0;
                }
                y.push(currentValue);<commit_msg>Fix absorbance / transmittance formula<commit_after>'use strict';
var process=require('./process.js');
var Util=require('./util.js');


function absorbance(experiment, reference) {
    var results=[];
    for (var i=0; i<experiment.length; i++) {
        var result=-Math.log10(experiment[i]/reference[i]);
        results.push(result);
    }
    return results;
}

function transmittance(experiment, reference) {
    var results=[];
    for (var i=0; i<experiment.length; i++) {
        var result=experiment[i]/reference[i]*100;
        results.push(result);
    }
    return results;
}



var difference=['r','q','p','o','n','m','l','k','j','%','J','K','L','M','N','O','P','Q','R'];

function parseData(lines) {
    var y=[];
    var currentValue=0;
    for (var i=0; i<lines.length; i++) {
        var line=lines[i];
        var fields=lines[i].split(/( ?(?=[a-zA-Z%])| +(?=[^a-zA-Z%]))/);
        for (var j=0; j<fields.length; j++) {
            var field=fields[j];
            if (field.trim().length>0) {
                // we check if we convert the first character
                if (field.match(/^[j-rJ-R%]/)) {
                    var firstChar=field.substring(0,1);
                    var value=difference.indexOf(firstChar)-9;
                    currentValue+=(value+field.substr(1))>>0;
                } else {
                    currentValue=fields[j]>>0;
                }
                y.push(currentValue);
{'fraction_non_alphanumeric': 0.20035149384885764, 'fraction_numerical': 0.013005272407732865, 'mean_word_length': 2.317016317016317, 'pattern_counts': {'":': 0, '<': 11, '<?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': '3250273', 'n_tokens_mistral': 957, 'n_tokens_neox': 909, 'n_words': 166}