1.2.0 • Published 7 years ago

sedra-model v1.2.0

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

sedra-model

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

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 of sedra-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

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

Development

npm install
npm run build

API Reference

sedraModel.wordType : Array.<string>

Word Type enumeration

Kind: static constant of sedraModel

sedraModel.vowel : Array.<string>

Vowel enumeration

Kind: static constant of sedraModel

sedraModel.wordNumber : Array.<string>

Word Number enumeration

Kind: static constant of sedraModel

sedraModel.wordGender : Array.<string>

Word Gender enumeration

Kind: static constant of sedraModel

sedraModel.wordForm : Array.<string>

Word Form enumeration

Kind: static constant of sedraModel

sedraModel.lexemeGrammaticalCategory : Array.<string>

Lexeme Grammatical Category enumeration

Kind: static constant of sedraModel

sedraModel.lexemeFirstSuffix : Array.<string>

Lexeme First Suffix enumeration

Kind: static constant of sedraModel

sedraModel.lexemeSecondSuffix : Array.<string>

Second Second Suffix enumeration

Kind: static constant of sedraModel

sedraModel.lexemeThirdSuffix : Array.<string>

Lexeme Third Suffix enumeration

Kind: static constant of sedraModel

sedraModel.lexemePrefix : Array.<string>

Lexeme Prefix enumeration

Kind: static constant of sedraModel

sedraModel.lexemeRadicalType : Array.<string>

Lexeme Radical Type enumeration

Kind: static constant of sedraModel

sedraModel.lexemeForm : Array.<string>

Lexeme Form enumeration

Kind: static constant of sedraModel

sedraModel.wordSuffixGender : Array.<string>

Word Suffix Gender enumeration

Kind: static constant of sedraModel

sedraModel.wordSuffixPerson : Array.<string>

Word Suffix Person enumeration

Kind: static constant of sedraModel

sedraModel.wordSuffixNumber : Array.<string>

Word Suffix Number enumeration

Kind: static constant of sedraModel

sedraModel.wordSuffixType : Array.<string>

Word Suffix Type enumeration

Kind: static constant of sedraModel

sedraModel.wordPerson : Array.<string>

Word Person enumeration

Kind: static constant of sedraModel

sedraModel.wordState : Array.<string>

Word State enumeration

Kind: static constant of sedraModel

sedraModel.wordTense : Array.<string>

Word Tense enumeration

Kind: static constant of sedraModel

sedraModel.textPosition : Array.<string>

Text position enumeration

Kind: static constant of sedraModel

sedraModel.fontType : Array.<string>

Font type enumeration

Kind: static constant of sedraModel

sedraModel.verbType : Array.<string>

Verb type enumeration

Kind: static constant of sedraModel

sedraModel.etymologyLanguage : Array.<string>

Etymology Language enumeration

Kind: static constant of sedraModel

sedraModel.books : Array.<string>

Peshitta books

Kind: static constant of sedraModel

sedraModel.peshittaBooks : Array.<Book>

Peshitta books sorted according to Eastern Peshitta ordering

Kind: static constant of sedraModel

sedraModel.bookGroups : Object

Eastern New Testament Peshitta book groups

Kind: static constant of sedraModel

sedraModel.makeRoot(root, sort, attributes) ⇒ Root

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

ParamTypeDescription
rootstringe.g. "AB"
sortstringe.g. "abA"
attributesnumber16-bit map

sedraModel.makeRootAttribute(seyame, rootType) ⇒ RootAttribute

Build Root Attribute object

Kind: static method of sedraModel
Returns: RootAttribute - Root Attribute object

ParamTypeDescription
seyamebooleantrue if root has seyame
rootTypestringword type enumeration

sedraModel.getRootAttribute(attributes) ⇒ RootAttribute

Get Root Attribute object from root attribute bit map

Kind: static method of sedraModel
Returns: RootAttribute - Root Attribute object

ParamTypeDescription
attributesnumber16-bit map

sedraModel.getRoot(id, root) ⇒ FlatRoot

Return flatten root object with parsed attribute values

Kind: static method of sedraModel
Returns: FlatRoot - the flatten root model

ParamTypeDescription
idnumberthe id of current root object
rootRootroot raw object

sedraModel.makeLexeme(rootId, lexeme, morphologicalType, attributes) ⇒ Lexeme

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

ParamTypeDescription
rootIdnumberRoot Address, e.g. 2
lexemestringe.g. "ABA"
morphologicalTypenumber32-bit map
attributesnumber16-bit map

sedraModel.makeLexemeAttribute(seyame, wordType, grammaticalCategory, listing) ⇒ LexemeAttribute

Build Lexeme Attribute object

Kind: static method of sedraModel
Returns: LexemeAttribute - Lexeme Attribute object

ParamTypeDescription
seyamebooleantrue if lexeme has seyame
wordTypestringword type enumeration
grammaticalCategorystringgrammatical category enumeration
listingbooleannot clear yet what this is used for

sedraModel.getLexemeAttribute(attributes) ⇒ LexemeAttribute

Get Lexeme Attribute object from lexeme attribute bit map

Kind: static method of sedraModel
Returns: LexemeAttribute - Lexeme Attribute object

ParamTypeDescription
attributesnumber16-bit map

sedraModel.makeLexemeMorphologicalType(firstSuffix, secondSuffix, thirdSuffix, prefix, firstVowel, secondVowel, thirdVowel, fourthVowel, vowelCount, radicalType, form) ⇒ LexemeMorphologicalType

Build Lexeme Morphological Type object

Kind: static method of sedraModel
Returns: LexemeMorphologicalType - Lexeme Morphological Type object

ParamTypeDescription
firstSuffixstringFirst suffix enumeration
secondSuffixstringSecond suffix enumeration
thirdSuffixstringThird suffix enumeration
prefixstringM, T, ? enumeration
firstVowelstringFirst Vowel
secondVowelstringSecond Vowel
thirdVowelstringThird Vowel
fourthVowelstringForth Vowel
vowelCountnumberTotal no of vowels in lexeme
radicalTypestringRadical type enumeration
formstringWord form enumeration

sedraModel.getLexemeMorphologicalType(morphologicalType) ⇒ LexemeMorphologicalType

Get Lexeme Morphological Type object from lexeme bit map

Kind: static method of sedraModel
Returns: LexemeMorphologicalType - Lexeme Morphological Type object

ParamTypeDescription
morphologicalTypenumberMorphological Type 32-bit map

sedraModel.getLexeme(id, lexeme, roots) ⇒ FlatLexeme

Return flatten lexeme object with parsed attribute and morphological values

Kind: static method of sedraModel
Returns: FlatLexeme - the flatten lexeme model

ParamTypeDescription
idnumberthe id of current lexeme object
lexemeLexemelexeme raw object
rootsArray.<Root>root list

sedraModel.makeWord(lexemeId, word, vocalised, morphologicalType, attributes) ⇒ Word

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

ParamTypeDescription
lexemeIdnumberLexeme Address, e.g. 2
wordstringWord, e.g. "ABHOH;"
vocalisedstringVocalised Word, e.g. "AaB,oHaOH_;"
morphologicalTypenumber32-bit map
attributesnumber16-bit map

sedraModel.makeWordAttribute(seyame, listing, enclitic, lexeme) ⇒ WordAttribute

Build Word Attribute object

Kind: static method of sedraModel
Returns: WordAttribute - Word Attribute object

ParamTypeDescription
seyamebooleantrue if word has seyame
listingnumberUndocumented
encliticbooleantrue if word has enclitics
lexemebooleantrue if current word is lexeme

sedraModel.getWordAttribute(attributes) ⇒ WordAttribute

Get Word Attribute object from word attribute bit map

Kind: static method of sedraModel
Returns: WordAttribute - Word Attribute object

ParamTypeDescription
attributesnumber16-bit map

sedraModel.makeWordMorphologicalType(suffixGender, suffixPerson, suffixNumber, suffixType, prefixCode, gender, person, number, state, tense, form) ⇒ WordMorphologicalType

Build Word Morphological Type object

Kind: static method of sedraModel
Returns: WordMorphologicalType - Word Morphological Type object

ParamTypeDescription
suffixGenderstringWord Suffix Gender enumeration
suffixPersonstringWord Suffix Person enumeration
suffixNumberstringWord Suffix Number enumeration
suffixTypestringWord Suffix Type enumeration
prefixCodenumberWord Prefix Code
genderstringWord Gender enumeration
personstringWord Person enumeration
numberstringWord Number enumeration
statestringWord State enumeration
tensestringWord Tense enumeration
formstringWord Form enumeration

sedraModel.getWordMorphologicalType(attributes) ⇒ WordMorphologicalType

Get Word Morphological Type object from word bit map

Kind: static method of sedraModel
Returns: WordMorphologicalType - Word Morphological Type object

ParamTypeDescription
attributesnumberMorphological Type 32-bit map

sedraModel.getWord(id, lexeme, lexemes) ⇒ FlatWord

Return flatten word object with parsed attribute and morphological values

Kind: static method of sedraModel
Returns: FlatWord - the flatten word model

ParamTypeDescription
idnumberthe id of current word object
lexemeWordword raw object
lexemesArray.<Lexeme>lexeme list

sedraModel.makeEnglish(lexemeId, word, before, after, comment, attributes, flag) ⇒ English

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

ParamTypeDescription
lexemeIdnumberLexeme address, e.g. 97
wordstringMeaning, e.g. "cause"
beforestringString before meaning, e.g. "without" (i.e. without cause)
afternumberString after meaning, e.g. ""
commentnumberComment, e.g. ""
attributesnumber16-bit map
flagnumber1 bit flag

sedraModel.makeEnglishAttribute(commentPosition, commentFont, stringBeforeFont, stringAfterFont, verb, number, gender, form) ⇒ EnglishAttribute

Build English Attribute object

Kind: static method of sedraModel
Returns: EnglishAttribute - English Attribute object

