@digitallinguistics/scription2dlx
A JavaScript library that converts scription text files to the Data Format for Digital Linguistics
Science Score: 54.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
✓Academic publication links
Links to: zenodo.org -
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (15.1%) to scientific vocabulary
Keywords
Repository
A JavaScript library that converts scription text files to the Data Format for Digital Linguistics
Basic Info
- Host: GitHub
- Owner: digitallinguistics
- License: mit
- Language: JavaScript
- Default Branch: main
- Homepage: https://developer.digitallinguistics.io/scription2dlx
- Size: 754 KB
Statistics
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 11
- Releases: 24
Topics
Metadata Files
README.md
scription2dlx
A JavaScript library that converts linguistic texts in scription format to the Data Format for Digital Linguistics (DaFoDiL). This library is useful for language researchers who want to work with their data in text formats that are simple to type and read (scription), but want to convert their data for use in other Digital Linguistics tools.
Quick Links
- Report a bug or request a feature
- View project on GitHub
- View project on npm
- Download the latest release
Contents
Basic Usage
- Install the library using npm or yarn:
cmd
npm i @digitallinguistics/scription2dlx
yarn add @digitallinguistics/scription2dlx
Or download the latest release from the releases page.
- Import the library into your project:
Node:
js
import convert from '@digitallinguistics/scription2dlx';
HTML:
html
<script src=scription2dlx.js type=module></script>
- The library exports a single function which accepts a string and returns a DaFoDiL Text Object.
data.txt
```
title: How the world began
waxdungu qasi one day a man ```
script.js
``js
const data = await fetch(data.txt`);
const text = scription2dlx(data);
console.log(text.utterances.transcription); // "waxdungu qasi" ```
You may also pass an options hash as the second option. See the Options section below.
js
const text = scription2dlx(data, { /* options */ });
Notes
If your project does not support ES modules and/or the latest JavaScript syntax, you may need to transpile this library using tools like Babel, and possibly bundle the library using a JavaScript bundler.
The
scription2dlxlibrary does not perform validation on the text data. You should use another validator like AJV to validate your data against the DLx DaFoDiL format.In order to keep this library small and dependency-free,
scription2dlxdoes not automatically parse the YAML header of a scription document. Instead, the header string is returned as aheaderproperty on the text object. If you would likescription2dlxto parse the header, pass a YAML parser to theparseroption when calling thescription2dlxfunction:
```js import yaml from 'yaml'; // use your preferred YAML parsing library
const text = scription2dlx(data, { parser: yaml.parse }); ```
Options
| Option | Default | Description |
| ------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| codes | {} | This option allows you to use custom backslash codes in your interlinear glosses. It should be a hash containing the scription code as a key (without a leading backslash), and the custom code as the value; ex: "txn": "t" will allow you to write \t instead of \txn for transcription lines. |
| emphasis | true | This option specifies whether emphasis should be passed through as-is (true, default), or stripped from the data (false).
| errors | "warn" | This option allows you to specify how to handle errors. If set to "warn"" (the default), an utterance which throws an error is skipped and a warning is logged to the console. If set to "object", an error object with information is returned in the results array. If set to false, utterances with errors will be skipped silently. If set to true, utterances with errors will throw and stop further processing. |
| orthography | "default" | An abbreviation for the default orthography to use for transcriptions when one is not specified. |
| parser | undefined | A YAML parser to use in parsing the header of a scription document. If none is present, the header will be provided as a string in the header property of the returned object. |
| utteranceMetadata | true | Whether to parse the utterance metadata line (the first line when it begins with #). If set to true, a metadata property will be added to each utterance that has it. |
Owner
- Name: Digital Linguistics
- Login: digitallinguistics
- Kind: organization
- Website: https://digitallinguistics.io/
- Twitter: digitalling
- Repositories: 27
- Profile: https://github.com/digitallinguistics
The science of managing linguistic data, digitally
Citation (CITATION.cff)
cff-version: 1.2.0
message: If you use this software in your research, please cite it following the model below.
authors:
- family-names: Hieber
given-names: Daniel W.
orcid: https://orcid.org/0000-0002-1411-3773
title: '@digitallinguistics/scription2dlx'
version: 0.14.0
doi: https://github.com/digitallinguistics/scription2dlx
date-released: 2023-11-18
url: https://github.com/digitallinguistics/scription2dlx
GitHub Events
Total
- Issues event: 3
- Pull request event: 1
- Create event: 1
Last Year
- Issues event: 3
- Pull request event: 1
- Create event: 1
Committers
Last synced: almost 3 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Daniel W. Hieber | d****b@g****m | 66 |
| dependabot[bot] | 4****]@u****m | 7 |
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 69
- Total pull requests: 54
- Average time to close issues: 5 months
- Average time to close pull requests: 2 months
- Total issue authors: 1
- Total pull request authors: 2
- Average comments per issue: 0.29
- Average comments per pull request: 0.11
- Merged pull requests: 47
- Bot issues: 0
- Bot pull requests: 15
Past Year
- Issues: 7
- Pull requests: 2
- Average time to close issues: 8 minutes
- Average time to close pull requests: N/A
- Issue authors: 1
- Pull request authors: 1
- Average comments per issue: 0.0
- Average comments per pull request: 0.0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 2
Top Authors
Issue Authors
- dwhieb (69)
Pull Request Authors
- dwhieb (39)
- dependabot[bot] (16)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- npm 13 last-month
- Total dependent packages: 1
- Total dependent repositories: 1
- Total versions: 18
- Total maintainers: 1
npmjs.org: @digitallinguistics/scription2dlx
A JavaScript library for converting linguistic texts in scription format to the DLx JSON format
- Homepage: https://github.com/digitallinguistics/scription2dlx
- License: MIT
-
Latest release: 0.14.1
published over 1 year ago
Rankings
Maintainers (1)
Dependencies
- 189 dependencies
- eslint ^7.4.0 development
- expect.js ^0.3.1 development
- mocha ^8.0.1 development
- yamljs ^0.3.0 development
- actions/checkout v2 composite
- actions/setup-node v1 composite
- actions/checkout v2 composite
- actions/setup-node v1 composite
- JasonEtco/create-an-issue v2 composite