<commit_before>export default class Vector {
  /**
   * Construct a vector consisting of binary components where truthy values represent 1 and falsy values represent 0.
   *
   * @param {Array<number>} [cs=[]] The components of the vector.
   *
   * @example
   * const v = Vector([1, 0, 1]);
   */
  constructor(cs = []) {
    const l = this.l = cs.length;
    const c = this.c = [];
    const s = this.s = 30;

    let i = 0;
    let k = 0;

    while (i < l) {
      const n = i + s > l ? l - i : s;

      for (let j = 0; j < n; j++) {
        c[k] |= (cs[i + j] ? 1 : 0) << n - j - 1;
      }

      i += n;
      k += 1;
    }
  }

  /**
   * Get the number of components in this vector.
   *
   * @memberof Vector
   * @return {number} The number of components in this vector.
   *
   * @example
   * const v = Vector([1, 0, 0, 1]);
   * v.size();
   * // => 4
   */
  size() {
    return this.l;
  }

  add(n) {
    const l = this.l;
    const s = this.s;
    const c = this.c;

    const d = l / s | 0;

    c[d] = c[d] << 1 | n ? 1 : 0;

    this.l++;
  }

  merge(v) {
    for (let i = 0, n = v.size(); i < n; i++) {
      this.add(v.get(i));
    }
  }

  /**
   * Get the component at the specified index of this vector.
   *
   * @param {number} i The index of the component to get.
   * @return {number} The component at the index if found, otherwise `undefined`.
   *
   * @example
   * const v = Vector([1, 0, 1, 1]);
   * v.get(0);
   * // => 1<commit_msg>Remove obsolete vector methods<commit_after>export default class Vector {
  /**
   * Construct a vector consisting of binary components where truthy values represent 1 and falsy values represent 0.
   *
   * @param {Array<number>} [cs=[]] The components of the vector.
   *
   * @example
   * const v = Vector([1, 0, 1]);
   */
  constructor(cs = []) {
    const l = this.l = cs.length;
    const c = this.c = [];
    const s = this.s = 30;

    let i = 0;
    let k = 0;

    while (i < l) {
      const n = i + s > l ? l - i : s;

      for (let j = 0; j < n; j++) {
        c[k] |= (cs[i + j] ? 1 : 0) << n - j - 1;
      }

      i += n;
      k += 1;
    }
  }

  /**
   * Get the number of components in this vector.
   *
   * @memberof Vector
   * @return {number} The number of components in this vector.
   *
   * @example
   * const v = Vector([1, 0, 0, 1]);
   * v.size();
   * // => 4
   */
  size() {
    return this.l;
  }

  /**
   * Get the component at the specified index of this vector.
   *
   * @param {number} i The index of the component to get.
   * @return {number} The component at the index if found, otherwise `undefined`.
   *
   * @example
   * const v = Vector([1, 0, 1, 1]);
   * v.get(0);
   * // => 1
{'fraction_non_alphanumeric': 0.16328038418913926, 'fraction_numerical': 0.02031769486516439, 'mean_word_length': 1.826722338204593, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7607759', 'n_tokens_mistral': 1044, 'n_tokens_neox': 980, 'n_words': 343}