<commit_before><!DOCTYPE html>
<html>
<head>
  <script src="pd0parser.js"></script>
</head>
<body>
  <h1>PD0 Parser Example</h1>
  <label for="pd0url">URL:</label>
  <input style="width: 80%" id="pd0url" value="http://spiddal.marine.ie/data/adcps/TRDI-WHB600Hz-1323/2016/04/02/TRDI-WHB600Hz-1323_20160402.pd0">
  <input type="button" id="parse-button" value="Go!">
  <div id="info"></div>
  <script>
  var withPd0s = function(array_of_pd0s){
    document.getElementById("info").innerHTML = "parsed "+array_of_pd0s.length+" pd0s. See console for details.";
    console.log(array_of_pd0s);
  };
  var errorHandler = function(err){
    document.getElementById("info").innerHTML = err;
  };
  var loadPd0 = function(){
    var pd0url = document.getElementById("pd0url").value;
    fetch(pd0url).then(function(response) {
        return response.arrayBuffer();
      }).then(function(ab) {
        var buffer = new Uint8Array(ab);
          document.getElementById("info").innerHTML = "parsing pd0...";
        new pd0parser().parse(buffer).then(withPd0s).catch(errorHandler);
      }).catch(errorHandler);
  };
  document.getElementById("parse-button").onclick = loadPd0;
  </script>
</body>
</html><commit_msg>added no-cors mode to example<commit_after><!DOCTYPE html>
<html>
<head>
  <script src="pd0parser.js"></script>
</head>
<body>
  <h1>PD0 Parser Example</h1>
  <label for="pd0url">URL:</label>
  <input style="width: 80%" id="pd0url" value="https://github.com/USF-COT/trdi_adcp_readers/blob/master/C12AN_90.PD0?raw=true">
  <input type="button" id="parse-button" value="Go!">
  <div id="info"></div>
  <script>
  var withPd0s = function(array_of_pd0s){
    document.getElementById("info").innerHTML = "parsed "+array_of_pd0s.length+" pd0s. See console for details.";
    console.log(array_of_pd0s);
  };
  var errorHandler = function(err){
    document.getElementById("info").innerHTML = err;
  };
  var loadPd0 = function(){
    var pd0url = document.getElementById("pd0url").value;
    fetch(pd0url,{mode: 'no-cors'}).then(function(response) {
        return response.arrayBuffer();
      }).then(function(ab) {
        var buffer = new Uint8Array(ab);
          document.getElementById("info").innerHTML = "parsing pd0...";
        new pd0parser().parse(buffer).then(withPd0s).catch(errorHandler);
      }).catch(errorHandler);
  };
  document.getElementById("parse-button").onclick = loadPd0;
  </script>
</body>
</html>
{'fraction_non_alphanumeric': 0.18032111980238782, 'fraction_numerical': 0.03293536434746809, 'mean_word_length': 4.328947368421052, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 41, 'https://': 1, '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': '5575624', 'n_tokens_mistral': 881, 'n_tokens_neox': 851, 'n_words': 138}