yawlib-又一个用于python的wordnet库

yawlib的Python项目详细描述


yawlib-又一个用于python的wordnet库

此库提供所有主要wordnet版本的接口(例如gloss wordnet、open multilingual wordnet、wordnetsql等)

数据文件:

wordnet 3.0sqlite:https://sourceforge.net/projects/wnsql/files/wnsql3/sqlite/3.0/

wordnet glosstag:http://wordnet.princeton.edu/glosstag.shtml

谷歌驱动链接

wordnet-3.0-sqlite.zip:https://drive.google.com/open?id=0Bwko6IfQbRUJMlN1NmdHcWNCWUk

wordnet glosstag:https://drive.google.com/open?id=0Bwko6IfQbRUJVUlkNEswMldJS2s

安装

pypi上提供yawlib

pip install yawlib
# or
python3 -m pip install yawlib

# Download wordnet data and extract them to ~/wordnet# Show yawlib information
python3 -m yawlib info

按引理搜索语法集research,使用python3 -m yawlib lemma research

wn lemma research
Looking for synsets by term (Provided: research | pos = None)

〔Synset〕00636921-n 〔Lemmas〕research 〔Keys〕research%1:04:00::
------------------------------------------------------------
(def) “systematic investigation to establish facts;”


〔Synset〕05797597-n 〔Lemmas〕inquiry; enquiry; research 〔Keys〕inquiry%1:09:01:: enquiry%1:09:00:: research%1:09:00::
------------------------------------------------------------
(def) “a search for knowledge;”
(ex) their pottery deserves more research than it has received;


〔Synset〕00648224-v 〔Lemmas〕research; search; explore 〔Keys〕research%2:31:00:: search%2:31:00:: explore%2:31:00::
------------------------------------------------------------
(def) “inquire into;”
(ex) the students had to research the history of the Second World War for their history project;
(ex) He searched for information on his relatives on the web;
(ex) Scientists are exploring the nature of consciousness;


〔Synset〕00877327-v 〔Lemmas〕research 〔Keys〕research%2:32:00::
------------------------------------------------------------
(def) “attempt to find out in a systematically and scientific manner;”
(ex) The student researched the history of that word;

Found 4 synset(s)

注意:提取glosstag文件夹和sqlite-30.db到~/wordnet。目录应该如下:

/home/user/wordnet
├── glosstag
│   ├── dtd
│   │   └── glosstag.dtd
│   ├── LICENSE.txt
│   ├── merged
│   │   ├── adj.xml
│   │   ├── adv.xml
│   │   ├── noun.xml
│   │   └── verb.xml
│   ├── README.txt
│   ├── standoff
│   │   ├── 00
│   │   ├── 01
│   │   ├── 02
│   │   ├── ....
│   │   ├── index.byid.tab
│   │   ├── index.bylem.adj.tab
│   │   ├── index.bylem.adv.tab
│   │   ├── index.bylem.noun.tab
│   │   ├── index.bylem.tab
│   │   ├── index.bylem.verb.tab
│   │   └── index.bysk.tab
│   └── statistics.tab
├── glosstag.db
├── sqlite-30.db

开发

转到yawlib文件夹,执行配置脚本,然后运行wntk.sh以生成glosstab db文件。

git clone https://github.com/letuananh/yawlib
cd yawlib

# create virtual environment
python3 -m venv yawlib_py3
. yawlib_py3/bin/activate

# install required packages
pip install -r requirements.txt
pip install -r requirements-optional.txt

# to show information
python -m yawlib info

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

推荐PyPI第三方库


热门话题
java组织。openqa。硒。遥远的UnreachableBrowserException如何定义EXE路径?   java Camel AdviceWith不使用指定文件替换端点   基于字符串的java图像加载   Java中的启发式算法,计算8个谜题状态的线性冲突   java为什么不支持文件。probeContentType返回null   JPA@EntityListeners、@PrePersist和Spring@RepositoryEventHandler、@HandleBeforeSave之间的java差异   可能前缀的Java字符串到字符串[]   安装rJava | Makefile时发生java错误。全部:38:target’libjri的配方。所以他失败了   Java公共静态void main()   java如何覆盖txt文件中的某些单词   java如何获得循环中生成的字符值之和?   java Log4j创建另一个具有相同属性的appender   java如何在从Axis2 Web服务客户端通过代理服务器调用Web服务时设置代理设置?   在Windows上安装Elasticsearch时发生java错误   java如何向EditText组件添加TextChangedListener?