{"_id":"@digitallinguistics/concordance","_rev":"3-0fdb516f45f9244e07e53b17a5be0f45","name":"@digitallinguistics/concordance","dist-tags":{"latest":"0.4.0"},"versions":{"0.2.2":{"name":"@digitallinguistics/concordance","version":"0.2.2","description":"A Node.js library for concordancing a corpus formatted according to the Data Format for Digital Linguistis (DaFoDiL)","keywords":["corpus linguistics","linguistics","corpus","corpora","digital linguistics","DLx"],"homepage":"https://developer.digitallinguistics.io/concordance","bugs":{"url":"https://github.com/digitallinguistics/concordance/issues"},"license":"MIT","author":{"name":"Daniel W. Hieber","url":"https://danielhieber.com"},"main":"src/index.js","repository":{"type":"git","url":"git+https://github.com/digitallinguistics/concordance.git"},"bin":{"dlx-conc":"./concordance.js"},"scripts":{"test":"node concordance.js -d test -o test/concordance.tsv -k little"},"engines":{"node":">=12.0"},"publishConfig":{"access":"public"},"devDependencies":{"eslint":"^6.4.0","fs-extra":"^8.1.0"},"dependencies":{"JSONStream":"^1.3.5","commander":"^3.0.2","csv-stringify":"^5.3.3","progress":"^2.0.3","recursive-readdir":"^2.2.2"},"gitHead":"d7012a3a18c2a2bc1552e05d8f1de7d09ee9456f","_id":"@digitallinguistics/concordance@0.2.2","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-0aNULHUZ5KZLyqE15tN+WvfpqHQ/MpSkLEyll6EjiZucbK1Xd8GfDHDDGwgnhlVPHQaNQP0QRPnP2ROZZ3o7rQ==","shasum":"77a022f2a08cdecefd4c77f5141a0f6f23df7135","tarball":"https://registry.npmjs.org/@digitallinguistics/concordance/-/concordance-0.2.2.tgz","fileCount":13,"unpackedSize":50325,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdkPNbCRA9TVsSAnZWagAATNcP/3voztkLU8JgN4asaKA0\n+gaTilOo9SPWYMzHp1i3tYFCL2CpH/Mh9vVLSWObcff/Plw5iYq1CBZ3m/KU\nHrVa6BZjRl4G14/HFZdK2wtWHyaxqPaBCfDQLmXkxvuHUrNdjO3hJwdBbAPP\nihjegPc6YUlhcEtLbNWRTo58HMVubu1MzkPwRi3fSECBpGP9LuUJ9sck90se\ndOkO+y723526c2hlPslNlE8ij8p2mM5bPYFrtvZeWnvyMOQcGegArd/bsZPO\njftRB9rZ13yuYfDPruzZcPVLDCN0EHTxSwsEL5h8hkbtxTRClUIdYrV9J6iV\nEryU/etu2jW1Haf12OaDaWaE+JYoaNQDgJXriCpg9RG4aAQ8u0itB07VZKxI\nMqejht6oP1QsKFGhSenpfUndlvp9F7F6YMNMAGci/M9fgAy9BiAir4n2lkEH\nVpYTp2giLDUZOCcriQkdBvP/gyLvc8TbLR0Y1VbtkRqIdVUODjvQDXUEeO8S\nVuBz1EpEem5bz7j47YgXY/8+4rcncewEk3KRWwq3kEqNIi1MGkD2P1dO+FdU\nAVZvZxK73ireMIZ7BLeivAZC25kmC7BQe9H9uFG4WZ+BSSAd2Q5ZDbVmjqdZ\nsyVumNRHsea77naoDW2I+Gx1SxuV6GxJxnkXEPQO103ceJTnPNohhxfLgG6o\nxD3i\r\n=aFOs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDh3p7Jmalq85690GcovB7jUQvImgKB1iXNTEQODvGiOAiAtYSZ1mnkKYUxFH6izBqDaggmvwVHxd9hFk6CXB61K6g=="}]},"maintainers":[{"name":"dwhieb","email":"dwhieb@gmail.com"}],"_npmUser":{"name":"dwhieb","email":"dwhieb@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/concordance_0.2.2_1569780570446_0.12198398049344839"},"_hasShrinkwrap":false},"0.3.0":{"name":"@digitallinguistics/concordance","version":"0.3.0","description":"A Node.js library for concordancing a corpus formatted according to the Data Format for Digital Linguistis (DaFoDiL)","keywords":["corpus linguistics","linguistics","corpus","corpora","digital linguistics","DLx"],"homepage":"https://developer.digitallinguistics.io/concordance","bugs":{"url":"https://github.com/digitallinguistics/concordance/issues"},"license":"MIT","author":{"name":"Daniel W. Hieber","url":"https://danielhieber.com"},"main":"src/index.js","repository":{"type":"git","url":"git+https://github.com/digitallinguistics/concordance.git"},"bin":{"dlx-conc":"./concordance.js"},"scripts":{"test":"node concordance.js -d test -o test/concordance.tsv -k --wordlist=test/wordlist.json"},"engines":{"node":">=12.0"},"publishConfig":{"access":"public"},"devDependencies":{"eslint":"^6.4.0"},"dependencies":{"JSONStream":"^1.3.5","commander":"^3.0.2","csv-stringify":"^5.3.3","fs-extra":"^8.1.0","progress":"^2.0.3","recursive-readdir":"^2.2.2"},"gitHead":"853ea2db345f3e9e57d7f04aa10a066ba29b2781","_id":"@digitallinguistics/concordance@0.3.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-i28F7yYAR9XLxev5jjkO36T2STMUIehiMXdyTBp06OVSw0//vr3kU3QpvC9WND4dWg2gCPLhmC5/6J7ozMB2qw==","shasum":"4526a713482990874b1550f6599757fb4f8a3a59","tarball":"https://registry.npmjs.org/@digitallinguistics/concordance/-/concordance-0.3.0.tgz","fileCount":14,"unpackedSize":50991,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdkVhoCRA9TVsSAnZWagAAZtwP/A0YkelgQUO8HrCNtNXI\n03evDy6hs+PkzVtxZTN0sfC3Pxy+EWXm71b9W6nUth3Tve2Y9lOqmdsd9BPM\nzWmlC8he8ooh1+IRDyb/V9E3pNEm7IVbQgZh9KiifRyR2JuXFQCt/9LJY2OP\nv+rOVWZOs0RD48XeQ+gIrrCgQ8DM21TP0lO2gK8clrDMrNltyxQ7jJWDJM8+\nBqlem+pJTvq9zevWtXjea/ShTg2gpf3b3sP0hCMUWtxmOjoJno4akzko9eLE\noBxcmi438L3AHWzX++t5Z816orppdTuiXmYvRVIL9+Z66nycNQ5kzCQENQGr\n7mjenGwma3P8OfL945QDo274UmLPkCsUDKFL0G9Uzt+IRvnflc3LrT3EkaMc\nK89ei71eitBsH7Gp62zFam8Nk14070iYRnMsRKyHHKnqnOGjeFRvy2eimhN7\nzrUKv0iJ6A6gL3R5LdL6Cp1J2EMZO2yqJwggzCuDFAQ94oOQ7FVHD6SztUCT\nmYo380FMnufTvmVDODX9HS2UjdtCnW1qSlwgj6Id+PQ28VLH0dyw7+O0p/SE\nolzAein6U7KlsfixQGdQZYOKps1XK6+UxSkYODIiEhNcd1viFblnRqnh6Io3\nWxs4ovfnnYCTOJjNFI8rMRgS5nt8j+pemtL2Z4Z+zGvHbWiWxDACw1La226x\nWO3Q\r\n=jRqp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCnqEzChAdBWCao5DgI7gkwctRDg41WxwcPXTwTP3rSJwIhALwVoOvRE1dh3ty/p28IRY8wNYdjBXmGzvxcSj+a2g1k"}]},"maintainers":[{"name":"dwhieb","email":"dwhieb@gmail.com"}],"_npmUser":{"name":"dwhieb","email":"dwhieb@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/concordance_0.3.0_1569806440062_0.5447193229997365"},"_hasShrinkwrap":false},"0.4.0":{"name":"@digitallinguistics/concordance","version":"0.4.0","description":"A Node.js library for concordancing a corpus formatted according to the Data Format for Digital Linguistis (DaFoDiL)","keywords":["corpus linguistics","linguistics","corpus","corpora","digital linguistics","DLx"],"homepage":"https://developer.digitallinguistics.io/concordance","bugs":{"url":"https://github.com/digitallinguistics/concordance/issues"},"license":"MIT","author":{"name":"Daniel W. Hieber","url":"https://danielhieber.com"},"main":"src/index.js","repository":{"type":"git","url":"git+https://github.com/digitallinguistics/concordance.git"},"bin":{"dlx-conc":"./concordance.js"},"scripts":{"test":"node concordance.js -d test -o test/concordance.tsv -c 5 -k --wordlist=test/wordlist.json"},"engines":{"node":">=12.0"},"publishConfig":{"access":"public"},"devDependencies":{"eslint":"^6.4.0"},"dependencies":{"JSONStream":"^1.3.5","commander":"^3.0.2","csv-stringify":"^5.3.3","fs-extra":"^8.1.0","progress":"^2.0.3","recursive-readdir":"^2.2.2"},"gitHead":"f640d563620eda32d9a9b1f49da64ab377312e6c","_id":"@digitallinguistics/concordance@0.4.0","_nodeVersion":"10.16.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-IjG9WXlIc9dWwRDNx9/s5G52c66Kj+P29ud6FZa45k0x9HkvmJNZn3SIU8TxLtxtdc/gMYG3McQCnyGaoVzkNA==","shasum":"77a70f104234fe376705edb4f138f51c248b8806","tarball":"https://registry.npmjs.org/@digitallinguistics/concordance/-/concordance-0.4.0.tgz","fileCount":14,"unpackedSize":51356,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdkmEbCRA9TVsSAnZWagAATj8P/A9Xv4Y3d0+GmZHuGwd6\nxkGSa7TsZwPktr6go1PBAW1/DwCgv6Ax0qdYfwsMCyox+Ar9Uo1+SDGhas6V\n3GdVpaMP/oKnagU5tk1h1dOWNAkkJE+ADsXOp8nH26H9JYk7BaqvdtDRNEPW\nOi9LpM8c+5mg042NTY6XYcDnubrqCiRQZ3dfcKovLAeveVnDmM6TQmV8X0Ny\nwTIzi8xbQSqMsJdv23UTJBGzfBwd8KaZOlbPYpzoxWou+2BKVavvlhsPhvsK\neLlXfayQAxXMCt98V4NX+ilBjTWRGWPa5zb5H5J3OsROV13pifdgNprSYRTT\nfJXNDKbKrxjORznPRnuYPesdjLFyLueOkZjDVotG6oy6AuyOhhGw7OJbKoUA\nRl7xjtYdW6tqWuN/rmXXShdeYRrC9IAFefBUI3azyjR2JF3o51gG7LrxbWgR\nxDOby8mozrulwvR+C0fQz84tyhdwPMG4JC0DqeTEPL0GIBfp9oXIzD3wi5Hb\nNLOSBvwFQvG6mLn6sa3EKLdvZdZ9z92YS6gZZ2xx/iDmmnvPVuU10toZLy2J\nZVpfuuxN62OHfIAOR3lavtrZAkAnhCL8eRwwpw5JpSxUBOlHPPLysTOOw0JG\n9c/CCYYoMROUkSc8izCO8yv907LJVBQuQPhMkP0dgZny4XYMgbU2V7wVloBm\ntwY3\r\n=EZz1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJHhHfMNve7XzvL4Qq68aBeyHHUc8WSGId3k6JBjXbDQIgarRT4CrnIQmSSd+/711gx7DmThEuQiRFA21PNcZafR0="}]},"maintainers":[{"name":"dwhieb","email":"dwhieb@gmail.com"}],"_npmUser":{"name":"dwhieb","email":"dwhieb@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/concordance_0.4.0_1569874203094_0.19925307280161064"},"_hasShrinkwrap":false}},"time":{"created":"2019-09-29T18:09:30.342Z","0.2.2":"2019-09-29T18:09:30.604Z","modified":"2022-04-05T04:37:40.559Z","0.3.0":"2019-09-30T01:20:40.230Z","0.4.0":"2019-09-30T20:10:03.274Z"},"maintainers":[{"name":"dwhieb","email":"dwhieb@gmail.com"}],"description":"A Node.js library for concordancing a corpus formatted according to the Data Format for Digital Linguistis (DaFoDiL)","homepage":"https://developer.digitallinguistics.io/concordance","keywords":["corpus linguistics","linguistics","corpus","corpora","digital linguistics","DLx"],"repository":{"type":"git","url":"git+https://github.com/digitallinguistics/concordance.git"},"author":{"name":"Daniel W. Hieber","url":"https://danielhieber.com"},"bugs":{"url":"https://github.com/digitallinguistics/concordance/issues"},"license":"MIT","readme":"# Concordance\n\n[![GitHub releases](https://img.shields.io/github/v/release/digitallinguistics/concordance)][releases]\n[![status](https://github.com/digitallinguistics/concordance/workflows/tests/badge.svg)][actions]\n[![issues](https://img.shields.io/github/issues/digitallinguistics/concordance)][issues]\n[![npm downloads](https://img.shields.io/npm/dt/digitallinguistics/concordance)][npm]\n[![DOI](https://zenodo.org/badge/210680113.svg)][Zenodo]\n[![license](https://img.shields.io/github/license/digitallinguistics/concordance)][license]\n[![GitHub stars](https://img.shields.io/github/stars/digitallinguistics/concordance?style=social)][GitHub]\n\nThe Digital Linguistics (DLx) Concordance library is a Node.js library for creating a concordance of words in a [corpus][corpus] (a collection of texts in a language) which is formatted according to the [Data Format for Digital Linguistics][DaFoDiL] (<abbr title='Data Format for Digital Linguistics'>DaFoDiL</abbr>) (a JSON-based format). It is useful for anybody doing research involving linguistic corpora. If your data are not yet in DaFoDiL format, there are several converters available [here][converters].\n\nThis library produces a tab-delimited file containing information about each token (instance) of the words specified. By default, the concordance is generated in <dfn>Keyword in Context</dfn> (<abbr>KWIC</abbr>) format, where the word is listed along with the immediately preceding and following context. An example of a partial concordance of the word _little_ in _The Three Little Pigs_ is shown in KWIC format below.\n\ntext | utterance | word |                        pre | token  | post                     |\n---- | --------- | ---- | -------------------------: | :----: | ------------------------ |\n3LP  | 1         | 14   | mother pig who had three   | little | pigs and not enough food |\n3LP  | 3         | 3    | The first                  | little | pig was very lazy.       |\n3LP  | 5         | 3    | The second                 | little | pig worked a little bit  |\n3LP  | 5         | 7    | second little pig worked a | little | bit harder but he was    |\n3LP  | 7         | 3    | The third                  | little | pig worked hard all day  |\n\n**NOTE:** _This project is still in initial development phases, but should be ready for initial release by the end of September 2019._\n\n## Basic Usage\n\nThis following examples process any JSON files in the current directory and output a concordance file to `concordance.tsv` in Keyword in Context format. At a minimum, the concordance function requires a single argument: a wordform or list of wordforms to concordance.\n\nAs a module:\n\n```js\nconst concordance = require(`concordance`)\n\nconst wordforms = [`little`, `big`];\n\nconcordance({ wordforms });\n```\n\nOn the command line:\n\n```cmd\ndlx-conc -k --wordforms=little,big\n```\n\n**Note:** The Keyword in Context format is _not_ enabled by default. It must be enabled by passing the `-k` or `--kwic` flag.\n\n## Options\n\nThe available options are listed below.\n\nModule       | Command Line       | Default             | Description\n------------ | ------------------ | ------------------- | -----------\n`context`    | `-c, --context`    | `10`                | the number of words to show to either side of the token (if the `KWIC` option is set to `true`)\n`dir`        | `-d, --dir`        | `\".\"`               | the directory where the corpus is located\n`KWIC`       | `-k, --KWIC`       | `false`             | whether to create the concordance in Keyword in Context format; adds `pre` and `post` columns to the concordance if true\n`outputPath` | `-o, --outputPath` | `\"concordance.tsv\"` | path where the concordance file should be generated\n`wordforms`  | `-w, --wordforms`  | `[]`                | a string or list of strings of words to concordance (formatted as an array when using as a module, and as a comma-separated list when using on the command line)\n`wordlist`   | `-l, --wordlist`   | `undefined`         | path to a file containing a JSON array of words to concordance\n\n## Contributing\n\n[Report an issue or suggest a feature here.][issues]\n\nPull requests are very welcome. Please make sure you've [opened and issue][issues] for your change first.\n\nNo test suite was written for this library, but you can test the results with `npm test`. A test concordance will be generated at `test/concordance.tsv`.\n\n## About\n\nThis library is authored and maintained by [Daniel W. Hieber][me]. Please consider citing this library following the model below:\n\n> Hieber, Daniel W. 2019. digitallinguistics/concordance. DOI:[10.5281/zenodo.3464144][Zenodo]\n\n[actions]:    https://github.com/digitallinguistics/concordance/actions\n[converters]: https://developer.digitallinguistics.io/#converters\n[corpus]:     https://en.wikipedia.org/wiki/Text_corpus\n[DaFoDiL]:    https://format.digitallinguistics.io/\n[GitHub]:     https://github.com/digitallinguistics/concordance\n[issues]:     https://github.com/digitallinguistics/concordance/issues\n[Jasmine]:    https://jasmine.github.io/\n[license]:    https://github.com/digitallinguistics/concordance/blob/master/LICENSE.md\n[me]:         https://danielhieber.com/\n[npm]:        https://www.npmjs.com/package/@digitallinguistics/concordance\n[releases]:   https://github.com/digitallinguistics/concordance/releases\n[Zenodo]:     https://zenodo.org/badge/latestdoi/210680113\n","readmeFilename":"README.md"}