Skip to content

Commit 4dc8ea6

Browse files
committed
Remove Nat'l Lib of NZ (Voyager7 now); Fix In these Times; Rewrite Gene Ontology to mirror DOI; Fix Flickr indiv item view; Update tests: Bloomberg, Highwire, IEEE, IMDb, PICA2, Nat'l Archives US;
1 parent da2dac5 commit 4dc8ea6

11 files changed

+145
-339
lines changed

Bloomberg.js

+3-7
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,9 @@ var testCases = [
9898
],
9999
"url": "http://www.bloomberg.com/news/2012-01-04/bank-earnings-increase-57-in-analyst-forecasts-which-proved-wrong-in-2011.html",
100100
"abstractNote": "Analysts’ failure to foresee declining earnings per share for the biggest U.S. banks last year hasn’t stopped them from predicting an even bigger profit surge for 2012.",
101-
"date": "Jan 3, 2012 5:00 PM MT",
101+
"date": "Jan 4, 2012 12:00 AM GMT+0000",
102102
"title": "Bank Earnings Jump 57% in Analyst Forecasts",
103-
"websiteTitle": "Bloomberg",
104-
"libraryCatalog": "Bloomberg",
105-
"accessDate": "CURRENT_TIMESTAMP"
103+
"websiteTitle": "Bloomberg"
106104
}
107105
]
108106
},
@@ -124,11 +122,9 @@ var testCases = [
124122
],
125123
"url": "http://www.bloomberg.com/news/2012-01-05/four-economists-come-together-to-say-we-agree-business-class.html",
126124
"abstractNote": "“If you laid all the economists in the world end to end, they still wouldn’t reach a conclusion.” This old joke still works because it reflects a common belief that economists can’t agree on anything important. Yet the four of us are part of a project that we believe will demonstrate that this proposition is wrong.",
127-
"date": "Jan 4, 2012 5:01 PM MT",
125+
"date": "Jan 5, 2012 12:01 AM GMT+0000",
128126
"title": "Four Economists Come Together to Say ‘We Agree’: Business Class",
129127
"websiteTitle": "Bloomberg",
130-
"libraryCatalog": "Bloomberg",
131-
"accessDate": "CURRENT_TIMESTAMP",
132128
"shortTitle": "Four Economists Come Together to Say ‘We Agree’"
133129
}
134130
]

Flickr.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,16 @@
99
"inRepository": true,
1010
"translatorType": 4,
1111
"browserSupport": "gcsbv",
12-
"lastUpdated": "2013-06-08 04:28:54"
12+
"lastUpdated": "2014-01-04 17:23:31"
1313
}
1414

