Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eddieantonio/cree-sro-syllabics.js
Convert Western Cree SRO to Syllabics (ᒐᐦᑭᐯᐦᐃᑲᓇ)
https://github.com/eddieantonio/cree-sro-syllabics.js
converter cree hacktoberfest nehinawewin nehiyawewin nihithawewin sro syllabics transliterator
Last synced: 3 months ago
JSON representation
Convert Western Cree SRO to Syllabics (ᒐᐦᑭᐯᐦᐃᑲᓇ)
- Host: GitHub
- URL: https://github.com/eddieantonio/cree-sro-syllabics.js
- Owner: eddieantonio
- License: mit
- Created: 2018-11-12T20:33:20.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-02-11T16:38:30.000Z (almost 2 years ago)
- Last Synced: 2024-08-18T03:50:37.367Z (5 months ago)
- Topics: converter, cree, hacktoberfest, nehinawewin, nehiyawewin, nihithawewin, sro, syllabics, transliterator
- Language: JavaScript
- Homepage:
- Size: 1.27 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Cree SRO/Syllabics
==================![Unit test status](https://github.com/eddieantonio/cree-sro-syllabics.js/workflows/test/badge.svg)
[![codecov](https://codecov.io/gh/eddieantonio/cree-sro-syllabics.js/branch/master/graph/badge.svg)](https://codecov.io/gh/eddieantonio/cree-sro-syllabics.js)
[![npm version](https://badge.fury.io/js/cree-sro-syllabics.svg)](https://badge.fury.io/js/cree-sro-syllabics)
[![calver YYYY.MM.DD](https://img.shields.io/badge/calver-YYYY.MM.DD-22bfda.svg)](http://calver.org/)Convert between Western Cree standard Roman orthography (SRO) and syllabics!
This is a port of the [Python library of the same
name][cree-sro-syllabics.py]. For more complete documentation, see the
[Python version's documentation][readthedocs].[cree-sro-syllabics.py]: https://github.com/eddieantonio/cree-sro-syllabics
[readthedocs]: https://crk-orthography.readthedocs.io/en/stable/Install
-------### Browser
Copy `cree-sro-syllabics.js` to wherever is most convenient. Then,
include it in your HTML like this:```html
```
**Make sure to provide `charset="UTF-8"`**! The browser may attempt to
read the file in an alternate encoding, and the converter will no longer
work as expected.When loaded in the browser, you can access all functions using the
`CreeSROSyllabics` global:```html
console.log(CreeSROSyllabics.sro2syllabics("tân'si")) // logs "ᑕᓂᓯ"
```
### NodeJS
Install using npm:
```shell
npm install cree-sro-syllabics --save
```Then `require()` it into your code:
```javascript
var CreeSROSyllabics = require('cree-sro-syllabics')console.log(CreeSROSyllabics.sro2syllabics("tân'si")) // logs ᑖᓂᓯ
```Usage
-----There are two primary functions: `sro2syllabics()` and
`syllabics2sro()`. There is also the `version` constant.### `sro2syllabics()`
```typescript
sro2Syllabics(sroString: string, options = {}): string
```Convert text in SRO to syllabics.
```javascript
CreeSROSyllabics.sro2syllabics("tân'si")
// returns "ᑕᓂᓯ"
````options`, if supplied, is an object containing the following options:
#### `options.hyphens`
What character to use as hyphens. Defaults to `U+202F NARROW NO-BREAK
SPACE`—a space that is narrower than a word separating space; line
breaks are not permitted at this space.Using a normal space character:
```javascript
CreeSROSyllabics.sro2syllabics('kâ-mahihkani-pimohtêt', { hyphens: ' ' })
```> ᑳ ᒪᐦᐃᐦᑲᓂ ᐱᒧᐦᑌᐟ
Using the default:
```javascript
CreeSROSyllabics.sro2syllabics('kâ-mahihkani-pimohtêt')
```> ᑳ ᒪᐦᐃᐦᑲᓂ ᐱᒧᐦᑌᐟ
#### `options.finalHK`
What character use as the word-final “hk” (e.g., in locatives and
certain conjunct mode verb forms). Use either `"x"` (default) or `"hk"`.The default is to use the «ᕽ» syllabic:
```javascript
CreeSROSyllabics.sro2syllabics('sâwanohk')
```> ᓵᐘᓄᕽ
This is equivalent to providing `{ finalHK: "x" }`:
```javascript
CreeSROSyllabics.sro2syllabics('sâwanohk', { finalHK: "x" })
```> ᓵᐘᓄᕽ
However, some communities (like Maskwacîs) do not use the «ᕽ» syllabic,
instead using «ᐦᐠ». You can specify `{ finalHK: "hk" }` to get this
behaviour instead:```javascript
CreeSROSyllabics.sro2syllabics('sâwanohk', { finalHK: "hk" })
```> ᓵᐘᓄᐦᐠ
### `syllabics2sro()`
```typescript
syllabics2sro(syllabicsString: string, options = {}): string
```Convert text in syllabics to SRO.
```javascript
CreeSROSyllabics.syllabics2sro('ᑖᓂᓯ')
// returns "tân'si"
````options`, if supplied, is an object containing the following options:
#### `options.longAccents`
Whether to produce circumflexes (âêîô) or macrons (āēīō) when
transliterating long vowels.Valid options:
- `'circumflexes'` (default)
- `'macrons'`Specifying `'macrons'`:
```javascript
CreeSROSyllabics.syllabics2sro("ᑖᓂᓯ", { longAccents: 'macrons' })
```> tānisi
Using the defaults (circumflexes):
```javascript
CreeSROSyllabics.syllabics2sro("ᑖᓂᓯ")
```> tânisi
### `version`
The module's current version, as a string.
License
-------Copyright © 2018–2021 National Research Council Canada.
Licensed under the MIT license.