Skip to content

Instantly share code, notes, and snippets.

@hurss
Created May 8, 2018 03:16
Show Gist options
  • Save hurss/ae27eaaee57f103614b1a3a8389d6054 to your computer and use it in GitHub Desktop.
Save hurss/ae27eaaee57f103614b1a3a8389d6054 to your computer and use it in GitHub Desktop.
연합뉴스용 간체자/약자/확장한자 변환기
// ==UserScript==
// @name Text Replacement
// @namespace Text Replacement
// @description 연합뉴스용 간체자/약자/확장한자 변환기
// @include *
// @exclude file://*
// @version 1
// @grant none
// @author Damheo Lee ([email protected])
// @run-at Tampermonkey (Greasemonkey) 설치후 사용
// ==/UserScript==
(function () {
var els = document.querySelectorAll('p,strong,li,meta,연합뉴스');
//var els = document.getElementsByTagName("P");
for(var i = 0, l = els.length; i < l; i++) {
var el = els[i];
// 벽자
el.innerHTML = el.innerHTML.replace(/준&lt;俊에서 사람인변 제거&gt;/gi, '夋');
el.innerHTML = el.innerHTML.replace(/&lt;木\+觀&gt;/gi, '欟');
el.innerHTML = el.innerHTML.replace(/침&lt;木\+岑&gt;/gi, '梣');
el.innerHTML = el.innerHTML.replace(/완&lt;풀초 아래에 亂&gt;/gi, '薍');
el.innerHTML = el.innerHTML.replace(/낭&lt;問에서 口 대신 良&gt;/gi, '閬');
el.innerHTML = el.innerHTML.replace(/랑&lt;問에서 口 대신 良&gt;/gi, '閬');
el.innerHTML = el.innerHTML.replace(/口\+卒/gi, '啐');
el.innerHTML = el.innerHTML.replace(/&lt;口\+卒&gt;/gi, '啐');
el.innerHTML = el.innerHTML.replace(/&lt;水\+亶&gt;/gi, '澶');
el.innerHTML = el.innerHTML.replace(/&lt;手\+爲&gt;/gi, '撝');
el.innerHTML = el.innerHTML.replace(/우\[土\+偶자에 人변 없음\]/gi, '堣');
el.innerHTML = el.innerHTML.replace(/면\[人변\+免\]/gi, '俛');
el.innerHTML = el.innerHTML.replace(/역\[木변\+樂\]/gi, '櫟');
el.innerHTML = el.innerHTML.replace(/력\[木변\+樂\]/gi, '櫟');
el.innerHTML = el.innerHTML.replace(/논&lt;木\+言\+木&gt;/gi, '㯎');
el.innerHTML = el.innerHTML.replace(/침&lt;沈에서 물수변 대신 마음심변&gt;/gi, '忱');
// 브랜드
el.innerHTML = el.innerHTML.replace(/經團連/gi, '経団連');
el.innerHTML = el.innerHTML.replace(/月の滿ち欠け/gi, '月の満ち欠け');
el.innerHTML = el.innerHTML.replace(/華爲/gi, '华为');
el.innerHTML = el.innerHTML.replace(/多維/gi, '多维');
el.innerHTML = el.innerHTML.replace(/新聞網/gi, '新闻网');
el.innerHTML = el.innerHTML.replace(/人民網/gi, '人民网');
el.innerHTML = el.innerHTML.replace(/央視網/gi, '央视网');
el.innerHTML = el.innerHTML.replace(/浙江華友鈷業/gi, '浙江华友钴业');
el.innerHTML = el.innerHTML.replace(/天安門/gi, '天安门');
el.innerHTML = el.innerHTML.replace(/百度貼吧/gi, '百度贴吧');
// 인명지명자
el.innerHTML = el.innerHTML.replace(/&lt;木\+庸&gt;/gi, '槦');
el.innerHTML = el.innerHTML.replace(/&lt;王\+賓&gt;/gi, '璸');
el.innerHTML = el.innerHTML.replace(/예&lt;초두머리 아래 刈&gt;/gi, '苅');
el.innerHTML = el.innerHTML.replace(/오&lt;갈래지을 오, 人변\+口\+天, 天이 口아래에 있음&gt;/gi, '俣');
el.innerHTML = el.innerHTML.replace(/&lt;魚\+念&gt;/gi, '鯰');
el.innerHTML = el.innerHTML.replace(/통&lt;木\+通&gt;/gi, '樋');
el.innerHTML = el.innerHTML.replace(/신&lt;木\+神&gt;/gi, '榊');
el.innerHTML = el.innerHTML.replace(/신&lt;木\+神&gt;/gi, '榊');
el.innerHTML = el.innerHTML.replace(/십&lt;于 대신 十이 들어간 迂&gt;/gi, '辻');
el.innerHTML = el.innerHTML.replace(/신<木+神>/gi, '榊');
el.innerHTML = el.innerHTML.replace(/인&lt;米\+刃&gt;/gi, '籾');
el.innerHTML = el.innerHTML.replace(/천&lt;土\+川&gt;/gi, '圳');
el.innerHTML = el.innerHTML.replace(/빈&lt;초두머리 아래 頻&gt;/gi, '蘋');
el.innerHTML = el.innerHTML.replace(/라&lt;金\+羅&gt;/gi, '鑼');
el.innerHTML = el.innerHTML.replace(/지&lt;兼대신虎들어간簾&gt;/gi, '篪');
el.innerHTML = el.innerHTML.replace(/니&lt;人+爾&gt;/gi, '你');
el.innerHTML = el.innerHTML.replace(/구&lt;求 밑에 衣&gt;/gi, '裘');
el.innerHTML = el.innerHTML.replace(/공&lt;龍 밑에 共&gt;/gi, '龔');
el.innerHTML = el.innerHTML.replace(/탁&lt;又대신尺들어간度&gt;/gi, '庹');
el.innerHTML = el.innerHTML.replace(/호&lt;삼수변\+扈&gt;/gi, '滬');
el.innerHTML = el.innerHTML.replace(/위&lt;火\+韋&gt;/gi, '煒');
el.innerHTML = el.innerHTML.replace(/반&lt;月\+半&gt;/gi, '胖');
el.innerHTML = el.innerHTML.replace(/고&lt;金\+古&gt;/gi, '鈷');
el.innerHTML = el.innerHTML.replace(/욕&lt;山\+谷&gt;/gi, '峪');
el.innerHTML = el.innerHTML.replace(/로&lt;山\+勞&gt;/gi, '崂');
el.innerHTML = el.innerHTML.replace(/&lt;口\+幼&gt;/gi, '呦');
el.innerHTML = el.innerHTML.replace(/파&lt;口\+巴&gt;/gi, '吧');
el.innerHTML = el.innerHTML.replace(/영&lt;口\+永&gt;/gi, '咏');
el.innerHTML = el.innerHTML.replace(/섭&lt;手변없는攝&gt;/gi, '聶');
el.innerHTML = el.innerHTML.replace(/섭&lt;손수변 없는 攝&gt;/gi, '聶');
el.innerHTML = el.innerHTML.replace(/섭&lt;손수변없는攝&gt;/gi, '聶');
el.innerHTML = el.innerHTML.replace(/손수변 없는 攝/gi, '聶');
el.innerHTML = el.innerHTML.replace(/송&lt;터럭발 아래 松&gt;/gi, '鬆');
el.innerHTML = el.innerHTML.replace(/묘&lt;水 아래 水水&gt;/gi, '淼');
el.innerHTML = el.innerHTML.replace(/위&lt;人대신火들어간偉&gt;/gi, '煒');
el.innerHTML = el.innerHTML.replace(/외&lt;木\+危&gt;/gi, '桅');
el.innerHTML = el.innerHTML.replace(/추&lt;木\+垂&gt;/gi, '棰');
el.innerHTML = el.innerHTML.replace(/각&lt;木\+角&gt;/gi, '桷');
el.innerHTML = el.innerHTML.replace(/품&lt;木\+品&gt;/gi, '榀');
el.innerHTML = el.innerHTML.replace(/체&lt;木+隷&gt;/gi, '棣');
el.innerHTML = el.innerHTML.replace(/&lt;金\(쇠금\)3개&gt;/gi, '鑫');
el.innerHTML = el.innerHTML.replace(/패&lt;土\+覇&gt;/gi, '壩');
el.innerHTML = el.innerHTML.replace(/우&lt;土\+于&gt;/gi, '圩');
el.innerHTML = el.innerHTML.replace(/진&lt;至\+秦&gt;/gi, '臻');
el.innerHTML = el.innerHTML.replace(/뢰&lt;손수변雷&gt;/gi, '擂');
// 중국관련
el.innerHTML = el.innerHTML.replace(/中國/gi, '中国');
el.innerHTML = el.innerHTML.replace(/廣東/gi, '广东');
el.innerHTML = el.innerHTML.replace(/堀起/gi, '崛起');
el.innerHTML = el.innerHTML.replace(/훙\(轟/gi, '훙\(轰');
el.innerHTML = el.innerHTML.replace(/젠\(殲/gi, '젠\(歼');
el.innerHTML = el.innerHTML.replace(/피리\(霹靂/gi, '피리\(霹雳');
el.innerHTML = el.innerHTML.replace(/內蒙古/gi, '内蒙古');
el.innerHTML = el.innerHTML.replace(/遼寧/gi, '辽宁');
el.innerHTML = el.innerHTML.replace(/瀋陽/gi, '沈阳');
el.innerHTML = el.innerHTML.replace(/룽징\(龍井/gi, '룽징\(龙井');
el.innerHTML = el.innerHTML.replace(/遊客/gi, '游客');
el.innerHTML = el.innerHTML.replace(/長沙/gi, '长沙');
el.innerHTML = el.innerHTML.replace(/重慶/gi, '重庆');
el.innerHTML = el.innerHTML.replace(/順義/gi, '顺义');
el.innerHTML = el.innerHTML.replace(/잔란\(湛藍/gi, '잔란\(湛蓝');
el.innerHTML = el.innerHTML.replace(/훙치\(紅旗/gi, '훙치\(红旗');
el.innerHTML = el.innerHTML.replace(/잉지\(鷹擊/gi, '잉지\(鹰击');
el.innerHTML = el.innerHTML.replace(/위\(魚/gi, '위\(鱼');
el.innerHTML = el.innerHTML.replace(/둥펑\(東風/gi, '둥펑\(东风');
el.innerHTML = el.innerHTML.replace(/陝西/gi, '陕西');
el.innerHTML = el.innerHTML.replace(/淸華/gi, '清华');
el.innerHTML = el.innerHTML.replace(/華東/gi, '华东');
el.innerHTML = el.innerHTML.replace(/季風/gi, '季风');
el.innerHTML = el.innerHTML.replace(/廣州/gi, '广州');
el.innerHTML = el.innerHTML.replace(/武漢/gi, '武汉');
el.innerHTML = el.innerHTML.replace(/遼寧/gi, '辽宁');
el.innerHTML = el.innerHTML.replace(/大連/gi, '大连');
el.innerHTML = el.innerHTML.replace(/溫州/gi, '温州');
el.innerHTML = el.innerHTML.replace(/華潤/gi, '华润');
el.innerHTML = el.innerHTML.replace(/九寨溝/gi, '九寨沟');
el.innerHTML = el.innerHTML.replace(/騰迅/gi, '腾迅');
el.innerHTML = el.innerHTML.replace(/阿壩/gi, '阿坝');
el.innerHTML = el.innerHTML.replace(/寶鷄/gi, '宝鸡');
el.innerHTML = el.innerHTML.replace(/漢中/gi, '汉中');
el.innerHTML = el.innerHTML.replace(/悅達/gi, '悦达');
// 일본관련
el.innerHTML = el.innerHTML.replace(/도치기\(檜木/gi, '도치기\(栃木');
el.innerHTML = el.innerHTML.replace(/회&lt;又대신 万이 들어간 板&gt;木/gi, '栃木');
el.innerHTML = el.innerHTML.replace(/沖繩/gi, '沖縄');
// 일본인명
el.innerHTML = el.innerHTML.replace(/太郞/gi, '太郎');
el.innerHTML = el.innerHTML.replace(/一郞/gi, '一郎');
el.innerHTML = el.innerHTML.replace(/塚本/gi, '塚本');
el.innerHTML = el.innerHTML.replace(/昭惠/gi, '昭恵');
el.innerHTML = el.innerHTML.replace(/佐川宣壽/gi, '佐川宣寿');
el.innerHTML = el.innerHTML.replace(/谷査惠子/gi, '谷査恵子');
el.innerHTML = el.innerHTML.replace(/今井尙哉/gi, '今井尚哉');
el.innerHTML = el.innerHTML.replace(/內藤榮/gi, '内藤栄');
el.innerHTML = el.innerHTML.replace(/沼田眞佑/gi, '沼田真佑');
el.innerHTML = el.innerHTML.replace(/鹽崎/gi, '塩崎');
el.innerHTML = el.innerHTML.replace(/古館伊知郞/gi, '古舘伊知郎');
el.innerHTML = el.innerHTML.replace(/水落敏榮/gi, '水落敏栄');
// 중국인명
el.innerHTML = el.innerHTML.replace(/劉建超/gi, '刘建超');
el.innerHTML = el.innerHTML.replace(/樂玉成/gi, '乐玉成');
el.innerHTML = el.innerHTML.replace(/楊潔篪/gi, '杨洁篪');
el.innerHTML = el.innerHTML.replace(/習近平/gi, '习近平');
el.innerHTML = el.innerHTML.replace(/溫家寶/gi, '温家宝');
el.innerHTML = el.innerHTML.replace(/華春瑩/gi, '华春莹');
el.innerHTML = el.innerHTML.replace(/傅瑩/gi, '傅莹');
el.innerHTML = el.innerHTML.replace(/宋濤/gi, '宋涛');
el.innerHTML = el.innerHTML.replace(/孫政才/gi, '孙政才');
el.innerHTML = el.innerHTML.replace(/薄熙來/gi, '薄熙来');
el.innerHTML = el.innerHTML.replace(/易綱/gi, '易纲');
el.innerHTML = el.innerHTML.replace(/馮新柱/gi, '冯新柱');
el.innerHTML = el.innerHTML.replace(/魯煒/gi, '鲁炜');
el.innerHTML = el.innerHTML.replace(/劉强/gi, '刘强');
el.innerHTML = el.innerHTML.replace(/張杰輝/gi, '张杰辉');
el.innerHTML = el.innerHTML.replace(/楊曉渡/gi, '杨晓渡');
el.innerHTML = el.innerHTML.replace(/陳敏爾/gi, '陈敏尔');
el.innerHTML = el.innerHTML.replace(/韓正/gi, '韩正');
el.innerHTML = el.innerHTML.replace(/張德江/gi, '张德江');
el.innerHTML = el.innerHTML.replace(/劉雲山/gi, '刘云山');
el.innerHTML = el.innerHTML.replace(/兪正聲/gi, '兪正声');
el.innerHTML = el.innerHTML.replace(/張高麗/gi, '张高丽');
el.innerHTML = el.innerHTML.replace(/毛澤東/gi, '毛泽东');
el.innerHTML = el.innerHTML.replace(/胡春華/gi, '胡春华');
el.innerHTML = el.innerHTML.replace(/栗戰書/gi, '栗战书');
el.innerHTML = el.innerHTML.replace(/彭麗媛/gi, '彭丽媛');
el.innerHTML = el.innerHTML.replace(/江澤民/gi, '江泽民');
el.innerHTML = el.innerHTML.replace(/溫雲超/gi, '温云超');
el.innerHTML = el.innerHTML.replace(/尙玉英/gi, '尚玉英');
el.innerHTML = el.innerHTML.replace(/聶辰席/gi, '聂辰席');
el.innerHTML = el.innerHTML.replace(/嚴搏非/gi, '严搏非');
el.innerHTML = el.innerHTML.replace(/秦暉/gi, '秦晖');
el.innerHTML = el.innerHTML.replace(/童之偉/gi, '童之伟');
el.innerHTML = el.innerHTML.replace(/劉鶴/gi, '刘鹤');
el.innerHTML = el.innerHTML.replace(/王義桅/gi, '王义桅');
el.innerHTML = el.innerHTML.replace(/陳風英/gi, '陈风英');
el.innerHTML = el.innerHTML.replace(/周恩來/gi, '周恩来');
el.innerHTML = el.innerHTML.replace(/劉少奇/gi, '刘少奇');
el.innerHTML = el.innerHTML.replace(/鄧小平/gi, '邓小平');
el.innerHTML = el.innerHTML.replace(/劉曉波/gi, '刘晓波');
el.innerHTML = el.innerHTML.replace(/王立軍/gi, '王立军');
el.innerHTML = el.innerHTML.replace(/賈榀/gi, '贾榀');
el.innerHTML = el.innerHTML.replace(/黎學文/gi, '黎学文');
el.innerHTML = el.innerHTML.replace(/黃思敏/gi, '黄思敏');
el.innerHTML = el.innerHTML.replace(/吳斌/gi, '吴斌');
el.innerHTML = el.innerHTML.replace(/夏寶龍/gi, '夏宝龙');
el.innerHTML = el.innerHTML.replace(/車俊/gi, '车俊');
el.innerHTML = el.innerHTML.replace(/王東明/gi, '王东明');
el.innerHTML = el.innerHTML.replace(/郭文貴/gi, '郭文贵');
el.innerHTML = el.innerHTML.replace(/傅政華/gi, '傅政华');
el.innerHTML = el.innerHTML.replace(/胡錦濤/gi, '胡锦涛');
el.innerHTML = el.innerHTML.replace(/鄧卓棣/gi, '邓卓棣');
el.innerHTML = el.innerHTML.replace(/劉宗巍/gi, '刘宗巍');
//el.innerHTML = el.innerHTML.replace(//gi, '');
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment