nlcst utility to classify ASCII emoticons as EmoticonNodes.
Note: You probably want to use retext-emoji.
This package is ESM only: Node 12+ is needed to use it and it must be imported instead of required.
npm:
npm install nlcst-emoticon-modifierimport {emoticonModifier} from 'nlcst-emoticon-modifier' import {inspect} from 'unist-util-inspect' import {ParseEnglish} from 'parse-english' const sentence = new ParseEnglish().parse('This makes me feel :).').children[0].children[0] emoticonModifier(sentence) console.log(inspect(sentence))Yields:
SentenceNode[10] ├─ WordNode[1] │ └─ TextNode: 'This' ├─ WhiteSpaceNode: ' ' ├─ WordNode[1] │ └─ TextNode: 'makes' ├─ WhiteSpaceNode: ' ' ├─ WordNode[1] │ └─ TextNode: 'me' ├─ WhiteSpaceNode: ' ' ├─ WordNode[1] │ └─ TextNode: 'feel' ├─ WhiteSpaceNode: ' ' ├─ EmoticonNode: ':)' └─ PunctuationNode: '.'This package exports the following identifiers: emoticonModifier. There is no default export.
Classify ASCII emoticons as EmoticonNodes.
Node to process (Sentence).
nlcst-affix-emoticon-modifier— Merge affix emoticons into the previous sentence in nlcstnlcst-emoji-modifier— Support emoji
See contributing.md in syntax-tree/.github for ways to get started. See support.md for ways to get help.
This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.