// ARRAY DI PAROLE NORMALE, POI PYTHON -> split, for loop, POS e <span con classe POS in html
// ARRAY DI PAROLE NORMALE, POI PYTHON -> split, for loop, POS e <span con classe POS in html
// The Myth of the Natural Language %%
// The Myth of the Natural Language %%
// Speech2Design!!
// Speech2Design!!
@ -12,15 +11,13 @@
// An API is a set of defined rules that explain how computers or applications communicate with one another.
// An API is a set of defined rules that explain how computers or applications communicate with one another.
// APIs sit between an application and the web server, acting as an intermediary layer that processes data transfer between systems.
// APIs sit between an application and the web server, acting as an intermediary layer that processes data transfer between systems.
// GLOBAL VARIABLES
// GLOBAL VARIABLES
letinterimTranscripts="";// Variable for interim results, the Speech-to-text try different worlds before to give us the most correct one.
letinterimTranscripts="";// Variable for interim results, the Speech-to-text try different worlds before to give us the most correct one.
letallTheInterim="";// Variable to store *all* the interim results
letallTheInterim="";// Variable to store *all* the interim results
letfinalTranscripts="";// Variable for the... final transcripts
letfinalTranscripts="";// Variable for the final transcripts
// To define bridges to the html file:
// To define bridges to the html file:
letspeech=document.getElementById("result");// where to print the final result of the recognition
letspeech=document.getElementById("result");// where to print the final result of the recognition
letprocess=document.getElementById("process");// and here the process, print the current sentence with interim results
letprocess=document.getElementById("process");// and here the process, print the current sentence with interim results
@ -28,12 +25,13 @@ let process = document.getElementById("process"); // and here the process, pri
lettextStorage=localStorage.getItem("speech");// This define where to save the results.
lettextStorage=localStorage.getItem("speech");// This define where to save the results.
speech.innerHTML=textStorage;// LocalStorage is a type of web storage that allows you to access a local Storage object and store the data in the browser with no expiration date.
speech.innerHTML=textStorage;// LocalStorage is a type of web storage that allows you to access a local Storage object and store the data in the browser with no expiration date.
finalTranscripts=textStorage;
// RESET STORAGE
// RESET STORAGE
letresetStorage=document.getElementById("reset");// This will just reset, through a button, all the results got by that moment.
letresetStorage=document.getElementById("reset");// This will just reset, through a button, all the results got by that moment.
}else{// There are also shown the interim results and according to their "confidence" (the percentage of how much the word is correct) the color of each word could change
// There are also shown the interim results and according to their "confidence" (the percentage of how much the word is correct) the color of each word could change