yawlib


Nameyawlib JSON
Version 0.1 PyPI version JSON
download
home_pagehttps://github.com/letuananh/yawlib
SummaryPython library for accessing major wordnet releases using relational databases for high performance batch processing
upload_time2021-05-13 09:37:13
maintainer
docs_urlNone
authorLe Tuan Anh
requires_python
licenseMIT License
keywords wordnet glosstag omw sqlite
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # YAWlib - Yet Another WordNet library for Python

A Python library for accessing major WordNet releases using relational databases for high performance batch processing.

- Princeton Wordnet 3.0
- NTU Open Multilingual WordNet
- Gloss WordNet
- and more to be added in future versions

## Installation

Yawlib is available on [PyPI](https://pypi.org/project/yawlib/)

```bash
pip install yawlib
```

Prebuilt database files are available on the author's [Open Science Framework project page: https://osf.io/9udjk/](https://osf.io/9udjk/).
Download them and extract those to your home folder at `~/wordnet/`.
On Linux it should look something like:

```
/home/username/wordnet/
    - glosstag.db
    - sqlite-30.db
    - wn-ntumc.db

# or on Mac OS
/Users/username/wordnet/
    - glosstag.db
    - sqlite-30.db
    - wn-ntumc.db
```

On Windows

```
C:\Users\<username>\wordnet\
    - glosstag.db
    - sqlite-30.db
    - wn-ntumc.db
```

To verify that yawlib is working properly, you can use the `info` command.

```bash
# Show yawlib information
python3 -m yawlib info
```

## Command-line tools

`yawlib` includes a command-line tool for querying wordnets directly from terminal.

For example, to search synsets by the lemma `research` one may use `python3 -m yawlib lemma research`

```
python3 -m yawlib 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)
```

## Development

Go to yawlib folder, execute the config script and then run wntk.sh to generate the glosstab DB file.

```bash
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
```

## Compiling glosstag.db from source

Make sure that `glosstag` source folder and `sqlite-30.db` are available in `~/wordnet`.
The directory should look like this:

```
/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
├── wn-ntumc.db
```

The run the `create` command to generate the database

```bash
python -m yawlib create
```

## Original sources

- WordNet 3.0 SQLite: https://sourceforge.net/projects/wnsql/files/wnsql3/sqlite/3.0/
- WordNet glosstag (XML): http://wordnet.princeton.edu/glosstag.shtml
- NTU Open Multilingual Wordnet: http://compling.hss.ntu.edu.sg/omw/
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/letuananh/yawlib",
    "name": "yawlib",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "wordnet,glosstag,omw,sqlite",
    "author": "Le Tuan Anh",
    "author_email": "tuananh.ke@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/94/93/e601cbf7cd1d6be72e543b482c484b974487ba6c7fe5c9a0c6498f898728/yawlib-0.1.tar.gz",
    "platform": "any",
    "description": "# YAWlib - Yet Another WordNet library for Python\n\nA Python library for accessing major WordNet releases using relational databases for high performance batch processing.\n\n- Princeton Wordnet 3.0\n- NTU Open Multilingual WordNet\n- Gloss WordNet\n- and more to be added in future versions\n\n## Installation\n\nYawlib is available on [PyPI](https://pypi.org/project/yawlib/)\n\n```bash\npip install yawlib\n```\n\nPrebuilt database files are available on the author's [Open Science Framework project page: https://osf.io/9udjk/](https://osf.io/9udjk/).\nDownload them and extract those to your home folder at `~/wordnet/`.\nOn Linux it should look something like:\n\n```\n/home/username/wordnet/\n    - glosstag.db\n    - sqlite-30.db\n    - wn-ntumc.db\n\n# or on Mac OS\n/Users/username/wordnet/\n    - glosstag.db\n    - sqlite-30.db\n    - wn-ntumc.db\n```\n\nOn Windows\n\n```\nC:\\Users\\<username>\\wordnet\\\n    - glosstag.db\n    - sqlite-30.db\n    - wn-ntumc.db\n```\n\nTo verify that yawlib is working properly, you can use the `info` command.\n\n```bash\n# Show yawlib information\npython3 -m yawlib info\n```\n\n## Command-line tools\n\n`yawlib` includes a command-line tool for querying wordnets directly from terminal.\n\nFor example, to search synsets by the lemma `research` one may use `python3 -m yawlib lemma research`\n\n```\npython3 -m yawlib lemma research\n\nLooking for synsets by term (Provided: research | pos = None)\n\n\u3014Synset\u301500636921-n \u3014Lemmas\u3015research \u3014Keys\u3015research%1:04:00::\n------------------------------------------------------------\n(def) \u201csystematic investigation to establish facts;\u201d\n\n\n\u3014Synset\u301505797597-n \u3014Lemmas\u3015inquiry; enquiry; research \u3014Keys\u3015inquiry%1:09:01:: enquiry%1:09:00:: research%1:09:00::\n------------------------------------------------------------\n(def) \u201ca search for knowledge;\u201d\n(ex) their pottery deserves more research than it has received;\n\n\n\u3014Synset\u301500648224-v \u3014Lemmas\u3015research; search; explore \u3014Keys\u3015research%2:31:00:: search%2:31:00:: explore%2:31:00::\n------------------------------------------------------------\n(def) \u201cinquire into;\u201d\n(ex) the students had to research the history of the Second World War for their history project;\n(ex) He searched for information on his relatives on the web;\n(ex) Scientists are exploring the nature of consciousness;\n\n\n\u3014Synset\u301500877327-v \u3014Lemmas\u3015research \u3014Keys\u3015research%2:32:00::\n------------------------------------------------------------\n(def) \u201cattempt to find out in a systematically and scientific manner;\u201d\n(ex) The student researched the history of that word;\n\nFound 4 synset(s)\n```\n\n## Development\n\nGo to yawlib folder, execute the config script and then run wntk.sh to generate the glosstab DB file.\n\n```bash\ngit clone https://github.com/letuananh/yawlib\ncd yawlib\n\n# create virtual environment\npython3 -m venv yawlib_py3\n. yawlib_py3/bin/activate\n\n# install required packages\npip install -r requirements.txt\npip install -r requirements-optional.txt\n\n# to show information\npython -m yawlib info\n```\n\n## Compiling glosstag.db from source\n\nMake sure that `glosstag` source folder and `sqlite-30.db` are available in `~/wordnet`.\nThe directory should look like this:\n\n```\n/home/user/wordnet\n\u251c\u2500\u2500 glosstag\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 dtd\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2514\u2500\u2500 glosstag.dtd\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 LICENSE.txt\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 merged\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 adj.xml\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 adv.xml\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 noun.xml\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2514\u2500\u2500 verb.xml\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 README.txt\n\u2502\u00a0\u00a0 \u251c\u2500\u2500 standoff\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 00\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 01\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 02\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 ....\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 index.byid.tab\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 index.bylem.adj.tab\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 index.bylem.adv.tab\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 index.bylem.noun.tab\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 index.bylem.tab\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 index.bylem.verb.tab\n\u2502\u00a0\u00a0 \u2502\u00a0\u00a0 \u2514\u2500\u2500 index.bysk.tab\n\u2502\u00a0\u00a0 \u2514\u2500\u2500 statistics.tab\n\u251c\u2500\u2500 glosstag.db\n\u251c\u2500\u2500 sqlite-30.db\n\u251c\u2500\u2500 wn-ntumc.db\n```\n\nThe run the `create` command to generate the database\n\n```bash\npython -m yawlib create\n```\n\n## Original sources\n\n- WordNet 3.0 SQLite: https://sourceforge.net/projects/wnsql/files/wnsql3/sqlite/3.0/\n- WordNet glosstag (XML): http://wordnet.princeton.edu/glosstag.shtml\n- NTU Open Multilingual Wordnet: http://compling.hss.ntu.edu.sg/omw/",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Python library for accessing major wordnet releases using relational databases for high performance batch processing",
    "version": "0.1",
    "split_keywords": [
        "wordnet",
        "glosstag",
        "omw",
        "sqlite"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "c146b87fbe351b16a88547c413a81fc8",
                "sha256": "1400fbc7117dfd2eb51b269bd0bd019b796a1aebde0d74f836de21f54a92f199"
            },
            "downloads": -1,
            "filename": "yawlib-0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "c146b87fbe351b16a88547c413a81fc8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 38320,
            "upload_time": "2021-05-13T09:37:13",
            "upload_time_iso_8601": "2021-05-13T09:37:13.197120Z",
            "url": "https://files.pythonhosted.org/packages/94/93/e601cbf7cd1d6be72e543b482c484b974487ba6c7fe5c9a0c6498f898728/yawlib-0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2021-05-13 09:37:13",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": null,
    "github_project": "letuananh",
    "error": "Could not fetch GitHub repository",
    "lcname": "yawlib"
}
        
Elapsed time: 0.30681s