1515
function detectWeb(doc, url) {
1616
if (ZU.xpath(doc,'//h1[@property="dc:title" and starts-with(@id, "title_div")]').length) {
1717
return "artwork";
18-
} else if (ZU.xpath(doc,'//span[contains(@class, "photo_container")]').length) {
18+
} else if (ZU.xpathText(doc,'//meta[@name="og:type"]/@content') && ZU.xpathText(doc,'//meta[@name="og:type"]/@content').match(/photo$/)) {
19+
return "artwork";
20+
}
21+
else if (ZU.xpath(doc,'//span[contains(@class, "photo_container")]').length) {
1922
return "multiple";
2023
}
2124
}
@@ -25,7 +28,8 @@ function doWeb(doc, url) {
2528

2629
// single result
2730
if (detectWeb(doc, url) != "multiple") {
28-
var elmt = ZU.xpathText(doc, '//meta[@property="og:image"]/@content')
31+
var elmt = ZU.xpathText(doc, '//meta[@property="og:image"]/@content');
32+
if (!elmt) elmt = ZU.xpathText(doc, '//meta[@name="og:image"]/@content');
2933
var photo_id = elmt.substr(elmt.lastIndexOf('/')+1).match(/^[0-9]+/);
3034
if(!photo_id) return;
3135
items[photo_id[0]] = "title";

Gene Ontology.js

+58-29
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
"priority": 100,
99
"inRepository": true,
1010
"translatorType": 4,
11-
"browserSupport": "gv",
12-
"lastUpdated": "2013-04-15 18:04:37"
11+
"browserSupport": "gcv",
12+
"lastUpdated": "2014-01-05 11:26:46"
1313
}
1414

1515
/*
@@ -36,10 +36,9 @@
3636
authors of that translator for their premium quality code.
3737
*/
3838

39-
var items = {};
40-
var selectArray = {};
41-
4239

40+
var items = {};
41+
var selectArray = {};
4342
function detectWeb(doc, url) {
4443
var xPath = '//cite//*[@class="pmid"] | //cite//a[contains (@href, "pubmed")]';
4544
var cites = doc.evaluate(xPath, doc, null, XPathResult.ANY_TYPE, null).iterateNext();
@@ -51,7 +50,12 @@ function detectWeb(doc, url) {
5150
}
5251

5352
function doWeb(doc, url) {
53+
var PMIDs = getPMIDs(doc);
54+
retrievePMIDs(PMIDs, doc);
55+
}
5456

57+
58+
function getPMIDs(doc){
5559
var myPMID = '//cite//*[@class="pmid"] | //cite//a[contains (@href, "pubmed")]';
5660
var pmids = doc.evaluate(myPMID, doc, null, XPathResult.ANY_TYPE, null);
5761
var pmid_list = new Array();
@@ -75,37 +79,62 @@ function doWeb(doc, url) {
7579
if (pmid_list.length > 0) {
7680
Zotero.debug( "Found " + pmid_list.length + " PMIDs!" );
7781
}
78-
// get the data from the NCBI server
79-
var pmids = pmid_list.join(",");
80-
var url = "http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=pubmed&retmode=xml&id=" + pmids;
81-
82-
Zotero.Utilities.HTTP.doGet(url, function(text) {
83-
// load translator for PubMed
84-
var translator = Zotero.loadTranslator("import");
85-
// var translator = Zotero.Translate.Import;
86-
translator.setTranslator("fcf41bed-0cbc-3704-85c7-8062a0068a7a");
87-
translator.setString(text);
82+
return pmid_list;
83+
}
8884

89-
// don't save when item is done
90-
translator.setHandler("itemDone", function(obj, item) {
91-
items[item.extra] = item;
92-
selectArray[item.extra] = item.title;
93-
});
85+
function retrievePMIDs(PMIDs, doc){
86+
_numPMIDs = PMIDs.length;
87+
for (var i=0; i<_numPMIDs; i++){
88+
(function(doc, PMID) {
89+
var translate = Zotero.loadTranslator("search");
90+
translate.setTranslator("fcf41bed-0cbc-3704-85c7-8062a0068a7a");
91+
92+
var item = {"itemType":"journalArticle", "PMID":PMID};
93+
translate.setSearch(item);
94+
95+
// don't save when item is done
96+
translate.setHandler("itemDone", function(translate, item) {
97+
item.repository = "CrossRef";
98+
items[PMID] = item;
99+
selectArray[PMID] = item.title;
100+
});
101+
102+
translate.setHandler("done", function(translate) {
103+
_numPMIDs--;
104+
if(_numPMIDs <= 0) {
105+
completePMIDs(doc);
106+
}
107+
});
108+
109+
// Don't throw on error
110+
translate.setHandler("error", function() {});
111+
112+
translate.translate();
113+
})(doc, PMIDs[i]);
114+
}
115+
}
94116

95-
translator.translate();
117+
function completePMIDs(doc) {
118+
// all PMIDs retrieved now
119+
// check to see if there is more than one DOI
120+
var numPMIDs = 0;
121+
for(var PMID in selectArray) {
122+
numPMIDs++;
123+
if(numPMIDs == 1) break;
124+
}
125+
if(numPMIDs == 0) {
126+
throw "Could not find PMID";
127+
} else {
128+
Zotero.selectItems(selectArray, function(selectedPMIDs) {
129+
if(!selectedPMIDs) return true;
96130

97-
// all pmids retrieved now
98-
99-
Zotero.selectItems(selectArray, function (selectArray) {
100-
if (!selectArray) {
101-
return true;
102-
}
103-
for (var PMID in selectArray) {
131+
for(var PMID in selectedPMIDs) {
104132
items[PMID].complete();
105133
}
106134
});
107-
});
135+
}
108136
}
137+
109138
/** BEGIN TEST CASES **/
110139
var testCases = [
111140
{

HighWire.js

+2-58
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"inRepository": true,
1010
"translatorType": 4,
1111
"browserSupport": "gcsbv",
12-
"lastUpdated": "2012-09-04 23:12:25"
12+
"lastUpdated": "2014-01-04 17:25:25"
1313
}
1414

1515
function detectWeb(doc, url) {
@@ -204,61 +204,5 @@ function doWeb(doc, url) {
204204
}
205205

206206
/** BEGIN TEST CASES **/
207-
var testCases = [
208-
{
209-
"type": "web",
210-
"url": "http://rphr.endojournals.org/cgi/content/full/59/1/1",
211-
"items": [
212-
{
213-
"itemType": "journalArticle",
214-
"creators": [
215-
{
216-
"lastName": "Negro",
217-
"firstName": "Alejandra",
218-
"creatorType": "author"
219-
},
220-
{
221-
"lastName": "Brar",
222-
"firstName": "Bhawanjit K.",
223-
"creatorType": "author"
224-
},
225-
{
226-
"lastName": "Lee",
227-
"firstName": "Kuo-Fen",
228-
"creatorType": "author"
229-
}
230-
],
231-
"notes": [],
232-
"tags": [],
233-
"seeAlso": [],
234-
"attachments": [
235-
{
236-
"title": "HighWire Snapshot"
237-
},
238-
{
239-
"title": "HighWire Full Text PDF",
240-
"mimeType": "application/pdf"
241-
}
242-
],
243-
"title": "Essential Roles of Her2/erbB2 in Cardiac Development and Function",
244-
"date": "January 1, 2004",
245-
"publicationTitle": "Recent Progress in Hormone Research",
246-
"journalAbbreviation": "Recent Prog Horm Res",
247-
"pages": "1-12",
248-
"volume": "59",
249-
"issue": "1",
250-
"url": "http://rphr.endojournals.org/cgi/content/abstract/59/1/1",
251-
"abstractNote": "The tyrosine kinase receptor erbB2, also known in humans as Her2, is a member of the epidermal growth factor receptor (EGFR or erbB1) family, which also includes erbB3 and erbB4. The erbBs were discovered in an avian erythroblastosis tumor virus and exhibited similarities to human EGFR (Yarden and Sliwkowski, 2001). Her2/erbB2 is highly expressed in many cancer types. Its overexpression is correlated with a poor prognosis for breast and ovarian cancer patients. ErbB receptors bind to a family of growth factors, termed neuregulins/heregulin (NRG/HRG), which comprise NRG-1, -2, -3, and -4 and include multiple isoforms. ErbB2/Her2 is an orphan receptor that does not bind ligand alone but heterodimerizes with the other erbB receptors for NRG signaling. ErbB2 is expressed in multiple neuronal and non-neuronal tissues in embryos and adult animals, including the heart. Genetic data demonstrated that erbB2 is required for normal embryonic development of neural crest-derived cranial sensory neurons. ErbB2/Her2-null mutant embryos of a trabeculation defect die before embryonic day (E) 11. To study its role at later stages of development, we generated a transgenic mouse line that specifically expresses the rat erbB2 cDNA in the heart under the control of the cardiac-specific {alpha}-myosin heavy chain promoter. When crossed into the null background, the expression of the rat erbB2 cDNA rescued the cardiac phenotype in the erbB2-null mutant mice that survive until birth but display an absence of Schwann cells and a severe loss of both motor and spinal sensory neurons. To study the role of erbB2 in the adult heart, we generated conditional mutant mice carrying a cardiac-restricted deletion of erbB2. These erbB2 conditional mutants exhibited multiple independent parameters of dilated cardiomyopathy, including chamber dilation, wall thinning, and decreased contractility. Interestingly, treatment of breast cancers overexpressing erbB2 with Herceptin (Trastuzumab), a humanized monoclonal antibody specific to the extracellular domain of erbB2, results in some patients developing cardiac dysfunction. The adverse effect is increased significantly in those patients who also receive the chemotherapeutical agent anthracycline. We found that erbB2-deficient cardiac myocytes are more susceptible to anthracycline-induced cytotoxicity. These results suggest that erbB2 signaling in the heart is essential for the prevention of dilated cardiomyopathy. These lines of mice provide models with which to elucidate the molecular and cellular mechanisms by which erbB2 signaling regulates cardiac functions. These mice also will provide important information for devising strategies to mitigate the cardiotoxic effects of Herceptin treatment, allowing for the potential expanded use of this drug to treat all cancers overexpressing erbB2.",
252-
"DOI": "10.1210/rp.59.1.1",
253-
"libraryCatalog": "HighWire",
254-
"accessDate": "CURRENT_TIMESTAMP"
255-
}
256-
]
257-
},
258-
{
259-
"type": "web",
260-
"url": "http://rphr.endojournals.org/cgi/search?sendit=Search&pubdate_year=&volume=&firstpage=&author1=&author2=&title=oxytocin+vasopressin&andorexacttitle=and&titleabstract=&andorexacttitleabs=and&fulltext=&andorexactfulltext=and&journalcode=endo&fmonth=Jan&fyear=2001&tmonth=Jan&tyear=2004&fdatedef=1+January+2001&tdatedef=1+January+2004&flag=&RESULTFORMAT=1&hits=10&hitsbrief=25&sortspec=relevance&sortspecbrief=relevance",
261-
"items": "multiple"
262-
}
263-
]
207+
var testCases = []
264208
/** END TEST CASES **/

IEEE Xplore.js

+28-30
Original file line numberDiff line numberDiff line change
@@ -360,23 +360,23 @@ var testCases = [
360360
],
361361
"notes": [],
362362
"tags": [
363+
"Deterministic fuzzy Turing machine (DFTM)",
363364
"Turing machines",
364365
"computational complexity",
365366
"deterministic automata",
366-
"fuzzy set theory",
367367
"deterministic fuzzy Turing machines",
368368
"fixed finite subset",
369-
"fuzzy languages",
370-
"fuzzy polynomial time-bounded computation",
371-
"fuzzy sets",
372-
"nondeterministic fuzzy Turing machines",
373-
"nondeterministic polynomial time-bounded computation",
374-
"Deterministic fuzzy Turing machine (DFTM)",
375369
"fuzzy computational complexity",
376370
"fuzzy grammar",
371+
"fuzzy languages",
372+
"fuzzy polynomial time-bounded computation",
377373
"fuzzy recursive language",
378374
"fuzzy recursively enumerable (f.r.e.) language",
375+
"fuzzy set theory",
376+
"fuzzy sets",
379377
"nondeterministic fuzzy Turing machine (NFTM)",
378+
"nondeterministic fuzzy Turing machines",
379+
"nondeterministic polynomial time-bounded computation",
380380
"universal fuzzy Turing machine (FTM)"
381381
],
382382
"seeAlso": [],
@@ -386,6 +386,7 @@ var testCases = [
386386
"mimeType": "text/html"
387387
}
388388
],
389+
"itemID": "4607247",
389390
"publicationTitle": "IEEE Transactions on Fuzzy Systems",
390391
"title": "Fuzzy Turing Machines: Variants and Universality",
391392
"date": "2008",
@@ -395,8 +396,6 @@ var testCases = [
395396
"abstractNote": "In this paper, we study some variants of fuzzy Turing machines (FTMs) and universal FTM. First, we give several formulations of FTMs, including, in particular, deterministic FTMs (DFTMs) and nondeterministic FTMs (NFTMs). We then show that DFTMs and NFTMs are not equivalent as far as the power of recognizing fuzzy languages is concerned. This contrasts sharply with classical TMs. Second, we show that there is no universal FTM that can exactly simulate any FTM on it. But if the membership degrees of fuzzy sets are restricted to a fixed finite subset A of [0,1], such a universal machine exists. We also show that a universal FTM exists in some approximate sense. This means, for any prescribed accuracy, that we can construct a universal machine that simulates any FTM with the given accuracy. Finally, we introduce the notions of fuzzy polynomial time-bounded computation and nondeterministic fuzzy polynomial time-bounded computation, and investigate their connections with polynomial time-bounded computation and nondeterministic polynomial time-bounded computation.",
396397
"DOI": "10.1109/TFUZZ.2008.2004990",
397398
"ISSN": "1063-6706",
398-
"conferenceName": "IEEE Transactions on Fuzzy Systems",
399-
"proceedingsTitle": "IEEE Transactions on Fuzzy Systems",
400399
"libraryCatalog": "IEEE Xplore",
401400
"shortTitle": "Fuzzy Turing Machines"
402401
}
@@ -432,37 +431,37 @@ var testCases = [
432431
],
433432
"notes": [],
434433
"tags": [
435-
"geophysical image processing",
436-
"geophysical techniques",
437-
"image classification",
438-
"image matching",
439-
"image resolution",
440-
"remote sensing",
434+
"Adaptation models",
435+
"Domain adaptation",
436+
"Entropy",
437+
"Manifolds",
438+
"Remote sensing",
439+
"Support vector machines",
440+
"Transforms",
441+
"Vector quantization",
441442
"adaptation algorithm",
442443
"angular effects",
443444
"cross-domain image processing techniques",
444445
"data acquisition conditions",
445446
"destination domain",
447+
"geophysical image processing",
448+
"geophysical techniques",
446449
"graph matching method",
450+
"image classification",
451+
"image matching",
452+
"image resolution",
453+
"model portability",
454+
"multitemporal classification",
447455
"multitemporal very high resolution image classification",
448456
"nonlinear deformation",
449457
"nonlinear transform",
450458
"remote sensing",
459+
"remote sensing",
451460
"source domain",
452-
"transfer learning mapping",
453-
"vector quantization",
454-
"Adaptation models",
455-
"Entropy",
456-
"Manifolds",
457-
"Remote sensing",
458-
"Support vector machines",
459-
"Transforms",
460-
"Vector quantization",
461-
"Domain adaptation",
462-
"model portability",
463-
"multitemporal classification",
464461
"support vector machine (SVM)",
465-
"transfer learning"
462+
"transfer learning",
463+
"transfer learning mapping",
464+
"vector quantization"
466465
],
467466
"seeAlso": [],
468467
"attachments": [
@@ -475,6 +474,7 @@ var testCases = [
475474
"mimeType": "text/html"
476475
}
477476
],
477+
"itemID": "6221978",
478478
"publicationTitle": "IEEE Transactions on Geoscience and Remote Sensing",
479479
"title": "Graph Matching for Adaptation in Remote Sensing",
480480
"date": "2013",
@@ -484,8 +484,6 @@ var testCases = [
484484
"abstractNote": "We present an adaptation algorithm focused on the description of the data changes under different acquisition conditions. When considering a source and a destination domain, the adaptation is carried out by transforming one data set to the other using an appropriate nonlinear deformation. The eventually nonlinear transform is based on vector quantization and graph matching. The transfer learning mapping is defined in an unsupervised manner. Once this mapping has been defined, the samples in one domain are projected onto the other, thus allowing the application of any classifier or regressor in the transformed domain. Experiments on challenging remote sensing scenarios, such as multitemporal very high resolution image classification and angular effects compensation, show the validity of the proposed method to match-related domains and enhance the application of cross-domains image processing techniques.",
485485
"DOI": "10.1109/TGRS.2012.2200045",
486486
"ISSN": "0196-2892",
487-
"conferenceName": "IEEE Transactions on Geoscience and Remote Sensing",
488-
"proceedingsTitle": "IEEE Transactions on Geoscience and Remote Sensing",
489487
"libraryCatalog": "IEEE Xplore"
490488
}
491489
]

0 commit comments

Comments
 (0)