<commit_before>var uuid = require('uuid');
const util = require('util');

function toObject() {
  var o = {}
  Object.getOwnPropertyNames(this).forEach(function(key) {
    o.key = this[key];
  });
  return o;
}

module.exports.Entity = (function() {
  function Entity(id, opts) {
    this.id = id || uuid.v4();
    this.created = new Date();
    for (var key in opts) {
      this[key] = opts[key];
    }
  }
  Entity.prototype.toVertex = function() {
    var p = {};
    Object.getOwnPropertyNames(this).forEach(function(key) { p.key = this[key]; });
    return {u: this.id, p: p };
  }
  Entity.prototype.toObject = toObject;
  Entity.prototype.toJSON = function() { return JSON.stringify(this.toObject()) };
  return Entity;
})();<commit_msg>added relationship class definition<commit_after>var uuid = require('uuid');
const util = require('util');

function toObject() {
  var o = {}
  Object.getOwnPropertyNames(this).forEach(function(key) {
    o.key = this[key];
  });
  return o;
}

module.exports.Entity = (function() {
  function Entity(id, opts) {
    this.id = id || uuid.v4();
    this.created = new Date();
    for (var key in opts) {
      this[key] = opts[key];
    }
  }
  Entity.prototype.toVertex = function() {
    var p = {};
    Object.getOwnPropertyNames(this).forEach(function(key) { p.key = this[key]; });
    return {u: this.id, p: p };
  }
  Entity.prototype.toObject = toObject;
  Entity.prototype.toJSON = function() { return JSON.stringify(this.toObject()) };
  return Entity;
})();

module.exports.Relationship = (function() {
  function Relationship(opts) {
    this.created = new Date();
    this.subject = opts.subject || return console.error(new Error("missing subject"));
    this.predicate = opts.predicate || return console.error(new Error("missing subject"));
    for (var key in opts) {
      this[key] = opts[key];
    }
  }
  Relationship.prototype.toEdge = function() {
    var p = {};
    Object.getOwnPropertyNames(this).forEach(function(key) { p.key = this[key]; });
    return {e: {u: this.subject, v: this.predicate}, p: p};
  }
  Relationship.prototype.toObject = toObject;
  Relationship.prototype.toJSON = function() { return JSON.stringify(this.toObject()) };
  return Relationship;
})();

()();
{'fraction_non_alphanumeric': 0.17133956386292834, 'fraction_numerical': 0.0008900756564307966, 'mean_word_length': 3.5971370143149284, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2429791', 'n_tokens_mistral': 724, 'n_tokens_neox': 730, 'n_words': 158}