<commit_before>function Cell(row, col, value, board) {
  this.row = row,
  this.col = col,
  this.value = value,
  this.board = board
}

Cell.prototype = {
  find: function(word, visited=new Set(), wordIndex=0) {
    if(visited.has(this)) return null;
    word = word.toUpperCase();
    var die = this.value;
    var letter = word[wordIndex];
    
    if(wordIndex === word.length - 1) {
      if(die !== letter) return null;
      visited.add(this);
      return visited;
    }

    if(die === letter) {
      visited.add(this);
      var neighbors = this.getNeighbors(this.row, this.col);
      var pass = neighbors.some(function(cell, index) { 
        return cell.find(word, visited, wordIndex + 1)
      }, this);
      if(pass) return visited;
    }
    visited.delete(this);
    return null;
  },

  getNeighbors: function() {
    var neighbors = [];
    var i = -1;
    while(i <= 1) {
      var j = -1;
      var row = this.row + i;
      while(j <= 1) {
        var col = this.col + j++;
        var neighbor = this.board.cell(row, col);
        if(neighbor) neighbors.push(neighbor);
      }
      i++;
    }
    return neighbors;
  },
}

module.exports = Cell;<commit_msg>Fix prototyping in cell<commit_after>function Cell(row, col, value, board) {
  this.row = row,
  this.col = col,
  this.value = value,
  this.board = board
}

Cell.prototype.find = function(word, visited=new Set(), wordIndex=0) {
  if(visited.has(this)) return null;
  word = word.toUpperCase();
  var die = this.value;
  var letter = word[wordIndex];
  
  if(wordIndex === word.length - 1) {
    if(die !== letter) return null;
    visited.add(this);
    return visited;
  }

  if(die === letter) {
    visited.add(this);
    var neighbors = this.getNeighbors(this.row, this.col);
    var pass = neighbors.some(function(cell, index) { 
      return cell.find(word, visited, wordIndex + 1)
    }, this);
    if(pass) return visited;
  }
  visited.delete(this);
  return null;
};

Cell.prototype.getNeighbors = function() {
  var neighbors = [];
  var i = -1;
  while(i <= 1) {
    var j = -1;
    var row = this.row + i;
    while(j <= 1) {
      var col = this.col + j++;
      var neighbor = this.board.cell(row, col);
      if(neighbor) neighbors.push(neighbor);
    }
    i++;
  }
  return neighbors;
};

module.exports = Cell;
{'fraction_non_alphanumeric': 0.15291576673866092, 'fraction_numerical': 0.006047516198704104, 'mean_word_length': 2.5358778625954197, 'pattern_counts': {'":': 0, '<': 7, '<?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': '1155451', 'n_tokens_mistral': 813, 'n_tokens_neox': 798, 'n_words': 193}