<commit_before>/*!*
 * mumble.js
 *
 * A simple framework for adding voice commands to a web site using the web speech recognition API.
 * Supports the CommonJs/node.js/AMD and global syntax.
 *
 * See https://github.com/swemaniac/annyang for a readme and some examples.
 * Forked from and inspired by https://github.com/TalAter/annyang.
 */
!function(t,n){"undefined"!=typeof module?module.exports=n():"function"==typeof define&&"object"==typeof define.amd?define(n):this[t]=n()}("Mumble",function(){"use strict";var t=function(t){function n(t){if(u=r(),g.isAvailable()){if(t)for(var n in f)t[n]&&(f[n]=t[n]);g.setLanguage(f.language),g.setContinuous(f.continuous),g.setAutoRestart(f.autoRestart),g.setMaxAlternatives(f.maxAlternatives),g.setDebug(f.debug),f.commands.forEach(function(t){g.addCommand(t.name,t.command,t.action)}),u.onstart=e,u.onend=o,u.onerror=i,u.onresult=a}}function e(t){c("Start listening..",t,f),s(f.callbacks.start,t,g)}function o(t){if(c("Stop listening..",t),s(f.callbacks.end,t,g),f.autoRestart&&!m){c("(Auto-restarting)");var n=(new Date).getTime()-l;1e3>n?setTimeout(g.start,1e3-n):g.start()}}function i(t){c("Error occurred",t),s(f.callbacks.error,t,g),-1!==["not-allowed","service-not-allowed"].indexOf(t.error)&&g.setAutoRestart(!1)}function a(t){c("Got result",t),s(f.callbacks.speech,t,g);for(var n=t.results[t.resultIndex],e=!1,o=0;o<n.length;o++){var i=n[o],a=i.transcript.trim();if(c('Recognized: "%s"',a),e=d.some(function(n){var e=n.command.exec(a);if(e){var o=e.slice(1);return c('Command matched: "%s", %s',n.name,n.command,o),s(f.callbacks.recognizeMatch,t,g),n.action.apply(g,o),!0}return!1}))break}return e||s(f.callbacks.recognizeNoMatch,t,g),e}function s(t,n,e){"function"==typeof t&&t.call(e,n)}function r(){var t=window.SpeechRecognition||window.webkitSpeechRecognition||window.mozSpeechRecognition||window.msSpeechRecognition||window.oSpeechRecognition;return t?new t:(c("SpeechRecognition object not supported"),null)}function c(){if(f.debug){var t=window.console||{log:function(){}};t.log.apply(t,arguments)}}var u=null,l=0,m=!1,d=[],f={language:"en-US",autoRestart:!0,continuous:"http:"===window.location.protocol,maxAlternatives:5,debug:!1,commands:[],callbacks:{start:null,end:null,speech:null,recognizeMatch:null,recognizeNoMatch:null,error:null}},g=this;this.start=function(){if(!this.isAvailable())throw"Speech recognition not supported in this browser";m=!1,l=(new Date).getTime(),c("Starting with %d command(s) active",d.length),u.start()},this.stop=function(){this.isAvailable()&&(m=!0,u.abort())},this.isAvailable=function(){return!!u},this.getSpeechRecognitionObject=function(){return u},this.addCommand=function(t,n,e){if(this.getCommand(t))throw'Command "'+t+'"" already exists';var o=new RegExp("string"==typeof n?n:n.source,"i");d.push({name:t,command:o,action:e}),c('Added command: "%s", %s',t,o)},this.removeCommand=function(t){var n=-1;d.some(function(e,o){return e.name==t?(n=o,!0):!1}),n>=0&&(delete d[n],c('Removed command "%s"',t))},this.getCommand=function(t){var n=null;return d.some(function(e){return e.name==t?(n=e,!0):!1}),n},this.setLanguage=function(t){f.language=t,this.isAvailable()&&(u.lang=f.language)},this.setAutoRestart=function(t){f.autoRestart=!!t},this.setMaxAlternatives=function(t){f.maxAlternatives=parseInt(t),this.isAvailable()&&(u.maxAlternatives=f.maxAlternatives)},this.setContinuous=function(t){f.continuous=!!t,this.isAvailable()&&(u.continuous=f.continuous)},this.setDebug=function(t){f.debug=!!t},n(t)};return t});<commit_msg>Updated to latest build<commit_after>/*!*
 * mumble.js v1.0.0
 * https://github.com/swemaniac/mumble
 *
 * A simple framework for adding voice commands to a web site using the web speech recognition API.
 * Supports the CommonJs/node.js/AMD and global syntax.
 *
 * See https://github.com/swemaniac/mumble for a readme and some examples.
 * Forked from and inspired by https://github.com/TalAter/annyang.
 */
!function(t,n){"undefined"!=typeof module?module.exports=n():"function"==typeof define&&"object"==typeof define.amd?define(n):this[t]=n()}("Mumble",function(){"use strict";var t=function(t){function n(t){if(u=r(),g.isAvailable()){if(t)for(var n in f)t[n]&&(f[n]=t[n]);g.setLanguage(f.language),g.setContinuous(f.continuous),g.setAutoRestart(f.autoRestart),g.setMaxAlternatives(f.maxAlternatives),g.setDebug(f.debug),f.commands.forEach(function(t){g.addCommand(t.name,t.command,t.action)}),u.onstart=e,u.onend=o,u.onerror=i,u.onresult=a}}function e(t){c("Start listening..",t,f),s(f.callbacks.start,t,g)}function o(t){if(c("Stop listening..",t),s(f.callbacks.end,t,g),f.autoRestart&&!m){c("(Auto-restarting)");var n=(new Date).getTime()-l;1e3>n?setTimeout(g.start,1e3-n):g.start()}}function i(t){c("Error occurred",t),s(f.callbacks.error,t,g),-1!==["not-allowed","service-not-allowed"].indexOf(t.error)&&g.setAutoRestart(!1)}function a(t){c("Got result",t),s(f.callbacks.speech,t,g);for(var n=t.results[t.resultIndex],e=!1,o=0;o<n.length;o++){var i=n[o],a=i.transcript.trim();if(c('Recognized: "%s"',a),e=d.some(function(n){var e=n.command.exec(a);if(e){var o=e.slice(1);return c('Command matched: "%s", %s',n.name,n.command,o),s(f.callbacks.recognizeMatch,t,g),n.action.apply(g,o),!0}return!1}))break}return e||s(f.callbacks.recognizeNoMatch,t,g),e}function s(t,n,e){"function"==typeof t&&t.call(e,n)}function r(){var t=window.SpeechRecognition||window.webkitSpeechRecognition||window.mozSpeechRecognition||window.msSpeechRecognition||window.oSpeechRecognition;return t?new t:(c("SpeechRecognition object not supported"),null)}function c(){if(f.debug){var t=window.console||{log:function(){}};t.log.apply(t,arguments)}}var u=null,l=0,m=!1,d=[],f={language:"en-US",autoRestart:!0,continuous:"http:"===window.location.protocol,maxAlternatives:5,debug:!1,commands:[],callbacks:{start:null,end:null,speech:null,recognizeMatch:null,recognizeNoMatch:null,error:null}},g=this;this.start=function(){if(!this.isAvailable())throw"Speech recognition not supported in this browser";m=!1,l=(new Date).getTime(),c("Starting with %d command(s) active",d.length),u.start()},this.stop=function(){this.isAvailable()&&(m=!0,u.abort())},this.isAvailable=function(){return!!u},this.getSpeechRecognitionObject=function(){return u},this.addCommand=function(t,n,e){if(this.getCommand(t))throw'Command "'+t+'"" already exists';var o=new RegExp("string"==typeof n?n:n.source,"i");d.push({name:t,command:o,action:e}),c('Added command: "%s", %s',t,o)},this.removeCommand=function(t){var n=-1;d.some(function(e,o){return e.name==t?(n=o,!0):!1}),n>=0&&(delete d[n],c('Removed command "%s"',t))},this.getCommand=function(t){var n=null;return d.some(function(e){return e.name==t?(n=e,!0):!1}),n},this.setLanguage=function(t){f.language=t,this.isAvailable()&&(u.lang=f.language)},this.setAutoRestart=function(t){f.autoRestart=!!t},this.setMaxAlternatives=function(t){f.maxAlternatives=parseInt(t),this.isAvailable()&&(u.maxAlternatives=f.maxAlternatives)},this.setContinuous=function(t){f.continuous=!!t,this.isAvailable()&&(u.continuous=f.continuous)},this.setDebug=function(t){f.debug=!!t},n(t)};return t});
{'fraction_non_alphanumeric': 0.23682361208713984, 'fraction_numerical': 0.007167955024595924, 'mean_word_length': 12.056880733944954, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 5, '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': '2714070', 'n_tokens_mistral': 2757, 'n_tokens_neox': 2712, 'n_words': 226}