<commit_before># retext-emoji [![Build Status](https://travis-ci.org/wooorm/retext-emoji.png)](https://travis-ci.org/wooorm/retext-emoji)

**[retext](https://github.com/wooorm/retext "Retext")** implementation of the textual parts of [Gemoji](https://github.com/github/gemoji "Github Emojis").

## Installation

```sh
$ npm install retext-emoji
```

## Usage & API

### emoji(options?)

```js
var Retext = require('retext'),
    emoji = require('retext-emoji');

var text = new Retext()
    .use(emoji({
        'convert' : 'encode'
    }))
    .parse('It’s raining :cat:s and :dog:s!')
    .toString(); // 'It’s raining 🐱s and 🐶s!'
```

- `options` (`Object`)
- `options.convert` (`encode` or `decode`):
  - When `encode`, converts named Gemoji’s into their unicode equivalent (e.g., `:pig:` to `🐷`);
  - When `decode`, converts named unicode emojis into their named equivalent (e.g., `🐷` to `:pig:`);

## License

  MIT<commit_msg>Fixed wording of “encoding” and “decoding”<commit_after># retext-emoji [![Build Status](https://travis-ci.org/wooorm/retext-emoji.png)](https://travis-ci.org/wooorm/retext-emoji)

**[retext](https://github.com/wooorm/retext "Retext")** encoding of gemoji short-codes to unicode, and decoding from unicode to short-code.

## Installation

```sh
$ npm install retext-emoji
```

## Usage & API

### emoji(options?)

```js
var Retext = require('retext'),
    emoji = require('retext-emoji');

var text = new Retext()
    .use(emoji({
        'convert' : 'encode'
    }))
    .parse('It’s raining :cat:s and :dog:s!')
    .toString(); // 'It’s raining 🐱s and 🐶s!'
```

- `options` (`Object`)
- `options.convert` (`encode` or `decode`):
  - When `encode`, converts short-codes into their unicode equivalent (e.g., `:pig:` to `🐷`);
  - When `decode`, converts unicode emojis into their short-code equivalent (e.g., `🐷` to `:pig:`);

## License

  MIT
{'fraction_non_alphanumeric': 0.20149253731343283, 'fraction_numerical': 0.0, 'mean_word_length': 3.9656084656084656, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 7, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1710448', 'n_tokens_mistral': 736, 'n_tokens_neox': 699, 'n_words': 169}