{"name":"parse-english","version":"0.0.16","description":"English (natural language) parser build on TextOM","keywords":["english","natural","language","parser","textom"],"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com"},"license":"MIT","dependencies":{"textom":"~0.0.16"},"devDependencies":{"complexity-report":"~1.0.3","eslint":"^0.6.2","istanbul":"~0.2.10","jscs":"^1.4.5","mocha":"~1.20.1"},"repository":{"type":"git","url":"https://github.com/wooorm/parse-english.git"},"scripts":{"test":"_mocha --reporter spec --check-leaks -u exports spec/parse-english.spec.js","test-travis":"istanbul cover node_modules/.bin/_mocha --report lcovonly -- --reporter spec --check-leaks -u exports spec/parse-english.spec.js","lint":"eslint index.js --env node --env browser --rule 'quotes: [2, single]' && node_modules/.bin/eslint spec/parse-english.spec.js --env node --env mocha --rule 'quotes: [2, single], no-loop-func: false' && node_modules/.bin/jscs index.js spec/parse-english.spec.js --reporter=inline","coverage":"istanbul cover node_modules/.bin/_mocha -- -- spec spec/parse-english.spec.js","complexity":"cr -l --maxcyc 20 --format minimal --silent index.js","make":"npm run-script lint && npm run-script complexity && npm run-script coverage"},"testling":{"files":"spec/parse-english.spec.js","harness":"mocha","browsers":["iexplore/latest","chrome/latest","chrome/canary","firefox/latest","firefox/nightly","opera/latest","opera/next","safari/latest","iphone/latest","android-browser/latest"]},"bugs":{"url":"https://github.com/wooorm/parse-english/issues"},"homepage":"https://github.com/wooorm/parse-english","_id":"parse-english@0.0.16","_shasum":"be8711bfb56492adadc67a99ca6e5b00f00556fd","_from":".","_npmVersion":"1.4.10","_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"dist":{"shasum":"be8711bfb56492adadc67a99ca6e5b00f00556fd","tarball":"http://registry-npm.ywwl.com/parse-english/download/parse-english-0.0.16.tgz","integrity":"sha512-0QgGI6I9Knu7SltiJpQJKa9ihmU+asU6pnhYCYp9HaYzoemtzu4UXxzDUfb2kYSstuKYYGdydYPs0P3hFc/VKw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFxfOoaehZSzeXOzulSspX89W5gtyyk9vUoyOvWcXwYSAiEA/V2ZsPTpzsnOkAD8ZBcQZvh3ylL056N8mDTSCo834cE="}],"size":40615,"noattachment":false,"key":"/parse-english/-/parse-english-0.0.16.tgz"},"directories":{},"readme":"# parse-english\n\n[![Build][build-badge]][build]\n[![Coverage][coverage-badge]][coverage]\n[![Downloads][downloads-badge]][downloads]\n[![Size][size-badge]][size]\n\nNatural language parser, for the English language, that produces [nlcst][].\n\n## Contents\n\n*   [What is this?](#what-is-this)\n*   [When should I use this?](#when-should-i-use-this)\n*   [Install](#install)\n*   [Use](#use)\n*   [API](#api)\n    *   [`ParseEnglish()`](#parseenglish)\n*   [Algorithm](#algorithm)\n*   [Types](#types)\n*   [Compatibility](#compatibility)\n*   [Security](#security)\n*   [Related](#related)\n*   [Contribute](#contribute)\n*   [License](#license)\n\n## What is this?\n\nThis package exposes a parser that takes English natural language and produces\na syntax tree.\n\n## When should I use this?\n\nIf you want to handle English natural language as syntax trees manually, use\nthis.\n\nAlternatively, you can use the retext plugin [`retext-english`][retext-english],\nwhich wraps this project to also parse natural language at a higher-level\n(easier) abstraction.\n\nFor Dutch or most Latin-script languages, you can instead use\n[`parse-dutch`][parse-dutch] or [`parse-latin`][parse-latin].\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 16+), install with [npm][]:\n\n```sh\nnpm install parse-english\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport {ParseEnglish} from 'https://esm.sh/parse-english@7'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n<script type=\"module\">\n  import {ParseEnglish} from 'https://esm.sh/parse-english@7?bundle'\n</script>\n```\n\n## Use\n\n```js\nimport {ParseEnglish} from 'parse-english'\nimport {inspect} from 'unist-util-inspect'\n\nconst tree = new ParseEnglish().parse(\n  'Mr. Henry Brown: A hapless but friendly City of London worker.'\n)\n\nconsole.log(inspect(tree))\n```\n\nYields:\n\n```txt\nRootNode[1] (1:1-1:63, 0-62)\n└─0 ParagraphNode[1] (1:1-1:63, 0-62)\n    └─0 SentenceNode[23] (1:1-1:63, 0-62)\n        ├─0  WordNode[2] (1:1-1:4, 0-3)\n        │    ├─0 TextNode \"Mr\" (1:1-1:3, 0-2)\n        │    └─1 PunctuationNode \".\" (1:3-1:4, 2-3)\n        ├─1  WhiteSpaceNode \" \" (1:4-1:5, 3-4)\n        ├─2  WordNode[1] (1:5-1:10, 4-9)\n        │    └─0 TextNode \"Henry\" (1:5-1:10, 4-9)\n        ├─3  WhiteSpaceNode \" \" (1:10-1:11, 9-10)\n        ├─4  WordNode[1] (1:11-1:16, 10-15)\n        │    └─0 TextNode \"Brown\" (1:11-1:16, 10-15)\n        ├─5  PunctuationNode \":\" (1:16-1:17, 15-16)\n        ├─6  WhiteSpaceNode \" \" (1:17-1:18, 16-17)\n        ├─7  WordNode[1] (1:18-1:19, 17-18)\n        │    └─0 TextNode \"A\" (1:18-1:19, 17-18)\n        ├─8  WhiteSpaceNode \" \" (1:19-1:20, 18-19)\n        ├─9  WordNode[1] (1:20-1:27, 19-26)\n        │    └─0 TextNode \"hapless\" (1:20-1:27, 19-26)\n        ├─10 WhiteSpaceNode \" \" (1:27-1:28, 26-27)\n        ├─11 WordNode[1] (1:28-1:31, 27-30)\n        │    └─0 TextNode \"but\" (1:28-1:31, 27-30)\n        ├─12 WhiteSpaceNode \" \" (1:31-1:32, 30-31)\n        ├─13 WordNode[1] (1:32-1:40, 31-39)\n        │    └─0 TextNode \"friendly\" (1:32-1:40, 31-39)\n        ├─14 WhiteSpaceNode \" \" (1:40-1:41, 39-40)\n        ├─15 WordNode[1] (1:41-1:45, 40-44)\n        │    └─0 TextNode \"City\" (1:41-1:45, 40-44)\n        ├─16 WhiteSpaceNode \" \" (1:45-1:46, 44-45)\n        ├─17 WordNode[1] (1:46-1:48, 45-47)\n        │    └─0 TextNode \"of\" (1:46-1:48, 45-47)\n        ├─18 WhiteSpaceNode \" \" (1:48-1:49, 47-48)\n        ├─19 WordNode[1] (1:49-1:55, 48-54)\n        │    └─0 TextNode \"London\" (1:49-1:55, 48-54)\n        ├─20 WhiteSpaceNode \" \" (1:55-1:56, 54-55)\n        ├─21 WordNode[1] (1:56-1:62, 55-61)\n        │    └─0 TextNode \"worker\" (1:56-1:62, 55-61)\n        └─22 PunctuationNode \".\" (1:62-1:63, 61-62)\n```\n\n## API\n\nThis package exports the identifier [`ParseEnglish`][api-parse-english].\nThere is no default export.\n\n### `ParseEnglish()`\n\nCreate a new parser.\n\n`ParseEnglish` extends `ParseLatin`.\nSee [`parse-latin`][parse-latin] for API docs.\n\n## Algorithm\n\nAll of [`parse-latin`][parse-latin] is included, and the following support for\nthe English natural language:\n\n*   unit abbreviations (`tsp.`, `tbsp.`, `oz.`, `ft.`, and more)\n*   time references (`sec.`, `min.`, `tues.`, `thu.`, `feb.`, and more)\n*   business Abbreviations (`Inc.` and `Ltd.`)\n*   social titles (`Mr.`, `Mmes.`, `Sr.`, and more)\n*   rank and academic titles (`Dr.`, `Rep.`, `Gen.`, `Prof.`, `Pres.`, and more)\n*   geographical abbreviations (`Ave.`, `Blvd.`, `Ft.`, `Hwy.`, and more)\n*   American state abbreviations (`Ala.`, `Minn.`, `La.`, `Tex.`, and more)\n*   Canadian province abbreviations (`Alta.`, `Qué.`, `Yuk.`, and more)\n*   English county abbreviations (`Beds.`, `Leics.`, `Shrops.`, and more)\n*   common elision (omission of letters) (`’n’`, `’o`, `’em`, `’twas`, `’80s`,\n    and more)\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports no additional types.\n\n## Compatibility\n\nProjects maintained by me are compatible with maintained versions of Node.js.\n\nWhen I cut a new major release, I drop support for unmaintained versions of\nNode.\nThis means I try to keep the current release line, `parse-english@^7`,\ncompatible with Node.js 16.\n\n## Security\n\nThis package is safe.\n\n## Related\n\n*   [`parse-latin`](https://github.com/wooorm/parse-latin)\n    — Latin-script natural language parser\n*   [`parse-dutch`](https://github.com/wooorm/parse-dutch)\n    — Dutch natural language parser\n\n## Contribute\n\nYes please!\nSee [How to Contribute to Open Source][contribute].\n\n## License\n\n[MIT][license] © [Titus Wormer][author]\n\n<!-- Definitions -->\n\n[build-badge]: https://github.com/wooorm/parse-english/workflows/main/badge.svg\n\n[build]: https://github.com/wooorm/parse-english/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/parse-english.svg\n\n[coverage]: https://codecov.io/github/wooorm/parse-english\n\n[downloads-badge]: https://img.shields.io/npm/dm/parse-english.svg\n\n[downloads]: https://www.npmjs.com/package/parse-english\n\n[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=parse-english\n\n[size]: https://bundlejs.com/?q=parse-english\n\n[npm]: https://docs.npmjs.com/cli/install\n\n[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[esmsh]: https://esm.sh\n\n[typescript]: https://www.typescriptlang.org\n\n[contribute]: https://opensource.guide/how-to-contribute/\n\n[license]: license\n\n[author]: https://wooorm.com\n\n[retext-english]: https://github.com/retextjs/retext/tree/main/packages/retext-english\n\n[nlcst]: https://github.com/syntax-tree/nlcst\n\n[parse-latin]: https://github.com/wooorm/parse-latin\n\n[parse-dutch]: https://github.com/wooorm/parse-dutch\n\n[api-parse-english]: #parseenglish\n","publish_time":1402405125139,"_cnpm_publish_time":1402405125139,"dist-tags":{"0.1.0-rc.1":"0.1.0-rc.1","0.1.0-rc.2":"0.1.0-rc.2","0.1.0-rc.3":"0.1.0-rc.3","0.1.0-rc.4":"0.1.0-rc.4","latest":"7.0.0"}}