Part-of-Speech Tagger with WordNet

2.1.0 · active · verified Wed Apr 22

wordpos is a set of fast part-of-speech (POS) utilities for both Node.js and browser environments, leveraging the WordNet database for its linguistic data. The current stable version is 2.1.0, which marked a significant refactoring to enable full browser compatibility, overcoming previous limitations regarding the size and un-browserify-ability of the WordNet database. While a specific release cadence isn't published, the project has undergone major version updates (1.x, 2.x) that introduced substantial performance improvements (up to 5x faster than prior versions), promise-based APIs, and a decoupling from the `natural` library's WordNet module. Its key differentiators include its speed, cross-environment support, a flexible API with options for stopword filtering and profiling, and a command-line interface.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart initializes WordPOS and demonstrates basic asynchronous part-of-speech tagging and word classification using callbacks.

const WordPOS = require('wordpos');
const wordpos = new WordPOS();

wordpos.getAdjectives('The angry bear chased the frightened little squirrel.', (result) => {
    console.log('Adjectives:', result);
});

wordpos.isAdjective('awesome', (result) => {
    console.log('Is awesome an adjective?', result);
});

// Demonstrating getPOS for all parts of speech
wordpos.getPOS('The quick brown fox jumps over the lazy dog.', (result) => {
    console.log('All POS breakdown:', result);
});

view raw JSON →