利用abbrevr包批量输出期刊缩写

简介: 有时候用endnote导入文献后显示的是期刊全称,而用到缩写时候就需要去一些网站上一个个搜索,比如CASSI, LetPub、Pubumed等网站,或者Y叔公号里直接回复,而逛Github时候突然发现abbrevr这小R包中可以很快批量实现这个需求,在此记录一下。

e660075306ec4f48e6e38ba7568f412.png

网络异常,图片无法展示
|

List of Title Word Abbreviations (LTWA)

安装

# install.packages("remotes")
remotes::install_github("patrickbarks/abbrevr")

查询期刊缩写

library(abbrevr)
AbbrevTitle("Transactions of the American Fisheries Society")
#> [1] "Trans. Am. Fish. Soc."
AbbrevTitle("Deutsche Medizinische Wochenschrift")
#> [1] "Dtsch. Med. Wochenschr."
AbbrevTitle("L'Intermédiaire des Mathématiciens")
#> [1] "Interméd. Math."

根据doi号批量获取

这里就需要结合另一个R包rcrossref, 这个包主要功能就是利用API接口根据doi号提取文献信息(具体原理可自行摸索),然后提取出文献全称再批量转化为缩写,一步到位,示例如下:

# load rcrossref
library(rcrossref)
# DOIs for a set of scientific publications
dois <- c(
  "10.1577/T09-174.1",
  "10.1371/journal.pone.0075858",
  "10.1111/1365-2435.12359",
  "10.1111/jeb.12823",
  "10.1111/1365-2745.12937"
)
# use rcrossref::cr_cn() to get citation info for DOIs
citations <- rcrossref::cr_cn(dois, format = "citeproc-json")
# extract journal titles from citation info
titles <- sapply(citations, function(x) x$`container-title`, USE.NAMES = FALSE)
# use abbrevr::AbbrevTitle() to abbreviate titles
titles_short <- sapply(titles, abbrevr::AbbrevTitle, USE.NAMES = FALSE)
# print data.frame
data.frame(
  doi = dois,
  title = titles,
  title_short = titles_short,
  stringsAsFactors = FALSE
)

5fe87c3e7356ddc14dc8c98555561fd.png

附当前版本说明:

The current version…

  • only handles common articles, prepositions, and conjunctions in English, German, and French (ISO 4 dictates that these classes should generally be ommitted, with exceptions noted in the document linked above)
  • omits all punctuation except for hyphens (ISO 4 dictates all punctuation except commas should be retained, but periods should be replaced with commas)
  • does not omit generic identifiers such as “Section”, “Series”, or “Part” (ISO 4 dictates such generics should be ommitted unless required for identification)
  • may not retain all diacritic marks (ISO 4 dictates that all diacritic marks should be retained)

Also beware of abbreviation rules that are difficult to implement algorithmically, e.g.:

  • names of persons should not be abbreviated
  • prepositions and articles should be retained if they are integral parts of proper names (e.g. “Los Alamos”) or locutions (e.g. “in vivo”)



作者:凯凯何_Boy

链接:https://www.jianshu.com/p/bd4c7e633c55

来源:简书

著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

相关文章
|
1月前
|
API Python
可以将文本按照每一批5000个字符进行分割,然后依次调用批量翻译接口进行翻译
可以将文本按照每一批5000个字符进行分割,然后依次调用批量翻译接口进行翻译
15 1
|
2月前
|
API Python
对于超过5000字符的文本,建议使用批量翻译接口
对于超过5000字符的文本,建议使用批量翻译接口
12 4
|
6月前
|
数据可视化
新建论文三线表模板,一键格式刷(包含word和latex版本)
新建论文三线表模板,一键格式刷(包含word和latex版本)
247 0
|
7月前
|
缓存 Python
【python脚本】word批注状态批量提取器V1版本
【python脚本】word批注状态批量提取器V1版本
|
10月前
|
存储 编解码 文件存储
平面设计实验一 新建文件和格式模式转换
平面设计实验一 新建文件和格式模式转换
57 0
|
11月前
|
存储 人工智能 监控
带你读《云存储应用白皮书》之41:附录一:相关英文缩写释义
带你读《云存储应用白皮书》之41:附录一:相关英文缩写释义
131 0
|
12月前
|
存储 算法 数据可视化
万文长字总结「类别增量学习」的前世今生、开源工具包(2)
万文长字总结「类别增量学习」的前世今生、开源工具包
142 0
|
12月前
|
算法 PyTorch 算法框架/工具
万文长字总结「类别增量学习」的前世今生、开源工具包(3)
万文长字总结「类别增量学习」的前世今生、开源工具包
276 0
|
12月前
|
机器学习/深度学习 存储 算法
万文长字总结「类别增量学习」的前世今生、开源工具包(1)
万文长字总结「类别增量学习」的前世今生、开源工具包
|
机器学习/深度学习 编解码 自然语言处理
错字修改 | 布署1个中文文文本拼蟹纠错模型
错字修改 | 布署1个中文文文本拼蟹纠错模型
220 0