New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

wn

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wn

Wordnet interface library

  • 0.11.0
  • PyPI
  • Socket score

Maintainers
1

Wn logo
a Python library for wordnets
PyPI link Python Support tests Documentation Status Conda-Forge Version
Available Wordnets | Documentation | FAQ | Migrating from NLTK | Roadmap


Wn is a Python library for exploring information in wordnets.

Installation

Install it from PyPI using pip:

pip install wn

Or install using conda from the conda-forge channel (conda-forge/wn-feedstock):

conda install -c conda-forge wn

Getting Started

First, download some data:

python -m wn download oewn:2024  # the Open English WordNet 2024

Now start exploring:

>>> import wn
>>> en = wn.Wordnet('oewn:2024')        # Create Wordnet object to query
>>> ss = en.synsets('win', pos='v')[0]  # Get the first synset for 'win'
>>> ss.definition()                     # Get the synset's definition
'be the winner in a contest or competition; be victorious'

Features

Available Wordnets

Any WN-LMF-formatted wordnet can be added to Wn's database from a local file or remote URL, but Wn also maintains an index (see wn/index.toml) of available projects, similar to a package manager for software, to aid in the discovery and downloading of new wordnets. The projects in this index are listed below.

English Wordnets

There are several English wordnets available. In general it is recommended to use the latest Open English Wordnet, but if you have stricter compatibility needs for, e.g., experiment replicability, you may try the OMW English Wordnet based on WordNet 3.0 (compatible with the Princeton WordNet 3.0 and with the NLTK), or OpenWordnet-EN (for use with the Portuguese wordnet OpenWordnet-PT).

NameSpecifier# SynsetsNotes
Open English WordNetoewn:2024
oewn:2023
oewn:2022
oewn:2021
ewn:2020
ewn:2019
120630
120135
120068
120039
120053
117791
Recommended
 
 
 
 
 
OMW English Wordnet based on WordNet 3.0omw-en:1.4117659Included with omw:1.4
OMW English Wordnet based on WordNet 3.1omw-en31:1.4117791
OpenWordnet-ENown-en:1.0.0117659Included with own:1.0.0

Other Wordnets and Collections

These are standalone non-English wordnets and collections. The wordnets of each collection are listed further down.

NameSpecifier# SynsetsLanguage
Open Multilingual Wordnetomw:1.4n/amultiple [mul]
Open German WordNetodenet:1.4
odenet:1.3
36268
36159
German [de]
Open Wordnets for Portuguese and Englishown:1.0.0n/amultiple [mul]
KurdNetkurdnet:1.02144Kurdish [ckb]

Open Multilingual Wordnet (OMW) Collection

The Open Multilingual Wordnet collection (omw:1.4) installs the following lexicons (from here) which can also be downloaded and installed independently:

NameSpecifier# SynsetsLanguage
Albanetomw-sq:1.44675Albanian [sq]
Arabic WordNet (AWN v2)omw-arb:1.49916Arabic [arb]
BulTreeBank Wordnet (BTB-WN)omw-bg:1.44959Bulgarian [bg]
Chinese Open Wordnetomw-cmn:1.442312Mandarin (Simplified) [cmn-Hans]
Croatian Wordnetomw-hr:1.423120Croatian [hr]
DanNetomw-da:1.44476Danish [da]
FinnWordNetomw-fi:1.4116763Finnish [fi]
Greek Wordnetomw-el:1.418049Greek [el]
Hebrew Wordnetomw-he:1.45448Hebrew [he]
IceWordNetomw-is:1.44951Icelandic [is]
Italian Wordnetomw-iwn:1.415563Italian [it]
Japanese Wordnetomw-ja:1.457184Japanese [ja]
Lithuanian WordNetomw-lt:1.49462Lithuanian [lt]
Multilingual Central Repositoryomw-ca:1.445826Catalan [ca]
Multilingual Central Repositoryomw-eu:1.429413Basque [eu]
Multilingual Central Repositoryomw-gl:1.419312Galician [gl]
Multilingual Central Repositoryomw-es:1.438512Spanish [es]
MultiWordNetomw-it:1.435001Italian [it]
Norwegian Wordnetomw-nb:1.44455Norwegian (Bokmål) [nb]
Norwegian Wordnetomw-nn:1.43671Norwegian (Nynorsk) [nn]
OMW English Wordnet based on WordNet 3.0omw-en:1.4117659English [en]
Open Dutch WordNetomw-nl:1.430177Dutch [nl]
OpenWN-PTomw-pt:1.443895Portuguese [pt]
plWordNetomw-pl:1.433826Polish [pl]
Romanian Wordnetomw-ro:1.456026Romanian [ro]
Slovak WordNetomw-sk:1.418507Slovak [sk]
sloWNetomw-sl:1.442583Slovenian [sl]
Swedish (SALDO)omw-sv:1.46796Swedish [sv]
Thai Wordnetomw-th:1.473350Thai [th]
WOLF (Wordnet Libre du Français)omw-fr:1.459091French [fr]
Wordnet Bahasaomw-id:1.438085Indonesian [id]
Wordnet Bahasaomw-zsm:1.436911Malaysian [zsm]

Open Wordnet (OWN) Collection

The Open Wordnets for Portuguese and English collection (own:1.0.0) installs the following lexicons (from here) which can also be downloaded and installed independently:

NameSpecifier# SynsetsLanguage
OpenWordnet-PTown-pt:1.0.052670Portuguese [pt]
OpenWordnet-ENown-en:1.0.0117659English [en]

Collaborative Interlingual Index

While not a wordnet, the Collaborative Interlingual Index (CILI) represents the interlingual backbone of many wordnets. Wn, including interlingual queries, will function without CILI loaded, but adding it to the database makes available the full list of concepts, their status (active, deprecated, etc.), and their definitions.

NameSpecifier# Concepts
Collaborative Interlingual Indexcili:1.0117659

Changes to the Index

ewnoewn

The 2021 version of the Open English WordNet (oewn:2021) has changed its lexicon ID from ewn to oewn, so the index is updated accordingly. The previous versions are still available as ewn:2019 and ewn:2020.

pwnomw-en, omw-en31

The wordnet formerly called the Princeton WordNet (pwn:3.0, pwn:3.1) is now called the OMW English Wordnet based on WordNet 3.0 (omw-en) and the OMW English Wordnet based on WordNet 3.1 (omw-en31). This is more accurate, as it is a OMW-produced derivative of the original WordNet data, and it also avoids license or trademark issues.

*wnomw-* for OMW wordnets

All OMW wordnets have changed their ID scheme from ...wn to omw-.. and the version no longer includes +omw (e.g., bulwn:1.3+omw is now omw-bg:1.4).

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc