<commit_before>module.exports = function(inString) {
  var number = parseInt(inString);

  if(/^\d+\.?\d*\s*k(ilo)?\w+$/.test(inString)) {
    return number * 1000;
  }

  if(/^\d+\.?\d*\s*c(enti)?\w+$/.test(inString)) {
    return number / 100;
  }

  if(/^\d+\.?\d*\s*(M|mega)\w+$/.test(inString)) {
    return number * Math.pow(1000, 2);
  }

  if(/^\d+\.?\d*\s*(G|giga)\w+$/.test(inString)) {
    return number * Math.pow(1000, 3);
  }

  if(/^\d+\.?\d*\s*(T|tera)\w+$/.test(inString)) {
    return number * Math.pow(1000, 4);
  }

  else return number;
<commit_msg>Code cleanup<commit_after>var prefixes = {
  centi: -2, c: -2,
  kilo:   3, k:  3,
  mega:   6, M:  6,
  giga:   9, G:  9,
  tera:  12, T: 12,
};
var matchers = Object.keys(prefixes).map(function(prefix) {
  return {
    prefix: prefix,
    multiplier: Math.pow(10, prefixes[prefix]),
    regex: new RegExp('^\\d+\\.?\\d*\\s*' + prefix + '\\w+$'),
  };
});

module.exports = function(inString) {
  var number = parseInt(inString);
  for (var i = 0; i < matchers.length; i++) {
    if(matchers[i].regex.test(inString)) {
      return number * matchers[i].multiplier;
    }
  }
  return number;
{'fraction_non_alphanumeric': 0.23924268502581755, 'fraction_numerical': 0.031841652323580036, 'mean_word_length': 2.825657894736842, 'pattern_counts': {'":': 0, '<': 4, '<?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': '4571836', 'n_tokens_mistral': 521, 'n_tokens_neox': 479, 'n_words': 86}