<commit_before>'use strict';

import NearestNeighborIndexProcessor from './NearestNeighborIndexProcessor';

class FixationsDataProcessor {

    constructor() {
        this.fixationsData = [];
        this.nniProcessor = new NearestNeighborIndexProcessor();
    }

    getScreenResolution(fileContentsAsArray)
    {
        let firstLine = fileContentsAsArray[0];
        let resolution = firstLine.split(' ');

        return {
            width: parseInt(resolution[0]),
            height: parseInt(resolution[1])
        }
    }

    process(fileContentsAsArray)
    {
        fileContentsAsArray.splice(0, 1);

        for(let c in fileContentsAsArray) {
            let lineItems = fileContentsAsArray[c].split(' ');

            this.addItemToMinute([lineItems[1], lineItems[2]], this.getMinuteFromTimestamp(parseInt(lineItems[0])));
        }

        for(let i in this.fixationsData) {
            this.fixationsData[i]['nni'] = this.nniProcessor.calculate(this.fixationsData[i].points);
        }

        return this.fixationsData;
    }

    addItemToMinute(point, minute)
    {
        if(this.fixationsData[minute] === undefined) {
            this.fixationsData[minute] = {
                points: [point]
            }
        } else {
            this.fixationsData[minute].points.push(point);
        }
    }

    getMinuteFromTimestamp(timestamp) {
        let minute = Math.floor(timestamp * 1.67 * 0.00001);
        return minute;
    }

}
<commit_msg>Fix formula as requested in review<commit_after>'use strict';

import NearestNeighborIndexProcessor from './NearestNeighborIndexProcessor';

class FixationsDataProcessor {

    constructor() {
        this.fixationsData = [];
        this.nniProcessor = new NearestNeighborIndexProcessor();
    }

    getScreenResolution(fileContentsAsArray)
    {
        let firstLine = fileContentsAsArray[0];
        let resolution = firstLine.split(' ');

        return {
            width: parseInt(resolution[0]),
            height: parseInt(resolution[1])
        }
    }

    process(fileContentsAsArray)
    {
        fileContentsAsArray.splice(0, 1);

        for(let c in fileContentsAsArray) {
            let lineItems = fileContentsAsArray[c].split(' ');

            this.addItemToMinute([lineItems[1], lineItems[2]], this.getMinuteFromTimestamp(parseInt(lineItems[0])));
        }

        for(let i in this.fixationsData) {
            this.fixationsData[i]['nni'] = this.nniProcessor.calculate(this.fixationsData[i].points);
        }

        return this.fixationsData;
    }

    addItemToMinute(point, minute)
    {
        if(this.fixationsData[minute] === undefined) {
            this.fixationsData[minute] = {
                points: [point]
            }
        } else {
            this.fixationsData[minute].points.push(point);
        }
    }

    getMinuteFromTimestamp(timestamp) {
        let minute = Math.floor(timestamp / 1000 / 60);
        return minute;
    }

}

{'fraction_non_alphanumeric': 0.11276164753544902, 'fraction_numerical': 0.010465901417960837, 'mean_word_length': 2.3594104308390023, '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': '5006839', 'n_tokens_mistral': 881, 'n_tokens_neox': 845, 'n_words': 131}