<commit_before>'use strict';


function Fillip() {
}

// Initialize function to load all parameters
Fillip.prototype.initialize = function(options){
  
  options = options || {};
  
  this.logging = options.logging;
  this.caching = options.caching;
  this.routes = options.routes;

  // throw errors if crucial information is missing
  if(typeof(this.logging) === 'undefined'){
    throw {
      name: 'FillipLoggingOptionNotDefined',
      message: 'Fillip object does not have a logging option'
    };
  }
  
  if(typeof(this.logging) !== 'boolean'){
    throw {
      name: 'FillipLoggingOptionIsNotBoolean',
      message: 'Fillip logging option is not boolean'
    };
  }
  
  if(typeof(this.caching) !== 'object'){
    throw {
      name: 'FillipCachingObjectNotDefined',
      message: 'Fillip caching option not defined'
    };
  }
  
  if(typeof(this.caching.type) === 'undefined'){
    throw {
      name: 'FillipCachingTypeUndefined',
      message: 'Fillip caching type is not given'
    };
  }
  
  if(this.caching.type !== 'redis'){
    throw {
      name: 'FillipCachingTypeUnknown',
      message: 'Fillip caching type is of unknown type'
    };
  }
  
  if(typeof(this.caching.db) === 'undefined'){
    throw {
      name: 'FillipCachingDbUndefined',
      message: 'Fillip caching db not attached'
    };
  }
  
  if(typeof(this.caching.db.RedisClient) !== 'function'){
    throw {
      name: 'FillipCachingDBNotRecognized',
      message: 'Fillip caching db mismatches with defined type'
    };
  }
  
  if(typeof(this.routes) === 'undefined'){
    throw {
      name: 'FillipRouteArrayNotDefined',
      message: 'Fillip route array not given'
    };
  }
  
  if(this.routes.length === 0){
    throw {
      name: 'FillipRouteArrayEmpty',
      message: 'Fillip route array is empty'
    };
  }
  
  for(var route1 in this.routes){
    if(typeof(this.routes[route1].address) === 'undefined'){
      throw {
        name: 'FillipRouteAddressMissing',
        message: 'Fillip route address missing'
      };
    }
  }
  
  for(var route2 in this.routes){
    if(typeof(this.routes[route2].address) !== 'string'){
      throw {
        name: 'FillipRouteAddressNotRecognized',
        message: 'Fillip route address is not a string'
      };
    }
  }
  
  for(var route3 in this.routes){
    if(typeof(this.routes[route3].controller) === 'undefined'){
      throw {
        name: 'FillipRouteControllerMissing',
        message: 'Fillip route controller missing'
      };
    }
  }
  
  for(var route4 in this.routes){
    if(typeof(this.routes[route4].controller) !== 'function'){
      throw {
        name: 'FillipRouteControllerNotRecognized',
        message: 'Fillip route controller is not a function'
      };
    }
  }
  
  for(var route5 in this.routes){
    if(this.routes[route5].caching && typeof(this.routes[route5].caching) !== 'boolean'){
      throw {
        name: 'FillipRouteCachingOptionNotBoolean',
        message: 'Fillip route caching option is not a boolean value'
      };
    }
  }

  for(var route6 in this.routes){
    if(this.routes[route6].caching && typeof(this.routes[route6].expiry) === 'undefined'){
      throw {
        name: 'FillipCacheExpiryNotSet',
        message: 'Fillip route cache expiry is not set'
      };
    }
  }

  for(var route7 in this.routes){
    if(this.routes[route7].caching && typeof(this.routes[route7].expiry) !== 'number'){
      throw {
        name: 'FillipCacheExpiryIsNotANumber',
        message: 'Fillip route cache expiry is not a number'
      };
    }
  }

  // Create Redis Client
  this.caching.client = this.caching.db.createClient();

};

