跨http://www.cs.cmu.edu/~dbaman/latin.html进行分析和搜索的工具

archives_org_latin_toolkit的Python项目详细描述


https://coveralls.io/repos/github/PonteIneptique/archives_org_latin_toolkit/badge.svg?branch=masterhttps://travis-ci.org/PonteIneptique/archives_org_latin_toolkit.svg?branch=masterhttps://badge.fury.io/py/archives_org_latin_toolkit.svgDocumentationhttps://zenodo.org/badge/68894385.svg

什么?

这一软件将用于david bamman(http://www.cs.cmu.edu/~dbamman/latin.html)编写的11k个拉丁文本。它只支持纯文本格式和元数据github repo csv文件。仅用python3进行了测试。我欢迎任何新功能或向后兼容支持。

如何安装?

  • 开发版本:
    • 克隆存储库:git clone https://github.com/ponteineptique/archives_org_latin_toolkit.git
    • 转到目录:cd archives_org_latin_toolkit
    • 使用develop选项安装源代码:python setup.py install
  • 带PIP:
    • 从pip安装:pip install archives_org_latin_toolkit

示例

下面的示例应该使用tests/test_data中的数据运行。示例可以使用python example.py

运行
# We import the main classes from the modulefromarchives_org_latin_toolkitimportRepo,Metadatafrompprintimportpprint# We initiate a Metadata object and a Repo objectmetadata=Metadata("./test/test_data/latin_metadata.csv")# We want the text to be set in lowercaserepo=Repo("./test/test_data/archive_org_latin/",metadata=metadata,lowercase=True)# We define a list of token we want to search fortokens=["ecclesiastico","ecclesia","ecclesiis","""]# We instantiate a result storageresults=[]# We iter over text having those tokens :# Note that we need to "unzip" the listfortext_matchinginrepo.find(*tokens):# For each text, we iter over embeddings found in the text# We want 3 words left, 3 words right,# and we want to keep the original token (Default behaviour)forembeddingintext_matching.find_embedding(*tokens,window=3,ignore_center=False):# We add it to the resultsresults.append(embedding)# We print the result (list of list of strings)pprint(results)

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java这种src与构建树时间戳的比较如何更快?   java如何在两个命令处理程序之间通信   java下拉框值更改   Java如何从另一个类中提取字段的值   无字段名的java Jackson序列化   java游戏循环和方法调用   java Spring Security permitAll()匹配器被忽略   java如何在一个方法中将数组中的int作为单独的int传递?   使用ArrayList在Java中实现同步队列   java JButton的操作侦听器在JTable中不工作   java中C++ OOP指针的技巧   java My regex搜索只打印出最后一个匹配项   java如何在Hadoop中序列化非常大的可写对象   spring Paypal JavaSDK支付执行问题   带有SPNEGO SSO的java Tomcat 6仍会提示输入登录名和密码   java HttpResponse主体正在更改   java如何在RxJava中实现链锁   为什么我需要java。lang.ClassNotFoundException:com。mysql。希杰。jdbc。mysqlconnectorjava8时的驱动程序。0.16.jar在类路径中?   java输入错误。即使在接受新输入后仍使用旧输入