<commit_before>
function url(val){

  var a =  document.createElement('a');
  a.href = val;

  return {
    href: a.href,
    hash: a.hash,
    port: a.port,
    protocol: a.protocol,
    // functions
    pathname: pathname,
    parmas: params,
    query: query,
    origin: origin,
    beforeHash: beforeHash,

    all: function(){
      return {
        port: a.port,
        protocol: a.protocol,
        hostname: a.hostname,
        pathname: pathname(),
        parmas: params(),
        query: query(),
        origin: origin(),
      }
    }
  }

  function beforeHash(){
    return a.href.replace(/#.*/, '')
  }

  function pathname(){
    var ppx = a.pathname || '/'+ a.pathname; // fix IE bug.
    return ppx.replace(/^([^\/])/,'/$1')
  }

  function params(){
    return clean(a.pathname.replace(/^\//,'').split('/'),'')
  }

  function query(){
    var ret = {}
    var seg = a.search.replace(/^\?/,'').split('&')
    var len = seg.length
    for (var i=0; i<len; i++) {
      if (!seg[i]) continue<commit_msg>ready to release 0.7.0 -2<commit_after>
function url(val){

  var a =  document.createElement('a');
  a.href = val;

  return {
    href: a.href,
    hash: a.hash,
    port: a.port,
    protocol: a.protocol,
    // functions
    pathname: pathname,
    params: params,
    query: query,
    origin: origin,
    beforeHash: beforeHash,

    all: function(){
      return {
        port: a.port,
        protocol: a.protocol,
        hostname: a.hostname,
        pathname: pathname(),
        params: params(),
        query: query(),
        origin: origin(),
      }
    }
  }

  function beforeHash(){
    return a.href.replace(/#.*/, '')
  }

  function pathname(){
    var ppx = a.pathname || '/'+ a.pathname; // fix IE bug.
    return ppx.replace(/^([^\/])/,'/$1')
  }

  function params(){
    return clean(a.pathname.replace(/^\//,'').split('/'),'')
  }

  function query(){
    var ret = {}
    var seg = a.search.replace(/^\?/,'').split('&')
    var len = seg.length
    for (var i=0; i<len; i++) {
      if (!seg[i]) continue
{'fraction_non_alphanumeric': 0.1890184645286686, 'fraction_numerical': 0.003887269193391642, 'mean_word_length': 2.0915915915915915, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5852214', 'n_tokens_mistral': 715, 'n_tokens_neox': 699, 'n_words': 167}