<commit_before>'use strict';

// Define the `core.json` module
angular.module('core.json', ['ngResource', 'core.config']);

angular.
  module('core.json').
  factory('Json', ['$resource', 'Config', appJson]);

function appJson($resource, config) {
  var url = config.json.rootPath + '/:path/:fileName';

  var resource = $resource(url, {}, {
    query: {
      method: 'GET',
      params: {
        path: '.',
        fileName: 'categories.json'
      },
      isArray: true,
      cache: true
    }
  });

  var getHomeJson = function(contact, about) {
    resource.query({}, function(data) {
        $.each(data, function(i, val) {
          jsons.categories[val.id] = val;

          resource.query({path: val.dirName, fileName: val.dirName + ".json"}, function(data1) {
            $.each(data1, function(j, val1) {
              if(!jsons.subjects[val.id]){
                jsons.subjects[val.id] = {};
              }
              jsons.subjects[val.id][val1.id] = val1;

              resource.query({path: val.dirName + "/" +val1.dirName, fileName: val1.dirName + ".json"}, function(data2) {
                $.each(data2, function(k, val2) {
                  if(!jsons.classes[val.id]){
                    jsons.classes[val.id] = {};
                    jsons.classes[val.id][val1.id] = {};
                  }
                  jsons.classes[val.id][val1.id][val2.id] = val2;
                })
              });
            })
          });
        });
      }
    );

    resource.query({fileName: contact}, function(data) {
        $.each(data, function(i, val) {
          jsons.contacts[val.id] = val;
        });<commit_msg>add classes data in json file<commit_after>'use strict';

// Define the `core.json` module
angular.module('core.json', ['ngResource', 'core.config']);

angular.
  module('core.json').
  factory('Json', ['$resource', 'Config', appJson]);

function appJson($resource, config) {
  var url = config.json.rootPath;
  var resource;

  var getResource = function(turl){
    resource = $resource(turl + '/:path/:fileName', {}, {
      query: {
        method: 'GET',
        params: {
          path: '.',
          fileName: 'categories.json'
        },
        isArray: true,
        cache: true
      }
    });
  }

  var getHomeJson = function(contact, about) {
    getResource(url);

    resource.query({}, function(data) {
        $.each(data, function(i, val) {
          jsons.categories[val.id] = val;

          resource.query({path: val.dirName, fileName: val.dirName + ".json"}, function(data1) {
            $.each(data1, function(j, val1) {
              if(!jsons.subjects[val.id]){
                jsons.subjects[val.id] = {};
              }
              jsons.subjects[val.id][val1.id] = val1;

              getResource(url + "/" + val.dirName);
              resource.query({path: val1.dirName, fileName: val1.dirName + ".json"}, function(data2) {
                $.each(data2, function(k, val2) {
                  if(!jsons.classes[val.id]){
                    jsons.classes[val.id] = {};
                    jsons.classes[val.id][val1.id] = {};
                  }
                  jsons.classes[val.id][val1.id][val2.id] = val2;
                })
              });
            })
          });
        });
      }
    );

    resource.query({fileName: contact}, function(data) {
        $.each(data, function(i, val) {
          jsons.contacts[val.id] = val;
        });
{'fraction_non_alphanumeric': 0.17244392659481503, 'fraction_numerical': 0.00815613166326828, 'mean_word_length': 1.8009787928221859, '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': '3360514', 'n_tokens_mistral': 1086, 'n_tokens_neox': 1070, 'n_words': 177}