wn-ts-node
v0.8.2
Published
Wordnet interface library - TypeScript port
Maintainers
Readme
wn-ts-node
Node.js implementation of the WordNet TypeScript ecosystem with SQLite integration and microkernel architecture.
Features
- Microkernel Architecture - Plugin-based design with relations, similarity, and translation plugins
- Native SQLite - High-performance database operations with native SQLite3
- Performance - Optimized for server-side processing and large datasets
- Type Safety - Full TypeScript support with comprehensive type definitions
- Cross-Lingual - Multi-language support with ILI-based translation
- CLI Tools - Built-in command-line interface for data management
- Data Export - Export WordNet data in multiple formats (JSON, XML, CSV)
Installation
npm install wn-ts-nodeUsage
Basic Usage
import { NodeWordNetKernel } from 'wn-ts-node';
const wordnet = new NodeWordNetKernel('oewn:2024');
await wordnet.initialize();
const words = await wordnet.words({ form: 'computer' });
await wordnet.close();Module Functions
import { words, synsets, download, add } from 'wn-ts-node';
// Query functions
const wordList = await words('computer');
const synsetList = await synsets('computer');
// Data management
await download('oewn:2024');
await add('oewn:2024');Plugin Usage
const hypernyms = await wordnet.getHypernyms(synsetId);
const similarity = await wordnet.getPathSimilarity(synset1, synset2);
const translations = await wordnet.getTranslations(synsetId, 'fr');Configuration
const options = {
filename: 'wordnet.db',
enableWAL: true,
enableForeignKeys: true,
maxConnections: 10
};CLI Usage
# Search
wn-cli search "computer" --lexicon oewn:2024
# Relationships
wn-cli relations "computer" --type hypernym
# Data management
wn-cli data download oewn:2024
wn-cli data export --format jsonFurther Reading
- Documentation - Complete documentation
- API Reference - API documentation
- Examples - Working examples
- Getting Started - Quick start guides
Troubleshooting
- Troubleshooting Guide - Common issues and solutions
- Recent Bug Fixes - Critical bugs fixed in v0.8.1
Contributing
- Bug Reporting Guide - How to submit bug reports for wn-ts-node
