<commit_before><<<<<<< HEAD
// No persistence for now
/*
=======
// No persistence or access control for now.
>>>>>>> af95a11cbefaafd07fbf674a22ca739d0e388d7a

"Why not just index the objects by number?"

Because then you couldn't replace something by renaming the old one.

*/

function ObjectDB(path, core) {
  if (!(this instanceof ObjectDB))
    return new ObjectDB(path);

  this.db = {};
  this.maxid = 0;
  this.initMinimal();
  // this.loadCore(path)
}

module.exports = ObjectDB;

ObjectDB.prototype = {
  initMinimal: function () {
    createSys(this);
    createRoot(this);
    createWiz(this);
  },


  get: function (id) { return this.db[id] },

  create: function (name) {
    this.maxid++;
    return this.db[this.maxid] = new CORVIDObject ({
        name: name,
        id: this.maxid,
        data: {},
        methods: {},
      });
  },

  destroy: function (id) {
    // Give the object a chance to clean itself up.
    try { this.db[id].sendMessage('dbDestroy'); }

    // Deleting hash elements is contra-indicated for performance reasons.
    this.db[id] = undefined;
  },

  init: function (core) {
  },
};

// Private functions below

function createSys(db) {
  var sys = db.create('sys');
  sys.
};

funciton createRoot(db) {
};

funciton createWiz(db) {
};
<commit_msg>Additional merge conflict fix<commit_after>/*

No persistence or access control for now.

"Why not just index the objects by number?"

Because then you couldn't replace something by renaming the old one.

*/

function ObjectDB(path, core) {
  if (!(this instanceof ObjectDB))
    return new ObjectDB(path);

  this.db = {};
  this.maxid = 0;
  this.initMinimal();
  // this.loadCore(path)
}

module.exports = ObjectDB;

ObjectDB.prototype = {
  initMinimal: function () {
    createSys(this);
    createRoot(this);
    createWiz(this);
  },


  get: function (id) { return this.db[id] },

  create: function (name) {
    this.maxid++;
    return this.db[this.maxid] = new CORVIDObject ({
        name: name,
        id: this.maxid,
        data: {},
        methods: {},
      });
  },

  destroy: function (id) {
    // Give the object a chance to clean itself up.
    try { this.db[id].sendMessage('dbDestroy'); }

    // Deleting hash elements is contra-indicated for performance reasons.
    this.db[id] = undefined;
  },

  init: function (core) {
  },
};

// Private functions below

function createSys(db) {
  var sys = db.create('sys');
  sys.
};

funciton createRoot(db) {
};

funciton createWiz(db) {
};

{'fraction_non_alphanumeric': 0.14382470119521912, 'fraction_numerical': 0.008366533864541833, 'mean_word_length': 2.9605678233438484, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, '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': '7437272', 'n_tokens_mistral': 864, 'n_tokens_neox': 824, 'n_words': 227}