{"name":"parse-latin","version":"4.1.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"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"http://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"http://wooorm.com"}],"files":["lib","index.js"],"dependencies":{"nlcst-to-string":"^2.0.0","unist-util-modify-children":"^1.0.0","unist-util-visit-children":"^1.0.0"},"devDependencies":{"browserify":"^14.0.0","bundle-collapser":"^1.2.1","esmangle":"^1.0.1","is-hidden":"^1.0.1","negate":"^1.0.0","nlcst-test":"^1.0.0","nyc":"^11.0.0","regenerate":"^1.3.1","remark-cli":"^4.0.0","remark-preset-wooorm":"^3.0.0","tape":"^4.0.0","unicode-8.0.0":"^0.7.0","unist-util-remove-position":"^1.1.0","vfile":"^2.0.0","xo":"^0.18.0"},"scripts":{"build-md":"remark . -qfo","build-expressions":"node script/build-expressions","build-bundle":"browserify index.js -p bundle-collapser/plugin --bare -s ParseLatin > parse-latin.js","build-mangle":"esmangle parse-latin.js > parse-latin.min.js","build":"npm run build-expressions && npm run build-md && npm run build-bundle && npm run build-mangle","lint":"xo","test-api":"node test/index.js","test-coverage":"nyc --reporter lcov tape test/index.js","test":"npm run build && npm run lint && npm run test-coverage"},"nyc":{"check-coverage":true,"lines":100,"functions":100,"branches":100},"xo":{"space":true,"esnext":false,"rules":{"no-useless-escape":"off","guard-for-in":"off","max-depth":"off"},"ignores":["parse-latin.js"]},"remarkConfig":{"plugins":["preset-wooorm"]},"gitHead":"c7fcf58db8206d8bf3d5cdce2e23932ca363a587","homepage":"https://github.com/wooorm/parse-latin#readme","_id":"parse-latin@4.1.0","_npmVersion":"5.0.0","_nodeVersion":"8.0.0","_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"dist":{"integrity":"sha512-mLNys0aA6v2bt4+/dmM5F7tRrLZ45Wg19++xr8iCo813NdurhIAiZpcXwvb086DvVGwSkcGUmz+AkbthMVVNyg==","shasum":"f560d46cab1cf04d632815443485a8b3b31e31a7","tarball":"http://registry-npm.ywwl.com/parse-latin/download/parse-latin-4.1.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHhfOob9HRsefjKPyBkmqkxPOaAgD7j29qZoeXVrpjy9AiBdEanXLhorCRfrr+qm8rh54JAKFNTLDKqaGiBYy6ZsIg=="}],"size":19644,"noattachment":false,"key":"/parse-latin/-/parse-latin-4.1.0.tgz"},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/parse-latin-4.1.0.tgz_1502384279238_0.6855662278831005"},"directories":{},"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":1502384280119,"_cnpm_publish_time":1502384280119,"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"}}