@bibletags/bibletags-ui-helper
v0.11.24
Published
## About
Downloads
38
Readme
Bible Tags
About
Original language Bible study for everyone, in every language.
Vision: That every Christian might have free access to the Bible tagged to the original Hebrew, Aramaic and Greek with parsing and lexical information—all in their own language.
For more information on this project, see the Bible Tags website.
Repos
- bibletags-data
- bibletags-react-native-app
- bibletags-ui-helper
- bibletags-versification
- bibletags-usfm
- bibletags-widget
- bibletags-widget-script
Bugs
- Report here.
bibletags-ui-helper
This repo provides functions used in bibletags-react-native-app, bibletags-widget, and bibletags-data.
Special notes on word divisions
Most modern languages separate words with spaces or other punctuation, but there are some exceptions. See here and here.
To address this, a word divider regex
will need to be provided for any text where the default /[\\P{L}]+/gu
is not the valid regex for the split function.
This will leave some languages without precise word dividers, resulting, at times, in smaller divisions than words (e.g. syllables). While this is not ideal for these languages, it should nonetheless allow all aspects of the app and widget to function properly, and only require a bit more clicking/tapping when tagging these texts to the original languages.
Programmatic exceptions to this approach will be few. To date, the following exception(s) exist:
- Possession and contractions in English using an apostraphe. E.g.
Balaam’s
,shouldn’t
. Such apostraphes will be escaped before theword divider regex
is used to split the verse.
Please contact us to suggest any programmatic exceptions for other languages.
Known examples of languages without precise word dividers:
- Vietnamese and Tai Lü use spaces to divide by syllable.
- Tibetan and Dzongkha use other marks to divide by syllable.
- While most Chinese characters are a single word, some words are made up of more than one.
- Japanese characters are each a single syllable.
- Lao translation may or may not use spaces.
Note: While embedding sites/apps providing USFM for verse content could distinguish between words, this information cannot be relied upon since other embedding sites/apps may only provide plain text.
Functions exposed
getOrigLangVersionIdFromRef(ref): "uhb" | "ugnt"
getOrigLangAndLXXVersionInfo(): Object
getOrigLanguageText(languageId): String // "Hebrew" or "Greek" in the proper language
getVersionStr(versionId): String //e.g. "Hebrew (UHB)" or "ESV"
getRefsInfo({ refs, skipBookName, abbreviated, usfmBookAbbr }): Object // e.g. { bookId: 1, chapter: 1, start_verse: 1, end_verse: 2 }
getPassageStr(params): String // e.g. "Genesis 1:2–3"
getBibleBookName(bookId): String // in the proper language
getUsfmBibleBookAbbr(bookId): String // e.g. "GEN"
getBookIdFromUsfmBibleBookAbbr(abbr): Int // between 1-66
getRefsFromUsfmRefStr(usfmRefStr): [ Object ]
getUsfmRefStrFromLoc(loc): String
getBibleBookAbbreviatedName(bookId): String // e.g. "Gen"
getNormalizedPOSCode({ morphLang, morphPos }): String
getPOSTerm({ languageId, posCode }): String
getMorphPartDisplayInfo({ morphLang, morphPart, isPrefixOrSuffix, wordIsMultiPart }): { str: String, color: String }
getMainWordPartIndex(wordParts): Int
getStrongs(wordInfo): String
getIsEntirelyPrefixAndSuffix(wordInfo): Boolean
hash64(str): String
getWordsHash({ usfm, wordDividerRegex }): [ String ]
getWordHashes({ usfm, wordDividerRegex }): [ { wordNumberInVerse: Int, hash: String, withBeforeHash: String, withAfterHash: String, withBeforeAndAfterHash: String }
isValidEmail(email): Boolean
isOriginalLanguageSearch(searchText): String
getTextLanguageId({ languageId, bookId }): String
isRTLText({ languageId, bookId, searchString }): Boolean
getCopyVerseText({ pieces, ref, versionAbbr }): String | undefined
getMorphInfo(morph): Object
getColorWithOpacity(color='rgba(0,0,0,1)', opacity): String
passOverI18n(i18nFunc): null
passOverI18nNumber(i18nNumberFunc): null
blockUsfmMarkers: Array
wordPartDividerRegex: RegExp
headingBlockUsfmMarkers: Array
inlineUsfmMarkers: Array
specialUsfmMarkers: Array
tagInList({ tag, list }): Boolean
getPiecesFromUSFM({ usfm='', inlineMarkersOnly, wordDividerRegex, splitIntoWords }): Array
splitVerseIntoWords({ usfm, wordDividerRegex, pieces, isOriginal }): Array
adjustPiecesForSpecialHebrew({ isOriginal, languageId, pieces }): Array
adjustTextForSups({ tag, text, pieces, idx }): String
getNormalizedGreekPOSCode(posCode): String
getGreekPOSTerm(posCode): String
getGreekPOSTypeTerm(posCode): String
getGreekMorphPartDisplayInfo({ morphPart }): Object
getHebrewPOSTerm(posCode): String
getGrammarColor({ isPrefixOrSuffix, morphPart="" }): String | undefined
grammarColors: Object
getHebrewMorphPartDisplayInfo({ morphLang, morphPart, isPrefixOrSuffix, wordIsMultiPart }): Object
bibleSearch({ query, flags, hebrewOrdering, offset, limit, getVersions, getUnitWords, getUnitRanges, getVerses, maxNumVersion=5, doClocking=false }): Object
getQueryAndFlagInfo({ query, FLAG_MAP={} }): Object
getInfoOnResultLocs({ resultsNeedingUsfm, lookupVersionInfo }): Object
containsHebrewChars(str): Boolean
containsGreekChars(str): Boolean
removeCantillation(usfm): String
stripHebrewVowelsEtc(str): String
normalizeSearchStr({ str, languageId }): String
stripVocalOfAccents(str): String
findLanguage({ searchStr, maxNumHits }): [Object]
getLanguageInfo(iso6393): Object
Constants exposed
defaultWordDividerRegex: String
bibleSearchScopes: Object