function routeFound(routeTable, address){
  <commit_msg>Fixing Travis-CI build issues<commit_after>'use strict';


function Fillip() {
}

// Initialize function to load all parameters
Fillip.prototype.initialize = function(options){
  
  options = options || {};
  
  this.logging = options.logging;
  this.caching = options.caching;
  this.routes = options.routes;

  // throw errors if crucial information is missing
  if(typeof(this.logging) === 'undefined'){
    throw {
      name: 'FillipLoggingOptionNotDefined',
      message: 'Fillip object does not have a logging option'
    };
  }
  
  if(typeof(this.logging) !== 'boolean'){
    throw {
      name: 'FillipLoggingOptionIsNotBoolean',
      message: 'Fillip logging option is not boolean'
    };
  }
  
  if(typeof(this.caching) !== 'object'){
    throw {
      name: 'FillipCachingObjectNotDefined',
      message: 'Fillip caching option not defined'
    };
  }
  
  if(typeof(this.caching.type) === 'undefined'){
    throw {
      name: 'FillipCachingTypeUndefined',
      message: 'Fillip caching type is not given'
    };
  }
  
  if(this.caching.type !== 'redis'){
    throw {
      name: 'FillipCachingTypeUnknown',
      message: 'Fillip caching type is of unknown type'
    };
  }
  
  if(typeof(this.caching.db) === 'undefined'){
    throw {
      name: 'FillipCachingDbUndefined',
      message: 'Fillip caching db not attached'
    };
  }
  
  if(typeof(this.caching.db.RedisClient) !== 'function'){
    throw {
      name: 'FillipCachingDBNotRecognized',
      message: 'Fillip caching db mismatches with defined type'
    };
  }
  
  if(typeof(this.routes) === 'undefined'){
    throw {
      name: 'FillipRouteArrayNotDefined',
      message: 'Fillip route array not given'
    };
  }
  
  if(this.routes.length === 0){
    throw {
      name: 'FillipRouteArrayEmpty',
      message: 'Fillip route array is empty'
    };
  }
  
  for(var route1 in this.routes){
    if(typeof(this.routes[route1].address) === 'undefined'){
      throw {
        name: 'FillipRouteAddressMissing',
        message: 'Fillip route address missing'
      };
    }
  }
  
  for(var route2 in this.routes){
    if(typeof(this.routes[route2].address) !== 'string'){
      throw {
        name: 'FillipRouteAddressNotRecognized',
        message: 'Fillip route address is not a string'
      };
    }
  }
  
  for(var route3 in this.routes){
    if(typeof(this.routes[route3].controller) === 'undefined'){
      throw {
        name: 'FillipRouteControllerMissing',
        message: 'Fillip route controller missing'
      };
    }
  }
  
  for(var route4 in this.routes){
    if(typeof(this.routes[route4].controller) !== 'function'){
      throw {
        name: 'FillipRouteControllerNotRecognized',
        message: 'Fillip route controller is not a function'
      };
    }
  }
  
  for(var route5 in this.routes){
    if(this.routes[route5].caching && typeof(this.routes[route5].caching) !== 'boolean'){
      throw {
        name: 'FillipRouteCachingOptionNotBoolean',
        message: 'Fillip route caching option is not a boolean value'
      };
    }
  }

  for(var route6 in this.routes){
    if(this.routes[route6].caching && typeof(this.routes[route6].expiry) === 'undefined'){
      console.log(this.routes[route6]);
      throw {
        name: 'FillipCacheExpiryNotSet',
        message: 'Fillip route cache expiry is not set'
      };
    }
  }

  for(var route7 in this.routes){
    if(this.routes[route7].caching && typeof(this.routes[route7].expiry) !== 'number'){
      throw {
        name: 'FillipCacheExpiryIsNotANumber',
        message: 'Fillip route cache expiry is not a number'
      };
    }
  }

  // Create Redis Client
  this.caching.client = this.caching.db.createClient();

};

function routeFound(routeTable, address){
  
{'fraction_non_alphanumeric': 0.13030628694250404, 'fraction_numerical': 0.004970445996775927, 'mean_word_length': 2.783028455284553, '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': '1488149', 'n_tokens_mistral': 2405, 'n_tokens_neox': 2406, 'n_words': 528}