{"name":"parse-english","version":"5.0.0","description":"English natural language parser","license":"MIT","keywords":["nlcst","english","natural","language","parser"],"repository":{"type":"git","url":"git+https://github.com/wooorm/parse-english.git"},"bugs":{"url":"https://github.com/wooorm/parse-english/issues"},"funding":{"type":"github","url":"https://github.com/sponsors/wooorm"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"sideEffects":false,"type":"module","main":"index.js","dependencies":{"nlcst-to-string":"^2.0.0","parse-latin":"^5.0.0","unist-util-modify-children":"^2.0.0","unist-util-visit-children":"^1.0.0"},"devDependencies":{"c8":"^7.0.0","is-hidden":"^2.0.0","nlcst-test":"^2.0.0","prettier":"^2.0.0","remark-cli":"^9.0.0","remark-preset-wooorm":"^8.0.0","tape":"^5.0.0","unist-util-remove-position":"^3.0.0","vfile":"^4.0.0","xo":"^0.38.0"},"scripts":{"format":"remark . -qfo && prettier . -w --loglevel warn && xo --fix","test-api":"node test/index.js","test-coverage":"c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov node test/index.js","test":"npm run format && npm run test-coverage"},"prettier":{"tabWidth":2,"useTabs":false,"singleQuote":true,"bracketSpacing":false,"semi":false,"trailingComma":"none"},"xo":{"prettier":true,"rules":{"complexity":"off","max-depth":"off","no-var":"off","prefer-arrow-callback":"off","unicorn/no-array-for-each":"off"}},"remarkConfig":{"plugins":["preset-wooorm"]},"gitHead":"9829baa7b1c71965ac6d3945eb36419d59eb280b","homepage":"https://github.com/wooorm/parse-english#readme","_id":"parse-english@5.0.0","_nodeVersion":"15.11.0","_npmVersion":"7.6.2","dist":{"integrity":"sha512-sMe/JmsY6g21aJCAm8KgCH90a9zCZ7aGSriSJ5B0CcGEsDN7YmiCk3+1iKPE1heDG6zYY4Xf++V8llWtCvNBSQ==","shasum":"baea1a4d2cba9fde9e49f51ea5b5f95df9d3f6b4","tarball":"http://registry-npm.ywwl.com/parse-english/download/parse-english-5.0.0.tgz","fileCount":4,"unpackedSize":17533,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgZYdrCRA9TVsSAnZWagAA/HAP/2RqOP0+b6uRi4k8ol0h\nxJuMakw0JiHE7+WeECrIUSn3FWK/B1xFHuKMjJ5hSE7J9Em++OSsVfQYXlvB\nj6tcQLg2ghiwduMHFRnPJdPcCB2Vbil+fxie4SY3vtizu84+d2tOjgL92+h6\nhB96GdQ3Hg+r1ouRMWpUKpDg292MfHRdekzu6+orms0TpRozO1N8ioVOmuLg\nys/2UKkaoSXKCza+RIQq2Ku22TOU2Y1a+SWpHOqyLZaEpDnZqzvcETW/Z7mv\nGAnGU/pmq5OwkfVLn3g1ZzK9FFEqXiE3C6AxBoxfHil/bjy3xeyIyzhHW+GE\nf0nrLSfcFC235VEekKRTtKKekjcjtfQkNXKGL8zDEb/e8thPKGrlCJ6PLx++\n96/cPxfoHfdnazjNuZnLGFZA06ffh6/cW7TFgctcbWtHqLJhBbjsCgcq2aZz\n2tqrdArSSk1eInBZXp0seMAGosXyB//lVCH+x/6LeNOHznBBnyhL7US8TKzy\nALGu8dp08kdb6dYTcOSTWRL453zvwoMJOdqBF+yso2wp1d3QUir17egpRemd\n9OnHAOJzhhyqkNbcAVbZjRGAhiLYKJM3ivq6tj1u+rIJDVuDBo0CW4q2/E6A\noXIKyHqLG0BgrUPu81Bt70cL0/33eoIH+32XXq0eZAyG4ZG5PZyvwt6lRIOe\nGaa3\r\n=cZNu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE4VDfuit64173LJSTrsdDsjw1qjPKyMgETBHP63XqL9AiAdDNPEiaRYnqmAgrAoWvfaEcprnoHJnFurqBy+1AxJ7w=="}],"size":6624,"noattachment":false,"key":"/parse-english/-/parse-english-5.0.0.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/parse-english_5.0.0_1617266538945_0.5469982073475186"},"_hasShrinkwrap":false,"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":1617266539159,"_cnpm_publish_time":1617266539159,"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"}}