phonetic-code-util
Version:
Semitic phonetic transliteration utilities
27 lines (26 loc) • 3.74 kB
JavaScript
/**
* @file Semitic phonetic transliteration utilities
* @version 1.0.5
* @author Greg Borota
* @copyright (c) 2017 Greg Borota.
* @license MIT
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?a(exports,require("aramaic-mapper")):"function"==typeof define&&define.amd?define(["exports","aramaic-mapper"],a):a(e.phoneticCodeUtil={},e.aramaicMapper)}(this,function(e,a){"use strict";var l=Object.freeze(Object.create(null,{alaph:{value:"’",enumerable:!0},beth:{value:"b",enumerable:!0},gamal:{value:"g",enumerable:!0},dalath:{value:"d",enumerable:!0},he:{value:"h",enumerable:!0},waw:{value:"w",enumerable:!0},zayn:{value:"z",enumerable:!0},heth:{value:"ḥ",enumerable:!0},teth:{value:"ṭ",enumerable:!0},yod:{value:"y",enumerable:!0},kaph:{value:"k",enumerable:!0},lamadh:{value:"l",enumerable:!0},mim:{value:"m",enumerable:!0},nun:{value:"n",enumerable:!0},semkath:{value:"s",enumerable:!0},e:{value:"‘",enumerable:!0},pe:{value:"p",enumerable:!0},sadhe:{value:"ṣ",enumerable:!0},qoph:{value:"q",enumerable:!0},resh:{value:"r",enumerable:!0},shin:{value:"š",enumerable:!0},taw:{value:"t",enumerable:!0}})),n=l,u=Object.freeze([n.alaph,n.beth,n.gamal,n.dalath,n.he,n.waw,n.zayn,n.heth,n.teth,n.yod,n.kaph,n.lamadh,n.mim,n.nun,n.semkath,n.e,n.pe,n.sadhe,n.qoph,n.resh,n.shin,n.taw]),t=[n.beth,n.gamal,n.dalath,n.kaph,n.pe,n.taw],r=["ḇ","g̱","ḏ","ḵ","p̱","ṯ"],m=Object.freeze(Object.create(null,{b:{value:"ḇ",enumerable:!0},g:{value:"g̱",enumerable:!0},d:{value:"ḏ",enumerable:!0},k:{value:"ḵ",enumerable:!0},p:{value:"p̱",enumerable:!0},t:{value:"ṯ",enumerable:!0}})),b=["ś","ḍ","ẓ"],o=Object.freeze(u.concat(r).concat(b)),h=Object.freeze(Object.create(null,{pthaha:{value:"a",enumerable:!0},zqapha:{value:"ā",enumerable:!0},rbasa:{value:"ē",enumerable:!0},hbasa:{value:"ī",enumerable:!0},esasa:{value:"ū",enumerable:!0},zlama:{value:"e",enumerable:!0},rwaha:{value:"ō",enumerable:!0}})),s=h,c=Object.freeze([s.pthaha,s.zqapha,s.rbasa,s.hbasa,s.esasa]),v=Object.freeze([s.zlama,s.rwaha]),i=Object.freeze(["u","i","o"]),p=Object.freeze(c.concat(v).concat(i)),d=function(e){return p.indexOf(e)>-1},f=a.hasDotting(d),w=a.clearDotting(d);e.consonantsByName=l,e.consonants=u,e.begadkepatConsonants=t,e.veghadhkhefathConsonants=r,e.begadkepatMap=m,e.extraConsonants=b,e.allConsonants=o,e.vowelsByName=h,e.commonVowels=c,e.easternVowels=v,e.otherVowels=i,e.allVowels=p,e.silent="∅",e.isConsonant=function(e){return o.indexOf(e)>-1},e.isVowel=d,e.isDotted=f,e.removeVowels=w,e.isBegadkepat=function(e){return t.indexOf(e)>-1},e.isVeghadhkhefath=function(e){return r.indexOf(e)>-1},Object.defineProperty(e,"__esModule",{value:!0})});