@bibletags/bibletags-ui-helper v0.11.30
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 regexis 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(): ObjectgetOrigLanguageText(languageId): String // "Hebrew" or "Greek" in the proper languagegetVersionStr(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 languagegetUsfmBibleBookAbbr(bookId): String // e.g. "GEN"getBookIdFromUsfmBibleBookAbbr(abbr): Int // between 1-66getRefsFromUsfmRefStr(usfmRefStr): [ Object ]getUsfmRefStrFromLoc(loc): StringgetBibleBookAbbreviatedName(bookId): String // e.g. "Gen"getNormalizedPOSCode({ morphLang, morphPos }): StringgetPOSTerm({ languageId, posCode }): StringgetMorphPartDisplayInfo({ morphLang, morphPart, isPrefixOrSuffix, wordIsMultiPart }): { str: String, color: String }getMainWordPartIndex(wordParts): IntgetStrongs(wordInfo): StringgetIsEntirelyPrefixAndSuffix(wordInfo): Booleanhash64(str): StringgetWordsHash({ usfm, wordDividerRegex }): [ String ]getWordHashes({ usfm, wordDividerRegex }): [ { wordNumberInVerse: Int, hash: String, withBeforeHash: String, withAfterHash: String, withBeforeAndAfterHash: String }isValidEmail(email): BooleanisOriginalLanguageSearch(searchText): StringgetTextLanguageId({ languageId, bookId }): StringisRTLText({ languageId, bookId, searchString }): BooleangetCopyVerseText({ pieces, ref, versionAbbr }): String | undefinedgetMorphInfo(morph): ObjectgetColorWithOpacity(color='rgba(0,0,0,1)', opacity): StringpassOverI18n(i18nFunc): nullpassOverI18nNumber(i18nNumberFunc): nullblockUsfmMarkers: ArraywordPartDividerRegex: RegExpheadingBlockUsfmMarkers: ArrayinlineUsfmMarkers: ArrayspecialUsfmMarkers: ArraytagInList({ tag, list }): BooleangetPiecesFromUSFM({ usfm='', inlineMarkersOnly, wordDividerRegex, splitIntoWords }): ArraysplitVerseIntoWords({ usfm, wordDividerRegex, pieces, isOriginal }): ArrayadjustPiecesForSpecialHebrew({ isOriginal, languageId, pieces }): ArrayadjustTextForSups({ tag, text, pieces, idx }): StringgetNormalizedGreekPOSCode(posCode): StringgetGreekPOSTerm(posCode): StringgetGreekPOSTypeTerm(posCode): StringgetGreekMorphPartDisplayInfo({ morphPart }): ObjectgetHebrewPOSTerm(posCode): StringgetGrammarColor({ isPrefixOrSuffix, morphPart="" }): String | undefinedgrammarColors: ObjectgetHebrewMorphPartDisplayInfo({ morphLang, morphPart, isPrefixOrSuffix, wordIsMultiPart }): ObjectbibleSearch({ query, flags, hebrewOrdering, offset, limit, getVersions, getUnitWords, getUnitRanges, getVerses, maxNumVersion=5, doClocking=false }): ObjectgetQueryAndFlagInfo({ query, FLAG_MAP={} }): ObjectgetInfoOnResultLocs({ resultsNeedingUsfm, lookupVersionInfo }): ObjectcontainsHebrewChars(str): BooleancontainsGreekChars(str): BooleanremoveCantillation(usfm): StringstripHebrewVowelsEtc(str): StringnormalizeSearchStr({ str, languageId }): StringstripVocalOfAccents(str): StringfindLanguage({ searchStr, maxNumHits }): [Object]getLanguageInfo(iso6393): ObjectConstants exposed
defaultWordDividerRegex: StringbibleSearchScopes: Object8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
7 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
4 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago