sedra-model
Sedra models and related utility functions
Installation
In order to use this library, Node.js should be installed. Then run:
npm install sedra-model --save
Following bundles are available:
sedra-model.js
- UMD ES5 version for use in browser, node, etc.sedra-model.min.js
- minified version ofsedra-model.js
sedra-model.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-model/-/sedra-model-1.2.0.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
- sedraModel
- .wordType :
Array.<string>
- .vowel :
Array.<string>
- .wordNumber :
Array.<string>
- .wordGender :
Array.<string>
- .wordForm :
Array.<string>
- .lexemeGrammaticalCategory :
Array.<string>
- .lexemeFirstSuffix :
Array.<string>
- .lexemeSecondSuffix :
Array.<string>
- .lexemeThirdSuffix :
Array.<string>
- .lexemePrefix :
Array.<string>
- .lexemeRadicalType :
Array.<string>
- .lexemeForm :
Array.<string>
- .wordSuffixGender :
Array.<string>
- .wordSuffixPerson :
Array.<string>
- .wordSuffixNumber :
Array.<string>
- .wordSuffixType :
Array.<string>
- .wordPerson :
Array.<string>
- .wordState :
Array.<string>
- .wordTense :
Array.<string>
- .textPosition :
Array.<string>
- .fontType :
Array.<string>
- .verbType :
Array.<string>
- .etymologyLanguage :
Array.<string>
- .books :
Array.<string>
- .peshittaBooks :
Array.<Book>
- .bookGroups :
Object
- .makeRoot(root, sort, attributes) ⇒
Root
- .makeRootAttribute(seyame, rootType) ⇒
RootAttribute
- .getRootAttribute(attributes) ⇒
RootAttribute
- .getRoot(id, root) ⇒
FlatRoot
- .makeLexeme(rootId, lexeme, morphologicalType, attributes) ⇒
Lexeme
- .makeLexemeAttribute(seyame, wordType, grammaticalCategory, listing) ⇒
LexemeAttribute
- .getLexemeAttribute(attributes) ⇒
LexemeAttribute
- .makeLexemeMorphologicalType(firstSuffix, secondSuffix, thirdSuffix, prefix, firstVowel, secondVowel, thirdVowel, fourthVowel, vowelCount, radicalType, form) ⇒
LexemeMorphologicalType
- .getLexemeMorphologicalType(morphologicalType) ⇒
LexemeMorphologicalType
- .getLexeme(id, lexeme, roots) ⇒
FlatLexeme
- .makeWord(lexemeId, word, vocalised, morphologicalType, attributes) ⇒
Word
- .makeWordAttribute(seyame, listing, enclitic, lexeme) ⇒
WordAttribute
- .getWordAttribute(attributes) ⇒
WordAttribute
- .makeWordMorphologicalType(suffixGender, suffixPerson, suffixNumber, suffixType, prefixCode, gender, person, number, state, tense, form) ⇒
WordMorphologicalType
- .getWordMorphologicalType(attributes) ⇒
WordMorphologicalType
- .getWord(id, lexeme, lexemes) ⇒
FlatWord
- .makeEnglish(lexemeId, word, before, after, comment, attributes, flag) ⇒
English
- .makeEnglishAttribute(commentPosition, commentFont, stringBeforeFont, stringAfterFont, verb, number, gender, form) ⇒
EnglishAttribute
- .getEnglishAttribute(attributes) ⇒
EnglishAttribute
- .getEnglish(id, english, lexemes) ⇒
FlatEnglish
- .makeEtymology(lexemeId, word, attributes) ⇒
Etymology
- .makeEtymologyAttribute(language, type) ⇒
EtymologyAttribute
- .getEtymologyAttribute(attributes) ⇒
EtymologyAttribute
- .getEtymology(id, etymology, lexemes) ⇒
FlatEtymology
- .makeBook(id, peshittaId, name, vocalised, english, stats) ⇒
Book
- .sorter(a, b) ⇒
number
- .getBook(id) ⇒
Book
- .getBooksByEnglish() ⇒
Object
- .getBookByEnglish(name) ⇒
Book
- .getBookEnglishNames() ⇒
Array
- .getNamedReferences() ⇒
Array
- .makeBookGroup(id, name, bookSet) ⇒
BookGroup
- .getVerseByIndex(index, ubs) ⇒
object
- .getIndexByVerseWoChapter(reference, ubs) ⇒
number
- .getIndexByVerse(reference, ubs) ⇒
number
- .wordType :
Array.<string>
sedraModel.wordType : Word Type enumeration
Kind: static constant of sedraModel
Array.<string>
sedraModel.vowel : Vowel enumeration
Kind: static constant of sedraModel
Array.<string>
sedraModel.wordNumber : Word Number enumeration
Kind: static constant of sedraModel
Array.<string>
sedraModel.wordGender : Word Gender enumeration
Kind: static constant of sedraModel
Array.<string>
sedraModel.wordForm : Word Form enumeration
Kind: static constant of sedraModel
Array.<string>
sedraModel.lexemeGrammaticalCategory : Lexeme Grammatical Category enumeration
Kind: static constant of sedraModel
Array.<string>
sedraModel.lexemeFirstSuffix : Lexeme First Suffix enumeration
Kind: static constant of sedraModel
Array.<string>
sedraModel.lexemeSecondSuffix : Second Second Suffix enumeration
Kind: static constant of sedraModel
Array.<string>
sedraModel.lexemeThirdSuffix : Lexeme Third Suffix enumeration
Kind: static constant of sedraModel
Array.<string>
sedraModel.lexemePrefix : Lexeme Prefix enumeration
Kind: static constant of sedraModel
Array.<string>
sedraModel.lexemeRadicalType : Lexeme Radical Type enumeration
Kind: static constant of sedraModel
Array.<string>
sedraModel.lexemeForm : Lexeme Form enumeration
Kind: static constant of sedraModel
Array.<string>
sedraModel.wordSuffixGender : Word Suffix Gender enumeration
Kind: static constant of sedraModel
Array.<string>
sedraModel.wordSuffixPerson : Word Suffix Person enumeration
Kind: static constant of sedraModel
Array.<string>
sedraModel.wordSuffixNumber : Word Suffix Number enumeration
Kind: static constant of sedraModel
Array.<string>
sedraModel.wordSuffixType : Word Suffix Type enumeration
Kind: static constant of sedraModel
Array.<string>
sedraModel.wordPerson : Word Person enumeration
Kind: static constant of sedraModel
Array.<string>
sedraModel.wordState : Word State enumeration
Kind: static constant of sedraModel
Array.<string>
sedraModel.wordTense : Word Tense enumeration
Kind: static constant of sedraModel
Array.<string>
sedraModel.textPosition : Text position enumeration
Kind: static constant of sedraModel
Array.<string>
sedraModel.fontType : Font type enumeration
Kind: static constant of sedraModel
Array.<string>
sedraModel.verbType : Verb type enumeration
Kind: static constant of sedraModel
Array.<string>
sedraModel.etymologyLanguage : Etymology Language enumeration
Kind: static constant of sedraModel
Array.<string>
sedraModel.books : Peshitta books
Kind: static constant of sedraModel
Array.<Book>
sedraModel.peshittaBooks : Peshitta books sorted according to Eastern Peshitta ordering
Kind: static constant of sedraModel
Object
sedraModel.bookGroups : Eastern New Testament Peshitta book groups
Kind: static constant of sedraModel
Root
sedraModel.makeRoot(root, sort, attributes) ⇒ Root records, e.g. 0:2,"AB","ab |A",0 Id is the position in the containing array so it is not stored
Kind: static method of sedraModel
Returns: Root
- Sedra Root row
Param | Type | Description |
---|---|---|
root | string |
e.g. "AB" |
sort | string |
e.g. "ab |
attributes | number |
16-bit map |
RootAttribute
sedraModel.makeRootAttribute(seyame, rootType) ⇒ Build Root Attribute object
Kind: static method of sedraModel
Returns: RootAttribute
- Root Attribute object
Param | Type | Description |
---|---|---|
seyame | boolean |
true if root has seyame |
rootType | string |
word type enumeration |
RootAttribute
sedraModel.getRootAttribute(attributes) ⇒ Get Root Attribute object from root attribute bit map
Kind: static method of sedraModel
Returns: RootAttribute
- Root Attribute object
Param | Type | Description |
---|---|---|
attributes | number |
16-bit map |
FlatRoot
sedraModel.getRoot(id, root) ⇒ Return flatten root object with parsed attribute values
Kind: static method of sedraModel
Returns: FlatRoot
- the flatten root model
Param | Type | Description |
---|---|---|
id | number |
the id of current root object |
root | Root |
root raw object |
Lexeme
sedraModel.makeLexeme(rootId, lexeme, morphologicalType, attributes) ⇒ Lexeme records, e.g. 1:2,0:2,"ABA",41960448,16 Id is the position in the array so it is not stored
Kind: static method of sedraModel
Returns: Lexeme
- Sedra Lexeme row
Param | Type | Description |
---|---|---|
rootId | number |
Root Address, e.g. 2 |
lexeme | string |
e.g. "ABA" |
morphologicalType | number |
32-bit map |
attributes | number |
16-bit map |
LexemeAttribute
sedraModel.makeLexemeAttribute(seyame, wordType, grammaticalCategory, listing) ⇒ Build Lexeme Attribute object
Kind: static method of sedraModel
Returns: LexemeAttribute
- Lexeme Attribute object
Param | Type | Description |
---|---|---|
seyame | boolean |
true if lexeme has seyame |
wordType | string |
word type enumeration |
grammaticalCategory | string |
grammatical category enumeration |
listing | boolean |
not clear yet what this is used for |
LexemeAttribute
sedraModel.getLexemeAttribute(attributes) ⇒ Get Lexeme Attribute object from lexeme attribute bit map
Kind: static method of sedraModel
Returns: LexemeAttribute
- Lexeme Attribute object
Param | Type | Description |
---|---|---|
attributes | number |
16-bit map |
LexemeMorphologicalType
sedraModel.makeLexemeMorphologicalType(firstSuffix, secondSuffix, thirdSuffix, prefix, firstVowel, secondVowel, thirdVowel, fourthVowel, vowelCount, radicalType, form) ⇒ Build Lexeme Morphological Type object
Kind: static method of sedraModel
Returns: LexemeMorphologicalType
- Lexeme Morphological Type object
Param | Type | Description |
---|---|---|
firstSuffix | string |
First suffix enumeration |
secondSuffix | string |
Second suffix enumeration |
thirdSuffix | string |
Third suffix enumeration |
prefix | string |
M, T, ? enumeration |
firstVowel | string |
First Vowel |
secondVowel | string |
Second Vowel |
thirdVowel | string |
Third Vowel |
fourthVowel | string |
Forth Vowel |
vowelCount | number |
Total no of vowels in lexeme |
radicalType | string |
Radical type enumeration |
form | string |
Word form enumeration |
LexemeMorphologicalType
sedraModel.getLexemeMorphologicalType(morphologicalType) ⇒ Get Lexeme Morphological Type object from lexeme bit map
Kind: static method of sedraModel
Returns: LexemeMorphologicalType
- Lexeme Morphological Type object
Param | Type | Description |
---|---|---|
morphologicalType | number |
Morphological Type 32-bit map |
FlatLexeme
sedraModel.getLexeme(id, lexeme, roots) ⇒ Return flatten lexeme object with parsed attribute and morphological values
Kind: static method of sedraModel
Returns: FlatLexeme
- the flatten lexeme model
Param | Type | Description |
---|---|---|
id | number |
the id of current lexeme object |
lexeme | Lexeme |
lexeme raw object |
roots | Array.<Root> |
root list |
Word
sedraModel.makeWord(lexemeId, word, vocalised, morphologicalType, attributes) ⇒ Word records, e.g. 2:8,1:2,"ABHOH;","AaB,oHaOH_;",7405716,129 Id is the position in the array so it is not stored
Kind: static method of sedraModel
Returns: Word
- Sedra Word row
Param | Type | Description |
---|---|---|
lexemeId | number |
Lexeme Address, e.g. 2 |
word | string |
Word, e.g. "ABHOH;" |
vocalised | string |
Vocalised Word, e.g. "AaB,oHaOH_;" |
morphologicalType | number |
32-bit map |
attributes | number |
16-bit map |
WordAttribute
sedraModel.makeWordAttribute(seyame, listing, enclitic, lexeme) ⇒ Build Word Attribute object
Kind: static method of sedraModel
Returns: WordAttribute
- Word Attribute object
Param | Type | Description |
---|---|---|
seyame | boolean |
true if word has seyame |
listing | number |
Undocumented |
enclitic | boolean |
true if word has enclitics |
lexeme | boolean |
true if current word is lexeme |
WordAttribute
sedraModel.getWordAttribute(attributes) ⇒ Get Word Attribute object from word attribute bit map
Kind: static method of sedraModel
Returns: WordAttribute
- Word Attribute object
Param | Type | Description |
---|---|---|
attributes | number |
16-bit map |
WordMorphologicalType
sedraModel.makeWordMorphologicalType(suffixGender, suffixPerson, suffixNumber, suffixType, prefixCode, gender, person, number, state, tense, form) ⇒ Build Word Morphological Type object
Kind: static method of sedraModel
Returns: WordMorphologicalType
- Word Morphological Type object
Param | Type | Description |
---|---|---|
suffixGender | string |
Word Suffix Gender enumeration |
suffixPerson | string |
Word Suffix Person enumeration |
suffixNumber | string |
Word Suffix Number enumeration |
suffixType | string |
Word Suffix Type enumeration |
prefixCode | number |
Word Prefix Code |
gender | string |
Word Gender enumeration |
person | string |
Word Person enumeration |
number | string |
Word Number enumeration |
state | string |
Word State enumeration |
tense | string |
Word Tense enumeration |
form | string |
Word Form enumeration |
WordMorphologicalType
sedraModel.getWordMorphologicalType(attributes) ⇒ Get Word Morphological Type object from word bit map
Kind: static method of sedraModel
Returns: WordMorphologicalType
- Word Morphological Type object
Param | Type | Description |
---|---|---|
attributes | number |
Morphological Type 32-bit map |
FlatWord
sedraModel.getWord(id, lexeme, lexemes) ⇒ Return flatten word object with parsed attribute and morphological values
Kind: static method of sedraModel
Returns: FlatWord
- the flatten word model
Param | Type | Description |
---|---|---|
id | number |
the id of current word object |
lexeme | Word |
word raw object |
lexemes | Array.<Lexeme> |
lexeme list |
English
sedraModel.makeEnglish(lexemeId, word, before, after, comment, attributes, flag) ⇒ English meaning, e.g. 3:165,1:97,"cause","without","","",0,0 Id is the position in the database array so it is not stored
Kind: static method of sedraModel
Returns: English
- Sedra English row
Param | Type | Description |
---|---|---|
lexemeId | number |
Lexeme address, e.g. 97 |
word | string |
Meaning, e.g. "cause" |
before | string |
String before meaning, e.g. "without" (i.e. without cause) |
after | number |
String after meaning, e.g. "" |
comment | number |
Comment, e.g. "" |
attributes | number |
16-bit map |
flag | number |
1 bit flag |
EnglishAttribute
sedraModel.makeEnglishAttribute(commentPosition, commentFont, stringBeforeFont, stringAfterFont, verb, number, gender, form) ⇒ Build English Attribute object
Kind: static method of sedraModel
Returns: EnglishAttribute
- English Attribute object
Param | Type | Description |
---|---|---|
commentPosition | string |
Comment before or after word meaning |
commentFont | string |
Normal or Italic |
stringBeforeFont | string |
Normal or Italic string before text font |
stringAfterFont | string |
Normal or Italic string after text font |
verb | string |
None, Transitive or Intransitive |
number | string |
Word Number enumeration |
gender | string |
Word Gender enumeration |
form | string |
Word Form enumeration |
EnglishAttribute
sedraModel.getEnglishAttribute(attributes) ⇒ Get English Attribute object from english attribute bit map
Kind: static method of sedraModel
Returns: EnglishAttribute
- English Attribute object
Param | Type | Description |
---|---|---|
attributes | number |
16-bit map |
FlatEnglish
sedraModel.getEnglish(id, english, lexemes) ⇒ Return flatten english object with parsed attribute values
Kind: static method of sedraModel
Returns: FlatEnglish
- the flatten english model
Param | Type | Description |
---|---|---|
id | number |
the id of current english object |
english | English |
english raw object |
lexemes | Array.<Lexeme> |
lexeme list |
Etymology
sedraModel.makeEtymology(lexemeId, word, attributes) ⇒ Etymology records, e.g. 4:1,1:1,"a\255h\256r",5 Id is the position in the array so it is not stored
Kind: static method of sedraModel
Returns: Etymology
- Sedra Etymology row
Param | Type | Description |
---|---|---|
lexemeId | number |
Lexeme address, e.g. 1 |
word | string |
Word Origin, e.g. "a\255h\256r" |
attributes | number |
16-bit map |
EtymologyAttribute
sedraModel.makeEtymologyAttribute(language, type) ⇒ Build Etymology Attribute object
Kind: static method of sedraModel
Returns: EtymologyAttribute
- Etymology Attribute object
Param | Type | Description |
---|---|---|
language | string |
the source language |
type | string |
word type enumeration |
EtymologyAttribute
sedraModel.getEtymologyAttribute(attributes) ⇒ Get Etymology Attribute object from etymology attribute bit map
Kind: static method of sedraModel
Returns: EtymologyAttribute
- Etymology Attribute object
Param | Type | Description |
---|---|---|
attributes | number |
16-bit map |
FlatEtymology
sedraModel.getEtymology(id, etymology, lexemes) ⇒ Return flatten etymology object with parsed attribute values
Kind: static method of sedraModel
Returns: FlatEtymology
- the flatten etymology model
Param | Type | Description |
---|---|---|
id | number |
the id of current etymology object |
etymology | Etymology |
etymology raw object |
lexemes | Array.<Lexeme> |
lexeme list |
Book
sedraModel.makeBook(id, peshittaId, name, vocalised, english, stats) ⇒ Build a Book object
Kind: static method of sedraModel
Returns: Book
- Book object
Param | Type | Description |
---|---|---|
id | number |
Book Id |
peshittaId | number |
Book Eastern Peshitta Id |
name | string |
Book Aramaic name |
vocalised | string |
Book vocalised Aramaic name |
english | Array.<string> |
Book English names: full name followed by abbreviations |
stats | object |
Book statistics { chapters, verses, words } |
number
sedraModel.sorter(a, b) ⇒ Callback to sort books by Eastern Peshitta ordering
Kind: static method of sedraModel
Returns: number
- sort order
Param | Type | Description |
---|---|---|
a | Book |
a book |
b | Book |
another book |
Book
sedraModel.getBook(id) ⇒ Get book record with the given id from books array
Kind: static method of sedraModel
Returns: Book
- Book object from books array
Param | Type | Description |
---|---|---|
id | number |
Book id |
Object
sedraModel.getBooksByEnglish() ⇒ Kind: static method of sedraModel
Returns: Object
- English name to Book hash
Book
sedraModel.getBookByEnglish(name) ⇒ Kind: static method of sedraModel
Returns: Book
- Book object from books array
Param | Type | Description |
---|---|---|
name | string |
book English full or short name |
Array
sedraModel.getBookEnglishNames() ⇒ Kind: static method of sedraModel
Returns: Array
- sorted list of book English names
Array
sedraModel.getNamedReferences() ⇒ Kind: static method of sedraModel
Returns: Array
- list of named references
BookGroup
sedraModel.makeBookGroup(id, name, bookSet) ⇒ Build a BookGroup object - a grouping of Peshitta books
Kind: static method of sedraModel
Returns: BookGroup
- A Book Group object
Param | Type | Description |
---|---|---|
id | number | string |
Book Group assigned Id |
name | string |
Book Group name |
bookSet | Array.<Book> |
Book subset from books array |
object
sedraModel.getVerseByIndex(index, ubs) ⇒ Get a verse by its index inside the whole of NT Peshitta
Kind: static method of sedraModel
Returns: object
- a hash with verse content, verse, chapter and book number
Param | Type | Description |
---|---|---|
index | number |
verse index overall NT Peshitta |
ubs | object |
NT Peshitta object hash |
number
sedraModel.getIndexByVerseWoChapter(reference, ubs) ⇒ Get an index by verse reference, leaving out chapter reference indexes
Kind: static method of sedraModel
Returns: number
- index
Param | Type | Description |
---|---|---|
reference | object |
{book:number, chapter:number, verse:number} reference |
ubs | object |
NT Peshitta object hash |
number
sedraModel.getIndexByVerse(reference, ubs) ⇒ Get an index by verse reference with chapter references included
Kind: static method of sedraModel
Returns: number
- index
Param | Type | Description |
---|---|---|
reference | object |
{book:number, chapter:number, verse:number} reference |
ubs | object |
NT Peshitta object hash |