<commit_before>// Used to make code cleaner without having to have lots of cases
// depending on whether syncstring is defined or undefined.
import { EventEmitter } from "events";

import { delay } from "awaiting";

export class FakeSyncstring extends EventEmitter {
  _string_id: string = "";

  constructor() {
    super();
    this.init();
  }

  async init() {
    await delay(0); // wait, so init can be listened to.
    this.emit("init");
  }

  close() {}

  from_str() {}

  to_str() {}

  exit_undo_mode() {}

  in_undo_mode() {}

  undo() {}

  redo() {}

  get_read_only() { return false; }
  has_uncommitted_changes() { return false; }
  has_unsaved_changes() { return false; }

  hash_of_saved_version() {
    return 0;
  }

  save_to_disk(cb) {
    if (cb) {
      cb();
    }
  }

  save(cb) {
    if (cb) {
      cb();
    }
  }

  _save(cb) {
    if (cb) {
      cb();
    }
  }
}
<commit_msg>opening PDF's was broken<commit_after>// Used to make code cleaner without having to have lots of cases
// depending on whether syncstring is defined or undefined.
import { EventEmitter } from "events";

import { Map } from "immutable";

import { delay } from "awaiting";

export class FakeSyncstring extends EventEmitter {
  _string_id: string = "";

  constructor() {
    super();
    this.init();
  }

  async init() {
    await delay(0); // wait, so init can be listened to.
    this.emit("init");
  }

  close() {}

  from_str() {}

  to_str() {}

  exit_undo_mode() {}

  in_undo_mode() {}

  undo() {}

  redo() {}

  get_read_only() {
    return false;
  }
  has_uncommitted_changes() {
    return false;
  }
  has_unsaved_changes() {
    return false;
  }

  hash_of_saved_version() {
    return 0;
  }

  save_to_disk(cb) {
    if (cb) {
      cb();
    }
  }

  save(cb) {
    if (cb) {
      cb();
    }
  }

  _save(cb) {
    if (cb) {
      cb();
    }
  }

  get_settings(): Map<string, any> {
    return Map();
  }

  set_settings(_: object): void {}
}

{'fraction_non_alphanumeric': 0.14704396159676605, 'fraction_numerical': 0.00202122283981809, 'mean_word_length': 2.498233215547703, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '6983765', 'n_tokens_mistral': 732, 'n_tokens_neox': 702, 'n_words': 179}