<commit_before>var extractHearingType = function(hearingRow) {
  return hearingRow.querySelectorAll('td')[4].textContent.trim();
};
var isPrelim = function(hearingRow) {
  return extractHearingType(hearingRow) == "PRELIMINARY HEARING";
};
var hearingNodes = function() {
  return document.querySelectorAll('tr[id^="tr_row"]');
};
var nodeListToArray = function(nodeList) {
  var a = [];
  for (var i = 0, l = nodeList.length; i < l; i += 1) {
    a[a.length] = nodeList[i];
  };
  return a;
};
var extractHearings = function() {
  return nodeListToArray(hearingNodes());
};
var filterPrelims = function(hearings) {
  return hearings.filter(isPrelim);
};
var hearings = extractHearings();
var prelims = filterPrelims(hearings);
console.log("There are " + hearings.length + " hearings.");
console.log("There are " + prelims.length + " prelims.");<commit_msg>Add functions to get case report links<commit_after>var getUrl = function(url, callback) {
  var oReq = new XMLHttpRequest();
  oReq.addEventListener("load", callback);
  oReq.open("GET", url);
  oReq.send();
}

var extractHearingType = function(hearingRow) {
  return hearingRow.querySelectorAll('td')[4].textContent.trim();
};
var extractCaseReportLink = function(hearingRow) {
  return hearingRow.querySelectorAll('td')[2].querySelector('a').href.replace('criminalcalendar', 'criminalcasereport');
};
var isPrelim = function(hearingRow) {
  return extractHearingType(hearingRow) == "PRELIMINARY HEARING";
};
var hearingNodes = function() {
  return document.querySelectorAll('tr[id^="tr_row"]');
};
var nodeListToArray = function(nodeList) {
  var a = [];
  for (var i = 0, l = nodeList.length; i < l; i += 1) {
    a[a.length] = nodeList[i];
  };
  return a;
};
var extractHearings = function() {
  return nodeListToArray(hearingNodes());
};
var filterPrelims = function(hearings) {
  return hearings.filter(isPrelim);
};
var hearings = extractHearings();
var prelims = filterPrelims(hearings);
var prelimLinks = prelims.forEach(extractCaseReportLink);
console.log("There are " + hearings.length + " hearings.");
console.log("There are " + prelims.length + " prelims.");
console.log(prelimLinks);
{'fraction_non_alphanumeric': 0.1572356215213358, 'fraction_numerical': 0.003246753246753247, 'mean_word_length': 5.698757763975156, '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': '4053030', 'n_tokens_mistral': 723, 'n_tokens_neox': 694, 'n_words': 148}