<commit_before>this.boggle = this.boggle || {};

(function(boggle) {
  "use strict";
  boggle.options = {
    grid: {
      width: 4,
      height: 4
    }
  };

  boggle.forEach = function (array, fn) {
    var i;
    for(i = 0; i < array.length; i++) {
      fn.call(this, array[i], i);
    }
  };

  boggle.forEachKeyValue = function (object, fn) {
    for(var key in object) {
      if(object.hasOwnProperty(key)) {
        fn.call(this, key, object[key]);
      }
    }
  };

  boggle._lettersForColumn = function (columnIndex, wordList) {
    return wordList.filter(function(word) {
      return word.length > columnIndex;
    }).map(function (word) {
      return word[columnIndex];
    });
  };

  boggle._insert = function (word, wordList, index) {
    var before, after;
    before = wordList.slice(0, index);
    after = wordList.slice(index, wordList.length);
    return before.concat([word], after);
  };

  boggle._areAdjacent = function (incompleteWord1, incompleteWord2) {
    var xdif, ydif, width, height;
    width = boggle.options.grid.width;
    height = boggle.options.grid.height;
    xdif = Math.abs(
      incompleteWord1.last().x - 
      incompleteWord2.first().x
    );
    ydif = Math.abs(
      incompleteWord1.last().y - 
      incompleteWord2.first().y
    );
    return xdif === 0 && ydif === 1 ||
           xdif === 1 && ydif === 0 ||
           xdif === 1 && ydif === 1;
  };

  boggle._seedIncompleteWord = function (
      incompleteWords, 
      wordList, 
      letter, 
      gridIndex) {
    var letters, columnIndex;
    columnIndex = 0;
    do {
      letters = this._lettersForColumn(columnIndex, wordList);
      if(~letters.indexOf(letter)) {
        incompleteWords.push(
          new boggle.IncompleteWord(
            letter, 
            columnIndex,
            gridIndex % boggle.options.grid.width,
            Math.floor(gridIndex / boggle.options.grid.height)
          )
        );
      }
      columnIndex++;<commit_msg>write isLetterForColumn<commit_after>this.boggle = this.boggle || {};

(function(boggle) {
  "use strict";
  boggle.options = {
    grid: {
      width: 4,
      height: 4
    }
  };

  boggle.forEach = function (array, fn) {
    var i;
    for(i = 0; i < array.length; i++) {
      fn.call(this, array[i], i);
    }
  };

  boggle.forEachKeyValue = function (object, fn) {
    for(var key in object) {
      if(object.hasOwnProperty(key)) {
        fn.call(this, key, object[key]);
      }
    }
  };

  boggle._lettersForColumn = function (columnIndex, wordList) {
    return wordList.filter(function(word) {
      return word.length > columnIndex;
    }).map(function (word) {
      return word[columnIndex];
    });
  };

  boggle._insert = function (word, wordList, index) {
    var before, after;
    before = wordList.slice(0, index);
    after = wordList.slice(index, wordList.length);
    return before.concat([word], after);
  };

  boggle._areAdjacent = function (incompleteWord1, incompleteWord2) {
    var xdif, ydif, width, height;
    width = boggle.options.grid.width;
    height = boggle.options.grid.height;
    xdif = Math.abs(
      incompleteWord1.last().x - 
      incompleteWord2.first().x
    );
    ydif = Math.abs(
      incompleteWord1.last().y - 
      incompleteWord2.first().y
    );
    return xdif === 0 && ydif === 1 ||
           xdif === 1 && ydif === 0 ||
           xdif === 1 && ydif === 1;
  };

  boggle.isLetterForColumn = function (letter, columnIndex, wordList) {
    var letters = this._lettersForColumn(columnIndex, wordList);
    return ~letters.indexOf(letter);
  };

  boggle._seedIncompleteWord = function (
      incompleteWords, 
      wordList, 
      letter, 
      gridIndex) {
    var letters, columnIndex;
    columnIndex = 0;
    do {
      letters = this._lettersForColumn(columnIndex, wordList);
      if(~letters.indexOf(letter)) {
        incompleteWords.push(
          new boggle.IncompleteWord(
            letter, 
            columnIndex,
            gridIndex % boggle.options.grid.width,
            Math.floor(gridIndex / boggle.options.grid.height)
          )
        );
      }
      columnIndex++;
{'fraction_non_alphanumeric': 0.13686746987951806, 'fraction_numerical': 0.00819277108433735, 'mean_word_length': 2.2918318794607453, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2677936', 'n_tokens_mistral': 1403, 'n_tokens_neox': 1335, 'n_words': 265}