Skip to content

Commit

Permalink
Fix mistakes in README
Browse files Browse the repository at this point in the history
  • Loading branch information
hilja committed Aug 10, 2019
1 parent 79b31e5 commit cb4121e
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Revive contractions
# Humanize contractions

The point of this package is, that it tries to revive English language contractions after they have been destroyed by dehumanizing process like camel-casing, kebab-casing, lower-casing, snakes-casing, or such. It's not an exact science and you can’t ever get 100% results, but maybe 80% results, on a good day.
This package tries the impossible, to revive English language contractions after they have been destroyed by dehumanizing process like camel-casing, kebab-casing, lower-casing, snakes-casing, or such. It's not an exact science and you can’t ever get 100% results, but maybe 80% results... on a good day.

## How it works

Expand All @@ -14,7 +14,7 @@ const contractions = [
}
```

Some words are replaceable, some are not, because they have another meaning, like "shell" for example. And that’s the crux of this operation: _it’s imperfect in its core_. But it provides tremendous helps in the process of reverse engineering a destroyed string.
Some words are replaceable, some are not, because they have another meaning, like "shell", for example. And that’s the crux of this operation: _it’s imperfect in its core_. But it provides a lot of help in the process of reverse engineering destroyed strings.

## Examples

Expand All @@ -25,7 +25,7 @@ const humanized = humanizeContractions('im having a bad day')
// I'm having a bad day
```

It doesn't replace words that have a meaning:
It doesnt replace words that have a meaning:

```js
const humanized = humanizeContractions('shed be mad')
Expand All @@ -39,18 +39,18 @@ const humanized = humanizeContractions('shed be mad', { brutalMode: true })
// she’d be mad
```

If the `brutalMode` is too brutal, individual words can be included, maybe the contraction "she’d" appears a lot in a given data-set and the word "shed" never:
If the `brutalMode` is too brutal, individual words can be included. Maybe the contraction "she’d" appears a lot in a given data-set and the word "shed" never:

```js
const humanized = humanizeContractions('shed be mad', { include: ['shed'] })
// she’d be mad
```

If you have special data-set with replicable words that have a meaning, you can exclude them:
If you have special data-set with replaceable words that have a meaning, you can exclude them:

```js
const humanized = humanizeContractions('the race at im was great', {
// IM referring to Isle of Man in this case.
// "IM" is referring to Isle of Man in this case.
exclude: ['im']
})
// the race at im was great
Expand All @@ -60,7 +60,6 @@ Or you can tweak it more by combining includes and excludes to suit your data:

```js
const humanized = humanizeContractions('the race at im was great id say', {
// IM referring to Isle of Man in this case.
exclude: ['im'],
include: ['id']
})
Expand Down Expand Up @@ -92,13 +91,13 @@ This package expects phrases where words are separated by spaces, so you have to
```js
import humanize from 'humanize-string'

const input = 'im-having-a-bad-day'
const input = humanize('im-having-a-bad-day')

const humanized = humanizeContractions(input)
const stringWithContractions = humanizeContractions(input)
// I'm having a bad day
```

Some humanize package available in npm:
Find humanize package from npm that suits you:

- [humanize-sting](https://www.npmjs.com/package/humanize-string)
- [string-humanize](https://www.npmjs.com/package/string-humanize)
Expand Down

0 comments on commit cb4121e

Please sign in to comment.