-
Notifications
You must be signed in to change notification settings - Fork 786
/
Copy pathIEEE Computer Society.js
429 lines (410 loc) · 14 KB
/
IEEE Computer Society.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
{
"translatorID": "8d72adbc-376c-4a33-b6be-730bc235190f",
"label": "IEEE Computer Society",
"creator": "Philipp Zumstein",
"target": "^https?://(www[0-9]?|search[0-9]?)\\.computer\\.org/(csdl/(mags/[0-9a-z/]+|trans/[0-9a-z/]+|letters/[0-9a-z]+|proceedings/[0-9a-z/]+|doi|abs/proceedings)|search/results|portal/web/computingnow/.*content\\?)",
"minVersion": "3.0",
"maxVersion": "",
"priority": 100,
"inRepository": true,
"translatorType": 4,
"browserSupport": "gcsibv",
"lastUpdated": "2017-06-07 18:52:06"
}
/*
***** BEGIN LICENSE BLOCK *****
Copyright © 2016 Philipp Zumstein
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 <http://www.gnu.org/licenses/>.
***** END LICENSE BLOCK *****
*/
function detectWeb(doc, url) {
//supports table of contents, seach results and single document pages
if (url.indexOf("web/search?") > 1 || url.indexOf("index.html") > -1) {
return "multiple";
} else if (url.indexOf("/csdl/mags/") > 1) {
return "magazineArticle";
} else if (url.search(/\/portal\/web\/computingnow\/.*content/) > 1) {
if (ZU.xpath(doc, '//li/a[contains(text(), "BibTex") and contains(@href, ".bib")]|//div[@id="bibText-content"]').length > 0) return "magazineArticle";
} else if (url.indexOf("/csdl/trans/") > 1) {
return "journalArticle";
} else if (url.indexOf("/csdl/proceedings/") > 1) {
return "conferencePaper";
} else if (url.indexOf("/csdl/abs/proceedings/") > 1) {
return "multiple";
} else if (url.indexOf("/csdl/letters/") > 1) {
return "journalArticle";
} else if (url.indexOf("/portal/web/csdl/doi/") > 1) {
var refWork = ZU.xpathText(doc, '//div[@id="refWorksText-content"]');
if (refWork) refWork = refWork.substr(0, 9);
else return false;
if (refWork.indexOf("JOUR") > 1) return "journalArticle";
else if (refWork.indexOf("MGZN") > 1) return "magazineArticle";
else if (refWork.indexOf("CONF") > 1) return "conferencePaper";
else return false;
} else {
return false;
}
}
function getSearchResults(doc, checkOnly) {
var items = {};
var found = false;
//index pages
var rows = ZU.xpath(doc, '//span[@class="tocLineItemTitle"]/a[not(contains(@href, ".pdf"))]');
for (var i=0; i<rows.length; i++) {
var href = rows[i].href;
var title = ZU.trimInternal(rows[i].textContent);
if (!href || !title) continue;
if (checkOnly) return true;
found = true;
items[href] = title;
}
//search result pages
rows = ZU.xpath(doc, '//div[@class="row"]');
for (var i=0; i<rows.length; i++) {
var href = ZU.xpathText(rows[i], './/a[contains(text(), "Abstract")]/@href');
var title = ZU.xpathText(rows[i], './/span[contains(@class, "h4")]');
if (!href || !title) continue;
if (checkOnly) return true;
found = true;
items[href] = title;
}
return found ? items : false;
}
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);
}
}
function scrape(doc, url) {
var bibtexlink = ZU.xpathText(doc, '//a[contains(text(), "BibTex") and contains(@href, "bibtex")]/@href');
ZU.doGet(bibtexlink, function (text) {
text = text.replace(/<br\/>/g,"");
var translator = Zotero.loadTranslator("import");// BibTeX translator
translator.setTranslator("9cb70025-a888-4a29-a210-93ec52da40d4");
translator.setHandler("itemDone", function (obj, item) {
if (item.DOI) item.DOI = item.DOI.replace(/^.*?10\./, "10.");
finalize(doc, url, item);
item.complete();
});
translator.setString(text);
translator.translate();
});
}
function finalize(doc, url, item) {
item.itemType = detectWeb(doc, url);
var title = ZU.xpathText(doc, '//div[@class="abstractTitle"]');
//Sometimes the BibTeX does not contain the authors names and
//then we have to try to extract this info from the website.
if (item.creators.length == 0) {
var authors = ZU.xpath(doc, '//div[@class="abstractTitle"]/following-sibling::div[@class="abstractAuthor"]/a');
for (var i=0; i<authors.length; i++) {
item.creators.push(ZU.cleanAuthor(authors[i].textContent, "author"));
}
}
//Authors names in BibTeX are nonstandard and therefore
//splitting into first and last name normally fails.
//Moreover, ignore "undefined" authors
var creators = [];
for (var i=0; i<item.creators.length; i++) {
if (item.creators[i].firstName=="") {
if (item.creators[i].lastName!=="undefined") {
creators.push(ZU.cleanAuthor(item.creators[i].lastName, item.creators[i].creatorType));
}
//delete the else cases
} else {
creators.push(item.creators[i]);
}
}
item.creators = creators;
//Adding abstract
item.abstractNote = ZU.xpathText(doc, '//div[text()="ABSTRACT"]/following-sibling::div[1]');
//Adding tags
var keywordText = ZU.xpathText(doc, '//div[text()="INDEX TERMS"]/following-sibling::div[1]');
if (keywordText) {
keywordText = keywordText.replace(/,\s*$/, '');
if (keywordText.indexOf(";")>-1) {
item.tags = keywordText.split("; ");
} else {
item.tags = keywordText.split(", ");
}
}
//Fixing undefined issue number from wrong BibTeX value "number = {undefined}"
if (!item.issue || item.issue=="undefined") {
var abstractText = ZU.xpathText(doc, '//div[@class="abstractTitle"]/following-sibling::div[contains(@class, "abstractText")]');
var m = abstractText.match(/Issue No\. 0?(\d+)/);
if (m) {
item.issue = m[1];
} else {
delete item.issue;
}
}
//Fixing wrong volume number from wrong BibTeX value "volume = {00}"
if (item.volume=="00") {
delete item.volume;
}
//Add isbn
var isbn = ZU.xpathText(doc, '//div[@class="abstractText" and contains(text(), "ISBN:")]');
if (!item.ISBN && isbn) {
item.ISBN = isbn;
}
//Add attachments
item.attachments.push({
document: doc,
mimeType: "text/html",
title: "Snapshot"
});
var pdfurl = ZU.xpathText(doc, '//div[@class="panel-body"]//a[contains(text(), "PDF")]/@href');
if (pdfurl) {
item.attachments.push({
url: pdfurl,
mimeType: "application/pdf",
title: "Full Text PDF"
});
}
}/** BEGIN TEST CASES **/
var testCases = [
{
"type": "web",
"url": "https://www.computer.org/csdl/trans/ta/2012/01/tta2012010003-abs.html",
"items": [
{
"itemType": "journalArticle",
"title": "Guest Editorial: Special Section on Naturalistic Affect Resources for System Building and Evaluation",
"creators": [
{
"firstName": "Bjorn",
"lastName": "Schuller",
"creatorType": "author"
},
{
"firstName": "Ellen",
"lastName": "Douglas-Cowie",
"creatorType": "author"
},
{
"firstName": "Anton",
"lastName": "Batliner",
"creatorType": "author"
}
],
"date": "2012",
"DOI": "10.1109/T-AFFC.2012.10",
"ISSN": "1949-3045",
"abstractNote": "The papers in this special section focus on the deployment of naturalistic affect resources for systems design and analysis.",
"issue": "1",
"itemID": "10.1109/T-AFFC.2012.10",
"libraryCatalog": "IEEE Computer Society",
"pages": "3-4",
"publicationTitle": "IEEE Transactions on Affective Computing",
"shortTitle": "Guest Editorial",
"volume": "3",
"attachments": [
{
"mimeType": "text/html",
"title": "Snapshot"
},
{
"mimeType": "application/pdf",
"title": "Full Text PDF"
}
],
"tags": [
"Behavioral sciences",
"Context awareness",
"Cultural differences",
"Emotion recognition",
"Human factors",
"Resource management",
"Special issues and sections",
"Speech processing",
"System analysis and design"
],
"notes": [],
"seeAlso": []
}
]
},
{
"type": "web",
"url": "https://www.computer.org/csdl/letters/ca/2012/01/lca2012010001-abs.html",
"items": [
{
"itemType": "journalArticle",
"title": "A Case for Hybrid Discrete-Continuous Architectures",
"creators": [
{
"firstName": "Simha",
"lastName": "Sethumadhavan",
"creatorType": "author"
},
{
"firstName": "Yannis",
"lastName": "Tsividis",
"creatorType": "author"
},
{
"firstName": "Ryan",
"lastName": "Roberts",
"creatorType": "author"
}
],
"date": "2011",
"DOI": "10.1109/L-CA.2011.22",
"ISSN": "1556-6056",
"abstractNote": "Current technology trends indicate that power- and energyefficiency will limit chip throughput in the future. Current solutions to these problems, either in the way of programmable or fixed-function digital accelerators will soon reach their limits as microarchitectural overheads are successively trimmed. A significant departure from current computing methods is required to carry forward computing advances beyond digital accelerators. In this paper we describe how the energy-efficiency of a large class of problems can be improved by employing a hybrid of the discrete and continuous models of computation instead of the ubiquitous, traditional discrete model of computation. We present preliminary analysis of domains and benchmarks that can be accelerated with the new model. Analysis shows that machine learning, physics and up to one-third of SPEC, RMS and Berkeley suite of applications can be accelerated with the new hybrid model.",
"issue": "1",
"itemID": "10.1109/L-CA.2011.22",
"libraryCatalog": "IEEE Computer Society",
"pages": "1-4",
"publicationTitle": "IEEE Computer Architecture Letters",
"volume": "11",
"attachments": [
{
"mimeType": "text/html",
"title": "Snapshot"
}
],
"tags": [
"Design studies",
"Hybrid systems"
],
"notes": [],
"seeAlso": []
}
]
},
{
"type": "web",
"url": "https://www.computer.org/csdl/mags/cg/2012/06/mcg2012060006-abs.html",
"items": [
{
"itemType": "magazineArticle",
"title": "Introducing Google Chart Tools and Google Maps API in Data Visualization Courses",
"creators": [
{
"firstName": "Ying",
"lastName": "Zhu",
"creatorType": "author"
}
],
"date": "2012",
"ISSN": "0272-1716",
"abstractNote": "This article reports the experience of using Google Chart Tools and Google Maps in a data visualization course at Georgia State University. These visualization toolkits have many benefits but haven't been widely used in such courses. Students found them easy to use for creating a variety of interactive data visualizations.",
"issue": "6",
"itemID": "10.1109/MCG.2012.114",
"libraryCatalog": "IEEE Computer Society",
"pages": "6-9",
"publicationTitle": "IEEE Computer Graphics and Applications",
"volume": "32",
"attachments": [
{
"mimeType": "text/html",
"title": "Snapshot"
}
],
"tags": [
"Data visualization",
"Data visualization,visualization education",
"Google",
"Google Chart Tools",
"Google Fusion Tables",
"Google Maps API",
"computer graphics",
"data visualization",
"processing"
],
"notes": [],
"seeAlso": []
}
]
},
{
"type": "web",
"url": "http://www.computer.org/csdl/trans/ta/2012/01/index.html",
"items": "multiple"
},
{
"type": "web",
"url": "https://www.computer.org/csdl/proceedings/bibe/2010/4083/00/4083a001-abs.html",
"items": [
{
"itemType": "conferencePaper",
"title": "A Clustering Approach to Identify Intergenic Non-coding RNA in Mouse Macrophages",
"creators": [
{
"firstName": "Lana X.",
"lastName": "Garmire",
"creatorType": "author"
},
{
"firstName": "Shankar",
"lastName": "Subramaniam",
"creatorType": "author"
},
{
"firstName": "David",
"lastName": "Garmire",
"creatorType": "author"
},
{
"firstName": "Chris K.",
"lastName": "Glass",
"creatorType": "author"
}
],
"date": "2010",
"DOI": "10.1109/BIBE.2010.10",
"ISBN": "9780769540832",
"abstractNote": "We present a global clustering approach to identify putative intergenic non-coding RNAs based on the RNA polymerase II and Histone 3 lysine 4 trimethylation signatures. Both of these signatures are processed from the digital sequencing tags produced by chromatin immunoprecipitation, a high-throughput massively parallel sequencing (ChIP-Seq) technology. Our method compares favorably to the comparison method. We characterize the intergenic non-coding RNAs to have conservative promoters. We predict that these nc-RNAs are related to metabolic process without lipopolysaccharides (LPS) treatment, but shift towards developmental and immune-related functions with LPS treatment. We demonstrate that more intergenic nc-RNAs respond positively to LPS treatment, rather than negatively. Using QPCR, we experimentally validate 8 out of 11 nc-RNA regions respond to LPS treatment as predicted by the computational method.",
"itemID": "10.1109/BIBE.2010.10",
"libraryCatalog": "IEEE Computer Society",
"pages": "1-6",
"place": "Los Alamitos, CA, USA",
"proceedingsTitle": "13th IEEE International Conference on BioInformatics and BioEngineering",
"publisher": "IEEE Computer Society",
"attachments": [
{
"mimeType": "text/html",
"title": "Snapshot"
}
],
"tags": [
"ChIP-Seq",
"RNA polymerase",
"clustering",
"macrophage",
"non-coding RNA"
],
"notes": [],
"seeAlso": []
}
]
},
{
"type": "web",
"url": "http://www.computer.org/csdl/proceedings/bibe/2010/4083/00/index.html",
"items": "multiple"
}
]
/** END TEST CASES **/