<commit_before>var async = require( 'async' )
var msgpack5 = require( 'msgpack5' )
var sublevel = require( 'level-sublevel' )

/**
 * HexaDB Constructor
 * @return {HexaDB}
 */
function HexaDB( db, options ) {
  
  if( !(this instanceof HexaDB) )
    return new HexaDB( db, options )
  
  this.format = msgpack5()
  this.encoding = {
    encode: function( value ) {
      return this.format.encode( value )
        .slice() // bl != instanceof Buffer
    }.bind( this ),
    decode: this.format.decode,
    buffer: true,
    type: 'msgpack',
  }
  
  this.db = sublevel( db, {
    keyEncoding: 'utf8',
    valueEncoding: this.encoding,
  })
  
  // Maps (s,p,o) hashes to each other
  this.graph = this.db.sublevel( 'graph' )
  // Maps values to hashes
  this.data = this.db.sublevel( 'data' )
  
}

HexaDB.Triple = require( './triple' )

HexaDB.TripleStream = require( './triple-stream' )

/**
 * HexaDB Prototype
 * @type {Object}
 */
HexaDB.prototype = {
  
  constructor: HexaDB,
  
  _buildQuery: function( pattern, options ) {
    
    var triple = HexaDB.Triple.create( pattern )
    var key = triple.getPattern()
    
    var query = {
      fillCache: true,
      limit: typeof options.limit === 'number' ? limit : -1,
      highWaterMark: 16,
    }
    <commit_msg>Updated lib/hexadb: Added kept ref to orig db<commit_after>var async = require( 'async' )
var msgpack5 = require( 'msgpack5' )
var sublevel = require( 'level-sublevel' )

/**
 * HexaDB Constructor
 * @return {HexaDB}
 */
function HexaDB( db, options ) {
  
  if( !(this instanceof HexaDB) )
    return new HexaDB( db, options )
  
  this.format = msgpack5()
  this.encoding = {
    encode: function( value ) {
      return this.format.encode( value )
        .slice() // bl != instanceof Buffer
    }.bind( this ),
    decode: this.format.decode,
    buffer: true,
    type: 'msgpack',
  }
  
  this.db = db
  this.level = sublevel( this.db, {
    keyEncoding: 'utf8',
    valueEncoding: this.encoding,
  })
  
  // Maps (s,p,o) hashes to each other
  this.graph = this.level.sublevel( 'graph' )
  // Maps values to hashes
  this.data = this.level.sublevel( 'data' )
  
}

HexaDB.Triple = require( './triple' )

HexaDB.TripleStream = require( './triple-stream' )

/**
 * HexaDB Prototype
 * @type {Object}
 */
HexaDB.prototype = {
  
  constructor: HexaDB,
  
  _buildQuery: function( pattern, options ) {
    
    var triple = HexaDB.Triple.create( pattern )
    var key = triple.getPattern()
    
    var query = {
      fillCache: true,
      limit: typeof options.limit === 'number' ? limit : -1,
      highWaterMark: 16,
    }
    
{'fraction_non_alphanumeric': 0.14132516277288396, 'fraction_numerical': 0.005361930294906166, 'mean_word_length': 2.6177285318559558, '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': '1621580', 'n_tokens_mistral': 925, 'n_tokens_neox': 915, 'n_words': 227}