- improve CSL

- tag institutional authors appropriately
This commit is contained in:
Simon Kornblith 2006-10-03 21:08:02 +00:00
parent 03e9dc5ae5
commit 96ccf85aba

View file

@ -1,4 +1,4 @@
-- 95 -- 96
DROP TABLE IF EXISTS translators; DROP TABLE IF EXISTS translators;
CREATE TABLE translators ( CREATE TABLE translators (
@ -1073,7 +1073,7 @@ REPLACE INTO "translators" VALUES ('add7c71c-21f3-ee14-d188-caf9da12728b', '2006
} else if(field == "added author") { } else if(field == "added author") {
newItem.creators.push(Zotero.Utilities.cleanAuthor(value, "contributor", true)); newItem.creators.push(Zotero.Utilities.cleanAuthor(value, "contributor", true));
} else if(field == "corporate author") { } else if(field == "corporate author") {
newItem.creators.push({lastName:author}); newItem.creators.push({lastName:author, isInstitution:true});
} else if(field == "subject term" || field == "corporate subject" || field == "geographic term") { } else if(field == "subject term" || field == "corporate subject" || field == "geographic term") {
var subjects = value.split("--"); var subjects = value.split("--");
newItem.tags = newItem.tags.concat(subjects); newItem.tags = newItem.tags.concat(subjects);
@ -3516,7 +3516,7 @@ function scrape(doc, url) {
author = words.join(" "); author = words.join(" ");
if(words[0] == "The") { if(words[0] == "The") {
newItem.creators.push({lastName:author, creatorType:"author"}); newItem.creators.push({lastName:author, creatorType:"author", isInstitution:true});
} else { } else {
newItem.creators.push(Zotero.Utilities.cleanAuthor(author, "author")); newItem.creators.push(Zotero.Utilities.cleanAuthor(author, "author"));
} }
@ -3640,7 +3640,7 @@ function scrape(doc) {
author = words.join(" "); author = words.join(" ");
if(words[0] == "The") { if(words[0] == "The") {
newItem.creators.push({lastName:author, creatorType:"author"}); newItem.creators.push({lastName:author, creatorType:"author", isInstitution:true});
} else { } else {
newItem.creators.push(Zotero.Utilities.cleanAuthor(author, "author")); newItem.creators.push(Zotero.Utilities.cleanAuthor(author, "author"));
} }
@ -6875,7 +6875,7 @@ function pullISBN(text) {
// corporate author extraction // corporate author extraction
function corpAuthor(author) { function corpAuthor(author) {
return {lastName:author}; return {lastName:author, isInstitution:true};
} }
// regular author extraction // regular author extraction
@ -7086,11 +7086,11 @@ record.prototype.translate = function(item) {
this._associateDBField(item, "700", "a", "creator", author, "contributor", true); this._associateDBField(item, "700", "a", "creator", author, "contributor", true);
this._associateDBField(item, "710", "a", "creator", corpAuthor, "contributor"); this._associateDBField(item, "710", "a", "creator", corpAuthor, "contributor");
this._associateDBField(item, "711", "a", "creator", corpAuthor, "contributor"); this._associateDBField(item, "711", "a", "creator", corpAuthor, "contributor");
if(!item.creators.length) { if(item.itemType == "book" && !item.creators.length) {
// some LOC entries have no listed author, but have the author in the person subject field as the first entry // some LOC entries have no listed author, but have the author in the person subject field as the first entry
var field = this.getFieldSubfields("600"); var field = this.getFieldSubfields("600");
if(field[0]) { if(field[0]) {
item.creators.push(cleanAuthor(field[0]["a"], true)); item.creators.push(Scholar.Utilities.cleanAuthor(field[0]["a"], true));
} }
} }
@ -7416,11 +7416,12 @@ REPLACE INTO "csl" VALUES('http://purl.org/net/xbiblio/csl/styles/chicago-note.c
<item> <item>
<choose> <choose>
<type name="book"> <type name="book">
<author suffix=", "/> <group delimiter=", ">
<titles font-style="italic"/> <author/>
<editor prefix=", "/> <titles font-style="italic"/>
<translator prefix=", "/> <editor/>
<titles relation="container" prefix=" "/> <translator/>
</group>
<group prefix=" (" suffix=")" delimiter=", "> <group prefix=" (" suffix=")" delimiter=", ">
<publisher/> <publisher/>
<date> <date>
@ -7431,13 +7432,17 @@ REPLACE INTO "csl" VALUES('http://purl.org/net/xbiblio/csl/styles/chicago-note.c
<access prefix=", "/> <access prefix=", "/>
</type> </type>
<type name="chapter"> <type name="chapter">
<author suffix=", "/> <group delimiter=", ">
<titles prefix="&#8220;" suffix=",&#8221; "/> <author/>
<titles quotes="true"/>
</group>
<group class="container"> <group class="container">
<text term-name="in" text-transform="lowercase"/> <text term-name="in" text-transform="lowercase"/>
<titles relation="container" prefix=" " font-style="italic"/> <group delimiter=", ">
<editor prefix=", "/> <titles relation="container" prefix=" " font-style="italic"/>
<translator prefix=", "/> <editor/>
<translator/>
</group>
<group prefix=" (" suffix=")" delimiter=", "> <group prefix=" (" suffix=")" delimiter=", ">
<publisher/> <publisher/>
<date> <date>
@ -7449,18 +7454,20 @@ REPLACE INTO "csl" VALUES('http://purl.org/net/xbiblio/csl/styles/chicago-note.c
</group> </group>
</type> </type>
<type name="article"> <type name="article">
<author suffix=", "/>
<titles prefix="&#8220;" suffix=",&#8221; "/>
<titles relation="container" font-style="italic" suffix=", "/>
<group delimiter=", "> <group delimiter=", ">
<author/>
<titles quotes="true"/>
<titles relation="container" font-style="italic"/>
<date/> <date/>
<access/> <access/>
</group> </group>
</type> </type>
<type name="article-journal"> <type name="article-journal">
<author suffix=", "/> <group delimiter=", ">
<titles prefix="&#8220;" suffix=",&#8221; "/> <author/>
<titles relation="container" font-style="italic"/> <titles quotes="true"/>
<titles relation="container" font-style="italic"/>
</group>
<volume prefix=" "/> <volume prefix=" "/>
<issue prefix=", "> <issue prefix=", ">
<label form="short" text-transform="lowercase" suffix=". "/> <label form="short" text-transform="lowercase" suffix=". "/>