-
Notifications
You must be signed in to change notification settings - Fork 525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat (Douban.js)大幅重构;支持电影和音乐专辑 #264
Conversation
Douban.js
Outdated
"creators": [ | ||
{ | ||
"firstName": "戴维", | ||
"lastName": "A.帕特森", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CSL 需要将“戴维·A. 帕特森”整体填在一起。这是因为 citeproc-js 的处理方法是,如果姓中有 CJK 字符,则总是按照行前名后的顺序输出,导致结果是“帕特森戴维·A.”。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ZU.cleanAuthor()
是个好东西,我不想自己再造生成creator
的轮子了,那我弄个补丁判断一下lastName有没有CJK然后拼接一下吧,稍后我把新的提交上来。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
对与 CSL 来说没问题。
似乎删了不少 testCases?我记得原来添加的时候每个代表一种 corner case。 |
原来列举的好多都是book的奇葩人名组合,我觉得挺重复的,就删掉了,把链接放在了 |
电影和音乐那里,我把“流派”对应“genre”,这是合适的吗? |
好的! |
Douban.js
Outdated
} | ||
], | ||
"date": "2014-02-27", | ||
"extra": "undefinedpublisher: 环球唱片\nmedium: CD\ngenre: 流行\nalias: Kepler\nbar-code: 0602488970204\nrating: 8.7\nrating-people: 33555人评价\ncomments: 11317\ncreatorsExt: [{\"firstName\":\"\",\"lastName\":\"孙燕姿\",\"creatorType\":\"performer\",\"country\":\"\",\"original\":\"\"}]", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 这里的
undefined
应该是误写的吧。 - “环球唱片”可以填在 Zotero 的
label
字段(同publisher
)。 medium
可以填在 Zotero 的audioRecordingFormat
字段(同medium
)。
我一般参考 https://aurimasv.github.io/z2csl/typeMap.xml 的 mapping。后两条导出的 CSL-JSON 应该是一样的,不过直接填在 Zotero 的字段对于用户更方便。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
前面提到的问题已经全部修正 |
赞!👍 |
Douban.js
Outdated
"abstractNote": "一场谋杀案使银行家安迪(蒂姆•罗宾斯 Tim Robbins 饰)蒙冤入狱,谋杀妻子及其情人的指控将囚禁他终生。在肖申克监狱的首次现身就让监狱“大哥”瑞德(摩根•弗里曼 Morgan Freeman 饰)对他另眼相看。瑞德帮助他搞到一把石锤和一幅女明星海报,两人渐成患难 之交。很快,安迪在监狱里大显其才,担当监狱图书管理员,并利用自己的金融知识帮助监狱官避税,引起了典狱长的注意,被招致麾下帮助典狱长洗黑钱。偶然一次,他得知一名新入狱的小偷能够作证帮他洗脱谋杀罪。燃起一丝希望的安迪找到了典狱长,希望他能帮自己翻案。阴险伪善的狱长假装答应安迪,背后却派人杀死小偷,让他唯一能合法出狱的希望泯灭。沮丧的安迪并没有绝望,在一个电闪雷鸣的风雨夜,一场暗藏几十年的越狱计划让他自我救赎,重获自由!老朋友瑞德在他的鼓舞和帮助下,也勇敢地奔向自由。 本片获得1995年奥斯卡10项提名,以及金球奖、土星奖等多项提名。", | ||
"extra": "original-title: The Shawshank Redemption\nplace: 美国\nalias: 月黑高飞(港) / 刺激1995(台) / 地狱诺言 / 铁窗岁月 / 消香克的救赎\nIMDb: tt0111161\nstyle: 剧情 / 犯罪\nrating: 9.7\nrating-people: 2962156人评价\ncomments: 579187\ncreatorsExt: [{\"firstName\":\"\",\"lastName\":\"弗兰克·德拉邦特\",\"creatorType\":\"director\",\"fieldMode\":1,\"country\":\"\",\"original\":\"\"},{\"firstName\":\"\",\"lastName\":\"弗兰克·德拉邦特\",\"creatorType\":\"scriptwriter\",\"fieldMode\":1,\"country\":\"\",\"original\":\"\"},{\"firstName\":\"\",\"lastName\":\"斯蒂芬·金\",\"creatorType\":\"scriptwriter\",\"fieldMode\":1,\"country\":\"\",\"original\":\"\"},{\"firstName\":\"\",\"lastName\":\"蒂姆·罗宾斯\",\"creatorType\":\"contributor\",\"fieldMode\":1,\"country\":\"\",\"original\":\"\"},{\"firstName\":\"\",\"lastName\":\"摩根·弗里曼\",\"creatorType\":\"contributor\",\"fieldMode\":1,\"country\":\"\",\"original\":\"\"},{\"firstName\":\"\",\"lastName\":\"鲍勃·冈顿\",\"creatorType\":\"contributor\",\"fieldMode\":1,\"country\":\"\",\"original\":\"\"},{\"firstName\":\"\",\"lastName\":\"威廉姆·赛德勒\",\"creatorType\":\"contributor\",\"fieldMode\":1,\"country\":\"\",\"original\":\"\"},{\"firstName\":\"\",\"lastName\":\"克兰西·布朗\",\"creatorType\":\"contributor\",\"fieldMode\":1,\"country\":\"\",\"original\":\"\"},{\"firstName\":\"\",\"lastName\":\"吉尔·贝罗斯\",\"creatorType\":\"contributor\",\"fieldMode\":1,\"country\":\"\",\"original\":\"\"},{\"firstName\":\"\",\"lastName\":\"马克·罗斯顿\",\"creatorType\":\"contributor\",\"fieldMode\":1,\"country\":\"\",\"original\":\"\"},{\"firstName\":\"\",\"lastName\":\"詹姆斯·惠特摩\",\"creatorType\":\"contributor\",\"fieldMode\":1,\"country\":\"\",\"original\":\"\"},{\"firstName\":\"\",\"lastName\":\"杰弗里·德曼\",\"creatorType\":\"contributor\",\"fieldMode\":1,\"country\":\"\",\"original\":\"\"},{\"firstName\":\"\",\"lastName\":\"拉里·布兰登伯格\",\"creatorType\":\"contributor\",\"fieldMode\":1,\"country\":\"\",\"original\":\"\"},{\"firstName\":\"\",\"lastName\":\"尼尔·吉恩托利\",\"creatorType\":\"contributor\",\"fieldMode\":1,\"country\":\"\",\"original\":\"\"},{\"firstName\":\"\",\"lastName\":\"布赖恩·利比\",\"creatorType\":\"contributor\",\"fieldMode\":1,\"country\":\"\",\"original\":\"\"},{\"firstName\":\"\",\"lastName\":\"大卫·普罗瓦尔\",\"creatorType\":\"contributor\",\"fieldMode\":1,\"country\":\"\",\"original\":\"\"},{\"firstName\":\"\",\"lastName\":\"约瑟夫·劳格诺\",\"creatorType\":\"contributor\",\"fieldMode\":1,\"country\":\"\",\"original\":\"\"},{\"firstName\":\"\",\"lastName\":\"祖德·塞克利拉\",\"creatorType\":\"contributor\",\"fieldMode\":1,\"country\":\"\",\"original\":\"\"},{\"firstName\":\"\",\"lastName\":\"保罗·麦克兰尼\",\"creatorType\":\"contributor\",\"fieldMode\":1,\"country\":\"\",\"original\":\"\"},{\"firstName\":\"\",\"lastName\":\"芮妮·布莱恩\",\"creatorType\":\"contributor\",\"fieldMode\":1,\"country\":\"\",\"original\":\"\"},{\"firstName\":\"\",\"lastName\":\"阿方索·弗里曼\",\"creatorType\":\"contributor\",\"fieldMode\":1,\"country\":\"\",\"original\":\"\"},{\"firstName\":\"\",\"lastName\":\"V·J·福斯特\",\"creatorType\":\"contributor\",\"fieldMode\":1,\"country\":\"\",\"original\":\"\"},{\"firstName\":\"\",\"lastName\":\"弗兰克·梅德拉诺\",\"creatorType\":\"contributor\",\"fieldMode\":1,\"country\":\"\",\"original\":\"\"},{\"firstName\":\"\",\"lastName\":\"马克·迈尔斯\",\"creatorType\":\"contributor\",\"fieldMode\":1,\"country\":\"\",\"original\":\"\"},{\"firstName\":\"\",\"lastName\":\"尼尔·萨默斯\",\"creatorType\":\"contributor\",\"fieldMode\":1,\"country\":\"\",\"original\":\"\"},{\"firstName\":\"\",\"lastName\":\"耐德·巴拉米\",\"creatorType\":\"contributor\",\"fieldMode\":1,\"country\":\"\",\"original\":\"\"},{\"firstName\":\"\",\"lastName\":\"布赖恩·戴拉特\",\"creatorType\":\"contributor\",\"fieldMode\":1,\"country\":\"\",\"original\":\"\"},{\"firstName\":\"\",\"lastName\":\"唐·麦克马纳斯更多\",\"creatorType\":\"contributor\",\"fieldMode\":1,\"country\":\"\",\"original\":\"\"}]", | ||
"genre": "Film", | ||
"language": "英语", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的“英语”应该是电影的对白语言,可能会导致 CSL 不能正确识别文献的语言。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
“语言”那里实在太多了,我不知道要不要武断地把中文以外的一切都作为英文来处理,或者我们对language不要做过多的处理
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
从 CSL 的角度,标题“肖申克的救赎”是中文,被引用时相当于中文文献,language
就应该填 zh-CN
。建议豆瓣电影的“语言”要么填在 extra
中(并且避开 language
字段),要么干脆不填。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
那我用原来的方案吧,就是靠标题有没有CJK来给“zh-CN”或者“en-US”
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
那我用原来的方案吧,就是靠标题有没有CJK来给“zh-CN”或者“en-US”
算了,不管了,中文歌曲有用英文名的现象,这是一趟浑水
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
最终还是把语言加上了,正如你所说,语言字段的设置应当与条目的记录语言相关。我们把字段填上的最终目的是为了节省用户的时间,虽然翻译器填的不一定对,但是毕竟还是起到了一定效果。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
最终还是把语言加上了,正如你所说,语言字段的设置应当与条目的记录语言相关。我们把字段填上的最终目的是为了节省用户的时间,虽然翻译器填的不一定对,但是毕竟还是起到了一定效果。
有道理!另外可以把表演者和标题和在一起检测有无 CJK 字符。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
豆瓣把作者全翻译成中文了,在此处不适用。但对于其它数据库,这确实是一个好方法,经验+1。
是的,英文名在 |
那当英文名需要拆分的如何解决呢?--所有的英文名都按合并后的对待嘛? |
考虑到 creatorsExt 只应用于存在译名的作者,不存在译名的就没有这个字段; 那是出于什么考虑把要拆分的 英文名 放到合并的字段 original 里,把不需要拆分的 中文译名 反而放到了 已经拆分的字段 firstName/lastName 里呢? |
我也感觉不需要这么复杂。 另外英文原名可以保存在
CSL-JSON: [
{
"id": "cps.4.13:2",
"type": "book",
"event-place": "北京",
"language": "zh-CN",
"note": "original-date: 1814\noriginal-author: Laplace || Pierre-Simon\noriginal-title: A philosophical essay on probabilities\noriginal-publisher: Unnamed Publisher",
"publisher": "未名出版社",
"publisher-place": "北京",
"title": "概率哲学",
"author": [
{
"family": "拉普拉斯",
"given": ""
}
],
"translator": [
{
"literal": "张三"
},
{
"literal": "李四"
}
],
"issued": {
"date-parts": [
[
"1951"
]
]
}
}
] |
新的、更统一的代码结构将有利于以后拓展修改。
遵照#257 的讨论结果,对
creatorsExt
进行了尝试,希望@northword 测试一下能不能用插件读取这些信息,实现中英文作者的转换、有无国籍的转换。