From df0a51ac8719d7edfedf52286862e4c7e5cc0042 Mon Sep 17 00:00:00 2001 From: yunusong Date: Fri, 26 May 2017 11:30:54 -0400 Subject: [PATCH 01/18] Create KStudy.js --- KStudy.js | 106 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 KStudy.js diff --git a/KStudy.js b/KStudy.js new file mode 100644 index 0000000000..52feac939b --- /dev/null +++ b/KStudy.js @@ -0,0 +1,106 @@ +{ + "translatorID": "b298ca93-0010-48f5-97fb-e9923519a380", + "label": "KStudy", + "creator": "Yunwoo Song", + "target": "^https?://[^/]+\\.kstudy\\.com", + "minVersion": "3.0", + "maxVersion": "", + "priority": 100, + "inRepository": true, + "translatorType": 4, + "browserSupport": "gcsi", + "lastUpdated": "2017-05-25 22:14:50" +} + +/* + ***** BEGIN LICENSE BLOCK ***** + + KISS (Koreanstudies Information Service System) Translator + Copyright © 2017 Yunwoo Song + + This file is part of Zotero. + + Zotero is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Zotero is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with Zotero. If not, see . + + ***** END LICENSE BLOCK ***** +*/ + + +/* FW LINE 59:b820c6d */ function flatten(t){var e=new Array;for(var i in t){var r=t[i];r instanceof Array?e=e.concat(flatten(r)):e.push(r)}return e}var FW={_scrapers:new Array};FW._Base=function(){this.callHook=function(t,e,i,r){if("object"==typeof this.hooks){var n=this.hooks[t];"function"==typeof n&&n(e,i,r)}},this.evaluateThing=function(t,e,i){var r=typeof t;if("object"===r){if(t instanceof Array){var n=this.evaluateThing,a=t.map(function(t){return n(t,e,i)});return flatten(a)}return t.evaluate(e,i)}return"function"===r?t(e,i):t},this.makeItems=function(t,e,i,r,n){n()}},FW.Scraper=function(t){FW._scrapers.push(new FW._Scraper(t))},FW._Scraper=function(t){for(x in t)this[x]=t[x];this._singleFieldNames=["abstractNote","applicationNumber","archive","archiveLocation","artworkMedium","artworkSize","assignee","audioFileType","audioRecordingType","billNumber","blogTitle","bookTitle","callNumber","caseName","code","codeNumber","codePages","codeVolume","committee","company","conferenceName","country","court","date","dateDecided","dateEnacted","dictionaryTitle","distributor","docketNumber","documentNumber","DOI","edition","encyclopediaTitle","episodeNumber","extra","filingDate","firstPage","forumTitle","genre","history","institution","interviewMedium","ISBN","ISSN","issue","issueDate","issuingAuthority","journalAbbreviation","label","language","legalStatus","legislativeBody","letterType","libraryCatalog","manuscriptType","mapType","medium","meetingName","nameOfAct","network","number","numberOfVolumes","numPages","pages","patentNumber","place","postType","presentationType","priorityNumbers","proceedingsTitle","programTitle","programmingLanguage","publicLawNumber","publicationTitle","publisher","references","reportNumber","reportType","reporter","reporterVolume","rights","runningTime","scale","section","series","seriesNumber","seriesText","seriesTitle","session","shortTitle","studio","subject","system","thesisType","title","type","university","url","version","videoRecordingType","volume","websiteTitle","websiteType"],this._makeAttachments=function(t,e,i,r){if(i instanceof Array)i.forEach(function(i){this._makeAttachments(t,e,i,r)},this);else if("object"==typeof i){var n=i.urls||i.url,a=i.types||i.type,s=i.titles||i.title,o=i.snapshots||i.snapshot,u=this.evaluateThing(n,t,e),l=this.evaluateThing(s,t,e),c=this.evaluateThing(a,t,e),h=this.evaluateThing(o,t,e);u instanceof Array||(u=[u]);for(var f in u){var p,m,v,d=u[f];p=c instanceof Array?c[f]:c,m=l instanceof Array?l[f]:l,v=h instanceof Array?h[f]:h,r.attachments.push({url:d,title:m,mimeType:p,snapshot:v})}}},this.makeItems=function(t,e,i,r,n){var a=new Zotero.Item(this.itemType);a.url=e;for(var s in this._singleFieldNames){var o=this._singleFieldNames[s];if(this[o]){var u=this.evaluateThing(this[o],t,e);u instanceof Array?a[o]=u[0]:a[o]=u}}var l=["creators","tags"];for(var c in l){var h=l[c],f=this.evaluateThing(this[h],t,e);if(f)for(var p in f)a[h].push(f[p])}this._makeAttachments(t,e,this.attachments,a),r(a,this,t,e),n()}},FW._Scraper.prototype=new FW._Base,FW.MultiScraper=function(t){FW._scrapers.push(new FW._MultiScraper(t))},FW._MultiScraper=function(t){for(x in t)this[x]=t[x];this._mkSelectItems=function(t,e){var i=new Object;for(var r in t)i[e[r]]=t[r];return i},this._selectItems=function(t,e,i){var r=new Array;Zotero.selectItems(this._mkSelectItems(t,e),function(t){for(var e in t)r.push(e);i(r)})},this._mkAttachments=function(t,e,i){var r=this.evaluateThing(this.attachments,t,e),n=new Object;if(r)for(var a in i)n[i[a]]=r[a];return n},this._makeChoices=function(t,e,i,r,n){if(t instanceof Array)t.forEach(function(t){this._makeTitlesUrls(t,e,i,r,n)},this);else if("object"==typeof t){var a=t.urls||t.url,s=t.titles||t.title,o=this.evaluateThing(a,e,i),u=this.evaluateThing(s,e,i),l=u instanceof Array;o instanceof Array||(o=[o]);for(var c in o){var h,f=o[c];h=l?u[c]:u,n.push(f),r.push(h)}}},this.makeItems=function(t,e,i,r,n){if(this.beforeFilter){var a=this.beforeFilter(t,e);if(a!=e)return void this.makeItems(t,a,i,r,n)}var s=[],o=[];this._makeChoices(this.choices,t,e,s,o);var u=this._mkAttachments(t,e,o),l=this.itemTrans;this._selectItems(s,o,function(t){if(t){var e=function(t){var e=t.documentURI,i=l;void 0===i&&(i=FW.getScraper(t,e)),void 0===i||i.makeItems(t,e,u[e],r,function(){})};Zotero.Utilities.processDocuments(t,e,n)}else n()})}},FW._MultiScraper.prototype=new FW._Base,FW.WebDelegateTranslator=function(t){return new FW._WebDelegateTranslator(t)},FW._WebDelegateTranslator=function(t){for(x in t)this[x]=t[x];this.makeItems=function(t,e,i,r,n){var a=this,s=Zotero.loadTranslator("web");s.setHandler("itemDone",function(i,n){r(n,a,t,e)}),s.setDocument(t),this.translatorId?(s.setTranslator(this.translatorId),s.translate()):(s.setHandler("translators",function(t,e){e.length&&(s.setTranslator(e[0]),s.translate())}),s.getTranslators()),n()}},FW._WebDelegateTranslator.prototype=new FW._Base,FW._StringMagic=function(){this._filters=new Array,this.addFilter=function(t){return this._filters.push(t),this},this.split=function(t){return this.addFilter(function(e){return e.split(t).filter(function(t){return""!=t})})},this.replace=function(t,e,i){return this.addFilter(function(r){return r.match(t)?r.replace(t,e,i):r})},this.prepend=function(t){return this.replace(/^/,t)},this.append=function(t){return this.replace(/$/,t)},this.remove=function(t,e){return this.replace(t,"",e)},this.trim=function(){return this.addFilter(function(t){return Zotero.Utilities.trim(t)})},this.trimInternal=function(){return this.addFilter(function(t){return Zotero.Utilities.trimInternal(t)})},this.match=function(t,e){return e||(e=0),this.addFilter(function(i){var r=i.match(t);return void 0===r||null===r?void 0:r[e]})},this.cleanAuthor=function(t,e){return this.addFilter(function(i){return Zotero.Utilities.cleanAuthor(i,t,e)})},this.key=function(t){return this.addFilter(function(e){return e[t]})},this.capitalizeTitle=function(){return this.addFilter(function(t){return Zotero.Utilities.capitalizeTitle(t)})},this.unescapeHTML=function(){return this.addFilter(function(t){return Zotero.Utilities.unescapeHTML(t)})},this.unescape=function(){return this.addFilter(function(t){return unescape(t)})},this._applyFilters=function(t,e){for(i in this._filters){t=flatten(t),t=t.filter(function(t){return void 0!==t&&null!==t});for(var r=0;r0&&a[0])return n}},FW.getScraper=function(t,e){var i=FW.detectWeb(t,e);return FW._scrapers.filter(function(r){return r.evaluateThing(r.itemType,t,e)==i&&r.evaluateThing(r.detect,t,e)})[0]},FW.doWeb=function(t,e){var i=FW.getScraper(t,e);i.makeItems(t,e,[],function(t,e,i,r){e.callHook("scraperDone",t,i,r),t.title||(t.title=""),t.complete()},function(){Zotero.done()}),Zotero.wait()}; +function detectWeb(doc, url) { return FW.detectWeb(doc, url); } +function doWeb(doc, url) { return FW.doWeb(doc, url); } + + +/** Articles */ +FW.Scraper({ + itemType : 'journalArticle', + detect : FW.Url().match(/(\/journal\/thesis_name\.asp)/), + title : FW.Xpath('//div[@class="agency_box"]/div[1]/span').text(), + language : "kr", + creators : FW.Xpath('//div[@class="agency_detail"]/ul/li[1]').text().split(/,/).trimInternal().cleanAuthor("author", false), + date : FW.Xpath('//div[@class="agency_detail"]/ul/li[2]').text().match(/(\d\d\d\d)/), + publicationTitle : FW.Xpath('//div[@class="agency_detail"]/ul/li[2]').text().match(/(<[\D]+>)/).remove(//), + pages : FW.Xpath('//div[@class="agency_detail"]/ul/li[2]').text().match(/(p+\.\d+-\d+)/).remove(/p+\./), + volume : FW.Xpath('//div[@class="agency_detail"]/ul/li[2]').text().match(/(>\s+\d+)/).remove(/>\s+/).remove(/0/), + issue : FW.Xpath('//div[@class="agency_detail"]/ul/li[2]').text().match(/(>\s+\d+\D\d+)/).remove(/>\s+\d+\D/).remove(/0/), + abstractNote: FW.Xpath('//div[@class="con_detail"]/div[4]/ul').text().trimInternal(), +}); + +/** Search Results */ +FW.MultiScraper({ + itemType : 'multiple', + detect : FW.Url().match(/(\/journal\/list_name\.asp|\/search\/result_kiss\.asp)/), + choices : { + titles : FW.Xpath('//li[@class="title"]/a').text().trim(), + urls : FW.Xpath('//li[@class="title"]/a').key('href').text() + } +});/** BEGIN TEST CASES **/ +var testCases = [ + { + "type": "web", + "url": "http://kiss.kstudy.com/journal/thesis_name.asp?tname=kiss2002&key=3297333", + "items": [ + { + "itemType": "journalArticle", + "title": "투고논문 : 소옹(邵雍)의 선천역학(先天易學)에 대한 王夫之의 비판", + "creators": [ + { + "firstName": "조우진 ( Woo Jin Cho", + "lastName": ")", + "creatorType": "author" + } + ], + "date": "2014", + "abstractNote": "초록 <한국어 초록> 본 논문의 목적은 소옹의 선천역학(先天易學)을 바탕으로 한 송대(宋代) 상수역(象數易)의 흐름을 살펴보고 왕부지의 비판적 입장을 고찰하는데 있다. 필자는 이러한 과정에서 상수역의 본래 모습을 확인하고자 한다. 왕부지는 자신의 역학체계를 바탕으로 선천과 후천의 개념, 선천의 전수과정, 선천도(先天圖)의 체계, 선천역학의 원리, 괘(卦)의 형성의 과정 등을 신랄하게 비판하였다. 그의 비판 논리는 경전의 내용을 바탕으로 하는 실증주의적 사고방식에 근거하고 있다. 왕부지의 입장에서 보자면 소옹의 선천역학과 관련된 이론이나 내용은 경전에 전혀 찾아볼 수 없는 것이며, 도가(道家)의 술수가들에 의해 전수된 것에 불과할 따름이다. 왕부지는 소옹의 선천역학을 비판하는 근거를 여러 가지로 제시하는데, 가장 결정적인 것은 점(占)과 관련된다. 선천역학의 핵심원리인 가일배법(加一倍法)은 아래로부터 위로 쌓아서 괘(卦)를 만들어가는 과정으로 점치는 것과 같은 것이다. 그래서 왕부지는 소옹의 선천역학을 술수학일 뿐만 아니라 점역(占易)에 치우친 것이라고 비판하면서 ‘점학일리(占學一理)’를 주장한다. <영어 초록> The object of this paper is to examine the current of Xiangshuyi(象數易) in Song dynasty(宋代) based on Shao-Yong(邵雍)’s Sunchenyeokhak(先天易學) and consider Wang-Fuzhi(王夫之)’s critical position. By this critical examination, we can ascertain the true features of Xiangshuyi. Wang-Fuzhi severely criticised the concept of Sunchen(先天) and Huchen(後天), the transmission process of Sunchen, the system of Sunchentu(先天圖), and the principle of Sunchenyeokhak, and the formation process of Gua(卦) through his Yeokhak(易學) system. His criticism is especially based on positivistic thinking on the contents of Jingzhuan(經傳). For Wang-Fuzhii, the content and theory concerning Shao-Yong’s Sunchenyeokhak aren’t found in Jingzhuan(經傳) and are nothing but brought by Zhushujia(術數家) in Daojia(道家). Wang-Fuzhi presents the several evidences of criticising Shao-Yong’s Xiangshuyi. Among them, the most decisive evidence is related to Zhan(占). Jiayibeifa(加一倍法) as the key principle of Sunchenyeokhak is a process of making Gua by stacking one on top of another and this process is the same as that of Zhan. In conclusion, Wang-Fuzhi maintains Zhanxueyili(占學一理) criticizing that Shao-Yong’s Sunchenyeokhak is only Zhushuxue and is biased toward Zhanyi.", + "language": "kr", + "libraryCatalog": "KStudy", + "pages": "179-210", + "publicationTitle": "공자학", + "shortTitle": "투고논문", + "url": "http://kiss.kstudy.com/journal/thesis_name.asp?tname=kiss2002&key=3297333", + "volume": "27", + "attachments": [], + "tags": [], + "notes": [], + "seeAlso": [] + } + ] + }, + { + "type": "web", + "url": "http://kiss.kstudy.com/search/result_kiss.asp", + "items": "multiple" + } +] +/** END TEST CASES **/ From c33a7d5ac782236454f1929e923e8296efce9d83 Mon Sep 17 00:00:00 2001 From: Philipp Zumstein Date: Sat, 27 May 2017 16:01:23 +0200 Subject: [PATCH 02/18] Rewrite KStudy.js as Non-FW translator --- KStudy.js | 114 +++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 83 insertions(+), 31 deletions(-) diff --git a/KStudy.js b/KStudy.js index 52feac939b..1a0a010c47 100644 --- a/KStudy.js +++ b/KStudy.js @@ -8,8 +8,8 @@ "priority": 100, "inRepository": true, "translatorType": 4, - "browserSupport": "gcsi", - "lastUpdated": "2017-05-25 22:14:50" + "browserSupport": "gcsibv", + "lastUpdated": "2017-05-27 14:00:17" } /* @@ -36,36 +36,90 @@ ***** END LICENSE BLOCK ***** */ +function detectWeb(doc, url) { + if (url.indexOf('/journal/thesis_name.asp')>-1) { + return "journalArticle"; + } else if ((url.indexOf('/journal/list_name.asp')>-1 || url.indexOf('/search/result_kiss.asp')>-1) && getSearchResults(doc, true)) { + return "multiple"; + } +} -/* FW LINE 59:b820c6d */ function flatten(t){var e=new Array;for(var i in t){var r=t[i];r instanceof Array?e=e.concat(flatten(r)):e.push(r)}return e}var FW={_scrapers:new Array};FW._Base=function(){this.callHook=function(t,e,i,r){if("object"==typeof this.hooks){var n=this.hooks[t];"function"==typeof n&&n(e,i,r)}},this.evaluateThing=function(t,e,i){var r=typeof t;if("object"===r){if(t instanceof Array){var n=this.evaluateThing,a=t.map(function(t){return n(t,e,i)});return flatten(a)}return t.evaluate(e,i)}return"function"===r?t(e,i):t},this.makeItems=function(t,e,i,r,n){n()}},FW.Scraper=function(t){FW._scrapers.push(new FW._Scraper(t))},FW._Scraper=function(t){for(x in t)this[x]=t[x];this._singleFieldNames=["abstractNote","applicationNumber","archive","archiveLocation","artworkMedium","artworkSize","assignee","audioFileType","audioRecordingType","billNumber","blogTitle","bookTitle","callNumber","caseName","code","codeNumber","codePages","codeVolume","committee","company","conferenceName","country","court","date","dateDecided","dateEnacted","dictionaryTitle","distributor","docketNumber","documentNumber","DOI","edition","encyclopediaTitle","episodeNumber","extra","filingDate","firstPage","forumTitle","genre","history","institution","interviewMedium","ISBN","ISSN","issue","issueDate","issuingAuthority","journalAbbreviation","label","language","legalStatus","legislativeBody","letterType","libraryCatalog","manuscriptType","mapType","medium","meetingName","nameOfAct","network","number","numberOfVolumes","numPages","pages","patentNumber","place","postType","presentationType","priorityNumbers","proceedingsTitle","programTitle","programmingLanguage","publicLawNumber","publicationTitle","publisher","references","reportNumber","reportType","reporter","reporterVolume","rights","runningTime","scale","section","series","seriesNumber","seriesText","seriesTitle","session","shortTitle","studio","subject","system","thesisType","title","type","university","url","version","videoRecordingType","volume","websiteTitle","websiteType"],this._makeAttachments=function(t,e,i,r){if(i instanceof Array)i.forEach(function(i){this._makeAttachments(t,e,i,r)},this);else if("object"==typeof i){var n=i.urls||i.url,a=i.types||i.type,s=i.titles||i.title,o=i.snapshots||i.snapshot,u=this.evaluateThing(n,t,e),l=this.evaluateThing(s,t,e),c=this.evaluateThing(a,t,e),h=this.evaluateThing(o,t,e);u instanceof Array||(u=[u]);for(var f in u){var p,m,v,d=u[f];p=c instanceof Array?c[f]:c,m=l instanceof Array?l[f]:l,v=h instanceof Array?h[f]:h,r.attachments.push({url:d,title:m,mimeType:p,snapshot:v})}}},this.makeItems=function(t,e,i,r,n){var a=new Zotero.Item(this.itemType);a.url=e;for(var s in this._singleFieldNames){var o=this._singleFieldNames[s];if(this[o]){var u=this.evaluateThing(this[o],t,e);u instanceof Array?a[o]=u[0]:a[o]=u}}var l=["creators","tags"];for(var c in l){var h=l[c],f=this.evaluateThing(this[h],t,e);if(f)for(var p in f)a[h].push(f[p])}this._makeAttachments(t,e,this.attachments,a),r(a,this,t,e),n()}},FW._Scraper.prototype=new FW._Base,FW.MultiScraper=function(t){FW._scrapers.push(new FW._MultiScraper(t))},FW._MultiScraper=function(t){for(x in t)this[x]=t[x];this._mkSelectItems=function(t,e){var i=new Object;for(var r in t)i[e[r]]=t[r];return i},this._selectItems=function(t,e,i){var r=new Array;Zotero.selectItems(this._mkSelectItems(t,e),function(t){for(var e in t)r.push(e);i(r)})},this._mkAttachments=function(t,e,i){var r=this.evaluateThing(this.attachments,t,e),n=new Object;if(r)for(var a in i)n[i[a]]=r[a];return n},this._makeChoices=function(t,e,i,r,n){if(t instanceof Array)t.forEach(function(t){this._makeTitlesUrls(t,e,i,r,n)},this);else if("object"==typeof t){var a=t.urls||t.url,s=t.titles||t.title,o=this.evaluateThing(a,e,i),u=this.evaluateThing(s,e,i),l=u instanceof Array;o instanceof Array||(o=[o]);for(var c in o){var h,f=o[c];h=l?u[c]:u,n.push(f),r.push(h)}}},this.makeItems=function(t,e,i,r,n){if(this.beforeFilter){var a=this.beforeFilter(t,e);if(a!=e)return void this.makeItems(t,a,i,r,n)}var s=[],o=[];this._makeChoices(this.choices,t,e,s,o);var u=this._mkAttachments(t,e,o),l=this.itemTrans;this._selectItems(s,o,function(t){if(t){var e=function(t){var e=t.documentURI,i=l;void 0===i&&(i=FW.getScraper(t,e)),void 0===i||i.makeItems(t,e,u[e],r,function(){})};Zotero.Utilities.processDocuments(t,e,n)}else n()})}},FW._MultiScraper.prototype=new FW._Base,FW.WebDelegateTranslator=function(t){return new FW._WebDelegateTranslator(t)},FW._WebDelegateTranslator=function(t){for(x in t)this[x]=t[x];this.makeItems=function(t,e,i,r,n){var a=this,s=Zotero.loadTranslator("web");s.setHandler("itemDone",function(i,n){r(n,a,t,e)}),s.setDocument(t),this.translatorId?(s.setTranslator(this.translatorId),s.translate()):(s.setHandler("translators",function(t,e){e.length&&(s.setTranslator(e[0]),s.translate())}),s.getTranslators()),n()}},FW._WebDelegateTranslator.prototype=new FW._Base,FW._StringMagic=function(){this._filters=new Array,this.addFilter=function(t){return this._filters.push(t),this},this.split=function(t){return this.addFilter(function(e){return e.split(t).filter(function(t){return""!=t})})},this.replace=function(t,e,i){return this.addFilter(function(r){return r.match(t)?r.replace(t,e,i):r})},this.prepend=function(t){return this.replace(/^/,t)},this.append=function(t){return this.replace(/$/,t)},this.remove=function(t,e){return this.replace(t,"",e)},this.trim=function(){return this.addFilter(function(t){return Zotero.Utilities.trim(t)})},this.trimInternal=function(){return this.addFilter(function(t){return Zotero.Utilities.trimInternal(t)})},this.match=function(t,e){return e||(e=0),this.addFilter(function(i){var r=i.match(t);return void 0===r||null===r?void 0:r[e]})},this.cleanAuthor=function(t,e){return this.addFilter(function(i){return Zotero.Utilities.cleanAuthor(i,t,e)})},this.key=function(t){return this.addFilter(function(e){return e[t]})},this.capitalizeTitle=function(){return this.addFilter(function(t){return Zotero.Utilities.capitalizeTitle(t)})},this.unescapeHTML=function(){return this.addFilter(function(t){return Zotero.Utilities.unescapeHTML(t)})},this.unescape=function(){return this.addFilter(function(t){return unescape(t)})},this._applyFilters=function(t,e){for(i in this._filters){t=flatten(t),t=t.filter(function(t){return void 0!==t&&null!==t});for(var r=0;r0&&a[0])return n}},FW.getScraper=function(t,e){var i=FW.detectWeb(t,e);return FW._scrapers.filter(function(r){return r.evaluateThing(r.itemType,t,e)==i&&r.evaluateThing(r.detect,t,e)})[0]},FW.doWeb=function(t,e){var i=FW.getScraper(t,e);i.makeItems(t,e,[],function(t,e,i,r){e.callHook("scraperDone",t,i,r),t.title||(t.title=""),t.complete()},function(){Zotero.done()}),Zotero.wait()}; -function detectWeb(doc, url) { return FW.detectWeb(doc, url); } -function doWeb(doc, url) { return FW.doWeb(doc, url); } +function getSearchResults(doc, checkOnly) { + var items = {}; + var found = false; + var rows = ZU.xpath(doc, '//li[@class="title"]/a'); + for (var i=0; i)/).remove(//), - pages : FW.Xpath('//div[@class="agency_detail"]/ul/li[2]').text().match(/(p+\.\d+-\d+)/).remove(/p+\./), - volume : FW.Xpath('//div[@class="agency_detail"]/ul/li[2]').text().match(/(>\s+\d+)/).remove(/>\s+/).remove(/0/), - issue : FW.Xpath('//div[@class="agency_detail"]/ul/li[2]').text().match(/(>\s+\d+\D\d+)/).remove(/>\s+\d+\D/).remove(/0/), - abstractNote: FW.Xpath('//div[@class="con_detail"]/div[4]/ul').text().trimInternal(), -}); +function doWeb(doc, url) { + if (detectWeb(doc, url) == "multiple") { + Zotero.selectItems(getSearchResults(doc, false), function (items) { + if (!items) { + return true; + } + var articles = []; + for (var i in items) { + articles.push(i); + } + ZU.processDocuments(articles, scrape); + }); + } else { + scrape(doc, url); + } +} -/** Search Results */ -FW.MultiScraper({ - itemType : 'multiple', - detect : FW.Url().match(/(\/journal\/list_name\.asp|\/search\/result_kiss\.asp)/), - choices : { - titles : FW.Xpath('//li[@class="title"]/a').text().trim(), - urls : FW.Xpath('//li[@class="title"]/a').key('href').text() +function scrape(doc, url) { + var item = new Zotero.Item("journalArticle"); + item.title = ZU.xpathText(doc, '//div[@class="agency_box"]/div[1]/span'); + item.language = "kr"; + + var creators = ZU.xpathText(doc, '//div[@class="agency_detail"]/ul/li[1]'); + if (creators) { + var creatorsList = creators.split(','); + for (var i=0; i]+)>/); + if (publicationTitle) { + item.publicationTitle = publicationTitle[1]; + } + var pagerange = details.match(/p+\.(\d+-\d+)/); + if (pagerange) { + item.pages = pagerange[1]; + } + var volumeIssue = details.match(/>\s+(\d+)\D(\d+)/); + if (volumeIssue) { + item.volume = volumeIssue[1].replace(/^0/, ''); + item.issue = volumeIssue[2].replace(/^0/, ''); + } + } + + item.abstractNote = ZU.xpathText(doc, '//div[@class="con_detail"]/div[4]/ul'); + if (item.abstractNote) { + item.abstractNote = ZU.trimInternal(item.abstractNote); } -});/** BEGIN TEST CASES **/ + + item.complete(); + +} + +/** BEGIN TEST CASES **/ var testCases = [ { "type": "web", @@ -76,8 +130,7 @@ var testCases = [ "title": "투고논문 : 소옹(邵雍)의 선천역학(先天易學)에 대한 王夫之의 비판", "creators": [ { - "firstName": "조우진 ( Woo Jin Cho", - "lastName": ")", + "lastName": "조우진 ( Woo Jin Cho )", "creatorType": "author" } ], @@ -88,7 +141,6 @@ var testCases = [ "pages": "179-210", "publicationTitle": "공자학", "shortTitle": "투고논문", - "url": "http://kiss.kstudy.com/journal/thesis_name.asp?tname=kiss2002&key=3297333", "volume": "27", "attachments": [], "tags": [], @@ -103,4 +155,4 @@ var testCases = [ "items": "multiple" } ] -/** END TEST CASES **/ +/** END TEST CASES **/ \ No newline at end of file From f22c3b0d9f2138dedfe5bd01830cf87d20863e52 Mon Sep 17 00:00:00 2001 From: yunusong Date: Sat, 27 May 2017 16:30:20 -0400 Subject: [PATCH 03/18] Update href links for Journal Issues I figured out how to unravel the javascripted links in Journal Issue type of "multiple". I tested on my zotero and confirmed that it works. --- KStudy.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/KStudy.js b/KStudy.js index 1a0a010c47..44c55a0852 100644 --- a/KStudy.js +++ b/KStudy.js @@ -50,6 +50,11 @@ function getSearchResults(doc, checkOnly) { var rows = ZU.xpath(doc, '//li[@class="title"]/a'); for (var i=0; i-1) { + var tnameAndKey = href.match(/detailView\(\'([\S]+)\'\,\'([\S]+)\'/); + var journalhref = "../journal/thesis_name.asp?tname=" + tnameAndKey[1] + "&key=" + tnameAndKey[2]; + href = journalhref; + } var title = ZU.trimInternal(rows[i].textContent); if (!href || !title) continue; if (checkOnly) return true; @@ -155,4 +160,4 @@ var testCases = [ "items": "multiple" } ] -/** END TEST CASES **/ \ No newline at end of file +/** END TEST CASES **/ From df47881a5c5fa02e03a2c002ba73fd630472ba31 Mon Sep 17 00:00:00 2001 From: yunusong Date: Sat, 27 May 2017 16:34:03 -0400 Subject: [PATCH 04/18] added zuphilipp as a creator --- KStudy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/KStudy.js b/KStudy.js index 44c55a0852..f5c5d1024e 100644 --- a/KStudy.js +++ b/KStudy.js @@ -1,7 +1,7 @@ { "translatorID": "b298ca93-0010-48f5-97fb-e9923519a380", "label": "KStudy", - "creator": "Yunwoo Song", + "creator": "Yunwoo Song","Philipp Zumstein" "target": "^https?://[^/]+\\.kstudy\\.com", "minVersion": "3.0", "maxVersion": "", From 8cd64e61c476aedff279b83d9c11f7bccab3db6f Mon Sep 17 00:00:00 2001 From: yunusong Date: Sat, 27 May 2017 16:34:42 -0400 Subject: [PATCH 05/18] creator change again --- KStudy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/KStudy.js b/KStudy.js index f5c5d1024e..b1c698b774 100644 --- a/KStudy.js +++ b/KStudy.js @@ -16,7 +16,7 @@ ***** BEGIN LICENSE BLOCK ***** KISS (Koreanstudies Information Service System) Translator - Copyright © 2017 Yunwoo Song + Copyright © 2017 Yunwoo Song and Philipp Zumstein This file is part of Zotero. From 72cf08999aa15b22408c7d26bbbc1af9b17efd06 Mon Sep 17 00:00:00 2001 From: yunusong Date: Sat, 27 May 2017 17:59:40 -0400 Subject: [PATCH 06/18] Update KStudy.js --- KStudy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/KStudy.js b/KStudy.js index b1c698b774..3c3cc0dc6d 100644 --- a/KStudy.js +++ b/KStudy.js @@ -1,7 +1,7 @@ { "translatorID": "b298ca93-0010-48f5-97fb-e9923519a380", "label": "KStudy", - "creator": "Yunwoo Song","Philipp Zumstein" + "creator": "Yunwoo Song, Philipp Zumstein" "target": "^https?://[^/]+\\.kstudy\\.com", "minVersion": "3.0", "maxVersion": "", From d4fa0298e3918be88400c43348e9796994a344d0 Mon Sep 17 00:00:00 2001 From: yunusong Date: Sat, 27 May 2017 18:44:19 -0400 Subject: [PATCH 07/18] comma added --- KStudy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/KStudy.js b/KStudy.js index 3c3cc0dc6d..2114d186d8 100644 --- a/KStudy.js +++ b/KStudy.js @@ -1,7 +1,7 @@ { "translatorID": "b298ca93-0010-48f5-97fb-e9923519a380", "label": "KStudy", - "creator": "Yunwoo Song, Philipp Zumstein" + "creator": "Yunwoo Song, Philipp Zumstein", "target": "^https?://[^/]+\\.kstudy\\.com", "minVersion": "3.0", "maxVersion": "", From a495d8475a3d83f508443d9f25fe5f0dbc982bb4 Mon Sep 17 00:00:00 2001 From: yunusong Date: Mon, 29 May 2017 19:46:59 -0400 Subject: [PATCH 08/18] Incorporated Frank's attachments Thanks Frank. I tried to code myself and confirmed that it works beautifully. I also added your name to the creator. I think this is ready to go now. Thank you everyone. --- KStudy.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/KStudy.js b/KStudy.js index 2114d186d8..ff32eec8f7 100644 --- a/KStudy.js +++ b/KStudy.js @@ -1,7 +1,7 @@ { "translatorID": "b298ca93-0010-48f5-97fb-e9923519a380", "label": "KStudy", - "creator": "Yunwoo Song, Philipp Zumstein", + "creator": "Yunwoo Song, Frank Bennett, Philipp Zumstein", "target": "^https?://[^/]+\\.kstudy\\.com", "minVersion": "3.0", "maxVersion": "", @@ -16,7 +16,7 @@ ***** BEGIN LICENSE BLOCK ***** KISS (Koreanstudies Information Service System) Translator - Copyright © 2017 Yunwoo Song and Philipp Zumstein + Copyright © 2017 Yunwoo Song, Frank Bennett, and Philipp Zumstein This file is part of Zotero. @@ -119,6 +119,16 @@ function scrape(doc, url) { if (item.abstractNote) { item.abstractNote = ZU.trimInternal(item.abstractNote); } + + var pdfJSurl = ZU.xpathText(doc, '//div[@class="search_box"]/div[@class="choice"]/span[1]/a/@href'); + var pdfurlKeys = pdfJSurl.match(/Select1\(\'(\S+)\'\,\s?\'(\S+)\'\,\s?(\S+)\,\s?(\S+)\,\s?(\S+)\)\;/); + var pdfUrl = pdfurlKeys[1].replace(/^(.*\/).*/, "$1") + "viewer.asp?code_num=" + pdfurlKeys[2]; + + item.attachments.push({ + url : pdfUrl, + title : "KISS PDF", + mimeType : "application/pdf", + }); item.complete(); From 787cd8862c3bef7d910d969a9fe70ce91ae48874 Mon Sep 17 00:00:00 2001 From: yunusong Date: Sun, 4 Jun 2017 14:02:07 -0400 Subject: [PATCH 09/18] Update KStudy.js I no longer care about single field for authors, and I would leave it as it since @fbennett suggested that it would be better to leave it that way. Otherwise, I incorporated your comments. --- KStudy.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/KStudy.js b/KStudy.js index ff32eec8f7..458ca88b70 100644 --- a/KStudy.js +++ b/KStudy.js @@ -85,7 +85,7 @@ function doWeb(doc, url) { function scrape(doc, url) { var item = new Zotero.Item("journalArticle"); item.title = ZU.xpathText(doc, '//div[@class="agency_box"]/div[1]/span'); - item.language = "kr"; + item.language = "ko-KR"; var creators = ZU.xpathText(doc, '//div[@class="agency_detail"]/ul/li[1]'); if (creators) { @@ -126,7 +126,7 @@ function scrape(doc, url) { item.attachments.push({ url : pdfUrl, - title : "KISS PDF", + title : "KStudy Full Text PDF", mimeType : "application/pdf", }); From 742e3f0793c49c4353a54afc829cfb8bd967925e Mon Sep 17 00:00:00 2001 From: Philipp Zumstein Date: Mon, 1 Jan 2018 23:28:38 +0100 Subject: [PATCH 10/18] [KStudy.js] Update after redesign of website --- KStudy.js | 147 ++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 103 insertions(+), 44 deletions(-) diff --git a/KStudy.js b/KStudy.js index 458ca88b70..70fcc2ea06 100644 --- a/KStudy.js +++ b/KStudy.js @@ -9,7 +9,7 @@ "inRepository": true, "translatorType": 4, "browserSupport": "gcsibv", - "lastUpdated": "2017-05-27 14:00:17" + "lastUpdated": "2018-01-01 22:27:16" } /* @@ -37,9 +37,9 @@ */ function detectWeb(doc, url) { - if (url.indexOf('/journal/thesis_name.asp')>-1) { + if (url.indexOf('/thesis/thesis-view.asp')>-1) { return "journalArticle"; - } else if ((url.indexOf('/journal/list_name.asp')>-1 || url.indexOf('/search/result_kiss.asp')>-1) && getSearchResults(doc, true)) { + } else if ((url.indexOf('/journal/journal-view.asp')>-1 || url.indexOf('/search/result_kiss.asp')>-1) && getSearchResults(doc, true)) { return "multiple"; } } @@ -47,14 +47,9 @@ function detectWeb(doc, url) { function getSearchResults(doc, checkOnly) { var items = {}; var found = false; - var rows = ZU.xpath(doc, '//li[@class="title"]/a'); + var rows = ZU.xpath(doc, '//div[contains(@class, "thesis-info")]/h5/a[contains(@href, "/thesis")]'); for (var i=0; i-1) { - var tnameAndKey = href.match(/detailView\(\'([\S]+)\'\,\'([\S]+)\'/); - var journalhref = "../journal/thesis_name.asp?tname=" + tnameAndKey[1] + "&key=" + tnameAndKey[2]; - href = journalhref; - } var title = ZU.trimInternal(rows[i].textContent); if (!href || !title) continue; if (checkOnly) return true; @@ -84,52 +79,62 @@ function doWeb(doc, url) { function scrape(doc, url) { var item = new Zotero.Item("journalArticle"); - item.title = ZU.xpathText(doc, '//div[@class="agency_box"]/div[1]/span'); + item.title = ZU.xpathText(doc, '//section[@class="pub-info"]/h3'); item.language = "ko-KR"; - var creators = ZU.xpathText(doc, '//div[@class="agency_detail"]/ul/li[1]'); + var creators = ZU.xpathText(doc, '//div[@class="writers"]'); if (creators) { var creatorsList = creators.split(','); for (var i=0; i]+)>/); - if (publicationTitle) { - item.publicationTitle = publicationTitle[1]; - } - var pagerange = details.match(/p+\.(\d+-\d+)/); - if (pagerange) { - item.pages = pagerange[1]; - } - var volumeIssue = details.match(/>\s+(\d+)\D(\d+)/); - if (volumeIssue) { - item.volume = volumeIssue[1].replace(/^0/, ''); - item.issue = volumeIssue[2].replace(/^0/, ''); + + var container = ZU.xpathText(doc, '//li[label[text()="간행물"]]'); + // e.g. container = 간행물 : 국제어문 54권0호 + if (container && container.includes(':')) { + var containerValue = container.split(':')[1]; + var containerParts = containerValue.match(/(.*)\s+(\d+)\D(\d+)/); + if (containerParts) { + item.publicationTitle = containerParts[1]; + item.volume = containerParts[2]; + item.issue = containerParts[3] !== '0' ? containerParts[3] : null; } } - item.abstractNote = ZU.xpathText(doc, '//div[@class="con_detail"]/div[4]/ul'); - if (item.abstractNote) { - item.abstractNote = ZU.trimInternal(item.abstractNote); + var date = ZU.xpathText(doc, '//li[label[text()="발행년월"]]'); + // e.g. date = 발행년월 : 2012년 04월 + if (date && date.includes(':')) { + var dateValue = date.split(':')[1]; + item.date = dateValue.trim().replace(/\D+/g, '-').replace(/-$/, ''); + } + + var pages = ZU.xpathText(doc, '//li[label[text()="페이지"]]'); + // e.g. pages = 페이지 : 43-93(51pages) + if (pages && pages.includes(':')) { + var pagesValue = pages.split(':')[1]; + item.pages = pagesValue.split('(')[0].replace('-', '–'); + } + + var abstract = ZU.xpathText(doc, '//comment()[contains(., "초록 보기")]/following-sibling::section[1]'); + if (abstract) { + item.abstractNote = ZU.trimInternal(abstract); } - var pdfJSurl = ZU.xpathText(doc, '//div[@class="search_box"]/div[@class="choice"]/span[1]/a/@href'); - var pdfurlKeys = pdfJSurl.match(/Select1\(\'(\S+)\'\,\s?\'(\S+)\'\,\s?(\S+)\,\s?(\S+)\,\s?(\S+)\)\;/); - var pdfUrl = pdfurlKeys[1].replace(/^(.*\/).*/, "$1") + "viewer.asp?code_num=" + pdfurlKeys[2]; - + //var pdfJSurl = ZU.xpathText(doc, '//div[@class="search_box"]/div[@class="choice"]/span[1]/a/@href'); + //var pdfurlKeys = pdfJSurl.match(/Select1\(\'(\S+)\'\,\s?\'(\S+)\'\,\s?(\S+)\,\s?(\S+)\,\s?(\S+)\)\;/); + //var pdfUrl = pdfurlKeys[1].replace(/^(.*\/).*/, "$1") + "viewer.asp?code_num=" + pdfurlKeys[2]; +/* item.attachments.push({ url : pdfUrl, title : "KStudy Full Text PDF", mimeType : "application/pdf", }); - +*/ item.complete(); } @@ -138,7 +143,7 @@ function scrape(doc, url) { var testCases = [ { "type": "web", - "url": "http://kiss.kstudy.com/journal/thesis_name.asp?tname=kiss2002&key=3297333", + "url": "http://kiss.kstudy.com/thesis/thesis-view.asp?key=3297333", "items": [ { "itemType": "journalArticle", @@ -146,14 +151,15 @@ var testCases = [ "creators": [ { "lastName": "조우진 ( Woo Jin Cho )", + "fieldMode": true, "creatorType": "author" } ], - "date": "2014", - "abstractNote": "초록 <한국어 초록> 본 논문의 목적은 소옹의 선천역학(先天易學)을 바탕으로 한 송대(宋代) 상수역(象數易)의 흐름을 살펴보고 왕부지의 비판적 입장을 고찰하는데 있다. 필자는 이러한 과정에서 상수역의 본래 모습을 확인하고자 한다. 왕부지는 자신의 역학체계를 바탕으로 선천과 후천의 개념, 선천의 전수과정, 선천도(先天圖)의 체계, 선천역학의 원리, 괘(卦)의 형성의 과정 등을 신랄하게 비판하였다. 그의 비판 논리는 경전의 내용을 바탕으로 하는 실증주의적 사고방식에 근거하고 있다. 왕부지의 입장에서 보자면 소옹의 선천역학과 관련된 이론이나 내용은 경전에 전혀 찾아볼 수 없는 것이며, 도가(道家)의 술수가들에 의해 전수된 것에 불과할 따름이다. 왕부지는 소옹의 선천역학을 비판하는 근거를 여러 가지로 제시하는데, 가장 결정적인 것은 점(占)과 관련된다. 선천역학의 핵심원리인 가일배법(加一倍法)은 아래로부터 위로 쌓아서 괘(卦)를 만들어가는 과정으로 점치는 것과 같은 것이다. 그래서 왕부지는 소옹의 선천역학을 술수학일 뿐만 아니라 점역(占易)에 치우친 것이라고 비판하면서 ‘점학일리(占學一理)’를 주장한다. <영어 초록> The object of this paper is to examine the current of Xiangshuyi(象數易) in Song dynasty(宋代) based on Shao-Yong(邵雍)’s Sunchenyeokhak(先天易學) and consider Wang-Fuzhi(王夫之)’s critical position. By this critical examination, we can ascertain the true features of Xiangshuyi. Wang-Fuzhi severely criticised the concept of Sunchen(先天) and Huchen(後天), the transmission process of Sunchen, the system of Sunchentu(先天圖), and the principle of Sunchenyeokhak, and the formation process of Gua(卦) through his Yeokhak(易學) system. His criticism is especially based on positivistic thinking on the contents of Jingzhuan(經傳). For Wang-Fuzhii, the content and theory concerning Shao-Yong’s Sunchenyeokhak aren’t found in Jingzhuan(經傳) and are nothing but brought by Zhushujia(術數家) in Daojia(道家). Wang-Fuzhi presents the several evidences of criticising Shao-Yong’s Xiangshuyi. Among them, the most decisive evidence is related to Zhan(占). Jiayibeifa(加一倍法) as the key principle of Sunchenyeokhak is a process of making Gua by stacking one on top of another and this process is the same as that of Zhan. In conclusion, Wang-Fuzhi maintains Zhanxueyili(占學一理) criticizing that Shao-Yong’s Sunchenyeokhak is only Zhushuxue and is biased toward Zhanyi.", - "language": "kr", + "date": "2014-11", + "abstractNote": "초록 보기 본 논문의 목적은 소옹의 선천역학(先天易學)을 바탕으로 한 송대(宋代) 상수역(象數易)의 흐름을 살펴보고 왕부지의 비판적 입장을 고찰하는데 있다. 필자는 이러한 과정에서 상수역의 본래 모습을 확인하고자 한다. 왕부지는 자신의 역학체계를 바탕으로 선천과 후천의 개념, 선천의 전수과정, 선천도(先天圖)의 체계, 선천역학의 원리, 괘(卦)의 형성의 과정 등을 신랄하게 비판하였다. 그의 비판 논리는 경전의 내용을 바탕으로 하는 실증주의적 사고방식에 근거하고 있다. 왕부지의 입장에서 보자면 소옹의 선천역학과 관련된 이론이나 내용은 경전에 전혀 찾아볼 수 없는 것이며, 도가(道家)의 술수가들에 의해 전수된 것에 불과할 따름이다. 왕부지는 소옹의 선천역학을 비판하는 근거를 여러 가지로 제시하는데, 가장 결정적인 것은 점(占)과 관련된다. 선천역학의 핵심원리인 가일배법(加一倍法)은 아래로부터 위로 쌓아서 괘(卦)를 만들어가는 과정으로 점치는 것과 같은 것이다. 그래서 왕부지는 소옹의 선천역학을 술수학일 뿐만 아니라 점역(占易)에 치우친 것이라고 비판하면서 ‘점학일리(占學一理)’를 주장한다. The object of this paper is to examine the current of Xiangshuyi(象數易) in Song dynasty(宋代) based on Shao-Yong(邵雍)’s Sunchenyeokhak(先天易學) and consider Wang-Fuzhi(王夫之)’s critical position. By this critical examination, we can ascertain the true features of Xiangshuyi. Wang-Fuzhi severely criticised the concept of Sunchen(先天) and Huchen(後天), the transmission process of Sunchen, the system of Sunchentu(先天圖), and the principle of Sunchenyeokhak, and the formation process of Gua(卦) through his Yeokhak(易學) system. His criticism is especially based on positivistic thinking on the contents of Jingzhuan(經傳). For Wang-Fuzhii, the content and theory concerning Shao-Yong’s Sunchenyeokhak aren’t found in Jingzhuan(經傳) and are nothing but brought by Zhushujia(術數家) in Daojia(道家). Wang-Fuzhi presents the several evidences of criticising Shao-Yong’s Xiangshuyi. Among them, the most decisive evidence is related to Zhan(占). Jiayibeifa(加一倍法) as the key principle of Sunchenyeokhak is a process of making Gua by stacking one on top of another and this process is the same as that of Zhan. In conclusion, Wang-Fuzhi maintains Zhanxueyili(占學一理) criticizing that Shao-Yong’s Sunchenyeokhak is only Zhushuxue and is biased toward Zhanyi.", + "language": "ko-KR", "libraryCatalog": "KStudy", - "pages": "179-210", + "pages": "179–210", "publicationTitle": "공자학", "shortTitle": "투고논문", "volume": "27", @@ -166,7 +172,60 @@ var testCases = [ }, { "type": "web", - "url": "http://kiss.kstudy.com/search/result_kiss.asp", + "url": "http://kiss.kstudy.com/thesis/thesis-view.asp?key=3500796", + "items": [ + { + "itemType": "journalArticle", + "title": "청소년의 비속어 · 욕설 · 은어 · 유행어 사용 실태와 언어 의식 연구", + "creators": [ + { + "lastName": "김태경 ( Kim Tae-kyung ) ", + "fieldMode": true, + "creatorType": "author" + }, + { + "lastName": " 장경희 ( Chang Kyung-hee ) ", + "fieldMode": true, + "creatorType": "author" + }, + { + "lastName": " 김정선 ( Kim Jeong-seon ) ", + "fieldMode": true, + "creatorType": "author" + }, + { + "lastName": " 이삼형 ( Lee Sam-hyung ) ", + "fieldMode": true, + "creatorType": "author" + }, + { + "lastName": " 이필영 ( Lee Phil-young ) ", + "fieldMode": true, + "creatorType": "author" + }, + { + "lastName": " 전은진 ( Jeon Eun-jin )", + "fieldMode": true, + "creatorType": "author" + } + ], + "date": "2012-04", + "abstractNote": "초록 보기 본 연구는 전국 청소년의 언어 실태와 언어 의식을 조사하고 이에 영향을 미치는 환경요인을 분석해 내는 데 목적이 있다. 본 연구의 조사 대상이 되는 언어 실태는 욕설 등 공격적 언어 표현, 비속어, 은어, 유행어 사용에 관한 것이다. 이를 위하여 본 연구에서는 전국 6개 권역(경인, 강원, 충청, 전라, 경상, 제주)의 초 · 중 · 고등학교 학생 6,053명을 대상으로 설문 조사를 수행하고, 비속어 등의 사용빈도와 거친 강도, 언어 규범 파괴 정도, 관련 환경 요인 등을 분석하였다. 그 결과, 응답자의 학교 급이 올라갈수록 사용하는 비속어나 은어·유행어의 거친 강도나 언어 규범 파괴 정도가 점점 심해지는 것으로 나타났다. 청소년의 이러한 언어실태는 부정적 언어 사용에 관한 용인 태도와 밀접한 관련을 지니고 있었다. 또한, 거주지의 도시화 층, 가정 경제 수준, 학업 성적, 자기통제력, 공감능력 등도 청소년의 공격적 언어 표현 사용에 직간접적으로 영향을 미치는 것으로 조사되었다. 가정 · 학교 · 사회 환경 요인별로는 `또래 간 비공식적 통제`가 청소년 언어에 가장 긍정적인 요소로 작용하며 `부모의 언어폭력으로 인한 스트레스`가 가장 부정적인 요소로 작용하는 것으로 나타났다. The purpose of this study is to investigate the current state of Korean teenager`s language use and attitude regarding expletives, aggressive language expression such as curses, teenage slangs and to examine the relevant environmental factors. We performed a questionnaire survey targeting 6,053 students of elementary, middle, high schools in 6 regions(Gyeongi, Gangwon, Chungcheong, Jeolla, Gyeongsang, Jeju). Our result indicate that the rough intensity of expletive and the language destruction level deepens with age, and adolescents` actual language use is closely related with the language attitude. The urbanization layer of dwelling place, home financial level, schoolwork grade, self-control, and empathy were also indicated to have direct and indirect influence upon adolescents` use of aggressive language expression. As a result of analyzing the relevant environmental factors, teenagers` language use is greatly influenced by their peers` informal control. And the stress caused by parents` verbal abuse would have an adverse effects upon teenager`s language use.", + "language": "ko-KR", + "libraryCatalog": "KStudy", + "pages": "43–93", + "publicationTitle": "국제어문", + "volume": "54", + "attachments": [], + "tags": [], + "notes": [], + "seeAlso": [] + } + ] + }, + { + "type": "web", + "url": "http://kiss.kstudy.com/journal/journal-view.asp?key1=25169&key2=2201", "items": "multiple" } ] From 8b44fad8ff72140a6789b18711f53b4f2a8cfa6c Mon Sep 17 00:00:00 2001 From: yunusong Date: Mon, 1 Jan 2018 18:49:45 -0500 Subject: [PATCH 11/18] Update KStudy.js --- KStudy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/KStudy.js b/KStudy.js index 70fcc2ea06..b61c7d175b 100644 --- a/KStudy.js +++ b/KStudy.js @@ -39,7 +39,7 @@ function detectWeb(doc, url) { if (url.indexOf('/thesis/thesis-view.asp')>-1) { return "journalArticle"; - } else if ((url.indexOf('/journal/journal-view.asp')>-1 || url.indexOf('/search/result_kiss.asp')>-1) && getSearchResults(doc, true)) { + } else if ((url.indexOf('/journal/journal-view.asp')>-1 || url.indexOf('/search/sch-search.asp')>-1) && getSearchResults(doc, true)) { return "multiple"; } } From 50bbe5df46c75fbbacb8db628c2608a8495eaefc Mon Sep 17 00:00:00 2001 From: Philipp Zumstein Date: Tue, 2 Jan 2018 16:53:11 +0100 Subject: [PATCH 12/18] Update KStudy.js to work also in the public part Deleted also the comments for downloading PDFs, which we do not yet handle. --- KStudy.js | 132 +++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 115 insertions(+), 17 deletions(-) diff --git a/KStudy.js b/KStudy.js index b61c7d175b..b26b7a97a5 100644 --- a/KStudy.js +++ b/KStudy.js @@ -9,7 +9,7 @@ "inRepository": true, "translatorType": 4, "browserSupport": "gcsibv", - "lastUpdated": "2018-01-01 22:27:16" + "lastUpdated": "2018-01-02 15:40:30" } /* @@ -39,7 +39,11 @@ function detectWeb(doc, url) { if (url.indexOf('/thesis/thesis-view.asp')>-1) { return "journalArticle"; - } else if ((url.indexOf('/journal/journal-view.asp')>-1 || url.indexOf('/search/sch-search.asp')>-1) && getSearchResults(doc, true)) { + } else if (url.search(/\/public\/public\d-article\.asp/)>-1) { + // these are reports and working paper series but with publicaton name, + // volume, issue numbers; thus handled as journal articles as well + return "journalArticle"; + } else if ((url.indexOf('/journal/journal-view.asp')>-1 || url.indexOf('/search/sch-search.asp')>-1 || url.indexOf('/search/result_kiss.asp')>-1) && getSearchResults(doc, true)) { return "multiple"; } } @@ -78,8 +82,9 @@ function doWeb(doc, url) { } function scrape(doc, url) { - var item = new Zotero.Item("journalArticle"); - item.title = ZU.xpathText(doc, '//section[@class="pub-info"]/h3'); + var type = detectWeb(doc, url); + var item = new Zotero.Item(type); + item.title = ZU.xpathText(doc, '//section[contains(@class, "pub-info")]//h3'); item.language = "ko-KR"; var creators = ZU.xpathText(doc, '//div[@class="writers"]'); @@ -92,13 +97,38 @@ function scrape(doc, url) { creatorType: "author" }); } + } else { + var authors = ZU.xpathText(doc, '//li[label[text()="저자"]]'); + // e.g. authors = 저자 : Kim, Yoon Tae, Park, Hyun Suk + // e.g. authors = 저자 : 이동호, 이재서, 윤숙자, 강병철 + if (authors && authors.includes(':')) { + var authorsValue = authors.split(':')[1]; + if (authorsValue.includes(', ')) { + // two spaces after comma are important here + var authorsList = authorsValue.split(', '); + } else { + var authorsList = authorsValue.split(','); + } + for (let i=0; i Date: Tue, 2 Jan 2018 14:13:10 -0500 Subject: [PATCH 13/18] Update KStudy.js I added an itemType "report" for one type of new formats and added some minor details. I think we need to add "url.indexOf('public2-jrd-sub.asp')>-1" as one of the options for "multiple", but for some reason I keep getting errors. Can someone take a look at this? The example address is: http://kiss.kstudy.com/public/public2-jrd-sub.asp?key1=100171&key2=10017&selYEAR=2012&selVOL1=1&selNUM1=2&selMon= --- KStudy.js | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 70 insertions(+), 6 deletions(-) diff --git a/KStudy.js b/KStudy.js index b26b7a97a5..d27fc35d2b 100644 --- a/KStudy.js +++ b/KStudy.js @@ -39,10 +39,12 @@ function detectWeb(doc, url) { if (url.indexOf('/thesis/thesis-view.asp')>-1) { return "journalArticle"; - } else if (url.search(/\/public\/public\d-article\.asp/)>-1) { + } else if (url.indeoxOf('/public2-article.asp')>-1) { // these are reports and working paper series but with publicaton name, // volume, issue numbers; thus handled as journal articles as well return "journalArticle"; + } else if (url.indexOf('/public3-article.asp')>-1) { + return "report"; } else if ((url.indexOf('/journal/journal-view.asp')>-1 || url.indexOf('/search/sch-search.asp')>-1 || url.indexOf('/search/result_kiss.asp')>-1) && getSearchResults(doc, true)) { return "multiple"; } @@ -131,11 +133,23 @@ function scrape(doc, url) { var containerParts = containerValue.match(/(.*)\s+(\d+)\D\s*(\d+)/); if (containerParts) { item.publicationTitle = containerParts[1]; - item.volume = containerParts[2]; + if (/\d{4}/.test(containerParts[2])) { + containerParts[2] = null; + } else { + item.volume = containerParts[2]; + } item.issue = containerParts[3] !== '0' ? containerParts[3] : null; } } - + + var department = ZU.xpathText(doc, '//li[label[text()="발행기관"]]'); + if (department && department.includes(':')) { + var departmentValue = department.split(':')[1]; + if (type == "report" && departmentValue) { + item.institution = departmentValue; + } + } + var date = ZU.xpathText(doc, '//li[label[text()="발행년월" or text()="발행 연도"]]'); // e.g. date = 발행년월 : 2012년 04월 if (date && date.includes(':')) { @@ -145,9 +159,12 @@ function scrape(doc, url) { var pages = ZU.xpathText(doc, '//li[label[text()="페이지"]]'); // e.g. pages = 페이지 : 43-93(51pages) - if (pages && pages.includes(':')) { - var pagesValue = pages.split(':')[1]; - item.pages = pagesValue.split('(')[0].replace('-', '–').replace('pp.', ''); + if (pages.search('-')>-1) { + //This is to avoid importing the total number of pages as the pages value. + if (pages && pages.includes(':')) { + var pagesValue = pages.split(':')[1]; + item.pages = pagesValue.split('(')[0].replace('-', '–').replace('pp.', ''); + } } var abstract = ZU.xpathText(doc, '//comment()[contains(., "초록 보기")]/following-sibling::section[1]'); @@ -326,5 +343,52 @@ var testCases = [ } ] } +] + { + "type": "web", + "url": "http://kiss.kstudy.com/public/public3-article.asp?key=60023584", + "items": [ + { + "itemType": "report", + "title": "온라인 수업 활성화를 위한 제도 분석", + "creators": [ + { + "lastName": "정영식", + "fieldMode": true, + "creatorType": "author" + }, + { + "lastName": "박종필", + "fieldMode": true, + "creatorType": "author" + }, + { + "lastName": "정순원", + "fieldMode": true, + "creatorType": "author" + }, + { + "lastName": "김유리", + "fieldMode": true, + "creatorType": "author" + }, + { + "lastName": "송교준", + "fieldMode": true, + "creatorType": "author" + } + ], + "date": "2013", + "abstractNote": "초록 보기", + "institution": "교육부", + "language": "ko-KR", + "libraryCatalog": "KStudy", + "attachments": [], + "tags": [], + "notes": [], + "seeAlso": [] + } + ] + } ] /** END TEST CASES **/ From 2fe5b39c741c44a611f52c41460009fb95431255 Mon Sep 17 00:00:00 2001 From: yunusong Date: Tue, 2 Jan 2018 14:47:26 -0500 Subject: [PATCH 14/18] Update KStudy.js --- KStudy.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/KStudy.js b/KStudy.js index d27fc35d2b..673f1bde34 100644 --- a/KStudy.js +++ b/KStudy.js @@ -133,9 +133,7 @@ function scrape(doc, url) { var containerParts = containerValue.match(/(.*)\s+(\d+)\D\s*(\d+)/); if (containerParts) { item.publicationTitle = containerParts[1]; - if (/\d{4}/.test(containerParts[2])) { - containerParts[2] = null; - } else { + if (containerParts[2].length<4) { //This is to avoid cases like Vol. 2017 item.volume = containerParts[2]; } item.issue = containerParts[3] !== '0' ? containerParts[3] : null; From add5b9231c6d0e0a582ebf025816828ed55c2c3b Mon Sep 17 00:00:00 2001 From: Philipp Zumstein Date: Wed, 3 Jan 2018 01:16:16 +0100 Subject: [PATCH 15/18] [KStudy] Rewrite by using RIS data + tweak multiples --- KStudy.js | 411 +++++++++++++++++++++++++++++++++++------------------- 1 file changed, 264 insertions(+), 147 deletions(-) diff --git a/KStudy.js b/KStudy.js index 673f1bde34..5730eaf502 100644 --- a/KStudy.js +++ b/KStudy.js @@ -9,13 +9,13 @@ "inRepository": true, "translatorType": 4, "browserSupport": "gcsibv", - "lastUpdated": "2018-01-02 15:40:30" + "lastUpdated": "2018-01-03 00:14:29" } /* ***** BEGIN LICENSE BLOCK ***** - KISS (Koreanstudies Information Service System) Translator + KISS (Korean Studies Information Service System) Translator Copyright © 2017 Yunwoo Song, Frank Bennett, and Philipp Zumstein This file is part of Zotero. @@ -36,16 +36,17 @@ ***** END LICENSE BLOCK ***** */ + function detectWeb(doc, url) { if (url.indexOf('/thesis/thesis-view.asp')>-1) { return "journalArticle"; - } else if (url.indeoxOf('/public2-article.asp')>-1) { + } else if (url.indexOf('/public2-article.asp')>-1) { // these are reports and working paper series but with publicaton name, // volume, issue numbers; thus handled as journal articles as well return "journalArticle"; } else if (url.indexOf('/public3-article.asp')>-1) { return "report"; - } else if ((url.indexOf('/journal/journal-view.asp')>-1 || url.indexOf('/search/sch-search.asp')>-1 || url.indexOf('/search/result_kiss.asp')>-1) && getSearchResults(doc, true)) { + } else if (getSearchResults(doc, true)) { return "multiple"; } } @@ -53,11 +54,15 @@ function detectWeb(doc, url) { function getSearchResults(doc, checkOnly) { var items = {}; var found = false; - var rows = ZU.xpath(doc, '//div[contains(@class, "thesis-info")]/h5/a[contains(@href, "/thesis")]'); + var rows = ZU.xpath(doc, '//div[contains(@class, "thesis-info")]/h5/a'); for (var i=0; i-1) { - //This is to avoid importing the total number of pages as the pages value. - if (pages && pages.includes(':')) { - var pagesValue = pages.split(':')[1]; - item.pages = pagesValue.split('(')[0].replace('-', '–').replace('pp.', ''); - } - } - - var abstract = ZU.xpathText(doc, '//comment()[contains(., "초록 보기")]/following-sibling::section[1]'); - if (abstract) { - item.abstractNote = ZU.trimInternal(abstract); - } - - item.complete(); - + item.complete(); + }); + translator.translate(); + }); } - /** BEGIN TEST CASES **/ var testCases = [ { @@ -185,21 +124,88 @@ var testCases = [ "title": "투고논문 : 소옹(邵雍)의 선천역학(先天易學)에 대한 王夫之의 비판", "creators": [ { - "lastName": "조우진 ( Woo Jin Cho )", - "fieldMode": true, - "creatorType": "author" + "lastName": "조우진", + "creatorType": "author", + "fieldMode": 1 } ], - "date": "2014-11", - "abstractNote": "초록 보기 본 논문의 목적은 소옹의 선천역학(先天易學)을 바탕으로 한 송대(宋代) 상수역(象數易)의 흐름을 살펴보고 왕부지의 비판적 입장을 고찰하는데 있다. 필자는 이러한 과정에서 상수역의 본래 모습을 확인하고자 한다. 왕부지는 자신의 역학체계를 바탕으로 선천과 후천의 개념, 선천의 전수과정, 선천도(先天圖)의 체계, 선천역학의 원리, 괘(卦)의 형성의 과정 등을 신랄하게 비판하였다. 그의 비판 논리는 경전의 내용을 바탕으로 하는 실증주의적 사고방식에 근거하고 있다. 왕부지의 입장에서 보자면 소옹의 선천역학과 관련된 이론이나 내용은 경전에 전혀 찾아볼 수 없는 것이며, 도가(道家)의 술수가들에 의해 전수된 것에 불과할 따름이다. 왕부지는 소옹의 선천역학을 비판하는 근거를 여러 가지로 제시하는데, 가장 결정적인 것은 점(占)과 관련된다. 선천역학의 핵심원리인 가일배법(加一倍法)은 아래로부터 위로 쌓아서 괘(卦)를 만들어가는 과정으로 점치는 것과 같은 것이다. 그래서 왕부지는 소옹의 선천역학을 술수학일 뿐만 아니라 점역(占易)에 치우친 것이라고 비판하면서 ‘점학일리(占學一理)’를 주장한다. The object of this paper is to examine the current of Xiangshuyi(象數易) in Song dynasty(宋代) based on Shao-Yong(邵雍)’s Sunchenyeokhak(先天易學) and consider Wang-Fuzhi(王夫之)’s critical position. By this critical examination, we can ascertain the true features of Xiangshuyi. Wang-Fuzhi severely criticised the concept of Sunchen(先天) and Huchen(後天), the transmission process of Sunchen, the system of Sunchentu(先天圖), and the principle of Sunchenyeokhak, and the formation process of Gua(卦) through his Yeokhak(易學) system. His criticism is especially based on positivistic thinking on the contents of Jingzhuan(經傳). For Wang-Fuzhii, the content and theory concerning Shao-Yong’s Sunchenyeokhak aren’t found in Jingzhuan(經傳) and are nothing but brought by Zhushujia(術數家) in Daojia(道家). Wang-Fuzhi presents the several evidences of criticising Shao-Yong’s Xiangshuyi. Among them, the most decisive evidence is related to Zhan(占). Jiayibeifa(加一倍法) as the key principle of Sunchenyeokhak is a process of making Gua by stacking one on top of another and this process is the same as that of Zhan. In conclusion, Wang-Fuzhi maintains Zhanxueyili(占學一理) criticizing that Shao-Yong’s Sunchenyeokhak is only Zhushuxue and is biased toward Zhanyi.", + "date": "2014", + "ISSN": "1738-2629", + "abstractNote": "본 논문의 목적은 소옹의 선천역학(先天易學)을 바탕으로 한 송대(宋代) 상수역(象數易)의 흐름을 살펴보고 왕부지의 비판적 입장을 고찰하는데 있다. 필자는 이러한 과정에서 상수역의 본래 모습을 확인하고자 한다. 왕부지는 자신의 역학체계를 바탕으로 선천과 후천의 개념, 선천의 전수과정, 선천도(先天圖)의 체계, 선천역학의 원리, 괘(卦)의 형성의 과정 등을 신랄하게 비판하였다. 그의 비판 논리는 경전의 내용을 바탕으로 하는 실증주의적 사고방식에 근거하고 있다. 왕부지의 입장에서 보자면 소옹의 선천역학과 관련된 이론이나 내용은 경전에 전혀 찾아볼 수 없는 것이며, 도가(道家)의 술수가들에 의해 전수된 것에 불과할 따름이다. 왕부지는 소옹의 선천역학을 비판하는 근거를 여러 가지로 제시하는데, 가장 결정적인 것은 점(占)과 관련된다. 선천역학의 핵심원리인 가일배법(加一倍法)은 아래로부터 위로 쌓아서 괘(卦)를 만들어가는 과정으로 점치는 것과 같은 것이다. 그래서 왕부지는 소옹의 선천역학을 술수학일 뿐만 아니라 점역(占易)에 치우친 것이라고 비판하면서 ‘점학일리(占學一理)’를 주장한다.", + "journalAbbreviation": "공자학", "language": "ko-KR", "libraryCatalog": "KStudy", "pages": "179–210", "publicationTitle": "공자학", "shortTitle": "투고논문", + "url": "http://kiss.kstudy.com/thesis/thesis-view.asp?key=3297333", "volume": "27", "attachments": [], - "tags": [], + "tags": [ + { + "tag": "Gua" + }, + { + "tag": "Jiayibeifa" + }, + { + "tag": "Sunchentu" + }, + { + "tag": "Sunchenyeokhak" + }, + { + "tag": "Xiangshuyi" + }, + { + "tag": "Zhan" + }, + { + "tag": "Zhanxueyili" + }, + { + "tag": "先天圖" + }, + { + "tag": "先天易學" + }, + { + "tag": "加一倍法" + }, + { + "tag": "占" + }, + { + "tag": "占學一理" + }, + { + "tag": "卦" + }, + { + "tag": "常數易" + }, + { + "tag": "가일배법" + }, + { + "tag": "괘" + }, + { + "tag": "상수역" + }, + { + "tag": "선천도" + }, + { + "tag": "선천역학" + }, + { + "tag": "점" + }, + { + "tag": "점학일리" + } + ], "notes": [], "seeAlso": [] } @@ -214,45 +220,109 @@ var testCases = [ "title": "청소년의 비속어 · 욕설 · 은어 · 유행어 사용 실태와 언어 의식 연구", "creators": [ { - "lastName": "김태경 ( Kim Tae-kyung ) ", - "fieldMode": true, - "creatorType": "author" + "lastName": "김태경", + "creatorType": "author", + "fieldMode": 1 }, { - "lastName": " 장경희 ( Chang Kyung-hee ) ", - "fieldMode": true, - "creatorType": "author" + "lastName": "장경희", + "creatorType": "author", + "fieldMode": 1 }, { - "lastName": " 김정선 ( Kim Jeong-seon ) ", - "fieldMode": true, - "creatorType": "author" + "lastName": "김정선", + "creatorType": "author", + "fieldMode": 1 }, { - "lastName": " 이삼형 ( Lee Sam-hyung ) ", - "fieldMode": true, - "creatorType": "author" + "lastName": "이삼형", + "creatorType": "author", + "fieldMode": 1 }, { - "lastName": " 이필영 ( Lee Phil-young ) ", - "fieldMode": true, - "creatorType": "author" + "lastName": "이필영", + "creatorType": "author", + "fieldMode": 1 }, { - "lastName": " 전은진 ( Jeon Eun-jin )", - "fieldMode": true, - "creatorType": "author" + "lastName": "전은진", + "creatorType": "author", + "fieldMode": 1 } ], - "date": "2012-04", - "abstractNote": "초록 보기 본 연구는 전국 청소년의 언어 실태와 언어 의식을 조사하고 이에 영향을 미치는 환경요인을 분석해 내는 데 목적이 있다. 본 연구의 조사 대상이 되는 언어 실태는 욕설 등 공격적 언어 표현, 비속어, 은어, 유행어 사용에 관한 것이다. 이를 위하여 본 연구에서는 전국 6개 권역(경인, 강원, 충청, 전라, 경상, 제주)의 초 · 중 · 고등학교 학생 6,053명을 대상으로 설문 조사를 수행하고, 비속어 등의 사용빈도와 거친 강도, 언어 규범 파괴 정도, 관련 환경 요인 등을 분석하였다. 그 결과, 응답자의 학교 급이 올라갈수록 사용하는 비속어나 은어·유행어의 거친 강도나 언어 규범 파괴 정도가 점점 심해지는 것으로 나타났다. 청소년의 이러한 언어실태는 부정적 언어 사용에 관한 용인 태도와 밀접한 관련을 지니고 있었다. 또한, 거주지의 도시화 층, 가정 경제 수준, 학업 성적, 자기통제력, 공감능력 등도 청소년의 공격적 언어 표현 사용에 직간접적으로 영향을 미치는 것으로 조사되었다. 가정 · 학교 · 사회 환경 요인별로는 `또래 간 비공식적 통제`가 청소년 언어에 가장 긍정적인 요소로 작용하며 `부모의 언어폭력으로 인한 스트레스`가 가장 부정적인 요소로 작용하는 것으로 나타났다. The purpose of this study is to investigate the current state of Korean teenager`s language use and attitude regarding expletives, aggressive language expression such as curses, teenage slangs and to examine the relevant environmental factors. We performed a questionnaire survey targeting 6,053 students of elementary, middle, high schools in 6 regions(Gyeongi, Gangwon, Chungcheong, Jeolla, Gyeongsang, Jeju). Our result indicate that the rough intensity of expletive and the language destruction level deepens with age, and adolescents` actual language use is closely related with the language attitude. The urbanization layer of dwelling place, home financial level, schoolwork grade, self-control, and empathy were also indicated to have direct and indirect influence upon adolescents` use of aggressive language expression. As a result of analyzing the relevant environmental factors, teenagers` language use is greatly influenced by their peers` informal control. And the stress caused by parents` verbal abuse would have an adverse effects upon teenager`s language use.", + "date": "2012", + "ISSN": "1225-1216", + "abstractNote": "본 연구는 전국 청소년의 언어 실태와 언어 의식을 조사하고 이에 영향을 미치는 환경요인을 분석해 내는 데 목적이 있다. 본 연구의 조사 대상이 되는 언어 실태는 욕설 등 공격적 언어 표현, 비속어, 은어, 유행어 사용에 관한 것이다. 이를 위하여 본 연구에서는 전국 6개 권역(경인, 강원, 충청, 전라, 경상, 제주)의 초 · 중 · 고등학교 학생 6,053명을 대상으로 설문 조사를 수행하고, 비속어 등의 사용빈도와 거친 강도, 언어 규범 파괴 정도, 관련 환경 요인 등을 분석하였다. 그 결과, 응답자의 학교 급이 올라갈수록 사용하는 비속어나 은어·유행어의 거친 강도나 언어 규범 파괴 정도가 점점 심해지는 것으로 나타났다. 청소년의 이러한 언어실태는 부정적 언어 사용에 관한 용인 태도와 밀접한 관련을 지니고 있었다. 또한, 거주지의 도시화 층, 가정 경제 수준, 학업 성적, 자기통제력, 공감능력 등도 청소년의 공격적 언어 표현 사용에 직간접적으로 영향을 미치는 것으로 조사되었다. 가정 · 학교 · 사회 환경 요인별로는 `또래 간 비공식적 통제`가 청소년 언어에 가장 긍정적인 요소로 작용하며 `부모의 언어폭력으로 인한 스트레스`가 가장 부정적인 요소로 작용하는 것으로 나타났다.", + "journalAbbreviation": "국제어문", "language": "ko-KR", "libraryCatalog": "KStudy", "pages": "43–93", "publicationTitle": "국제어문", + "url": "http://kiss.kstudy.com/thesis/thesis-view.asp?key=3500796", "volume": "54", "attachments": [], - "tags": [], + "tags": [ + { + "tag": "aggressive language expression" + }, + { + "tag": "buzz-word" + }, + { + "tag": "curse" + }, + { + "tag": "expletive" + }, + { + "tag": "language attitude" + }, + { + "tag": "language destruction" + }, + { + "tag": "language use" + }, + { + "tag": "questionnaire survey" + }, + { + "tag": "teenage slang" + }, + { + "tag": "teenager`s language" + }, + { + "tag": "공격적 언어 표현" + }, + { + "tag": "비속어" + }, + { + "tag": "설문 조사" + }, + { + "tag": "언어 실태" + }, + { + "tag": "언어 의식" + }, + { + "tag": "언어 파괴" + }, + { + "tag": "욕설" + }, + { + "tag": "유행어" + }, + { + "tag": "은어" + }, + { + "tag": "청소년 언어" + } + ], "notes": [], "seeAlso": [] } @@ -273,35 +343,51 @@ var testCases = [ "creators": [ { "lastName": "이동호", - "fieldMode": true, - "creatorType": "author" + "creatorType": "author", + "fieldMode": 1 }, { "lastName": "이재서", - "fieldMode": true, - "creatorType": "author" + "creatorType": "author", + "fieldMode": 1 }, { "lastName": "윤숙자", - "fieldMode": true, - "creatorType": "author" + "creatorType": "author", + "fieldMode": 1 }, { "lastName": "강병철", - "fieldMode": true, - "creatorType": "author" + "creatorType": "author", + "fieldMode": 1 } ], "date": "2010", - "abstractNote": "초록 보기", + "ISSN": "1229-8212", + "abstractNote": "Purpose : This study was performed to analyze the position, pattern of impacted mesiodens, and their relationship to the adjacent teeth using Dental cone-beam CT. Materials and Methods : Sixty-two dental cone-beam CT images with 81 impacted mesiodenses were selected from about 2,298 cone-beam CT images at Chonnam National University Dental Hospital from June 2006 to March 2009. The position, pattern, shape of impacted mesiodenses and their complications were analyzed in cone-beam CT including 3D images. Results : The sex ratio (M : F) was 2.9 : 1. Most of the mesiodenses (87.7%) were located at palatal side to the incisors. 79% of the mesiodenses were conical in shape. 60.5% of the mesiodenses were inverted, 21% normal erupting direction, and 18.5% transverse direction. The complications due to the presence of mesiodenses were none in 43.5%, diastema in 19.4%, tooth displacement in 17.7%, delayed eruption or impaction in 12.9%, tooth rotation in 4.8%, and dentigerous cyst in 1.7%. Conclusions : Dental cone-beam CT images with 3D provided 3-dimensional perception of mesiodens to the neighboring teeth. This results would be helpful for management of the impacted mesiodens.", "issue": "3", + "journalAbbreviation": "대한구강악안면방사선학회지 (대한구강악안면방사선학회)", "language": "ko-KR", "libraryCatalog": "KStudy", "pages": "109–114", "publicationTitle": "대한구강악안면방사선학회지 (대한구강악안면방사선학회)", + "url": "http://kiss.kstudy.com/public/public2-article.asp?key=50064290", "volume": "40", "attachments": [], - "tags": [], + "tags": [ + { + "tag": "Cone-Beam Computed Tomograpahy" + }, + { + "tag": "Incisor" + }, + { + "tag": "Supernumerary" + }, + { + "tag": "Tooth" + } + ], "notes": [], "seeAlso": [] } @@ -316,32 +402,63 @@ var testCases = [ "title": "KOLMOGOROV DISTANCE FOR MULTIVARIATE NORMAL APPROXIMATION", "creators": [ { - "firstName": "Yoon Tae", "lastName": "Kim", - "creatorType": "author" + "creatorType": "author", + "fieldMode": 1 + }, + { + "lastName": "Yoon Tae", + "creatorType": "author", + "fieldMode": 1 }, { - "firstName": "Hyun Suk", "lastName": "Park", - "creatorType": "author" + "creatorType": "author", + "fieldMode": 1 + }, + { + "lastName": "Hyun Suk", + "creatorType": "author", + "fieldMode": 1 } ], "date": "2015", - "abstractNote": "초록 보기", + "ISSN": "1976-8605", + "abstractNote": "This paper concerns the rate of convergence in the multidimensional normal approximation of functional of Gaussian fields. The aim of the present work is to derive explicit upper bounds of the Kolmogorov distance for the rate of convergence instead of Wasserstein distance studied by Nourdin et al. [Ann. Inst. H. Poincar$\\acute{e}$(B) Probab.Statist. 46(1) (2010) 45-98].", "issue": "1", + "journalAbbreviation": "Korean Journal of mathematics (강원경기수학회)", "language": "ko-KR", "libraryCatalog": "KStudy", "pages": "1–10", "publicationTitle": "Korean Journal of mathematics (강원경기수학회)", + "url": "http://kiss.kstudy.com/public/public2-article.asp?key=50789039", "volume": "23", "attachments": [], - "tags": [], + "tags": [ + { + "tag": "Kolmogorov distance" + }, + { + "tag": "Malliavin calculus" + }, + { + "tag": "Stein`s method" + }, + { + "tag": "Wasserstein distance" + }, + { + "tag": "fractional Brownian motion" + }, + { + "tag": "multidimensional normal approximation" + } + ], "notes": [], "seeAlso": [] } ] - } -] + }, { "type": "web", "url": "http://kiss.kstudy.com/public/public3-article.asp?key=60023584", @@ -352,35 +469,35 @@ var testCases = [ "creators": [ { "lastName": "정영식", - "fieldMode": true, - "creatorType": "author" + "creatorType": "author", + "fieldMode": 1 }, { "lastName": "박종필", - "fieldMode": true, - "creatorType": "author" + "creatorType": "author", + "fieldMode": 1 }, { "lastName": "정순원", - "fieldMode": true, - "creatorType": "author" + "creatorType": "author", + "fieldMode": 1 }, { "lastName": "김유리", - "fieldMode": true, - "creatorType": "author" + "creatorType": "author", + "fieldMode": 1 }, { "lastName": "송교준", - "fieldMode": true, - "creatorType": "author" + "creatorType": "author", + "fieldMode": 1 } ], "date": "2013", - "abstractNote": "초록 보기", "institution": "교육부", "language": "ko-KR", "libraryCatalog": "KStudy", + "url": "http://kiss.kstudy.com/public/public3-article.asp?key=60023584", "attachments": [], "tags": [], "notes": [], From c554a9dafb750e7893f1a383ffd679ab180a5211 Mon Sep 17 00:00:00 2001 From: Sebastian Karcher Date: Tue, 2 Jan 2018 22:50:30 -0500 Subject: [PATCH 16/18] change indexOf to includes --- KStudy.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/KStudy.js b/KStudy.js index 5730eaf502..8c3efb835d 100644 --- a/KStudy.js +++ b/KStudy.js @@ -16,7 +16,7 @@ ***** BEGIN LICENSE BLOCK ***** KISS (Korean Studies Information Service System) Translator - Copyright © 2017 Yunwoo Song, Frank Bennett, and Philipp Zumstein + Copyright © 2017-2018 Yunwoo Song, Frank Bennett, and Philipp Zumstein This file is part of Zotero. @@ -38,13 +38,13 @@ function detectWeb(doc, url) { - if (url.indexOf('/thesis/thesis-view.asp')>-1) { + if (url.includes('/thesis/thesis-view.asp')) { return "journalArticle"; - } else if (url.indexOf('/public2-article.asp')>-1) { + } else if (url.includes('/public2-article.asp')) { // these are reports and working paper series but with publicaton name, // volume, issue numbers; thus handled as journal articles as well return "journalArticle"; - } else if (url.indexOf('/public3-article.asp')>-1) { + } else if (url.includes('/public3-article.asp')) { return "report"; } else if (getSearchResults(doc, true)) { return "multiple"; From 5f07940c8d7618ef2f5332301bc2e313d2e593a3 Mon Sep 17 00:00:00 2001 From: Philipp Zumstein Date: Wed, 3 Jan 2018 14:11:08 +0100 Subject: [PATCH 17/18] [KStudy.js] Update according to the reviews --- KStudy.js | 187 ++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 154 insertions(+), 33 deletions(-) diff --git a/KStudy.js b/KStudy.js index 8c3efb835d..0910cb38d2 100644 --- a/KStudy.js +++ b/KStudy.js @@ -9,7 +9,7 @@ "inRepository": true, "translatorType": 4, "browserSupport": "gcsibv", - "lastUpdated": "2018-01-03 00:14:29" + "lastUpdated": "2018-01-03 13:10:00" } /* @@ -38,15 +38,18 @@ function detectWeb(doc, url) { - if (url.includes('/thesis/thesis-view.asp')) { - return "journalArticle"; - } else if (url.includes('/public2-article.asp')) { - // these are reports and working paper series but with publicaton name, - // volume, issue numbers; thus handled as journal articles as well - return "journalArticle"; - } else if (url.includes('/public3-article.asp')) { - return "report"; - } else if (getSearchResults(doc, true)) { + if (/\bkey=(\d+)\b/.test(url)) { + if (url.includes('/thesis/thesis-view.asp')) { + return "journalArticle"; + } else if (url.includes('/public2-article.asp')) { + // these are reports and working paper series but with publicaton name, + // volume, issue numbers; thus handled as journal articles as well + return "journalArticle"; + } else if (url.includes('/public3-article.asp')) { + return "report"; + } + } + if (getSearchResults(doc, true)) { return "multiple"; } } @@ -63,6 +66,8 @@ function getSearchResults(doc, checkOnly) { if (href=="#") continue; // exclude links to overview of journal if (href.includes("/journal/journal-view")) continue; + // make sure we have a key to make the risURL + if (!(/\bkey=(\d+)\b/.test(href))) continue; if (checkOnly) return true; found = true; items[href] = title; @@ -91,9 +96,10 @@ function doWeb(doc, url) { function scrape(doc, url) { var key = url.match(/\bkey=(\d+)\b/)[1]; - var risURL = "http://kiss.kstudy.com/p-common/export_endnote.asp"; + var risURL = "/p-common/export_endnote.asp"; var postData = "atcl_data=" + key + "&export_gubun=EndNote"; ZU.doPost(risURL, postData, function(text) { + // Z.debug(text); var translator = Zotero.loadTranslator("import"); translator.setTranslator("32d59d2d-b65a-4da4-b0a3-bdd3cfb979e7"); translator.setString(text); @@ -101,18 +107,80 @@ function scrape(doc, url) { if (url.includes('/public/public3-article')) { item.itemType = "report"; } + var latin = item.title.match(/[\u{0000}-\u{00FF}]/ug); + if (latin.length > item.title.length/2 && item.title.toUpperCase() == item.title) { + item.title = ZU.capitalizeTitle(item.title, true); + } + // sometimes the author tags in RIS are empty and therefore we + // try to scrape author names also directly + if (item.creators.length == 0) { + item.creators = scrapeAuthorsDirectly(doc, url); + } else { + // romanized Korean names with first and last name are splitted + // wrongly into two AU tags in RIS and therefore we scrape + // author names directly here + let firstName = item.creators[0].lastName; + let latinCharacters = firstName.match(/[\u{0000}-\u{00FF}]/ug); + if (!item.creators[0].firstName && latinCharacters && latinCharacters.length == firstName.length) { + item.creators = scrapeAuthorsDirectly(doc, url); + } + } if (item.issue && item.issue == "0") { delete item.issue; } item.language = "ko-KR"; - if (item.pages) { - item.pages = item.pages.replace('-', '–'); - } item.complete(); }); translator.translate(); }); } + + +function scrapeAuthorsDirectly(doc, url) { + var creators = []; + var writers = ZU.xpathText(doc, '//div[@class="writers"]'); + if (writers) { + var creatorsList = writers.split(','); + for (var i=0; i Date: Wed, 3 Jan 2018 22:10:39 -0500 Subject: [PATCH 18/18] Remove space before colon --- KStudy.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/KStudy.js b/KStudy.js index 0910cb38d2..4829528dde 100644 --- a/KStudy.js +++ b/KStudy.js @@ -111,6 +111,8 @@ function scrape(doc, url) { if (latin.length > item.title.length/2 && item.title.toUpperCase() == item.title) { item.title = ZU.capitalizeTitle(item.title, true); } + //remove space before colon in title + item.title = item.title.replace(/\s+:/, ":"); // sometimes the author tags in RIS are empty and therefore we // try to scrape author names also directly if (item.creators.length == 0) { @@ -189,7 +191,7 @@ var testCases = [ "items": [ { "itemType": "journalArticle", - "title": "투고논문 : 소옹(邵雍)의 선천역학(先天易學)에 대한 王夫之의 비판", + "title": "투고논문: 소옹(邵雍)의 선천역학(先天易學)에 대한 王夫之의 비판", "creators": [ { "lastName": "조우진",