1// å ¨è§æ°åâåè§æ°å 2String.prototype.toSingleByteNumeric = function() { 3 return this.replace(/[ï¼-ï¼]/g, function(s) { 4 return String.fromCharCode(s.charCodeAt(0) - 0xfee0); 5 }); 6} 7 8// ã²ãããªâã«ã¿ã«ã 9String.prototype.toKatakana = function() { 10 return this.replace(/[ã-ã]/g, function(s) { 11 return String.fromCharCode(s.charCodeAt(0) + 0x60); 12 }); 13} 14 15// åè§è±æ°åâå ¨è§è±æ°å 16String.prototype.toFullwidthChar = function() { 17 return this.replace(/[A-Za-z0-9]/g, function(s) { 18 return String.fromCharCode(s.charCodeAt(0) + 0xfee0); 19 }); 20} 21 22// åè§è±æ°åã»åè§()âå ¨è§è±æ°åã»å ¨è§ï¼ï¼ 23String.prototype.toFullwidthCharKakko = function() { 24 return this.replace(/[A-Za-z0-9()]/g, function(s) { 25 return String.fromCharCode(s.charCodeAt(0) + 0xfee0); 26 }); 27} 28 29// å ¨è§è±æ°åã»è¨å·âåè§è±æ°åã»è¨å· 30String.prototype.toHalfwidthChar = function() { 31 return this.replace(/[ï¼-ï½]/g, function(s) { 32 return String.fromCharCode(s.charCodeAt(0) - 0xfee0); 33 }); 34} 35 36// åè§ã«ãâå ¨è§ã«ã 37const D_MUD = 'ã¬ã®ã°ã²ã´ã¶ã¸ãºã¼ã¾ããã ãããããããããããã'; 38const S_MUD = 'ï½¶ï¾ï½·ï¾ï½¸ï¾ï½¹ï¾ï½ºï¾ï½»ï¾ï½¼ï¾ï½½ï¾ï½¾ï¾ï½¿ï¾ï¾ï¾ï¾ï¾ï¾ï¾ï¾ï¾ï¾ï¾ï¾ï¾ï¾ï¾ï¾ï¾ï¾ï¾ï¾ï¾ï¾ï¾ï¾ï¾ï¾ï¾ï¾ï¾ï¾ï¾'; 39const D_KIY = 'ã¢ã¤ã¦ã¨ãªã«ãã¯ã±ã³ãµã·ã¹ã»ã½ã¿ããããããããããããããããã ã¡ã¢ã¤ã¦ã¨ã©ãªã«ã¬ãã¯ã²ã³ã¡ã£ã¥ã§ã©ãã£ã¥ã§ããã¼ããã»ã¼ï¼ï¼'; 40const S_KIY = 'アイウエオカキクケコサシスセソï¾ï¾ï¾ï¾ï¾ï¾ ï¾ï¾ï¾ï¾ï¾ï¾ï¾ï¾ï¾ï¾ï¾ï¾ï¾ï¾ï¾ï¾ï¾ï¾ï¾ï¾ï¾ï¾ï¾ï½¦ï¾ï½§ï½¨ï½©ï½ªï½«ï½¯ï½¬ï½ï½®ï½¡ï½¤ã¼ï½¢ï½£ï½¥ï½°-ââ»'; 41const D_KIGO = 'ââ'; 42const S_KIGO = '\`\''; 43const D_NOBASI = 'ã¼'; 44const D_HYPHEN = 'ï¼'; 45// åè§ã«ãâå ¨è§ã«ã 46const toZenKana = str =>{ 47 for(let i=0, len=D_MUD.length; i<len; i++) { 48 const re = new RegExp(S_MUD.slice(i*2, i*2+2), 'g'); 49 str = str.replace(re ,D_MUD.slice(i,i+1)); 50 } 51 for(let i=0, len=D_KIY.length; i<len; i++) { 52 const re= new RegExp(S_KIY.slice(i, i+1), 'g'); 53 str = str.replace(re,D_KIY.slice(i,i+1)); 54 } 55 return str; 56}; 57 58// å ¨è§è¨å·(ââ)âåè§è¨å·(`') 59const toHanKigo = str =>{ 60 for(let i=0, len=S_KIGO.length; i<len; i++) { 61 const re= new RegExp(D_KIGO.slice(i, i+1), 'g'); 62 str = str.replace(re,S_KIGO.slice(i,i+1)); 63 } 64 return str; 65}; 66// ï¼ âã¼ 67const toZenHyphen = str =>{ 68 for(let i=0, len=D_NOBASI.length; i<len; i++) { 69 const re= new RegExp(D_HYPHEN.slice(i, i+1), 'g'); 70 str = str.replace(re,D_NOBASI.slice(i,i+1)); 71 } 72 return str; 73};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.