# wink-nlp-utils

> NLP Functions for amplifying negations, managing elisions, creating ngrams, stems, phonetic codes to tokens and more.

Latest version **2.1.0** (published 2022-10-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install wink-nlp-utils
pnpm add wink-nlp-utils
yarn add wink-nlp-utils
bun add wink-nlp-utils
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2022-10-12 |
| First published | 2017-05-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 203 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Sanjaya Kumar Saxena |
| Maintainers | sanjaya, r4chn4, prtksxna |
| Keywords | Tokenize, Stem, NGrams, Bag of Words, Phonetize, Soundex, Stop Words, Sentence Breaking, Regex, NLP, Natural Language Processing |

## Links

- npm: https://www.npmjs.com/package/wink-nlp-utils
- Repository: https://github.com/winkjs/wink-nlp-utils
- Homepage: http://winkjs.org/
- Issues: https://github.com/winkjs/wink-nlp-utils/issues
- npm.io page: https://npm.io/package/wink-nlp-utils

## Dependencies (6)

- [wink-nlp](https://npm.io/package/wink-nlp.md) ^1.12.0
- [wink-helpers](https://npm.io/package/wink-helpers.md) ^2.0.0
- [wink-distance](https://npm.io/package/wink-distance.md) ^2.0.1
- [wink-tokenizer](https://npm.io/package/wink-tokenizer.md) ^5.2.3
- [wink-porter2-stemmer](https://npm.io/package/wink-porter2-stemmer.md) ^2.0.1
- [wink-eng-lite-web-model](https://npm.io/package/wink-eng-lite-web-model.md) ^1.4.3

## Recent versions

- 2.1.0 (latest) — 2022-10-12
- 2.0.7 — 2021-08-27
- 2.0.6 — 2020-06-30
- 2.0.5 — 2019-04-16
- 2.0.4 — 2019-04-05
- 2.0.3 — 2018-11-12
- 2.0.2 — 2018-11-12
- 2.0.1 — 2018-11-11
- 2.0.0 — 2018-11-03
- 1.9.1 — 2018-08-30
- 1.9.0 — 2018-05-18
- 1.8.0 — 2018-03-31
- 1.7.1 — 2018-02-21
- 1.7.0 — 2017-10-18
- 1.6.1 — 2017-10-14
- … 10 more at https://npm.io/package/wink-nlp-utils/versions

## README

# wink-nlp-utils

NLP Functions for amplifying negations, managing elisions, creating ngrams, stems, phonetic codes to tokens and more.

### [![Build Status](https://app.travis-ci.com/winkjs/wink-nlp-utils.svg?branch=master)](https://app.travis-ci.com/github/winkjs/wink-nlp-utils) [![Coverage Status](https://coveralls.io/repos/github/winkjs/wink-nlp-utils/badge.svg?branch=master)](https://coveralls.io/github/winkjs/wink-nlp-utils?branch=master) [![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/winkjs/Lobby)

[<img align="right" src="https://decisively.github.io/wink-logos/logo-title.png" width="100px" >](http://wink.org.in/)

Prepare raw text for Natural Language Processing (NLP) using **`wink-nlp-utils`**. It offers a set of [APIs](http://wink.org.in/wink-nlp-utils/) to work on [strings](http://wink.org.in/wink-nlp-utils/#string) such as names, sentences, paragraphs and [tokens](http://wink.org.in/wink-nlp-utils/#tokens) represented as an array of strings/words. They perform the required pre-processing for many ML tasks such as [semantic search](https://www.npmjs.com/package/wink-bm25-text-search), and [classification](https://www.npmjs.com/package/wink-naive-bayes-text-classifier).

<table><tr><td>👉🏽</td><td>
    Use <b><a href="https://github.com/winkjs/wink-nlp">wink-nlp</a></b> if you require an integrated NLP for 
    <i>tokenization</i>, <i>sentence boundary detection (sbd)</i>, <i>negation handling</i>, <i>sentiment analysis</i>, <i>part-of-speech (pos) tagging</i>, <i>named entity recognition (ner)</i>, and <i>custom entities recognition (cer)</i>. It also runs on web browsers and can process raw text at speeds over 525,000 tokens/second. 
</td></tr></table>

### Installation
Use [npm](https://www.npmjs.com/package/wink-nlp-utils) to install:
```
npm install wink-nlp-utils --save
```


### Getting Started
The `wink-nlp-utils` provides over **36 utility functions** for Natural Language Processing tasks. Some representative examples are extracting person's name from a string, compose training corpus for a chat bot, sentence boundary detection, tokenization and stop words removal:
```javascript

// Load wink-nlp-utils
var nlp = require( 'wink-nlp-utils' );

// Extract person's name from a string:
var name = nlp.string.extractPersonsName( 'Dr. Sarah Connor M. Tech., PhD. - AI' );
console.log( name );
// -> 'Sarah Connor'

// Compose all possible sentences from a string:
var str = '[I] [am having|have] [a] [problem|question]';
console.log( nlp.string.composeCorpus( str ) );
// -> [ 'I am having a problem',
// ->   'I am having a question',
// ->   'I have a problem',
// ->   'I have a question' ]

// Sentence Boundary Detection.
var para = 'AI Inc. is focussing on AI. I work for AI Inc. My mail is r2d2@yahoo.com';
console.log( nlp.string.sentences( para ) );
// -> [ 'AI Inc. is focussing on AI.',
//      'I work for AI Inc.',
//      'My mail is r2d2@yahoo.com' ]

// Tokenize a sentence.
var s = 'For details on wink, check out http://winkjs.org/ URL!';
console.log( nlp.string.tokenize( s, true ) );
// -> [ { value: 'For', tag: 'word' },
//      { value: 'details', tag: 'word' },
//      { value: 'on', tag: 'word' },
//      { value: 'wink', tag: 'word' },
//      { value: ',', tag: 'punctuation' },
//      { value: 'check', tag: 'word' },
//      { value: 'out', tag: 'word' },
//      { value: 'http://winkjs.org/', tag: 'url' },
//      { value: 'URL', tag: 'word' },
//      { value: '!', tag: 'punctuation' } ]

// Remove stop words:
var t = nlp.tokens.removeWords( [ 'mary', 'had', 'a', 'little', 'lamb' ] );
console.log( t );
// -> [ 'mary', 'little', 'lamb' ]

```

Try [experimenting with these examples on Runkit](https://npm.runkit.com/wink-nlp-utils) in the browser.

### Documentation
Check out the [wink NLP utilities API](http://winkjs.org/wink-nlp-utils/) documentation to learn more.

### Need Help?
If you spot a bug and the same has not yet been reported, raise a new [issue](https://github.com/winkjs/wink-nlp-utils/issues) or consider fixing it and sending a pull request.

### About wink
[Wink](http://winkjs.org/) is a family of open source packages for **Statistical Analysis**, **Natural Language Processing** and **Machine Learning** in NodeJS. The code is **thoroughly documented** for easy human comprehension and has a **test coverage of ~100%** for reliability to build production grade solutions.


### Copyright & License
**wink-nlp-utils** is copyright 2017-22 [GRAYPE Systems Private Limited](http://graype.in/).

It is licensed under the terms of the MIT License.

---
_Source: https://npm.io/package/wink-nlp-utils · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
