<commit_before>var app = angular.module('vroomApp');

var ConfirmLocationController = function($scope, $location, $timeout) {
    $scope.address = "";
    $scope.isListening = false;

    $scope.getUserLocation = function() {
        var x = document.getElementsByClassName("footer")[0];

        if(navigator.geolocation) {
            console.log("geolocation available");
            navigator.geolocation.getCurrentPosition(getAddress);
        }else {
            console.log('geolocation not available');
        }

        function getAddress(position) {
            var latlng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude); // network pull
            
            geocoder = new google.maps.Geocoder();
            geocoder.geocode({'latLng': latlng}, function(results, status) {
                if(status == google.maps.GeocoderStatus.OK) {
                    $scope.address = results[1].formatted_address;
                    $scope.$apply();
                }
            });
        };
    };
    $scope.getUserLocation();
    console.log($scope.address);

    var keywords = {"yes": true, 
        "yeah": true, 
        "sure": true, 
        "yup": true};

    var recognizer = new webkitSpeechRecognition(); // jshint ignore:line
    recognizer.onstart = function() {
        $scope.isListening = true;
        var foot = document.getElementsByClassName('footer')[0];
        var h1 = document.createElement("span");
        h1.className = 'speak-now';
        var text = document.createTextNode("speak now");
        h1.appendChild(text);
        foot.appendChild(h1);


        $scope.shrinkMic();
        console.log('speech started');
    };

    recognizer.onend = function() {
        $scope.isListening = false;
        console.log('speech ended');
    };
    recognizer.continuous = true;
    recognizer.interimResults = true;
    recognizer.lang = "en";
    recognizer.onresult = function(e) {
        if(e.results.length) {
            var lastResultIndex = e.results.length - 1;
            var words = e.results[lastResultIndex][0].transcript.split(" ");
            $scope.receivedWords = words[words.length - 1];
            console.log('words is: ' + words);
            words.forEach(function(element) {<commit_msg>remove speak label when web speech isn't listening<commit_after>var app = angular.module('vroomApp');

var ConfirmLocationController = function($scope, $location, $timeout) {
    $scope.address = "";
    $scope.isListening = false;

    $scope.getUserLocation = function() {
        var x = document.getElementsByClassName("footer")[0];

        if(navigator.geolocation) {
            console.log("geolocation available");
            navigator.geolocation.getCurrentPosition(getAddress);
        }else {
            console.log('geolocation not available');
        }

        function getAddress(position) {
            var latlng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude); // network pull
            
            geocoder = new google.maps.Geocoder();
            geocoder.geocode({'latLng': latlng}, function(results, status) {
                if(status == google.maps.GeocoderStatus.OK) {
                    $scope.address = results[1].formatted_address;
                    $scope.$apply();
                }
            });
        };
    };
    $scope.getUserLocation();
    console.log($scope.address);

    var keywords = {"yes": true, 
        "yeah": true, 
        "sure": true, 
        "yup": true};

    var recognizer = new webkitSpeechRecognition(); // jshint ignore:line
    recognizer.onstart = function() {
        $scope.isListening = true;
        var foot = document.getElementsByClassName('footer')[0];
        var h1 = document.createElement("span");
        h1.className = 'speak-now';
        var text = document.createTextNode("speak now");
        h1.appendChild(text);
        foot.appendChild(h1);


        $scope.shrinkMic();
        console.log('speech started');
    };

    recognizer.onend = function() {
        $scope.isListening = false;
        console.log('speech ended');
        var footer = document.getElementsByClassName('footer')[0];
        var speakLabel = document.getElementsByClassName('speak-now')[0];
        console.log(speakLabel);
        footer.removeChild(speakLabel);

    };
    recognizer.continuous = true;
    recognizer.interimResults = true;
    recognizer.lang = "en";
    recognizer.onresult = function(e) {
        if(e.results.length) {
            var lastResultIndex = e.results.length - 1;
            var words = e.results[lastResultIndex][0].transcript.split(" ");
            $scope.receivedWords = words[words.length - 1];
            console.log('words is: ' + words);
            words.forEach(function(element) {
{'fraction_non_alphanumeric': 0.13211466555878687, 'fraction_numerical': 0.004570004154549232, 'mean_word_length': 2.297945205479452, 'pattern_counts': {'":': 8, '<': 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': '670210', 'n_tokens_mistral': 1398, 'n_tokens_neox': 1345, 'n_words': 241}