<commit_before>(function () {
    'use strict';
    var apikey = 'c631ef46e918c82cf81ef4869f0029d4';
    angular.module('directory', [])
    .config(['$routeProvider', function ($routeProvider) {
        $routeProvider
        .when('/directory', {templateUrl: 'partials/directory/searchForm.html', controller: 'directorySearchController'})
        .when('/directory/:keywords', {templateUrl: 'partials/directory/searchForm.html', controller: 'directorySearchController'});
    }])
    . controller(
        'directorySearchController',
        ['$scope', '$location', '$routeParams', function ($scope, $location, $routeParams) {
            $scope.searchSubmitted = false;
            $scope.loading = false;
            $scope.loadError = false;
            $scope.results = {};

            var allowedCharsOnly = function (value) {
                // Only allow alphabetic characters, space, and colon.
                // This is done for convenience/sanity, not security.
                // Client-side checks are easily bypassed, duh.
                // Server-side still needs to gracefully handle anything thrown at it.
                return value.replace(/[^A-Za-z :]/g, ' ');
            };

            $scope.search = function () {
                $location.url('/directory/' + allowedCharsOnly($scope.keywords));
            };<commit_msg>allow quotation marks<commit_after>(function () {
    'use strict';
    var apikey = 'c631ef46e918c82cf81ef4869f0029d4';
    angular.module('directory', [])
    .config(['$routeProvider', function ($routeProvider) {
        $routeProvider
        .when('/directory', {templateUrl: 'partials/directory/searchForm.html', controller: 'directorySearchController'})
        .when('/directory/:keywords', {templateUrl: 'partials/directory/searchForm.html', controller: 'directorySearchController'});
    }])
    . controller(
        'directorySearchController',
        ['$scope', '$location', '$routeParams', function ($scope, $location, $routeParams) {
            $scope.searchSubmitted = false;
            $scope.loading = false;
            $scope.loadError = false;
            $scope.results = {};

            var allowedCharsOnly = function (value) {
                // Only allow alphabetic characters, space, colon, and quotation mark.
                // This is done for convenience/sanity, not security.
                // Client-side checks are easily bypassed, duh.
                // Server-side still needs to gracefully handle anything thrown at it.
                return value.replace(/[^A-Za-z :"]/g, ' ');
            };

            $scope.search = function () {
                $location.url('/directory/' + allowedCharsOnly($scope.keywords));
            };
{'fraction_non_alphanumeric': 0.13548150860490663, 'fraction_numerical': 0.015378982057854266, 'mean_word_length': 2.352147239263804, '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': '2005774', 'n_tokens_mistral': 747, 'n_tokens_neox': 692, 'n_words': 160}