<commit_before>
   angular.module('invertedIndex', [])
   .controller('indexController', ($scope)=>{
        var ind = new index();
        $scope.indexNames = [];
        $scope.currentIndex = null;
        $scope.searchResult = [];
        $scope.message = '';
        $scope.query = '';

         $scope.createIndex = (file)=>{
             if (!file.name.toLowerCase().match(/\.json$/)) {
                 setMessage('This is not a JSON file.');
                return;
             }
            // console.log(file);

             const title = file.name.split('.')[0]
             const reader = new FileReader();
             
             reader.onloadend = (e)=>{
                 try{
                     setMessage = '';
                     const fileContent = JSON.parse(e.target.result);
                     if(!fileContent[0] && fileContent[0].title){<commit_msg>Add indexController<commit_after>
   angular.module('invertedIndex', [])
   .controller('indexController', ($scope)=>{
        var ind = new index();
        $scope.indexNames = [];
        $scope.currentIndex = null;
        $scope.searchResult = [];
        $scope.message = '';
       // $scope.query = '';


        $scope.search =()=>{
            $scope.indexObject = ind.searchIndex($scope.query);

        }

         $scope.createIndex = (file)=>{
             if (!file.name.toLowerCase().match(/\.json$/)) {
                 setMessage('This is not a JSON file.');
                return;
             }
             const title = file.name.split('.')[0]
             const reader = new FileReader();
             
             reader.onloadend = (e)=>{
                 try{
                     setMessage = '';
                     const fileContent = JSON.parse(e.target.result);
                     if(!fileContent[0] && fileContent[0].title){
{'fraction_non_alphanumeric': 0.15535035306898426, 'fraction_numerical': 0.0032590983161325366, 'mean_word_length': 1.47248322147651, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, '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': '1299432', 'n_tokens_mistral': 493, 'n_tokens_neox': 476, 'n_words': 86}