<commit_before>var final_transcript = '';
var recognizing = false;
var recognition;

// reply processing
var two_line = /\n\n/g;
var one_line = /\n/g;
function linebreak(s) {
  return s.replace(two_line, '<p></p>').replace(one_line, '<br>');
}

var first_char = /\S/;
function capitalize(s) {
  return s.replace(first_char, function(m) { return m.toUpperCase(); });
}

function startConverting() {
    console.log("coming");
  if (recognizing) {
    recognition.stop();
    return;
  }
  console.log("25");
  final_transcript = '';
  recognition.lang = 'en-US';
  recognition.start();
}


function show_result(){
     if(final_transcript.toLowerCase() == 'hello'){
                $('#hello_response').text("Hi! I'm Bhuvanesh")
                $('#hello_response').css('background-color', '#18bc9c');
            }
            else if(final_transcript.toLowerCase() == 'show me your picture'){
                $('#pic_response').append('<img class="img-fluid" src="img/profile3.jpg">');
            }
            else if(final_transcript.toLowerCase() == 'show expense report'){
                $('#report_response').animate({bottom: '-100px'});
            }
  final_transcript = "";
}


$( document ).ready(function() {
    if('webkitSpeechRecognition' in window){
        recognition = new webkitSpeechRecognition();
        recognition.continuous = false;
        recognition.interimResults = false;
        recognition.maxAlternatives = 1;

        recognition.onstart = function() {
            
            // $('#mic').css('color', 'red');
            console.log("in onstart");
            recognizing = true;
        };
        recognition.onend = function() {
            // $('#mic').css('color', 'black');
            console.log("in onend");
            recognizing = false;
            recognition.start();
            console.log("-------------",final_transcript);
            
            
        };
        recognition.onspeechstart = function() {    
            console.log("in onspeechstart");
            // setTimeout(function(){<commit_msg>Update speech_recognition.js<commit_after>var final_transcript = '';
var recognizing = false;
var recognition;

// reply processing
var two_line = /\n\n/g;
var one_line = /\n/g;
function linebreak(s) {
  return s.replace(two_line, '<p></p>').replace(one_line, '<br>');
}

var first_char = /\S/;
function capitalize(s) {
  return s.replace(first_char, function(m) { return m.toUpperCase(); });
}

function startConverting() {
    console.log("coming");
  if (recognizing) {
    recognition.stop();
    return;
  }
  console.log("25");
  final_transcript = '';
  recognition.lang = 'en-US';
  recognition.start();
}


function show_result(){
     if(final_transcript.toLowerCase() == 'hello'){
                $('#hello_response').text("Hi! I'm Bhuvanesh")
                $('#hello_response').css('background-color', '#18bc9c');
            }
            else if(final_transcript.toLowerCase() == 'show me your picture'){
                $('#pic_response').append('<img class="img-fluid" src="img/profile3.jpg">');
            }
            else if(final_transcript.toLowerCase() == 'show expense report'){
                $("#report_response").css("display", "block");
                $('#report_response').animate({bottom: '-100px'});
            }
  final_transcript = "";
}


$( document ).ready(function() {
    if('webkitSpeechRecognition' in window){
        recognition = new webkitSpeechRecognition();
        recognition.continuous = false;
        recognition.interimResults = false;
        recognition.maxAlternatives = 1;

        recognition.onstart = function() {
            
            // $('#mic').css('color', 'red');
            console.log("in onstart");
            recognizing = true;
        };
        recognition.onend = function() {
            // $('#mic').css('color', 'black');
            console.log("in onend");
            recognizing = false;
            recognition.start();
            console.log("-------------",final_transcript);
            
            
        };
        recognition.onspeechstart = function() {    
            console.log("in onspeechstart");
            // setTimeout(function(){
{'fraction_non_alphanumeric': 0.16967680608365018, 'fraction_numerical': 0.004752851711026616, 'mean_word_length': 2.29858934169279, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '2453154', 'n_tokens_mistral': 1218, 'n_tokens_neox': 1197, 'n_words': 214}