把作者归属于巴特的工具
lauteur的Python项目详细描述
lauteur==tools用于将作者归属于 懊恼 ` barthes<;http://en.wikipedia.org/wiki/death-of-u-the-author>;``uuuu
安装
pip install lauteur
测试
需要nose
nosetests
用法
lauteur有两个方法:from_string和from_html
from_string主要用于rss提要解析,其中作者是 有时嵌入为署名:
importlauteurstring='By: Brian Abelson ,and Michael H. Keller & Dr. Stijn Debrouwere IV'authors=lauteur.from_string(string)printauthors# ['Brian Abelson', 'Michael H Keller', 'DR Stijn Debrouwere IV']
from_html搜索作者的公共元标记。
importlauteurimportrequestsr=requests.get('http://www.nytimes.com/2013/12/20/books/michiko-kakutanis-10-favorite-books-of-2013.html')authors=lauteur.from_html(r.content)printauthors# ['Michiko Kakutani']
待办事项:
- []查找更多元标记。
- []改进名称格式化算法。