<commit_before>var placement = function (units, objects, container, placementContainer) {
  var picker = document.createElement('ul');

  var selectedUnit;
  for (let unit of units) {
    var unitEl = document.createElement('li');
    unitEl.innerHTML = unit;
    unitEl.onclick = function () {
      selectedUnit = unit;
    };

    picker.appendChild(unitEl);
  }

  for (let object of objects.filter(o => o.type === 'marker')) {
    object.callback = function () {
      if (!selectedUnit) {
        return;
      }

      object.type = 'unit';
      object.unitType = selectedUnit;
      /* XXX I'd like to find some CLEANER way than calling draw manually */
      draw(objects, container);
    };
  }
  
  placementContainer.appendChild(picker);
};<commit_msg>Add a cancel marker<commit_after>var placement = function (units, objects, container, placementContainer) {
  var picker = document.createElement('ul');

  var selectedUnit;
  for (let unit of ['(remove)', ...units]) {
    var unitEl = document.createElement('li');
    unitEl.innerHTML = unit;
    unitEl.onclick = function () {
      selectedUnit = unit;
    };

    picker.appendChild(unitEl);
  }

  for (let object of objects.filter(o => o.type === 'marker')) {
    object.callback = function () {
      if (!selectedUnit) {
        return;
      }

      if (selectedUnit == '(remove)') {
        object.type = 'marker';
        delete object.unitType;
      } else {
        object.type = 'unit';
        object.unitType = selectedUnit;
      }

      /* XXX I'd like to find some CLEANER way than calling draw manually */
      draw(objects, container);
    };
  }
  
  placementContainer.appendChild(picker);
};
{'fraction_non_alphanumeric': 0.1311572700296736, 'fraction_numerical': 0.0, 'mean_word_length': 2.7054945054945057, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6833696', 'n_tokens_mistral': 490, 'n_tokens_neox': 476, 'n_words': 128}