JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 28182
  • Score
    100M100P100Q154531F
  • License MIT

Emoji in NLCST

Package Exports

  • nlcst-emoji-modifier

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (nlcst-emoji-modifier) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

nlcst-emoji-modifier Build Status Coverage Status

Classify unicode emoji and Gemoji shortcodes as EmoticonNodes.

Implemented by retext-emoji, but separated for use by standalone (non-retext) processing.

Installation

npm:

npm install nlcst-emoji-modifier

Usage

var modifier = require('nlcst-emoji-modifier');
var inspect = require('unist-util-inspect');
var english = require('parse-english')();

english.useFirst('tokenizeSentence', modifier);

console.log(inspect(english.parse('It\'s raining ðŸąs and ðŸķs.')));

Yields:

RootNode[1]
└─ ParagraphNode[1]
   └─ SentenceNode[10]
      ├─ WordNode[1]
      │  └─ TextNode: 'Who'
      ├─ WhiteSpaceNode: ' '
      ├─ WordNode[3]
      │  ├─ TextNode: 'doesn'
      │  ├─ PunctuationNode: '’'
      │  └─ TextNode: 't'
      ├─ WhiteSpaceNode: ' '
      ├─ WordNode[1]
      │  └─ TextNode: 'like'
      ├─ WhiteSpaceNode: ' '
      ├─ WordNode[1]
      │  └─ TextNode: 'Gemoji'
      ├─ WhiteSpaceNode: ' '
      ├─ EmoticonNode: '👍'
      └─ PunctuationNode: '?'

API

emoji(sentence)

Merge affix emoticons into the previous sentence.

Parameters

License

MIT ÂĐ Titus Wormer