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.
npm install wordposVerified import paths — ran on the pinned version, not inferred.
This quickstart initializes WordPOS and demonstrates basic asynchronous part-of-speech tagging and word classification using callbacks.
Review WordPOS API for direct equivalents. If you need `natural`'s WordNet specifically, use `natural` directly or stick to `wordpos` pre-1.0.0.
For browser usage, ensure your bundling setup handles the WordNet data files correctly, or consider using `wordpos-web` for a pre-optimized browser distribution. Test thoroughly after upgrading.
Always pass a callback function as the last argument to methods like `getNouns`, `isAdjective`, `getPOS`, etc., or handle the returned Promise explicitly (e.g., `.then().catch()` or `await`).
Ensure you create an instance of the class: `const wordpos = new WordPOS();`
Change your import statement to `import WordPOS from 'wordpos';` and ensure your project is configured for ESM (e.g., `"type": "module"` in `package.json`).
Provide a callback function as the last argument to all asynchronous API calls, e.g., `wordpos.getNouns('text', (result) => { /* handle result */ });`.No dependency data recorded yet.