一种分析单词数据的工具wiktionary.com网站转换为JSON对象。基于Suyash-Behera的wiktionary解析器
wiktionaryparser-ml的Python项目详细描述
Wiktionary解析器
一个python项目,它以易于使用的JSON格式解析Wiktionary中的单词内容。 现在,它解析词源、定义、发音、示例、音频链接和相关单词。在
JSON结构
[{"pronunciations":{"text":["pronunciation text"],"audio":["pronunciation audio"]},"definitions":[{"relatedWords":[{"relationshipType":"word relationship type","words":["list of related words"]}],"text":["list of definitions"],"partOfSpeech":"part of speech","examples":["list of examples"]}],"etymology":"etymology text",}]
安装
使用pip
- 运行
pip install wiktionaryparser
来源
- 克隆回购或下载zip
cd
到文件夹- 运行
pip install -r "requirements.txt"
用法
- 导入WiktionaryParser类。在
- 初始化一个对象并使用
fetch("word", "language")
方法。在 - 默认语言是英语,可以使用
set_default_language method
对其进行更改。在 - 使用
include_part_of_speech(part_of_speech)
和exclude_part_of_speech(part_of_speech)
包含/排除要分析的词性 - 使用
include_relation(relation)
和exclude_relation(relation)
分析的包含/排除关系
示例
^{pr2}$
要求
- 请求==2.20.0
- 美化组4==4.4.0
捐款
pip install wiktionaryparser
cd
到文件夹pip install -r "requirements.txt"
fetch("word", "language")
方法。在set_default_language method
对其进行更改。在include_part_of_speech(part_of_speech)
和exclude_part_of_speech(part_of_speech)
包含/排除要分析的词性include_relation(relation)
和exclude_relation(relation)
分析的包含/排除关系如果您想添加特性/改进或报告问题,请随时发送请求!在
许可证
Wiktionary解析器是在MIT下授权的。在
- 项目
标签: