0.11.15 • Published 2 months ago

@bibletags/bibletags-ui-helper v0.11.15

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

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

Bugs

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 the word 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
0.11.15

2 months ago

0.11.12

11 months ago

0.11.13

10 months ago

0.11.14

10 months ago

0.11.10

11 months ago

0.11.11

11 months ago

0.11.8

1 year ago

0.11.9

1 year ago

0.11.7

1 year ago

0.11.0

1 year ago

0.10.14

1 year ago

0.11.1

1 year ago

0.11.2

1 year ago

0.11.3

1 year ago

0.11.4

1 year ago

0.11.5

1 year ago

0.10.11

1 year ago

0.11.6

1 year ago

0.10.12

1 year ago

0.10.13

1 year ago

0.10.9

1 year ago

0.10.8

2 years ago

0.10.10

1 year ago

0.10.4

2 years ago

0.10.5

2 years ago

0.10.6

2 years ago

0.10.7

2 years ago

0.9.14

2 years ago

0.9.15

2 years ago

0.9.16

2 years ago

0.10.1

2 years ago

0.10.2

2 years ago

0.10.3

2 years ago

0.10.0

2 years ago

0.9.12

2 years ago

0.9.13

2 years ago

0.8.5

2 years ago

0.8.4

2 years ago

0.9.10

2 years ago

0.9.11

2 years ago

0.9.0

2 years ago

0.9.2

2 years ago

0.9.1

2 years ago

0.9.8

2 years ago

0.7.11

2 years ago

0.9.7

2 years ago

0.7.10

2 years ago

0.7.9

2 years ago

0.7.13

2 years ago

0.9.9

2 years ago

0.7.12

2 years ago

0.9.4

2 years ago

0.7.6

2 years ago

0.9.3

2 years ago

0.7.5

2 years ago

0.9.6

2 years ago

0.7.8

2 years ago

0.9.5

2 years ago

0.7.7

2 years ago

0.7.19

2 years ago

0.7.18

2 years ago

0.7.15

2 years ago

0.7.14

2 years ago

0.7.17

2 years ago

0.7.16

2 years ago

0.8.1

2 years ago

0.8.0

2 years ago

0.8.3

2 years ago

0.8.2

2 years ago

0.7.2

2 years ago

0.7.1

2 years ago

0.7.4

2 years ago

0.7.3

2 years ago

0.7.0

2 years ago

0.5.24

2 years ago

0.6.2

2 years ago

0.6.1

2 years ago

0.6.0

2 years ago

0.5.18

2 years ago

0.5.19

2 years ago

0.5.16

2 years ago

0.5.17

2 years ago

0.5.14

2 years ago

0.5.15

2 years ago

0.5.12

2 years ago

0.5.13

2 years ago

0.5.21

2 years ago

0.5.22

2 years ago

0.5.20

2 years ago

0.5.23

2 years ago

0.5.10

2 years ago

0.5.11

2 years ago

0.5.9

2 years ago

0.5.8

2 years ago

0.5.7

2 years ago

0.5.6

2 years ago

0.5.5

2 years ago

0.5.4

2 years ago

0.5.3

2 years ago

0.5.2

2 years ago

0.5.1

2 years ago

0.5.0

2 years ago

0.4.0

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.9

2 years ago

0.2.8

2 years ago

0.2.7

2 years ago

0.2.6

2 years ago

0.2.5

2 years ago

0.2.4

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.0

2 years ago