paricafe/packages/backend/assets/js/tinyld.normal.node.mjs

2 lines
577 KiB
JavaScript
Raw Normal View History

2024-11-19 06:58:15 -06:00
var N={TINYLD_CONFIG:"normal"};var y=/[,.。,、#%&/\\+*¡!¿?[\];:…„“«»”"“_—~]/gi,p=/[0-9]/g,S=/[\uFF10-\uFF19]/g,v=/\s\s+/g,j=//gi,H=/[\u0300-\u036f]/g;function X(a){return typeof a=="string"||a instanceof String}function V(a){return a.toLowerCase().replace(j,"'").replace(y," ").replace(S,i=>String.fromCharCode(i.charCodeAt(0)-65248)).replace(p,"").replace(v," ").trim()}function U(a){return a.normalize("NFD").replace(H,"")}var P={light:{TRAINING_UNIQUE_GRAMS:[1,2,3,4],TOP_LANGUAGE_UNIQUE_GRAMS:60,TOP_LANGUAGE_STATS_GRAMS:50},normal:{TRAINING_UNIQUE_GRAMS:[1,2,3,4,5],TOP_LANGUAGE_UNIQUE_GRAMS:100,TOP_LANGUAGE_STATS_GRAMS:180},heavy:{TRAINING_UNIQUE_GRAMS:[1,2,3,4,5],TOP_LANGUAGE_UNIQUE_GRAMS:320,TOP_LANGUAGE_STATS_GRAMS:1024}},M=N.TINYLD_CONFIG||"normal",F=P[M].TRAINING_UNIQUE_GRAMS,n0=P[M].TOP_LANGUAGE_UNIQUE_GRAMS,o0=P[M].TOP_LANGUAGE_STATS_GRAMS,R=1e4;function Q(a){return Math.round(a*R)/R}var T=a=>{let i={only:[],verbose:!1};return a?Object.assign(i,a):i},u={afr:{code:"af",region:"africa",name:"Afrikaans",skipLight:!0},amh:{code:"am",region:"africa",name:"Amharic",skipLight:!0,coefProb:0},ber:{code:"ber",region:"africa",name:"Berber",skipLight:!0,coefProb:.25},run:{code:"rn",region:"africa",name:"Kirundi",skipLight:!0},jpn:{code:"ja",region:"asia-east",name:"Japanese",alias:["jp"],coefProb:0},cmn:{code:"zh",region:"asia-east",name:"Chinese",alias:["cn"],coefProb:.25},kor:{code:"ko",region:"asia-east",name:"Korean",alias:["kr"],coefProb:0},mya:{code:"my",region:"asia",name:"Burmese",skipLight:!0,coefProb:0},tha:{code:"th",region:"asia",name:"Thai",coefProb:0},vie:{code:"vi",region:"asia",name:"Vietnamese",skipLight:!0,coefProb:0},ind:{code:"id",region:"asia",name:"Indonesian",skipLight:!0},khm:{code:"km",region:"asia",name:"Khmer",skipLight:!0,coefProb:0},tgl:{code:"tl",region:"asia",name:"Tagalog",skipLight:!0},ben:{code:"bn",region:"asia-south",name:"Bengali",coefProb:0},tam:{code:"ta",region:"asia-south",name:"Tamil",skipLight:!0,coefProb:0},hin:{code:"hi",region:"asia-south",name:"Hindi",coefProb:0},urd:{code:"ur",region:"asia-south",name:"Urdu",skipLight:!0,coefProb:0},guj:{code:"gu",region:"asia-south",name:"Gujarati",skipLight:!0,coefProb:0},kan:{code:"kn",region:"asia-south",name:"Kannada",skipLight:!0,coefProb:0},tel:{code:"te",region:"asia-south",name:"Telugu",skipLight:!0,coefProb:0},fra:{code:"fr",region:"europe-west",name:"French"},eng:{code:"en",region:"europe-west",name:"English",alias:["us","gb"]},deu:{code:"de",region:"europe-west",name:"German",coefProb:.5},spa:{code:"es",region:"europe-west",name:"Spanish"},por:{code:"pt",region:"europe-west",name:"Portuguese",alias:["po"]},ita:{code:"it",region:"europe-west",name:"Italian"},nld:{code:"nl",region:"europe-west",name:"Dutch"},gle:{code:"ga",region:"europe-west",name:"Irish",skipLight:!0},lat:{code:"la",region:"europe",name:"Latin",skipLight:!0},ces:{code:"cs",region:"europe",name:"Czech",skipLight:!0},srp:{code:"sr",region:"europe",name:"Serbian",skipLight:!0},ell:{code:"el",region:"europe",name:"Greek",alias:["gr"],coefProb:0},mkd:{code:"mk",region:"europe",name:"Macedonian",skipLight:!0,coefProb:1.5},slk:{code:"sk",region:"europe",name:"Slovak",skipLight:!0},dan:{code:"da",region:"europe-north",name:"Danish",skipLight:!0,coefProb:1.5},swe:{code:"sv",region:"europe-north",name:"Swedish"},fin:{code:"fi",region:"europe-north",name:"Finnish"},nob:{code:"no",region:"europe-north",name:"Norwegian",coefProb:1.5},isl:{code:"is",region:"europe-north",name:"Icelandic",skipLight:!0,coefProb:.5},hun:{code:"hu",region:"europe-east",name:"Hungarian"},ron:{code:"ro",region:"europe-east",name:"Romanian",coefProb:.5},bul:{code:"bg",region:"europe-east",name:"Bulgarian",skipLight:!0},bel:{code:"be",region:"europe-east",name:"Belarusian",skipLight:!0},rus:{code:"ru",region:"europe-east",name:"Russian"},ukr:{code:"uk",region:"europe-east",name:"Ukrainian",skipLight:!0},pol:{code:"pl",region:"europe-east",name:"Polish",coefProb:.5},lit:{code:"lt",region:"europe-east",name:"Lithuanian",skipLight:!0},est:{code:"et",region:"europe-east",name:"