<commit_before>const helper = require('./helper')
const alpha = 'ABCDEFGHJKLMNOPQRSTUVWXYZ'

class Board {
    constructor(width = 19, height = 19, arrangement = [], captures = null) {
        this.width = width
        this.height = height
        this.captures = captures ? captures.slice() : [0, 0]
        this.arrangement = []
        this.markups = {}
        this.ghosts = {}
        this.lines = []

        // Initialize arrangement

        for (let y = 0; y < this.height; y++) {
            this.arrangement[y] = y in arrangement ? [...arrangement[y]] : Array(this.width).fill(0)
        }
    }

    get([x, y]) {
        return this.arrangement[y] ? this.arrangement[y][x] : undefined
    }

    set([x, y], sign) {
        this.arrangement[y][x] = sign
        return this
    }

    clone() {
        return new Board(this.width, this.height, this.arrangement, this.captures)
    }

    diff(board) {
        let result = []

        for (let x = 0; x < this.width; x++) {
            for (let y = 0; y < this.height; y++) {
                let sign = board.get([x, y])
                if (this.get([x, y]) === sign) continue

                result.push([x, y])
            }
        }

        return result
    }

    hasVertex([x, y]) {
        return 0 <= x && x < this.width && 0 <= y && y < this.height<commit_msg>Board.diff() returns null if size does not match<commit_after>const helper = require('./helper')
const alpha = 'ABCDEFGHJKLMNOPQRSTUVWXYZ'

class Board {
    constructor(width = 19, height = 19, arrangement = [], captures = null) {
        this.width = width
        this.height = height
        this.captures = captures ? captures.slice() : [0, 0]
        this.arrangement = []
        this.markups = {}
        this.ghosts = {}
        this.lines = []

        // Initialize arrangement

        for (let y = 0; y < this.height; y++) {
            this.arrangement[y] = y in arrangement ? [...arrangement[y]] : Array(this.width).fill(0)
        }
    }

    get([x, y]) {
        return this.arrangement[y] ? this.arrangement[y][x] : undefined
    }

    set([x, y], sign) {
        this.arrangement[y][x] = sign
        return this
    }

    clone() {
        return new Board(this.width, this.height, this.arrangement, this.captures)
    }

    diff(board) {
        if (board.width !== this.width || board.height !== this.height) {
            return null
        }

        let result = []

        for (let x = 0; x < this.width; x++) {
            for (let y = 0; y < this.height; y++) {
                let sign = board.get([x, y])
                if (this.get([x, y]) === sign) continue

                result.push([x, y])
            }
        }

        return result
    }

    hasVertex([x, y]) {
        return 0 <= x && x < this.width && 0 <= y && y < this.height
{'fraction_non_alphanumeric': 0.15294535131298795, 'fraction_numerical': 0.008516678495386799, 'mean_word_length': 1.7315891472868217, 'pattern_counts': {'":': 0, '<': 17, '<?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': '6471185', 'n_tokens_mistral': 942, 'n_tokens_neox': 880, 'n_words': 221}