2.3.1 • Published 1 year ago

wordnet-parser v2.3.1

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

Wordnet Parser

The fastest WordNet node API out there ⚡

What is WordNet?

It is a large database for English words, their definitions, and other lexical information. The project is made by Princeton University.

API

Note on DBPATH

First of all: download the WordNet database files

The api provided below relies on a constant variable called DBPATH which is initiliazed as such:

const DBPATH = process.env.DBPATH || "./dict";

If your WordNet database is in the root directory of your project you don't need to worry about anything, jump right in to the API. Otherwise if it isn't, you need to create a .env file in the root directory of your project and write:

DBPATH="path/to/dict/folder"

listWords():void

This function is memoized using memoizee. Thus it is lightning fast!

listWords()
.then((list)=>{
    console.log(list)
})
// list of all words in WordNet database

Output: npm.io In just 17.8ms!

lookup():Promise<Word[] | undefined>

Uses a memoized map to lookup word. Also blazingly fast!

lookup("laugh")
.then((result)=>{
    if (result !== undefined)
        console.log(result)
})

Output: npm.io

In just 12.5ms!

Downloads

linux

windows

License

2.3.1

1 year ago

2.3.0

1 year ago

2.2.0

1 year ago

2.1.0

1 year ago

2.0.0

1 year ago

1.0.0

1 year ago