<commit_before>
var oboe = (function(oboe){
   "use strict";

   /**
    * @param {Object} opt an object of options. Passed though
    * directly to clarinet.js but oboe.js does not
    * currently provide options.
    */
   oboe.parser = function(opt){
      return new OboeParser(opt);
   };
   
   /**
    * Convenient alias. Creates a new parser, starts an ajax request and returns the parser
    * ready to call .onPath() or .onFind() to register some callbacks
    * @param url
    */
   oboe.fetch = function(url){
      return new OboeParser().fetch(url);
   };      
      
   function OboeParser(opt) {
   
      var clarinetParser = clarinet.parser(opt);
   
      this._thingFoundListeners = [];
      this._pathMatchedListeners = [];
      this._errorListeners = [];
      this._clarinet = clarinetParser;
         
      this._listenForSaxEvents(clarinetParser)        
   }
   
   OboeParser.prototype._listenForSaxEvents = function( clarinet ) {
   
      var   oboeInstance = this
      ,     curNode
      ,     curKey
      ,     nodeStack = [] // TODO: use fastlist
      ,     pathStack = [];

   
   
      /* For when we find a new key in the json. The value may not be known in which case null can be given */  
      function notifyOfKeyFound(key, value) {
         oboeInstance._notifyListeners(oboeInstance._pathMatchedListeners, value, pathStack.concat(key), nodeStack);      
      }
              
      function entityFound( thingFound, foundIn, foundAtKey ) {

         var thingIsRoot = !foundIn;

         if( isArray(foundIn) ) {
            // for arrays we aren't pre-warned of the coming paths (there is no call to onkey like there is for objects)
            // so we need to notify of the paths when we find the items: 
            notifyOfKeyFound(curKey, thingFound);
         }

         if( thingIsRoot ) {
            // Parsed the root object. Notify path listeners (eg to '!' or '*') that the root path has been satisfied:         <commit_msg>formatting<commit_after>
var oboe = (function(oboe){
   "use strict";

   /**
    * @param {Object} opt an object of options. Passed though
    * directly to clarinet.js but oboe.js does not
    * currently provide options.
    */
   oboe.parser = function(opt){
      return new OboeParser(opt);
   };
   
   /**
    * Convenient alias. Creates a new parser, starts an ajax request and returns the parser
    * ready to call .onPath() or .onFind() to register some callbacks
    * @param url
    */
   oboe.fetch = function(url){
      return new OboeParser().fetch(url);
   };      
      
   function OboeParser(opt) {
   
      var clarinetParser = clarinet.parser(opt);
   
      this._thingFoundListeners = [];
      this._pathMatchedListeners = [];
      this._errorListeners = [];
      this._clarinet = clarinetParser;
         
      this._listenForSaxEvents(clarinetParser)        
   }
   
   OboeParser.prototype._listenForSaxEvents = function( clarinet ) {
   
      var   oboeInstance = this
      ,     curNode
      ,     curKey
      ,     nodeStack = [] // TODO: use fastlist?
      ,     pathStack = [];
     
      /* For when we find a new key in the json. The value may not be known in which case null can be given */  
      function notifyOfKeyFound(key, value) {
         oboeInstance._notifyListeners(oboeInstance._pathMatchedListeners, value, pathStack.concat(key), nodeStack);      
      }
              
      function entityFound( thingFound, foundIn, foundAtKey ) {

         var thingIsRoot = !foundIn;

         if( isArray(foundIn) ) {
            // for arrays we aren't pre-warned of the coming paths (there is no call to onkey like there is for objects)
            // so we need to notify of the paths when we find the items: 
            notifyOfKeyFound(curKey, thingFound);
         }

         if( thingIsRoot ) {
            // Parsed the root object. Notify path listeners (eg to '!' or '*') that the root path has been satisfied:         
{'fraction_non_alphanumeric': 0.09081761006289309, 'fraction_numerical': 0.0, 'mean_word_length': 2.0965732087227416, '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': '6736162', 'n_tokens_mistral': 1142, 'n_tokens_neox': 1134, 'n_words': 358}