<commit_before>(function(config, models, views, routers, utils) {

// The Router
// ---------------

routers.Application = Backbone.Router.extend({
  initialize: function() {
    // Using this.route, because order matters
    this.route(":user", 'user', this.start);
    this.route(/(.*\/.*)/, 'posts', this.posts);
    this.route(/(.*\/.*)\/(.*\.\w+)$/, 'post', this.post);
    this.route(/(.*\/.*)\/(.*\.\w+)(\/edit)$/, 'post', this.post);
    this.route(/(.*\/.*)\/new$/, 'new_post', this.newPost);
    this.route("", "start", this.start);
  },

  start: function(username) {
    if (confirmExit()) {
      app.state = {
        user: "",
        repo: "",
        branch: "",
        path: ""
      };
      app.instance.start(username);
    }
  },

  extractURL: function(url) {
    url = url.split('/');
    app.state = {
      user: url[0],
      repo: url[1],
      branch: url[2],
      path: (url.slice(3) || []).join('/')
    };
    return [url[0], app.state.repo, app.state.branch, app.state.path]
  },

  // #example-user/example-repo/gh-pages/path/to/new
  newPost: function(url) {
    if (confirmExit()) {
      app.instance.newPost.apply(this, this.extractURL(url));
    }
  },

  // #example-user/example-repo/gh-pages/path/to
  // #example-user/example-repo/gh-pages
  posts: function(url) {
    if (confirmExit()) {
      app.instance.posts.apply(this, this.extractURL(url));
    }
  },

  // #example-user/example-repo/gh-pages/path/to/2012-01-01.md
  post: function(url, file, edit) {
    if (confirmExit()) {
      var path = this.extractURL(url);
      app.state.file = file;
      app.instance.post.apply(this, path.concat(file).concat(!edit));
    }
  }
});

}).apply(this, window.args);
<commit_msg>Use dedicated route for profiles (user / organization).<commit_after>(function(config, models, views, routers, utils) {

// The Router
// ---------------

routers.Application = Backbone.Router.extend({
  initialize: function() {
    // Using this.route, because order matters
    this.route(":user", 'user', this.profile);
    this.route(/(.*\/.*)/, 'posts', this.posts);
    this.route(/(.*\/.*)\/(.*\.\w+)$/, 'post', this.post);
    this.route(/(.*\/.*)\/(.*\.\w+)(\/edit)$/, 'post', this.post);
    this.route(/(.*\/.*)\/new$/, 'new_post', this.newPost);
    this.route("", "start", this.start);
  },

  start: function(username) {
    if (confirmExit()) {
      app.state = {
        user: "",
        repo: "",
        branch: "",
        path: ""
      };
      app.instance.start(username);
    }
  },

  extractURL: function(url) {
    url = url.split('/');
    app.state = {
      user: url[0],
      repo: url[1],
      branch: url[2],
      path: (url.slice(3) || []).join('/')
    };
    return [url[0], app.state.repo, app.state.branch, app.state.path]
  },

  // #example-user
  // #example-organization
  profile: function(username) {
    if (confirmExit()) {
      app.instance.profile(username);
    }
  },

  // #example-user/example-repo/gh-pages/path/to/new
  newPost: function(url) {
    if (confirmExit()) {
      app.instance.newPost.apply(this, this.extractURL(url));
    }
  },

  // #example-user/example-repo/gh-pages/path/to
  // #example-user/example-repo/gh-pages
  posts: function(url) {
    if (confirmExit()) {
      app.instance.posts.apply(this, this.extractURL(url));
    }
  },

  // #example-user/example-repo/gh-pages/path/to/2012-01-01.md
  post: function(url, file, edit) {
    if (confirmExit()) {
      var path = this.extractURL(url);
      app.state.file = file;
      app.instance.post.apply(this, path.concat(file).concat(!edit));
    }
  }
});

}).apply(this, window.args);

{'fraction_non_alphanumeric': 0.23005209761447765, 'fraction_numerical': 0.007129147244310392, 'mean_word_length': 2.4093457943925234, 'pattern_counts': {'":': 2, '<': 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': '2740507', 'n_tokens_mistral': 1305, 'n_tokens_neox': 1278, 'n_words': 201}