{"name":"parse-latin","version":"5.0.0","description":"Latin-script (natural language) parser","license":"MIT","keywords":["nlcst","latin","script","natural","language","parser"],"repository":{"type":"git","url":"git+https://github.com/wooorm/parse-latin.git"},"bugs":{"url":"https://github.com/wooorm/parse-latin/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","unist-util-modify-children":"^2.0.0","unist-util-visit-children":"^1.0.0"},"devDependencies":{"@unicode/unicode-13.0.0":"^1.0.0","c8":"^7.0.0","is-hidden":"^2.0.0","negate":"^1.0.0","nlcst-test":"^2.0.0","nyc":"^15.0.0","prettier":"^2.0.0","regenerate":"^1.0.0","remark-cli":"^9.0.0","remark-preset-wooorm":"^8.0.0","tape":"^5.0.0","tinyify":"^3.0.0","unist-util-remove-position":"^3.0.0","vfile":"^4.0.0","xo":"^0.38.0"},"scripts":{"generate":"node script/build-expressions","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 generate && npm run format && npm run test-coverage"},"prettier":{"tabWidth":2,"useTabs":false,"singleQuote":true,"bracketSpacing":false,"semi":false,"trailingComma":"none"},"xo":{"prettier":true,"rules":{"import/no-mutable-exports":"off","max-depth":"off","no-var":"off","no-misleading-character-class":"off","prefer-arrow-callback":"off","unicorn/no-array-for-each":"off","unicorn/no-this-assignment":"off","unicorn/prefer-reflect-apply":"off"}},"remarkConfig":{"plugins":["preset-wooorm"]},"gitHead":"0ee7c5e945671020d040ec7e31f90ad106db9db1","homepage":"https://github.com/wooorm/parse-latin#readme","_id":"parse-latin@5.0.0","_nodeVersion":"15.11.0","_npmVersion":"7.6.2","dist":{"integrity":"sha512-Ht+4/+AUySMS5HKGAiQpBmkFsHSoGrj6Y83flLCa5OIBdtsVkO3UD4OtboJ0O0vZiOznH02x8qlwg9KLUVXuNg==","shasum":"a1963445f59fb9cfa3cb1ddf5f839bfeb0ee4b42","tarball":"http://registry-npm.ywwl.com/parse-latin/download/parse-latin-5.0.0.tgz","fileCount":26,"unpackedSize":62028,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgYw2nCRA9TVsSAnZWagAAQHQP/2PzGQq85ZvBYYJ/NvnM\n/+y605k9Ctp7ZZlK66cMNQnGHEbZgzJXSdeg/OUIJMepKuGxxk5C+kiaoD6f\nzeNNcdATaRhyC7jHd00ZSolFlbL8tTEyyQDdJOvfoUKcYAta0gB9M8xEfDbW\nhlNZu/JLbL/huzIL9EEXf6G1kUmA0foXXTHQxrXGSd3PRKFPZ8mUYLlLXJAb\n2vPPEgnEvVdqD6a5QdeUY1pSIENgkwiiweNHN9hjTdQwwkaheMt9/gYz/q4Y\nubnwWa/A4fu7IK0z3Q3tyfJnSrJnBF+/MFdYLrbN/dSi+NDwhKHLQo0gOqFI\n6cMGOE3Y1qkvCZ4oeWgjGKghOck5OsVoK8uNLRIGReM1d60P7PD8V3fPVsXx\noZzjGAgRZp4CMARfPKDJW3zMxF3Z83EqSWzD7LGdJouGFFyTgbxlHFzJtefK\nx5OLBsfYbJ+B+K0UBVE6k6PdDyauKKlEQSdQi+1lFfohmJbHI6DTxNQwn3S7\nkcHHaXgWPC1nY+SXGb+erRsl5Gc+/vkvFp6IoYoDwo2Iecppl64H+rXo0EBQ\nlG6Ta1LIi+oRtmkGS7DxmYkpvWRM7DABGWkEWEASzHYD2+eoNus0xbH8Ak1l\nd+taaRCDt+ByEiqwvDgovWqv6QOGM4hFMyQIQVtMTuai1YQbVErrZhnBo4P4\nDerh\r\n=LT+T\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGZQ6Z4XCtlqBvLKrrIyiwkE9IrU4vHYEwybv0l/9QEWAiBSvYXykQoY8PLWUmCs8xaSW7TudZFE6x6Q3sJcqmygbg=="}],"size":20243,"noattachment":false,"key":"/parse-latin/-/parse-latin-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-latin_5.0.0_1617104294763_0.33324117411148024"},"_hasShrinkwrap":false,"readme":"# parse-latin\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 Latin-script languages, 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    *   [`ParseLatin()`](#parselatin)\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 Latin-script natural language and\nproduces a syntax tree.\n\n## When should I use this?\n\nIf you want to handle natural language as syntax trees manually, use this.\n\nAlternatively, you can use the retext plugin [`retext-latin`][retext-latin],\nwhich wraps this project to also parse natural language at a higher-level\n(easier) abstraction.\n\nWhether Old-English (“þā gewearþ þǣm hlāforde and þǣm hȳrigmannum wiþ ānum\npenninge”), Icelandic (“Hvað er að frétta”), French (“Où sont les toilettes?”),\nthis project does a good job at tokenizing it.\n\nFor English and Dutch, you can instead use [`parse-english`][parse-english] and\n[`parse-dutch`][parse-dutch].\n\nYou can somewhat use this for Latin-like scripts, such as Cyrillic (“привет”),\nGeorgian (“გამარჯობა”), Armenian (“Բարեւ”), and such.\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 16+), install with [npm][]:\n\n```sh\nnpm install parse-latin\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport {ParseLatin} from 'https://esm.sh/parse-latin@7'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n<script type=\"module\">\n  import {ParseLatin} from 'https://esm.sh/parse-latin@7?bundle'\n</script>\n```\n\n## Use\n\n```js\nimport {ParseLatin} from 'parse-latin'\nimport {inspect} from 'unist-util-inspect'\n\nconst tree = new ParseLatin().parse('A simple sentence.')\n\nconsole.log(inspect(tree))\n```\n\nYields:\n\n```txt\nRootNode[1] (1:1-1:19, 0-18)\n└─0 ParagraphNode[1] (1:1-1:19, 0-18)\n    └─0 SentenceNode[6] (1:1-1:19, 0-18)\n        ├─0 WordNode[1] (1:1-1:2, 0-1)\n        │   └─0 TextNode \"A\" (1:1-1:2, 0-1)\n        ├─1 WhiteSpaceNode \" \" (1:2-1:3, 1-2)\n        ├─2 WordNode[1] (1:3-1:9, 2-8)\n        │   └─0 TextNode \"simple\" (1:3-1:9, 2-8)\n        ├─3 WhiteSpaceNode \" \" (1:9-1:10, 8-9)\n        ├─4 WordNode[1] (1:10-1:18, 9-17)\n        │   └─0 TextNode \"sentence\" (1:10-1:18, 9-17)\n        └─5 PunctuationNode \".\" (1:18-1:19, 17-18)\n```\n\n## API\n\nThis package exports the identifier [`ParseLatin`][api-parse-latin].\nThere is no default export.\n\n### `ParseLatin()`\n\nCreate a new parser.\n\n#### `ParseLatin#parse(value)`\n\nTurn natural language into a syntax tree.\n\n###### Parameters\n\n*   `value` (`string`, optional)\n    — value to parse\n\n###### Returns\n\nTree ([`RootNode`][root]).\n\n## Algorithm\n\n> 👉 **Note**:\n> The easiest way to see how `parse-latin` parses, is by using the\n> [online parser demo][demo], which shows the syntax tree corresponding to\n> the typed text.\n\n`parse-latin` splits text into white space, punctuation, symbol, and word\ntokens:\n\n*   “word” is one or more unicode letters or numbers\n*   “white space” is one or more unicode white space characters\n*   “punctuation” is one or more unicode punctuation characters\n*   “symbol” is one or more of anything else\n\nThen, it manipulates and merges those tokens into a syntax tree, adding\nsentences and paragraphs where needed.\n\n*   some punctuation marks are part of the word they occur in, such as\n    `non-profit`, `she’s`, `G.I.`, `11:00`, `N/A`, `&c`, `nineteenth- and…`\n*   some periods do not mark a sentence end, such as `1.`, `e.g.`, `id.`\n*   although periods, question marks, and exclamation marks (sometimes) end a\n    sentence, that end might not occur directly after the mark, such as `.)`,\n    `.\"`\n*   …and many more exceptions\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-latin@^7`, compatible\nwith Node.js 16.\n\n## Security\n\nThis package is safe.\n\n## Related\n\n*   [`parse-english`](https://github.com/wooorm/parse-english)\n    — English (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-latin/workflows/main/badge.svg\n\n[build]: https://github.com/wooorm/parse-latin/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/parse-latin.svg\n\n[coverage]: https://codecov.io/github/wooorm/parse-latin\n\n[downloads-badge]: https://img.shields.io/npm/dm/parse-latin.svg\n\n[downloads]: https://www.npmjs.com/package/parse-latin\n\n[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=parse-latin\n\n[size]: https://bundlejs.com/?q=parse-latin\n\n[npm]: https://docs.npmjs.com/cli/install\n\n[demo]: https://wooorm.com/parse-latin/\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[nlcst]: https://github.com/syntax-tree/nlcst\n\n[root]: https://github.com/syntax-tree/nlcst#root\n\n[retext-latin]: https://github.com/retextjs/retext/tree/main/packages/retext-latin\n\n[parse-english]: https://github.com/wooorm/parse-english\n\n[parse-dutch]: https://github.com/wooorm/parse-dutch\n\n[api-parse-latin]: #parselatin\n","publish_time":1617104294920,"_cnpm_publish_time":1617104294920,"dist-tags":{"0.1.0-rc.3":"0.1.0-rc.3","0.1.0-rc.4":"0.1.0-rc.4","latest":"7.0.0","next":"0.4.0-rc.1"}}