Skip to content

Commit b6432f4

Browse files
committed
[T&F] Unescape HTML special entities
1 parent 39fde23 commit b6432f4

File tree

1 file changed

+134
-78
lines changed

1 file changed

+134
-78
lines changed

Taylor and Francis+NEJM.js

+134-78
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"inRepository": true,
1010
"translatorType": 4,
1111
"browserSupport": "gcsibv",
12-
"lastUpdated": "2014-06-01 22:52:27"
12+
"lastUpdated": "2014-08-26 01:04:25"
1313
}
1414

1515
/*
@@ -117,6 +117,16 @@ function scrape(doc, url, dois) {
117117
translator.setTranslator("9cb70025-a888-4a29-a210-93ec52da40d4");
118118
translator.setString(text);
119119
translator.setHandler("itemDone", function(obj, item) {
120+
// BibTeX content can have HTML entities (e.g. &) in various fields
121+
// We'll just try to unescape the most likely fields to contain these entities
122+
// Note that RIS data is not always correct, so we avoid using it
123+
var unescapeFields = ['title', 'publicationTitle', 'abstractNote'];
124+
for(var i=0; i<unescapeFields.length; i++) {
125+
if(item[unescapeFields[i]]) {
126+
item[unescapeFields[i]] = ZU.unescapeHTML(item[unescapeFields[i]]);
127+
}
128+
}
129+
120130
item.bookTitle = item.publicationTitle;
121131

122132
//unfortunately, bibtex is missing some data
@@ -127,11 +137,12 @@ function scrape(doc, url, dois) {
127137
risTrans.setString(text);
128138
risTrans.setHandler("itemDone", function(obj, risItem) {
129139
if(!item.title) item.title = "<no title>"; //RIS title can be even worse, it actually says "null"
140+
if(risItem.date) item.date = risItem.date; // More complete
130141
item.publisher = risItem.publisher;
131142
item.ISSN = risItem.ISSN;
132143
item.ISBN = risItem.ISBN;
133144
//clean up abstract removing Abstract:, Summary: or Abstract Summary:
134-
if (item.abstractNote) item.abstractNote = item.abstractNote.replace(/^(Abstract)?\s*(Summary)?:\s*/, "");
145+
if (item.abstractNote) item.abstractNote = item.abstractNote.replace(/^(Abstract)?\s*(Summary)?:?\s*/i, "");
135146
if(item.title.toUpperCase() == item.title) {
136147
item.title = ZU.capitalizeTitle(item.title, true);
137148
}
@@ -154,6 +165,7 @@ var testCases = [
154165
"items": [
155166
{
156167
"itemType": "journalArticle",
168+
"title": "Informality and productivity in the labor market in Peru",
157169
"creators": [
158170
{
159171
"firstName": "Alberto",
@@ -171,9 +183,17 @@ var testCases = [
171183
"creatorType": "author"
172184
}
173185
],
174-
"notes": [],
175-
"tags": [],
176-
"seeAlso": [],
186+
"date": "December 1, 2008",
187+
"DOI": "10.1080/17487870802543480",
188+
"ISSN": "1748-7870",
189+
"abstractNote": "This article analyzes the evolution of informal employment in Peru from 1986 to 2001. Contrary to what one would expect, the informality rates increased steadily during the 1990s despite the introduction of flexible contracting mechanisms, a healthy macroeconomic recovery, and tighter tax codes and regulation. We explore different factors that may explain this upward trend including the role of labor legislation and labor allocation between/within sectors of economic activity. Finally, we illustrate the negative correlation between productivity and informality by evaluating the impacts of the Youth Training PROJOVEN Program that offers vocational training to disadvantaged young individuals. We find significant training impacts on the probability of formal employment for both males and females.",
190+
"issue": "4",
191+
"itemID": "doi:10.1080/17487870802543480",
192+
"libraryCatalog": "Taylor and Francis+NEJM",
193+
"pages": "229-245",
194+
"publicationTitle": "Journal of Economic Policy Reform",
195+
"url": "http://www.tandfonline.com/doi/abs/10.1080/17487870802543480",
196+
"volume": "11",
177197
"attachments": [
178198
{
179199
"title": "Full Text PDF",
@@ -183,18 +203,9 @@ var testCases = [
183203
"title": "Snapshot"
184204
}
185205
],
186-
"itemID": "doi:10.1080/17487870802543480",
187-
"title": "Informality and productivity in the labor market in Peru",
188-
"publicationTitle": "Journal of Economic Policy Reform",
189-
"volume": "11",
190-
"issue": "4",
191-
"pages": "229-245",
192-
"date": "2008",
193-
"DOI": "10.1080/17487870802543480",
194-
"url": "http://www.tandfonline.com/doi/abs/10.1080/17487870802543480",
195-
"abstractNote": "This article analyzes the evolution of informal employment in Peru from 1986 to 2001. Contrary to what one would expect, the informality rates increased steadily during the 1990s despite the introduction of flexible contracting mechanisms, a healthy macroeconomic recovery, and tighter tax codes and regulation. We explore different factors that may explain this upward trend including the role of labor legislation and labor allocation between/within sectors of economic activity. Finally, we illustrate the negative correlation between productivity and informality by evaluating the impacts of the Youth Training PROJOVEN Program that offers vocational training to disadvantaged young individuals. We find significant training impacts on the probability of formal employment for both males and females.",
196-
"ISSN": "1748-7870",
197-
"libraryCatalog": "Taylor and Francis+NEJM"
206+
"tags": [],
207+
"notes": [],
208+
"seeAlso": []
198209
}
199210
]
200211
},
@@ -209,6 +220,7 @@ var testCases = [
209220
"items": [
210221
{
211222
"itemType": "journalArticle",
223+
"title": "Informality and productivity in the labor market in Peru",
212224
"creators": [
213225
{
214226
"firstName": "Alberto",
@@ -226,9 +238,17 @@ var testCases = [
226238
"creatorType": "author"
227239
}
228240
],
229-
"notes": [],
230-
"tags": [],
231-
"seeAlso": [],
241+
"date": "December 1, 2008",
242+
"DOI": "10.1080/17487870802543480",
243+
"ISSN": "1748-7870",
244+
"abstractNote": "This article analyzes the evolution of informal employment in Peru from 1986 to 2001. Contrary to what one would expect, the informality rates increased steadily during the 1990s despite the introduction of flexible contracting mechanisms, a healthy macroeconomic recovery, and tighter tax codes and regulation. We explore different factors that may explain this upward trend including the role of labor legislation and labor allocation between/within sectors of economic activity. Finally, we illustrate the negative correlation between productivity and informality by evaluating the impacts of the Youth Training PROJOVEN Program that offers vocational training to disadvantaged young individuals. We find significant training impacts on the probability of formal employment for both males and females.",
245+
"issue": "4",
246+
"itemID": "doi:10.1080/17487870802543480",
247+
"libraryCatalog": "Taylor and Francis+NEJM",
248+
"pages": "229-245",
249+
"publicationTitle": "Journal of Economic Policy Reform",
250+
"url": "http://www.tandfonline.com/doi/abs/10.1080/17487870802543480",
251+
"volume": "11",
232252
"attachments": [
233253
{
234254
"title": "Full Text PDF",
@@ -238,18 +258,9 @@ var testCases = [
238258
"title": "Snapshot"
239259
}
240260
],
241-
"itemID": "doi:10.1080/17487870802543480",
242-
"title": "Informality and productivity in the labor market in Peru",
243-
"publicationTitle": "Journal of Economic Policy Reform",
244-
"volume": "11",
245-
"issue": "4",
246-
"pages": "229-245",
247-
"date": "2008",
248-
"DOI": "10.1080/17487870802543480",
249-
"url": "http://www.tandfonline.com/doi/abs/10.1080/17487870802543480",
250-
"abstractNote": "This article analyzes the evolution of informal employment in Peru from 1986 to 2001. Contrary to what one would expect, the informality rates increased steadily during the 1990s despite the introduction of flexible contracting mechanisms, a healthy macroeconomic recovery, and tighter tax codes and regulation. We explore different factors that may explain this upward trend including the role of labor legislation and labor allocation between/within sectors of economic activity. Finally, we illustrate the negative correlation between productivity and informality by evaluating the impacts of the Youth Training PROJOVEN Program that offers vocational training to disadvantaged young individuals. We find significant training impacts on the probability of formal employment for both males and females.",
251-
"ISSN": "1748-7870",
252-
"libraryCatalog": "Taylor and Francis+NEJM"
261+
"tags": [],
262+
"notes": [],
263+
"seeAlso": []
253264
}
254265
]
255266
},
@@ -259,6 +270,7 @@ var testCases = [
259270
"items": [
260271
{
261272
"itemType": "journalArticle",
273+
"title": "Estimating willingness to pay by risk adjustment mechanism",
262274
"creators": [
263275
{
264276
"firstName": "Joo Heon",
@@ -271,9 +283,17 @@ var testCases = [
271283
"creatorType": "author"
272284
}
273285
],
274-
"notes": [],
275-
"tags": [],
276-
"seeAlso": [],
286+
"date": "September 14, 2011",
287+
"DOI": "10.1080/00036846.2011.568404",
288+
"ISSN": "0003-6846",
289+
"abstractNote": "Measuring consumers’ Willingness To Pay (WTP) without considering the level of uncertainty in valuation and the consequent risk premiums will result in estimates that are biased toward lower values. This research proposes a model and method for correctly assessing WTP in cases involving valuation uncertainty. The new method, called Risk Adjustment Mechanism (RAM), is presented theoretically and demonstrated empirically. It is shown that the RAM outperforms the traditional method for assessing WTP, especially in a context of a nonmarket good such as a totally new product.",
290+
"issue": "1",
291+
"itemID": "doi:10.1080/00036846.2011.568404",
292+
"libraryCatalog": "Taylor and Francis+NEJM",
293+
"pages": "37-46",
294+
"publicationTitle": "Applied Economics",
295+
"url": "http://www.tandfonline.com/doi/abs/10.1080/00036846.2011.568404",
296+
"volume": "45",
277297
"attachments": [
278298
{
279299
"title": "Full Text PDF",
@@ -283,18 +303,9 @@ var testCases = [
283303
"title": "Snapshot"
284304
}
285305
],
286-
"itemID": "doi:10.1080/00036846.2011.568404",
287-
"title": "Estimating willingness to pay by risk adjustment mechanism",
288-
"publicationTitle": "Applied Economics",
289-
"volume": "45",
290-
"issue": "1",
291-
"pages": "37-46",
292-
"date": "2013",
293-
"DOI": "10.1080/00036846.2011.568404",
294-
"url": "http://www.tandfonline.com/doi/abs/10.1080/00036846.2011.568404",
295-
"abstractNote": "Measuring consumers’ Willingness To Pay (WTP) without considering the level of uncertainty in valuation and the consequent risk premiums will result in estimates that are biased toward lower values. This research proposes a model and method for correctly assessing WTP in cases involving valuation uncertainty. The new method, called Risk Adjustment Mechanism (RAM), is presented theoretically and demonstrated empirically. It is shown that the RAM outperforms the traditional method for assessing WTP, especially in a context of a nonmarket good such as a totally new product.",
296-
"ISSN": "0003-6846",
297-
"libraryCatalog": "Taylor and Francis+NEJM"
306+
"tags": [],
307+
"notes": [],
308+
"seeAlso": []
298309
}
299310
]
300311
},
@@ -309,6 +320,7 @@ var testCases = [
309320
"items": [
310321
{
311322
"itemType": "journalArticle",
323+
"title": "Cutting Family Planning in Texas",
312324
"creators": [
313325
{
314326
"firstName": "Kari",
@@ -331,9 +343,18 @@ var testCases = [
331343
"creatorType": "author"
332344
}
333345
],
334-
"notes": [],
335-
"tags": [],
336-
"seeAlso": [],
346+
"date": "September 26, 2012",
347+
"DOI": "10.1056/NEJMp1207920",
348+
"ISSN": "0028-4793",
349+
"abstractNote": "Four fundamental principles drive public funding for family planning. First, unintended pregnancy is associated with negative health consequences, including reduced use of prenatal care, lower breast-feeding rates, and poor maternal and neonatal outcomes.1,2 Second, governments realize substantial cost savings by investing in family planning, which reduces the rate of unintended pregnancies and the costs of prenatal, delivery, postpartum, and infant care.3 Third, all Americans have the right to choose the timing and number of their children. And fourth, family planning enables women to attain their educational and career goals and families to provide for their children. These principles led . . .",
350+
"extra": "PMID: 23013071",
351+
"issue": "13",
352+
"itemID": "doi:10.1056/NEJMp1207920",
353+
"libraryCatalog": "Taylor and Francis+NEJM",
354+
"pages": "1179-1181",
355+
"publicationTitle": "New England Journal of Medicine",
356+
"url": "http://www.nejm.org/doi/full/10.1056/NEJMp1207920",
357+
"volume": "367",
337358
"attachments": [
338359
{
339360
"title": "Full Text PDF",
@@ -343,19 +364,9 @@ var testCases = [
343364
"title": "Snapshot"
344365
}
345366
],
346-
"extra": "PMID: 23013071",
347-
"itemID": "doi:10.1056/NEJMp1207920",
348-
"title": "Cutting Family Planning in Texas",
349-
"publicationTitle": "New England Journal of Medicine",
350-
"volume": "367",
351-
"issue": "13",
352-
"pages": "1179-1181",
353-
"date": "2012",
354-
"DOI": "10.1056/NEJMp1207920",
355-
"url": "http://www.nejm.org/doi/full/10.1056/NEJMp1207920",
356-
"abstractNote": "Four fundamental principles drive public funding for family planning. First, unintended pregnancy is associated with negative health consequences, including reduced use of prenatal care, lower breast-feeding rates, and poor maternal and neonatal outcomes.1,2 Second, governments realize substantial cost savings by investing in family planning, which reduces the rate of unintended pregnancies and the costs of prenatal, delivery, postpartum, and infant care.3 Third, all Americans have the right to choose the timing and number of their children. And fourth, family planning enables women to attain their educational and career goals and families to provide for their children. These principles led . . .",
357-
"ISSN": "0028-4793",
358-
"libraryCatalog": "Taylor and Francis+NEJM"
367+
"tags": [],
368+
"notes": [],
369+
"seeAlso": []
359370
}
360371
]
361372
},
@@ -365,16 +376,25 @@ var testCases = [
365376
"items": [
366377
{
367378
"itemType": "journalArticle",
379+
"title": "<no title>",
368380
"creators": [
369381
{
370382
"firstName": "Milan",
371383
"lastName": "Janic",
372384
"creatorType": "author"
373385
}
374386
],
375-
"notes": [],
376-
"tags": [],
377-
"seeAlso": [],
387+
"date": "December 1, 2003",
388+
"DOI": "10.1080/0308106032000167373",
389+
"ISSN": "0308-1060",
390+
"abstractNote": "This article deals with a multicriteria evaluation of High-Speed Rail, Transrapid Maglev and Air Passenger Transport in Europe. Operational, socio-economic and environmental performance indicators of the specific high-speed transport systems are adopted as the evaluation criteria. By using the entropy method, weights are assigned to particular criteria in order to indicate their relative importance in decision-making. The TOPSIS method is applied to carry out the multicriteria evaluation and selection of the preferable alternative (high-speed system) under given circumstances.",
391+
"issue": "6",
392+
"itemID": "doi:10.1080/0308106032000167373",
393+
"libraryCatalog": "Taylor and Francis+NEJM",
394+
"pages": "491-512",
395+
"publicationTitle": "Transportation Planning and Technology",
396+
"url": "http://dx.doi.org/10.1080/0308106032000167373",
397+
"volume": "26",
378398
"attachments": [
379399
{
380400
"title": "Full Text PDF",
@@ -384,25 +404,61 @@ var testCases = [
384404
"title": "Snapshot"
385405
}
386406
],
387-
"itemID": "doi:10.1080/0308106032000167373",
388-
"publicationTitle": "Transportation Planning and Technology",
389-
"volume": "26",
390-
"issue": "6",
391-
"pages": "491-512",
392-
"date": "2003",
393-
"DOI": "10.1080/0308106032000167373",
394-
"url": "http://dx.doi.org/10.1080/0308106032000167373",
395-
"abstractNote": "This article deals with a multicriteria evaluation of High-Speed Rail, Transrapid Maglev and Air Passenger Transport in Europe. Operational, socio-economic and environmental performance indicators of the specific high-speed transport systems are adopted as the evaluation criteria. By using the entropy method, weights are assigned to particular criteria in order to indicate their relative importance in decision-making. The TOPSIS method is applied to carry out the multicriteria evaluation and selection of the preferable alternative (high-speed system) under given circumstances.",
396-
"title": "<no title>",
397-
"ISSN": "0308-1060",
398-
"libraryCatalog": "Taylor and Francis+NEJM"
407+
"tags": [],
408+
"notes": [],
409+
"seeAlso": []
399410
}
400411
]
401412
},
402413
{
403414
"type": "web",
404415
"url": "http://www.tandfonline.com/action/doSearch?AllField=labor+market",
405416
"items": "multiple"
417+
},
418+
{
419+
"type": "web",
420+
"url": "http://www.tandfonline.com/doi/abs/10.1080/00380768.1991.10415050#.U_vX3WPATVE",
421+
"items": [
422+
{
423+
"itemType": "journalArticle",
424+
"title": "Concentration dependence of CO2 evolution from soil in chamber with low CO2 concentration (< 2,000 ppm), and CO2 diffusion/sorption model in soil",
425+
"creators": [
426+
{
427+
"firstName": "Takahiko",
428+
"lastName": "Naganawa",
429+
"creatorType": "author"
430+
},
431+
{
432+
"firstName": "Kazutake",
433+
"lastName": "Kyuma",
434+
"creatorType": "author"
435+
}
436+
],
437+
"date": "September 1, 1991",
438+
"DOI": "10.1080/00380768.1991.10415050",
439+
"ISSN": "0038-0768",
440+
"abstractNote": "Concentration dependence of CO2 evolution from soil was studied under field and laboratory conditions. Under field conditions, when the CO2 concentration was measured with an infrared gas analyzer (IRGA) in a small and column-shaped chamber placed on the ground, the relationship among the CO2 concentration c (m3 m-3), time t (h), height of the chamber h, a constant rate of CO2 evolution from the soil v (m3 m-2 h-1), and an appropriate constant k, was expressed by the following equation, d c/d t = v/ h—k(c— a) (c=a at t = 0). Although most of the data of measured CO2 evolution fitted to this equation, the applicability of the equation was limited to the data to which a linear equation could not be fitted, because the estimated value of v had a larger error than that estimated by linear regression analysis, as observed by computer simulation. The concentration dependence shown above and some other variations were analyzed based on a sorption/diffusion model, i.e. they were associated with CO2-sorption by the soil and modified by the conditions of CO2 diffusion in the soil.",
441+
"issue": "3",
442+
"itemID": "doi:10.1080/00380768.1991.10415050",
443+
"libraryCatalog": "Taylor and Francis+NEJM",
444+
"pages": "381-386",
445+
"publicationTitle": "Soil Science and Plant Nutrition",
446+
"url": "http://dx.doi.org/10.1080/00380768.1991.10415050",
447+
"volume": "37",
448+
"attachments": [
449+
{
450+
"title": "Full Text PDF",
451+
"mimeType": "application/pdf"
452+
},
453+
{
454+
"title": "Snapshot"
455+
}
456+
],
457+
"tags": [],
458+
"notes": [],
459+
"seeAlso": []
460+
}
461+
]
406462
}
407463
]
408464
/** END TEST CASES **/

0 commit comments

Comments
 (0)