<commit_before>/**
 * Created by Rohail on 6/17/2017.
 */

const ipc = require('electron').ipcRenderer;
const csvParser = require('csvtojson');

const selectDirBtn = document.getElementById('fileClicker');

selectDirBtn.addEventListener('click', function (event) {
  ipc.send('open-file-dialog')
});
let data = [];
ipc.on('selected-directory', function (event, path) {
  csvParser()
    .fromFile(path[0])
    .on('json',(jsonObj)=>{
      data.push(jsonObj);
    })<commit_msg>normalize data<commit_after>/**
 * Created by Rohail on 6/17/2017.
 */

const ipc = require('electron').ipcRenderer;
const csvParser = require('csvtojson');

const selectDirBtn = document.getElementById('fileClicker');

selectDirBtn.addEventListener('click', function (event) {
  ipc.send('open-file-dialog')
});
let data = [];
ipc.on('selected-directory', function (event, path) {
  csvParser()
    .fromFile(path[0])
    .on('json',(jsonObj)=>{
      for(let prop in jsonObj){
        if(jsonObj.hasOwnProperty(prop))
          if(jsonObj[prop] === "")
            jsonObj[prop] = "None"
      }
      data.push(jsonObj);
    })
{'fraction_non_alphanumeric': 0.17779783393501805, 'fraction_numerical': 0.01444043321299639, 'mean_word_length': 4.018099547511312, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6579857', 'n_tokens_mistral': 378, 'n_tokens_neox': 360, 'n_words': 67}