A lightweight REST API service providing WordNet dictionary lookup functionality, built with Bun and PostgreSQL.
- ⚡ Fast word lookup with fuzzy matching
- Returns detailed word information including:
- Definitions
- Part of speech
- Pronunciations
- Examples
- Synonyms
- Antonyms
- Similar words
- Bun v1.1.22 or higher
- uv for the tools
- PostgreSQL database
- WordNet XML dump from https://en-word.net
- Install dependencies:
bun install- Create a
.envfile in the project rootvyntr/.env:
Read the main README.md for instructions.
- Prepare the WordNet data:
- Place WordNet XML file as
wn.xmlin thetools/srcdirectory - Sync uv:
cd tools/src uv sync- Run the conversion script:
python convert_wn_xml_to_json.py
- Load the data into PostgreSQL:
python load_wordnet_into_db.py
- Place WordNet XML file as
Start the API server:
bun run index.tsLook up a word with fuzzy matching support.
Parameters:
word(path parameter): The word to look up
Response:
[
{
"similarity": 1.0,
"entry": {
"id": "string",
"word": "string",
"partOfSpeech": "string",
"pronunciations": ["string"],
"definitions": [
{
"pos": "string",
"gloss": "string",
"source": "string"
}
],
"examples": ["string"],
"synonyms": ["string"],
"antonyms": ["string"],
"similarWords": ["string"]
}
}
]Health check endpoint.
Response:
200 OKwith body: "OK"
This project uses WordNet data which is subject to the WordNet 1 License 2.