{"id":22025861,"url":"https://github.com/digitallinguistics/word-aligner","last_synced_at":"2026-02-09T12:36:20.152Z","repository":{"id":49621402,"uuid":"277561856","full_name":"digitallinguistics/word-aligner","owner":"digitallinguistics","description":"A small JavaScript utility for vertically aligning interlinear glosses","archived":false,"fork":false,"pushed_at":"2021-06-12T00:02:48.000Z","size":247,"stargazers_count":3,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-17T22:07:39.536Z","etag":null,"topics":["corpus-linguistics","digital-humanities","digital-linguistics","dlx","glossing","interlinear","interlinear-gloss","linguistics"],"latest_commit_sha":null,"homepage":"https://developer.digitallinguistics.io/word-aligner/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/digitallinguistics.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-06T14:18:27.000Z","updated_at":"2021-09-11T04:54:47.000Z","dependencies_parsed_at":"2022-09-26T17:01:33.969Z","dependency_job_id":null,"html_url":"https://github.com/digitallinguistics/word-aligner","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitallinguistics%2Fword-aligner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitallinguistics%2Fword-aligner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitallinguistics%2Fword-aligner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/digitallinguistics%2Fword-aligner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/digitallinguistics","download_url":"https://codeload.github.com/digitallinguistics/word-aligner/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245090876,"owners_count":20559298,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["corpus-linguistics","digital-humanities","digital-linguistics","dlx","glossing","interlinear","interlinear-gloss","linguistics"],"created_at":"2024-11-30T07:20:14.504Z","updated_at":"2026-02-09T12:36:20.081Z","avatar_url":"https://github.com/digitallinguistics.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# word-aligner\n\n_word-aligner_ is a small JavaScript utility (Node / browser) for vertically aligning words in an interlinear gloss (or any multi-line format).\n\n[![GitHub release (latest by date)](https://img.shields.io/github/v/release/digitallinguistics/word-aligner)][releases]\n[![npm](https://img.shields.io/npm/dt/@digitallinguistics/word-aligner)][npm]\n[![GitHub issues](https://img.shields.io/github/issues/digitallinguistics/word-aligner)][issues]\n[![test status](https://github.com/digitallinguistics/word-aligner/workflows/test/badge.svg)][actions]\n[![DOI](https://zenodo.org/badge/277561856.svg)][Zenodo]\n[![license](https://img.shields.io/github/license/digitallinguistics/word-aligner)][license]\n[![GitHub stars](https://img.shields.io/github/stars/digitallinguistics/word-aligner?style=social)][GitHub]\n\n[Click here to open an issue on GitHub.][new-issue]\n\n## Basic Usage\n\nInstall the library using npm or yarn:\n\n```cmd\nnpm i @digitallinguistics/word-aligner\nyarn add @digitallinguistics/word-aligner\n```\n\nImport the module:\n\n```js\nimport alignWords from '@digitallinguistics/word-aligner';\n```\n\nRun the utility on an array of the lines you'd like to vertically align:\n\n```js\nconst lines = [\n  `waxdungu qasi`,\n  `waxt-qungu qasi`,\n  `day-one man`,\n];\n\nconst aligned = alignWords(lines);\n```\n\nThe value of the `aligned` variable will be:\n\n```txt\n[\n  \"waxdungu   qasi\",\n  \"waxt-qungu qasi\",\n  \"day-one    man\"\n]\n```\n\n**Note:** _word-aligner_ does _not_ do automatic line detection. It will not know what type of line you are handing it (morphemes, glosses, translation, etc.). Only provide the lines you actually want aligned. Usually this means you will not provide a free translation line.\n\n## Options\n\nOption           | Default  | Description\n-----------------|----------|------------\n`alignmentError` | `false`  | Specifies whether the library should throw an error if all lines do not have the same number of words.\n`groupWith`      | `[]`     | Specifies a pair of characters to use to group words together in a line. Any words enclosed by these characters will be treated as a single word by the library.\n`separator`      | `spaces` | Specifies whether words should be aligned using spaces or tabs. Allowed values: `spaces`, `tabs`.\n\n[actions]:   https://github.com/digitallinguistics/word-aligner/actions?query=workflow%3Atest\n[GitHub]:    https://github.com/digitallinguistics/word-aligner\n[issues]:    https://github.com/digitallinguistics/word-aligner/issues\n[license]:   https://github.com/digitallinguistics/word-aligner/blob/main/LICENSE\n[new-issue]: https://github.com/digitallinguistics/word-aligner/issues/new\n[npm]:       https://www.npmjs.com/package/@digitallinguistics/word-aligner\n[releases]:  https://github.com/digitallinguistics/word-aligner/releases\n[Zenodo]:    https://zenodo.org/badge/latestdoi/277561856\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitallinguistics%2Fword-aligner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdigitallinguistics%2Fword-aligner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdigitallinguistics%2Fword-aligner/lists"}