node package manager
Stop writing boring code. Discover, share, and reuse within your team. Create a free org »

aramaic-mapper

aramaic-mapper

npm version npm module downloads Build Status License: MIT Dependency Status Coverage Status Gitter

Generic support for mapping between Aramaic writing systems

Installation

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 of aramaic-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.4.tgz

More information

Peshitta App

Beth Mardutho

CAL

License

MIT

Contributing

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 the app or post questions or feedback, follow @peshittap at @peshittapor Gitter

Development

npm install
npm run build

API Reference

aramaicMapper.Writing

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

new Writing(consonants, vowels, diacritics, punctuation, other)

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.

aramaicMapper.Mapper

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

new Mapper(fromWriting, toWriting, mapCallback)

Param Type Description
fromWriting Writing base writing system
toWriting Writing writing system to map to
mapCallback mapCallback | undefined optional map callback

mapper.fromWriting : Writing

Source writing system to be mapped

Kind: instance property of Mapper

mapper.toWriting : Writing

Destination writing system to map to

Kind: instance property of Mapper

mapper.fromTo : Object.<string, string>

Character mapping hash from base Writing to mapped Writing

Kind: instance property of Mapper

mapper.multiples : Array.<string>

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

mapper.map(word, wordProps) ⇒ string

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

aramaicMapper.hasDotting(isDotting) ⇒ function

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

aramaicMapper.clearDotting(isDotting) ⇒ function

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

aramaicMapper.getSort(letterAsciiMap, removeDotting) ⇒ function

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
removeDotting function (word => word) remove dots function

aramaicMapper.mapCallback ⇒ string

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