<commit_before>var Routington = require('./routington')

Routington.parse = function (string) {
  var options = Parse(string)

  if (!options || (
    !options.name &&
    !options.regex &&
    !Object.keys(options.string).length
  )) throw new Error('Invalid parsed string: ' + string)

  return options
}

function Parse(string) {
  var og = string
  var options = {
    name: '',
    string: {},
    regex: ''
  }

  // Check for trailing ?
  if (string[string.length - 1] === '?') {
    string = string.slice(0, -1)
    options.string[''] = true
  }

  // Is a simple string
  if (isValidSlug(string)) {
    options.string[string] = true
    return options
  }

  // Pipe-separated strings
  if (/^[\w-][\w\|-]+[\w-]$/.test(string)) {
    string.split('|').forEach(function (x) {
      options.string[x] = true
    })
    return options<commit_msg>ooo well all that was unnecessary<commit_after>var Routington = require('./routington')

Routington.parse = function (string) {
  var options = Parse(string)
  if (!options)
    throw new Error('Invalid parsed string: ' + string)

  return options
}

function Parse(string) {
  var og = string
  var options = {
    name: '',
    string: {},
    regex: ''
  }

  // Check for trailing ?
  if (string[string.length - 1] === '?') {
    string = string.slice(0, -1)
    options.string[''] = true
  }

  // Is a simple string
  if (isValidSlug(string)) {
    options.string[string] = true
    return options
  }

  // Pipe-separated strings
  if (/^[\w-][\w\|-]+[\w-]$/.test(string)) {
    string.split('|').forEach(function (x) {
      options.string[x] = true
    })
    return options
{'fraction_non_alphanumeric': 0.1724770642201835, 'fraction_numerical': 0.003669724770642202, 'mean_word_length': 2.7181818181818183, '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': '5342110', 'n_tokens_mistral': 552, 'n_tokens_neox': 535, 'n_words': 127}