# propose

> Propse a word when the input word is not in the dictionary

Latest version **0.0.5** (published 2015-06-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install propose
pnpm add propose
yarn add propose
bun add propose
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2015-06-24 |
| First published | 2015-06-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Shuping LIU |
| Maintainers | liushuping |
| Keywords | word, typo, propose, similar, correction, did you mean |

## Links

- npm: https://www.npmjs.com/package/propose
- Repository: https://github.com/liushuping/propose
- Homepage: https://github.com/liushuping/propose#readme
- Issues: https://github.com/liushuping/propose/issues
- npm.io page: https://npm.io/package/propose

## Dependencies (1)

- [levenshtein-edit-distance](https://npm.io/package/levenshtein-edit-distance.md) ^1.0.0

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.0.5 (latest) — 2015-06-24
- 0.0.4 — 2015-06-24
- 0.0.3 — 2015-06-23
- 0.0.2 — 2015-06-23
- 0.0.1 — 2015-06-22

## README

# propose
Propse a word when the input word is not in the dictionary

[![build status](https://travis-ci.org/liushuping/propose.svg?branch=master)](https://travis-ci.org/liushuping/propose.svg?branch=master)

This module can be used to propse the right command in the scenario when there is a typo or mis-spell in the command line, it looks up the given dictionary and identifies the most similar word. It can also be used in any case that the string is formed by one or a series of known words, for example URL, directory path etc.

## Example
```javascript
var propose = require('propose');
var dictionary = ['hello', 'world'];
var word = 'hallo';
propose(word, dictionary); //hello
```

## Options
`threshold` [0~1] specifies only the word with similarity equals to or higher than that value will be returned
```javascript
var propose = require('propose');
var dictionary = ['aaaaaaaa', 'baabbbb', 'ccccc'];
var word = 'ab';
propose(word, dictionary, {
    threshold: 0.5
}); // null as the most similar word does not meet the threshold value
```

`ignoreCase` [true, false] specifies whether ignore case when comparing two words
```javascript
var propose = require('propose');
var dictionary = ['HELLO', 'hallo'];
var word = 'hello';
propose(word, dictionary, {
    ignoreCase: true
}); //'HELLO'
```

## Test
Make sure `mocha` is installed globally
```
npm install mocha -g
```
Run `npm test` to run unit test

## Dependencies
levenshtein-edit-distance

## License
MIT

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