sedra-parse
Parse Sedra 3 text database records and return their JavaScript representation
Installation
In order to use this library, Node.js should be installed. Then run:
npm install sedra-parse --save
Following bundles are available:
sedra-parse.js
- UMD ES5 version for use in browser, node, etc.sedra-parse.min.js
- minified version ofsedra-parse.js
sedra-parse.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/sedra-parse/-/sedra-parse-1.1.8.tgz
More information
License
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 Peshitta app or post questions or feedback, follow @peshittap at or
Development
npm install
npm run build
API Reference
- sedraParse
- static
- .getRoots(content) ⇒
string
- .getLexemes(content) ⇒
string
- .getWords(content) ⇒
string
- .getEnglish(content) ⇒
string
- .getEtymology(content) ⇒
object
- .getUbs(content) ⇒
object
- .getRoots(content) ⇒
- inner
- ~rootRegex :
RegExp
- ~lexemeRegex :
RegExp
- ~wordRegex :
RegExp
- ~noYRegex :
RegExp
- ~noWRegex :
RegExp
- ~parseWords ⇒
object
- ~englishRegex :
RegExp
- ~etymologyRegex :
RegExp
- ~parseEtymology ⇒
object
- ~ubsRegex :
RegExp
- ~buildUbs ⇒
Object
- ~parseUbs ⇒
Object
- ~rootRegex :
- static
string
sedraParse.getRoots(content) ⇒ Build roots javascript from root records e.g. 0:2,"AB","ab |A",0
Kind: static method of sedraParse
Returns: string
- JavaScript root representation
Param | Type | Description |
---|---|---|
content | string |
Sedra root records |
string
sedraParse.getLexemes(content) ⇒ Build lexemes javascript from lexeme records e.g. 1:2,0:2,"ABA",41960448,16
Kind: static method of sedraParse
Returns: string
- Lexeme javascript records
Param | Type | Description |
---|---|---|
content | string |
Lexeme text records |
string
sedraParse.getWords(content) ⇒ Build word JavaScript from word records e.g. 2:31070,1:2055,"DMSBRNOTA","D'aMSaB'RoNuOT,oA",6915072,128
Kind: static method of sedraParse
Returns: string
- Word JavaScript records
Param | Type | Description |
---|---|---|
content | string |
Word text records |
string
sedraParse.getEnglish(content) ⇒ Build english javascript from english records e.g. 3:165,1:97,"cause","without","","",0,0
Kind: static method of sedraParse
Returns: string
- English JavaScript content
Param | Type | Description |
---|---|---|
content | string |
English text content |
object
sedraParse.getEtymology(content) ⇒ Build etymology JavaScript from etymology records e.g. 4:10,1:75,"eu\310",5
Kind: static method of sedraParse
Returns: object
- Etymology JavaScript records + reference
Param | Type | Description |
---|---|---|
content | string |
Etymology text file records |
object
sedraParse.getUbs(content) ⇒ Build Ubs JavaScript from ubs records e.g. 0:8,520100108,33554599,36 and index to reference map. To get verse only index -> reference, filter out entries where verse is 0.
Kind: static method of sedraParse
Returns: object
- { ubs, reference } JavaScript
Param | Type | Description |
---|---|---|
content | string |
Ubs text database records |
RegExp
sedraParse~rootRegex : Regex to remove ids from root rows and extract relevant information
Kind: inner constant of sedraParse
RegExp
sedraParse~lexemeRegex : Regex to remove ids from lexeme records and extract relevant information
Kind: inner constant of sedraParse
RegExp
sedraParse~wordRegex : Regex to remove ids from word records and extract wanted information
Kind: inner constant of sedraParse
RegExp
sedraParse~noYRegex : Regex to find vocalized words with i vowels without supporting y
Kind: inner constant of sedraParse
RegExp
sedraParse~noWRegex : Regex to find vocalized words with u vowels without supporting w
Kind: inner constant of sedraParse
object
sedraParse~parseWords ⇒ Remove id from word file as id will be given by the position in the array. Word file has 432 gaps with largest ones being 45 (see sedrajs unit tests).
Kind: inner constant of sedraParse
Returns: object
- hash of parsed word records and no Y/W words
Param | Type | Description |
---|---|---|
content | string |
Input word records |
RegExp
sedraParse~englishRegex : Regex to remove ids from english records and extract relevant information only
Kind: inner constant of sedraParse
RegExp
sedraParse~etymologyRegex : Regex to remove ids from etymology records and extract useful info only
Kind: inner constant of sedraParse
object
sedraParse~parseEtymology ⇒ Remove id from etymology records as id will be given by the array position. Etymology file has 3 gaps but difference is 1 only (see sedrajs unit tests).
Kind: inner constant of sedraParse
Returns: object
- Parsed etymology content + reference
Param | Type | Description |
---|---|---|
content | string |
Input etymology text records |
RegExp
sedraParse~ubsRegex : Regex to remove ids from Ubs records and extract parsed information book - Left 2 digits represent the book (52=Matt, 53=Mark, 54=Luke, etc.) chapter - Next 2 digits = chapter verse - Next 3 digits = verse index - Next 2 digits = word wordId - the two most significant bits are always 02 which represents the database file number
Kind: inner constant of sedraParse
Object
sedraParse~buildUbs ⇒ Build parsed Usb object from the ubsRegex match
Kind: inner constant of sedraParse
Returns: Object
- object created from match result
Param | Type | Description |
---|---|---|
match | Object |
regex match result |
Object
sedraParse~parseUbs ⇒ Remove id from Ubs records as it is not being used and it is also messed up - it overflows and becomes negative a number of times. To get verse only index -> reference, filter out entries with verse as 0.
Kind: inner constant of sedraParse
Returns: Object
- Parsed JavaScript Ubs/reference records
Param | Type | Description |
---|---|---|
content | string |
Input Ubs text records |