<commit_before>export default class Search {
  constructor() {
  }

  query(q) {
    const results = this.get(`http://www.dippam.ac.uk/eppi/results?search%5Bper_page%5D=25&search%5Bpage%5D=1&search%5Btotal_pages%5D=644&search%5Bview%5D=table&search%5Bqclean%5D=${q}&search%5Bq%5D=${q}%0A&search%5Bfields%5D=fulltext&search%5Bchrono%5D=on&search%5Bfrom%5D=1801&search%5Bto%5D=1922&search%5Bcat%5D%5B0%5D=on&search%5Bcat%5D%5B1%5D=on&search%5Bcat%5D%5B2%5D=on&search%5Bcat%5D%5B3%5D=on&search%5Bcat%5D%5B4%5D=on&search%5Bsort%5D=title&search%5Bsort_dir%5D=asc`);
    results.then(x => { document.getElementsByTagName("tbody")[0].innerHTML = x; });
  }

  get(url) {
    return new Promise(function(resolve, reject) {
      let req = new XMLHttpRequest();
      req.open('GET', url);
      req.onload = function() {
        if (req.status === 200) resolve(req.response);
        else reject(Error(req.statusText));
      };
      req.onerror = function() { reject(Error("Network Error")); };
      req.send();
    });
  }
}<commit_msg>Refactor search module.  Presentation only.<commit_after>export default function Search() {
  this.query = function(q) {
    const results = this.get(`http://www.dippam.ac.uk/eppi/results?search%5Bper_page%5D=25&search%5Bpage%5D=1&search%5Btotal_pages%5D=644&search%5Bview%5D=table&search%5Bqclean%5D=${q}&search%5Bq%5D=${q}%0A&search%5Bfields%5D=fulltext&search%5Bchrono%5D=on&search%5Bfrom%5D=1801&search%5Bto%5D=1922&search%5Bcat%5D%5B0%5D=on&search%5Bcat%5D%5B1%5D=on&search%5Bcat%5D%5B2%5D=on&search%5Bcat%5D%5B3%5D=on&search%5Bcat%5D%5B4%5D=on&search%5Bsort%5D=title&search%5Bsort_dir%5D=asc`)
    results.then((x) => {document.querySelector("tbody").innerHTML = x})
  }

  this.get = function(url) {
    return new Promise((resolve, reject) => {
      let req = new XMLHttpRequest()
      req.open('GET', url)
      req.onload = () => { (req.status === 200) ? resolve(req.response) : reject(Error(req.statusText)) }
      req.onerror = () => reject(Error("Network Error"))
      req.send()
    })
  }
}
{'fraction_non_alphanumeric': 0.1901028907398334, 'fraction_numerical': 0.06614404703576678, 'mean_word_length': 5.829431438127091, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2594106', 'n_tokens_mistral': 887, 'n_tokens_neox': 862, 'n_words': 73}