{"name":"parse-latin","version":"5.0.1","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":"^3.0.0","unist-util-modify-children":"^3.0.0","unist-util-visit-children":"^2.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":"^3.0.0","nyc":"^15.0.0","prettier":"^2.0.0","regenerate":"^1.0.0","remark-cli":"^11.0.0","remark-preset-wooorm":"^9.0.0","unist-util-remove-position":"^4.0.0","vfile":"^5.0.0","xo":"^0.52.0"},"scripts":{"prepack":"npm run generate && npm run format","fixture":"node script/generate-fixture.js","generate":"node script/build-expressions.js","format":"remark . -qfo && prettier . -w --loglevel warn && xo --fix","test-api":"node --conditions development test/index.js","test-coverage":"c8 --check-coverage --100 --reporter lcov npm run test-api","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":{"max-depth":"off","no-misleading-character-class":"off"}},"remarkConfig":{"plugins":["preset-wooorm"]},"gitHead":"467065b0425ea937b743829ed0eabd2b60753ecb","homepage":"https://github.com/wooorm/parse-latin#readme","_id":"parse-latin@5.0.1","_nodeVersion":"19.0.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-b/K8ExXaWC9t34kKeDV8kGXBkXZ1HCSAZRYE7HR14eA1GlXX5L8iWhs8USJNhQU9q5ci413jCKF0gOyovvyRBg==","shasum":"f3b4fac54d06f6a0501cf8b8ecfafa4cbb4f2f47","tarball":"http://registry-npm.ywwl.com/parse-latin/download/parse-latin-5.0.1.tgz","fileCount":26,"unpackedSize":61430,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBzfaQ6o7LBPbVSLrFgeQFUv92pm63RC/AlOvgeDX317AiBrWLZELeLiE10rMKqvxhmQVPZCpyIuhoiduhK6vcD1FQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjbOWtACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrj4Q/+JOidfeZtrivQfllXkQCJBuR7fymFWp+8TWgpRWZ/h7M7Hc5L\r\nH+3mBFfAtLU40TMsrCnXvYsxNMthCu4zsN7KTNNukiX7ohiGfyczLNjeAoG0\r\ntbYdv7aVxU4jE+n0VuXKdOlVhWnsaIlfzf0RtkdMh4PHi8Sf3UvDsRzftEbr\r\n2ctsahxo+q/5o7abQ8PZbmGxYNsMvtJVkX1vG4PGaJ/eTAj4b02qTH0/0E9k\r\n7GH7iy8oz2AAdvQgSJxbfB7nwigWz/A5fjZcoA8+ur44d/4AiQ6qBf4V0AHN\r\nj3atsTDlpvCEbHr84aVeV+BErtbX6KXJGujcDpbV4pI/w3vbiR0Kg6ocbJVY\r\nchGrMMkDNPpcgzUY46MtuGPbMi6BWi90X4rPs4QgknsZQBJIz9AiSABkrqBr\r\nnlGFkhNsym/f9AWzkU69BWY4fQxQ5zk6IUOHoI2zJoi/5KNrJ0LRVgSip5Hi\r\ns5nyfu3NFOQu6oDFHjPCzEyPKwaZ/0ub5sgv+N6kCFgiNchltBJ96HbgGTfb\r\nY8BaatZnaEEPgA7uULVBufMah1mNGcROmhznTKxV0BqD7DsP0jn0E5+xHfXf\r\nA986UCNxp9Nq9TdfxshziVDzA7Nxr8r67TUz+2CpVyL024lk/rgQ+v6HK/jv\r\nrRsqdxwKUlVuXlbOd8sE47Gr2Ni1/eGy/28=\r\n=dbAa\r\n-----END PGP SIGNATURE-----\r\n","size":19766,"noattachment":false,"key":"/parse-latin/-/parse-latin-5.0.1.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.1_1668081069606_0.7140162548319875"},"_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":1668081069791,"_cnpm_publish_time":1668081069791,"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"}}