{"name":"parse-latin","version":"6.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","types":"index.d.ts","dependencies":{"@types/nlcst":"^1.0.0","@types/unist":"^2.0.0","nlcst-to-string":"^3.0.0","unist-util-modify-children":"^3.0.0","unist-util-visit-children":"^2.0.0","vfile":"^5.0.0"},"devDependencies":{"@types/node":"^18.0.0","@types/regenerate":"^1.0.0","@unicode/unicode-13.0.0":"^1.0.0","c8":"^7.0.0","is-hidden":"^2.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","type-coverage":"^2.0.0","typescript":"^4.0.0","unist-util-remove-position":"^4.0.0","xo":"^0.52.0"},"scripts":{"prepack":"npm run generate && npm run build && npm run format","fixture":"node script/generate-fixture.js","build":"tsc --build --clean && tsc --build && type-coverage","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 build && 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"]},"typeCoverage":{"atLeast":100,"detail":true,"strict":true},"gitHead":"ea33f09b63cb7e7844fa9f53117a669b3b2ca046","homepage":"https://github.com/wooorm/parse-latin#readme","_id":"parse-latin@6.0.0","_nodeVersion":"19.0.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-lfPvFJNYHnGpWYrmdzWddkszaH5d3j93/CBDhUts92Os46xfWVfmfbYljQ1t1094+1YhOyHAiXVZ+wkk2mmoYw==","shasum":"b1ef750c63e9a4cc1d31ad18df8b50227d1806b4","tarball":"http://registry-npm.ywwl.com/parse-latin/download/parse-latin-6.0.0.tgz","fileCount":43,"unpackedSize":68711,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDz+UG/ISY339rwRGYKrBLYOzzuXr5beOHl+mmY6JdxgQIhAPQz48zfxOsTdez8w/NifW0r8UjdlSfyluapXqibDjIi"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjbl0MACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqn1Q//R1Xnfzb9r+C3k0MBN+Nh8YGr7TZw4ImUWPE3EjPEzwL04Qmj\r\nq2ZgXt8OGfO6au8QGunU3Cv39xK+XYb/tKthFhlv8rUs+DNkJtbvytclSJ4X\r\nULpPD86ErnJhOtKbO2UvQSKyZZD/o8jNQlZbscMF1AATBBgLySduDqSYPPTV\r\npjtw1EPw3rStZg+77eOdmDNFZjOT7EYB+7lZSCiaJwD0BmbLDzKWW46VxH07\r\nbVQkdQlKUgJrPDnmdCuki8ig1Nynk9+QF2WZX99pV8bzeECusuz/RrojHY8s\r\nY3KUQxtMbLQ9JMvfM6/KJKIBNijSSA+IPklqZPPDFLnqQ0aPYSl2smEKuJoi\r\nXYclKkU9xR0TGo5t57WJESPoZAQ48G2S0eioATfEWG+Jt/lRhyqIeERJj3VX\r\nBGf7uRzjaXYzQoDzhFbqqe06+yuvXs/KLy/Wntap9vTgP4Va9fSJaeuoMtpw\r\ng/Bq/R1Ge7kGU/fSr5GkNm5vPdo42PVxGYu0XqQLOP0H+VeUV2DoM50L+5Zd\r\nTUn+0E8WOlzxT0y8LBKwOQe+wXnXoiGmq2FMIpEX6Jn8y7EL2+tfFT5XMgl6\r\no5d0OhTmr6yOLVOmv6ouih8BLDLmV7yCDxkdaIQdxrzfJJIrmxhdD2O5f+hb\r\n1IYYtHmDpE5gPJuXVFZqJFzwpBwUJUNCOkU=\r\n=3Hm6\r\n-----END PGP SIGNATURE-----\r\n","size":20106,"noattachment":false,"key":"/parse-latin/-/parse-latin-6.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_6.0.0_1668177164180_0.8446914917730382"},"_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":1668177164400,"_cnpm_publish_time":1668177164400,"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"}}