Files
30-seconds-of-code/node_modules/retext-english/readme.md
2019-08-20 15:52:05 +02:00

160 lines
4.5 KiB
Markdown

# retext-english
[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]
[![Sponsors][sponsors-badge]][collective]
[![Backers][backers-badge]][collective]
[![Chat][chat-badge]][chat]
[**retext**][retext] plugin to parse English natural language.
[Parser][] for [**unified**][unified].
Parses English language prose to [**nlcst**][nlcst] syntax trees.
## Sponsors
<!--lint ignore no-html maximum-line-length-->
<table>
<tr valign="top">
<td width="20%" align="center">
<a href="https://zeit.co"><img src="https://avatars1.githubusercontent.com/u/14985020?s=400&v=4"></a>
<br><br>🥇
<a href="https://zeit.co">ZEIT</a>
</td>
<td width="20%" align="center">
<a href="https://www.gatsbyjs.org"><img src="https://avatars1.githubusercontent.com/u/12551863?s=400&v=4"></a>
<br><br>🥇
<a href="https://www.gatsbyjs.org">Gatsby</a></td>
<td width="20%" align="center">
<a href="https://compositor.io"><img src="https://avatars1.githubusercontent.com/u/19245838?s=400&v=4"></a>
<br><br>🥉
<a href="https://compositor.io">Compositor</a>
</td>
<td width="20%" align="center">
<a href="https://www.holloway.com"><img src="https://avatars1.githubusercontent.com/u/35904294?s=400&v=4"></a>
<br><br>
<a href="https://www.holloway.com">Holloway</a>
</td>
<td width="20%" align="center">
<br><br><br><br>
<a href="https://opencollective.com/unified"><strong>You?</strong>
</td>
</tr>
</table>
[**Read more about the unified collective on Medium »**][announcement]
## Install
[npm][]:
```sh
npm install retext-english
```
## Use
```js
var unified = require('unified')
var stream = require('unified-stream')
var english = require('retext-english')
var stringify = require('retext-stringify')
var emoji = require('retext-emoji')
var processor = unified()
.use(english)
.use(emoji, {convert: 'encode'})
.use(stringify)
process.stdin.pipe(stream(processor)).pipe(process.stdout)
```
## API
### `processor.use(english)`
Parse English natural language.
There is no configuration for the parser.
### `english.Parser`
Access to the [parser][] ([`parse-english`][parse-english]).
## Contribute
See [`contributing.md`][contributing] in [`retextjs/.github`][health] for ways
to get started.
See [`support.md`][support] for ways to get help.
Ideas for new plugins and tools can be posted in [`retextjs/ideas`][ideas].
A curated list of awesome retext resources can be found in [**awesome
retext**][awesome].
This project has a [Code of Conduct][coc].
By interacting with this repository, organisation, or community you agree to
abide by its terms.
## License
[MIT][license] © [Titus Wormer][author]
<!-- Definitions -->
[build-badge]: https://img.shields.io/travis/retextjs/retext/master.svg
[build]: https://travis-ci.org/retextjs/retext
[coverage-badge]: https://img.shields.io/codecov/c/github/retextjs/retext.svg
[coverage]: https://codecov.io/github/retextjs/retext
[downloads-badge]: https://img.shields.io/npm/dm/retext-english.svg
[downloads]: https://www.npmjs.com/package/retext-english
[size-badge]: https://img.shields.io/bundlephobia/minzip/retext-english.svg
[size]: https://bundlephobia.com/result?p=retext-english
[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg
[backers-badge]: https://opencollective.com/unified/backers/badge.svg
[collective]: https://opencollective.com/unified
[chat-badge]: https://img.shields.io/badge/join%20the%20community-on%20spectrum-7b16ff.svg
[chat]: https://spectrum.chat/unified/retext
[health]: https://github.com/retextjs/.github
[contributing]: https://github.com/retextjs/.github/blob/master/contributing.md
[support]: https://github.com/retextjs/.github/blob/master/support.md
[coc]: https://github.com/retextjs/.github/blob/master/code-of-conduct.md
[ideas]: https://github.com/retextjs/ideas
[awesome]: https://github.com/retextjs/awesome-retext
[license]: https://github.com/retextjs/retext/blob/master/license
[author]: https://wooorm.com
[npm]: https://docs.npmjs.com/cli/install
[unified]: https://github.com/unifiedjs/unified
[retext]: https://github.com/retextjs/retext
[nlcst]: https://github.com/syntax-tree/nlcst
[parser]: https://github.com/unifiedjs/unified#processorparser
[parse-english]: https://github.com/wooorm/parse-english
[announcement]: https://medium.com/unifiedjs/collectively-evolving-through-crowdsourcing-22c359ea95cc