<commit_before>module.exports = function(line) {
  var components = line.split(',');
  console.log(components);

  if(components.length && components[0]) {
    var collection = components[0];
    var aggregation = collection.split('.')[1];
    var deviceId = components[1].split('=')[1];
    var deviceType = components[2].split('=')[1];
    var hub = components[3].split('=')[1];
    var averageComponents = components[4].split(' ');
    var deviceStream = averageComponents[0].split('=')[1];
    var value = averageComponents[1].split('=')[1];
    var timestamp = parseInt(averageComponents[2]) / 1000000;
    var data = {hub: hub, topic: deviceType+'/'+deviceId+'/'+deviceStream, value: value, timestamp: timestamp, aggregation: aggregation};
    return {collection: collection, data: data};
  } else {
    return null;
  }
}<commit_msg>Should parse the value as a float so it's conveyed that way in JSON.<commit_after>module.exports = function(line) {
  var components = line.split(',');
  console.log(components);

  if(components.length && components[0]) {
    var collection = components[0];
    var aggregation = collection.split('.')[1];
    var deviceId = components[1].split('=')[1];
    var deviceType = components[2].split('=')[1];
    var hub = components[3].split('=')[1];
    var averageComponents = components[4].split(' ');
    var deviceStream = averageComponents[0].split('=')[1];
    var value = averageComponents[1].split('=')[1];
    var timestamp = parseInt(averageComponents[2]) / 1000000;
    var data = {hub: hub, topic: deviceType+'/'+deviceId+'/'+deviceStream, value: parseFloat(value), timestamp: timestamp, aggregation: aggregation};
    return {collection: collection, data: data};
  } else {
    return null;
  }
}
{'fraction_non_alphanumeric': 0.17630223239839726, 'fraction_numerical': 0.025186033199771037, 'mean_word_length': 4.549206349206349, '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': '4853617', 'n_tokens_mistral': 542, 'n_tokens_neox': 516, 'n_words': 125}