<commit_before>var formats = require("./formats"),
    _ = require("underscore");

var Halpert = module.exports = function(initialData, mediaType) {
  var self = this;
  this.formats = formats;

  this.initialData = initialData;
  this.mediaType = mediaType;

  this.parse = function() {
    if (this.mediaType === 'hyperdescribe') {
      this.parsed = this.initialData;
    } else {
      this.parsed = this.formats[mediaType].parse(this.initialData);
    }
    return self;
  }

  this.convertTo = function(toFormat) {
    if (!this.parsed) this.parse();
    if(!this.initialData || this.formats[toFormat] == undefined) return undefined;
    var data = (this.initialData && !this.parsed) ? this.initialData : this.parsed;
    return this.formats[toFormat].build(data);
  }

  this.reset = function() {
    delete this.initialData;
    delete this.parsedData;
  }

  return self;
}


<commit_msg>Fix spacing<commit_after>var formats = require("./formats"),
    _ = require("underscore");

var Halpert = module.exports = function(initialData, mediaType) {
  var self = this;
  this.formats = formats;

  this.initialData = initialData;
  this.mediaType = mediaType;

  this.parse = function() {
    if (this.mediaType === 'hyperdescribe') {
      this.parsed = this.initialData;
    } else {
      this.parsed = this.formats[mediaType].parse(this.initialData);
    }
    return self;
  }

  this.convertTo = function(toFormat) {
    if (!this.parsed) this.parse();
    if (!this.initialData || this.formats[toFormat] == undefined) return undefined;
    var data = (this.initialData && !this.parsed) ? this.initialData : this.parsed;
    return this.formats[toFormat].build(data);
  }

  this.reset = function() {
    delete this.initialData;
    delete this.parsedData;
  }

  return self;
}



{'fraction_non_alphanumeric': 0.1403899721448468, 'fraction_numerical': 0.0, 'mean_word_length': 3.39119804400978, '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': '294754', 'n_tokens_mistral': 581, 'n_tokens_neox': 574, 'n_words': 114}