| 44 | const nameblnx = /(高倍|(?!1)2+(x|倍)|ˣ²|ˣ³|ˣ⁴|ˣ⁵|ˣ¹⁰)/i; |
| 45 | const namenx = /(高倍|(?!1)(0\.|\d)+(x|倍)|ˣ²|ˣ³|ˣ⁴|ˣ⁵|ˣ¹⁰)/i; |
| 46 | function operator(y) { |
| 47 | y.forEach((e) => { |
| 48 | Object.keys(rurekey).forEach((ikey) => { |
| 49 | e.name = e.name.replace(rurekey[ikey], ikey); |
| 50 | }); |
| 51 | }); |
| 52 | if (inname !== "") { |
| 53 | var inputList = gl(inname); |
| 54 | } else { |
| 55 | const inn = y.slice(0, 10).map((proxy) => gReg(proxy.name)).reduce((counts, region) => { |
| 56 | counts[region] = (counts[region] || 0) + 1; |
| 57 | return counts; |
| 58 | }, {}); |
| 59 | const rein = Object.entries(inn); |
| 60 | rein.sort((a, b) => b[1] - a[1]); |
| 61 | const regss = rein[0][0]; |
| 62 | var inputList = gl(regss); |
| 63 | } |
| 64 | var outputList = gl($arguments["out"]); |
| 65 | var ik = inputList.reduce((acc, curr, index) => { |
| 66 | acc[curr] = [outputList[index], 0];return acc; |
| 67 | }, {}); |
| 68 | if(clear){y = y.filter(res => !nameclear.test(res.name))} |
| 69 | if(nx){y = y.filter(res => !res.name.match(namenx))} |
| 70 | if(blnx){y = y.filter(res => res.name.match(nameblnx))} |
| 71 | const delFgf = []; |
| 72 | const newPr = []; |
| 73 | y.forEach((res) => { |
| 74 | let isFgf = false; |
| 75 | const ikey=[] |
| 76 | if (!nf) {ikey.push(jcname)} |
| 77 | for (const elem of Object.keys(ik)) { |
| 78 | if (res.name.indexOf(elem) !== -1) { |
| 79 | if (!isFgf) { |
| 80 | isFgf = true; |
| 81 | ik[elem][1] += 1; |
| 82 | let namekey = nf ? jcname + FGF : ""; |
| 83 | if (addflag) { |
| 84 | ikey.push(gF(us[Object.keys(ik).indexOf(elem)]) +FGF+ namekey + ik[elem][0]); |
| 85 | } else { |
| 86 | ikey.push(ik[elem][0]); |
| 87 | } |
| 88 | if (bl) { |
| 89 | regexArray.forEach((regex, index) => { |
| 90 | if (regex.test(res.name)) { |
| 91 | ikey.splice(2, 0, valueArray[index]);}}); |
| 92 | const match = res.name.match(/(倍率\D?((\d\.)?\d+)\D?)|((\d\.)?\d+)(倍|X|x|×)/); |
| 93 | if (match) { |
| 94 | const rev = match[0].match(/(\d[\d.]*)/)[0]; |
| 95 | if (rev !== '1') { |
| 96 | const newValue = rev + "×"; |
| 97 | ikey.push(newValue);}} |
| 98 | } |
| 99 | } |
| 100 | } |
| 101 | } |
| 102 | if (isFgf) { |
| 103 | const kb = ikey.filter(item => item.trim() !== ''); |