ParamTypeDescription
commentPositionstringComment before or after word meaning
commentFontstringNormal or Italic
stringBeforeFontstringNormal or Italic string before text font
stringAfterFontstringNormal or Italic string after text font
verbstringNone, Transitive or Intransitive
numberstringWord Number enumeration
genderstringWord Gender enumeration
formstringWord Form enumeration

sedraModel.getEnglishAttribute(attributes) ⇒ EnglishAttribute

Get English Attribute object from english attribute bit map

Kind: static method of sedraModel
Returns: EnglishAttribute - English Attribute object

ParamTypeDescription
attributesnumber16-bit map

sedraModel.getEnglish(id, english, lexemes) ⇒ FlatEnglish

Return flatten english object with parsed attribute values

Kind: static method of sedraModel
Returns: FlatEnglish - the flatten english model

ParamTypeDescription
idnumberthe id of current english object
englishEnglishenglish raw object
lexemesArray.<Lexeme>lexeme list

sedraModel.makeEtymology(lexemeId, word, attributes) ⇒ Etymology

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

ParamTypeDescription
lexemeIdnumberLexeme address, e.g. 1
wordstringWord Origin, e.g. "a\255h\256r"
attributesnumber16-bit map

sedraModel.makeEtymologyAttribute(language, type) ⇒ EtymologyAttribute

Build Etymology Attribute object

Kind: static method of sedraModel
Returns: EtymologyAttribute - Etymology Attribute object

ParamTypeDescription
languagestringthe source language
typestringword type enumeration

sedraModel.getEtymologyAttribute(attributes) ⇒ EtymologyAttribute

Get Etymology Attribute object from etymology attribute bit map

Kind: static method of sedraModel
Returns: EtymologyAttribute - Etymology Attribute object

ParamTypeDescription
attributesnumber16-bit map

sedraModel.getEtymology(id, etymology, lexemes) ⇒ FlatEtymology

Return flatten etymology object with parsed attribute values

Kind: static method of sedraModel
Returns: FlatEtymology - the flatten etymology model

ParamTypeDescription
idnumberthe id of current etymology object
etymologyEtymologyetymology raw object
lexemesArray.<Lexeme>lexeme list

sedraModel.makeBook(id, peshittaId, name, vocalised, english, stats) ⇒ Book

Build a Book object

Kind: static method of sedraModel
Returns: Book - Book object

ParamTypeDescription
idnumberBook Id
peshittaIdnumberBook Eastern Peshitta Id
namestringBook Aramaic name
vocalisedstringBook vocalised Aramaic name
englishArray.<string>Book English names: full name followed by abbreviations
statsobjectBook statistics { chapters, verses, words }

sedraModel.sorter(a, b) ⇒ number

Callback to sort books by Eastern Peshitta ordering

Kind: static method of sedraModel
Returns: number - sort order

ParamTypeDescription
aBooka book
bBookanother book

sedraModel.getBook(id) ⇒ Book

Get book record with the given id from books array

Kind: static method of sedraModel
Returns: Book - Book object from books array

ParamTypeDescription
idnumberBook id

sedraModel.getBooksByEnglish() ⇒ Object

Kind: static method of sedraModel
Returns: Object - English name to Book hash

sedraModel.getBookByEnglish(name) ⇒ Book

Kind: static method of sedraModel
Returns: Book - Book object from books array

ParamTypeDescription
namestringbook English full or short name

sedraModel.getBookEnglishNames() ⇒ Array

Kind: static method of sedraModel
Returns: Array - sorted list of book English names

sedraModel.getNamedReferences() ⇒ Array

Kind: static method of sedraModel
Returns: Array - list of named references

sedraModel.makeBookGroup(id, name, bookSet) ⇒ BookGroup

Build a BookGroup object - a grouping of Peshitta books

Kind: static method of sedraModel
Returns: BookGroup - A Book Group object

ParamTypeDescription
idnumber | stringBook Group assigned Id
namestringBook Group name
bookSetArray.<Book>Book subset from books array

sedraModel.getVerseByIndex(index, ubs) ⇒ object

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

ParamTypeDescription
indexnumberverse index overall NT Peshitta
ubsobjectNT Peshitta object hash

sedraModel.getIndexByVerseWoChapter(reference, ubs) ⇒ number

Get an index by verse reference, leaving out chapter reference indexes

Kind: static method of sedraModel
Returns: number - index

ParamTypeDescription
referenceobject{book:number, chapter:number, verse:number} reference
ubsobjectNT Peshitta object hash

sedraModel.getIndexByVerse(reference, ubs) ⇒ number

Get an index by verse reference with chapter references included

Kind: static method of sedraModel
Returns: number - index

ParamTypeDescription
referenceobject{book:number, chapter:number, verse:number} reference
ubsobjectNT Peshitta object hash
1.2.0

7 years ago

1.1.9

8 years ago

1.1.8

8 years ago

1.1.7

8 years ago

1.1.6

8 years ago

1.1.5

8 years ago

1.1.4

8 years ago

1.1.3

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.9

8 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago