MCPcopy Create free account
hub / github.com/modelscope/FunASR / getHotwords

Function getHotwords

runtime/html5/static/main.js:260–288  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

258
259
260function getHotwords(){
261
262 var obj = document.getElementById("varHot");
263
264 if(typeof(obj) == 'undefined' || obj==null || obj.value.length<=0){
265 return null;
266 }
267 let val = obj.value.toString();
268
269 console.log("hotwords="+val);
270 let items = val.split(/[(\r\n)\r\n]+/); //split by \r\n
271 var jsonresult = {};
272 const regexNum = /^[0-9]*$/; // test number
273 for (item of items) {
274
275 let result = item.split(" ");
276 if(result.length>=2 && regexNum.test(result[result.length-1]))
277 {
278 var wordstr="";
279 for(var i=0;i<result.length-1;i++)
280 wordstr=wordstr+result[i]+" ";
281
282 jsonresult[wordstr.trim()]= parseInt(result[result.length-1]);
283 }
284 }
285 console.log("jsonresult="+JSON.stringify(jsonresult));
286 return JSON.stringify(jsonresult);
287
288}
289function getAsrMode(){
290
291 var item = null;

Callers 1

onOpenFunction · 0.70

Calls 1

logMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…