Generic support for mapping between Aramaic writing systems
In order to use this library, Node.js should be installed. Then run:
npm install aramaic-mapper --save
Following bundles are available:
aramaic-mapper.js
- UMD ES5 version for use in browser, node, etc.aramaic-mapper.min.js
- minified version ofaramaic-mapper.js
aramaic-mapper.esm.js
- ES6 module version, suitable for bundling with other libraries and applications
The package could also be downloaded directly from: https://registry.npmjs.org/aramaic-mapper/-/aramaic-mapper-1.1.5.tgz
The final goal for this work is to learn the Word of God as recorded by Peshitta. You are welcomed to improve this implementation or provide feedback. Please feel free to Fork, create a Pull Request or submit Issues.
To read quick updates about Peshitta app or post questions or feedback, follow @peshittap at or
npm install
npm run build
- aramaicMapper
- .Writing
- .Mapper
- new Mapper(fromWriting, toWriting, mapCallback)
- .fromWriting :
Writing
- .toWriting :
Writing
- .fromTo :
Object.<string, string>
- .multiples :
Array.<string>
- .map(word, wordProps) ⇒
string
- .hasDotting(isDotting) ⇒
function
- .clearDotting(isDotting) ⇒
function
- .getSort(letterAsciiMap, isConsonant) ⇒
function
- .mapCallback ⇒
string
Tuple for storing an Aramaic writing system:
- Consonants are expected to be in the standard Aramaic order.
- Vowels are expected to be in the Sedra [ a o e i u ] order + optional Eastern/Hebrew short E and long O in positions 6 and 7 respectively.
- Diacritics, if provided, should follow Sedra [' , _ *] order. They are Qushaya, Rukkakha, Linea Occultans and Seyame respectively. Other diacritics like verb and homograph dots or Hebrew Sheva, if supported, should be added after the above.
- Optionally punctuation and other characters could be added for mapping.
The main idea is that each mapped character should be in the same position in the to Writing system as the from Writing system.
Kind: static class of aramaicMapper
Param | Type | Description |
---|---|---|
consonants | Array.<string> |
consonant list in the standard aramaic order |
vowels | Array.<string> |
vowel list in the Sedra order |
diacritics | Array.<string> |
optional diacritics list in the Sedra order |
punctuation | Array.<string> | undefined |
optional punctuation list |
other | Array.<string> | undefined |
optional other symbols like crosses, etc. |
Map from a base writing system to another system.
The optional mapCallback
when called will be provided following arguments:
- word - the word to be mapped
- index - index of the current character to be mapped
- fromTo - character mapping hash from base Writing to mapped Writing
mapCallback
needs to be provided only when the simple one to one mapping
between writing systems is not enough, and custom mapping needs to be
implemented instead.
Kind: static class of aramaicMapper
- .Mapper
- new Mapper(fromWriting, toWriting, mapCallback)
- .fromWriting :
Writing
- .toWriting :
Writing
- .fromTo :
Object.<string, string>
- .multiples :
Array.<string>
- .map(word, wordProps) ⇒
string
Param | Type | Description |
---|---|---|
fromWriting | Writing |
base writing system |
toWriting | Writing |
writing system to map to |
mapCallback | mapCallback | undefined |
optional map callback |
Source writing system to be mapped
Kind: instance property of Mapper
Destination writing system to map to
Kind: instance property of Mapper
Character mapping hash from base Writing to mapped Writing
Kind: instance property of Mapper
Mapped multiple char sequences that map to a single fromWriting
char.
Used to move only 1 character ahead, instead of length of mapped string.
Kind: instance property of Mapper
Map word from a base writing system to another system
Kind: instance method of Mapper
Returns: string
- mapped word
Param | Type | Description |
---|---|---|
word | string |
input word to be mapped |
wordProps | Object |
optional word settings - to be passed to callback |
Returns function which returns true if input word has vowels or diacritics.
Kind: static method of aramaicMapper
Returns: function
- hasDotting (word => boolean) function logic
Param | Type | Description |
---|---|---|
isDotting | function |
(char => boolean) which checks if char is dotting |
Returns a function to remove vowels and diacritics and keep the consonantal skeleton only.
Kind: static method of aramaicMapper
Returns: function
- clearDotting (word => word) function logic
Param | Type | Description |
---|---|---|
isDotting | function |
(char => boolean) which checks if char is dotting |
Returns a function to be used for sorting words using the provided letterAsciiMap
Kind: static method of aramaicMapper
Returns: function
- ((word1, word2) => number) function implementation
Param | Type | Description |
---|---|---|
letterAsciiMap | Object.<string, string> |
letter to ASCII value map |
isConsonant | function |
(char => boolean) Is character c a consonant |
Kind: static typedef of aramaicMapper
Returns: string
- the mapped string for c - could be longer than one
character
Param | Type | Description |
---|---|---|
word | string |
input word to be mapped |
index | number |
index of the current character to be mapped |
fromTo | Object.<string, string> |
character mapping hash from |
wordProps | Object |
optional word properties hash base Writing to mapped Writing |