<commit_before>/*
 * Calaca - Search UI for Elasticsearch
 * https://github.com/romansanchez/Calaca
 * http://romansanchez.me
 * @rooomansanchez
 * 
 * v1.2.0
 * MIT License
 */

/* Calaca Controller
 *
 * On change in search box, search() will be called, and results are bind to scope as results[]
 *
 TODO: Try Google AutoComplete for Country: http://plnkr.co/edit/il2J8qOI2Dr7Ik1KHRm8?p=preview
*/
Calaca.controller('calacaCtrl', ['calacaService', '$scope', '$location', function(results, $scope, $location){

        //Init empty array
        $scope.results = [];

        //Init offset
        $scope.offset = 0;
        $scope.query = {"general":'',"country":''};
        var countries = [
          "South Africa",
          "Mauritius",
          "Botswana",
          "Zambia",
          "Namibia",
          "Swaziland",
          "Tanzania",
          "Zimbabwe"
        ];

        var paginationTriggered;
        var maxResultsSize = CALACA_CONFIGS.size;
        var searchTimeout;

        $scope.delayedSearch = function(mode) {
            clearTimeout(searchTimeout);
            searchTimeout = setTimeout(function() {
                $scope.search(mode)
            }, CALACA_CONFIGS.search_delay);
        }

         $scope.countryChanged = function  ($event) {              
            if ( typeof $scope.query.general !== '' && $scope.query.country !== '' && $event.keyCode === 13)
            {
                clearTimeout(searchTimeout);
                searchTimeout = setTimeout(function() {
                    $scope.search(0)
                }, CALACA_CONFIGS.search_delay);
            }
         }

        //On search, reinitialize array, then perform search and load results
        $scope.search = function(m){
            $scope.results = [];<commit_msg>Countries in auto filter<commit_after>/*
 * Calaca - Search UI for Elasticsearch
 * https://github.com/romansanchez/Calaca
 * http://romansanchez.me
 * @rooomansanchez
 * 
 * v1.2.0
 * MIT License
 */

/* Calaca Controller
 *
 * On change in search box, search() will be called, and results are bind to scope as results[]
 *
 TODO: Try Google AutoComplete for Country: http://plnkr.co/edit/il2J8qOI2Dr7Ik1KHRm8?p=preview
*/
Calaca.controller('calacaCtrl', ['calacaService', '$scope', '$location', function(results, $scope, $location){

        //Init empty array
        $scope.results = [];

        //Init offset
        $scope.offset = 0;
        $scope.query = {"general":'',"country":''};
        var countries = [
          "South Africa",
          "Morocco",
          "Kenya",
          "Ghana",
          "Tanzania",
          "Tunisia",
          "Algeria",
          "Zimbabwe",
          "Uganda",
          "Namibia",
          "Mauritius",
          "Botswana",
          "Zambia",          
          "Swaziland"
        ];

        var paginationTriggered;
        var maxResultsSize = CALACA_CONFIGS.size;
        var searchTimeout;

        $scope.delayedSearch = function(mode) {
            clearTimeout(searchTimeout);
            searchTimeout = setTimeout(function() {
                $scope.search(mode)
            }, CALACA_CONFIGS.search_delay);
        }

         $scope.countryChanged = function  ($event) {              
            if ( typeof $scope.query.general !== '' && $scope.query.country !== '' && $event.keyCode === 13)
            {
                clearTimeout(searchTimeout);
                searchTimeout = setTimeout(function() {
                    $scope.search(0)
                }, CALACA_CONFIGS.search_delay);
            }
         }

        //On search, reinitialize array, then perform search and load results
        $scope.search = function(m){
            $scope.results = [];
{'fraction_non_alphanumeric': 0.12922252010723861, 'fraction_numerical': 0.006970509383378016, 'mean_word_length': 1.87, 'pattern_counts': {'":': 4, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '478109', 'n_tokens_mistral': 1100, 'n_tokens_neox': 1048, 'n_words': 223}