<commit_before>var app = angular.module('refApp', []);

app.controller('MainCtrl', [function() {
  var self = this
  self.references = [];
  // self.columns = 12
  self.addRef = function(url, size) {
    var added = {url: url, size: size};
    self.references.push(added);
    // self.columns -= size;
    console.log(self.columns)
  };

  var urlChecker = function(url) {
    //checks if pattern is present
    // if not, adds on http to url
  }

}]);<commit_msg>begins regex for urlChecker<commit_after>var app = angular.module('refApp', []);

app.controller('MainCtrl', [function() {
  var self = this
  self.references = [];
  // self.columns = 12
  self.addRef = function(url, size) {
    urlChecker(url);
    var added = {url: url, size: size};
    self.references.push(added);
    // self.columns -= size;
    // console.log(self.columns)
  };

  var urlChecker = function(url) {
    //checks if pattern is present
    // if not, adds on http to url
      // what if https needed? error handling?
      var pattern = /^(https?:\/\/)?/
      if(!pattern.test(url)) {
        url = "http://" + url;
        console.log('added http')
      }
      console.log('urlChecker done')
    }

  }]);
{'fraction_non_alphanumeric': 0.16722408026755853, 'fraction_numerical': 0.0033444816053511705, 'mean_word_length': 2.605421686746988, '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': '7673635', 'n_tokens_mistral': 400, 'n_tokens_neox': 393, 'n_words': 99}