{ "cells": [ { "cell_type": "markdown", "id": "d824a2cc-56ba-443c-90a4-7ded0d791353", "metadata": {}, "source": [ "# Lexical parallels in parasha #11 Vayigash (Genesis 44:18-47:27)" ] }, { "cell_type": "markdown", "id": "60af701a-2af8-4297-b840-545749d9a1f1", "metadata": {}, "source": [ "## Table of Content (ToC)\n", "\n", "* 1 - Introduction\n", "* 2 - Load Text-Fabric app and data\n", "* 3 - Performing the queries\n", " * 3.1 - Locate the parallels\n", "* 4 - Required libraries\n", "* 5 - Further reading\n", "* 6 - Notebook version details" ] }, { "cell_type": "markdown", "id": "b17560e5-9e90-4008-ae35-04a34624a43a", "metadata": { "tags": [] }, "source": [ "# 1 - Introduction \n", "##### [Back to ToC](#TOC)\n", "\n", "In this notebook we search for lexical parallels between verses in this parasha with other verses in the Tenach." ] }, { "cell_type": "markdown", "id": "0ad449f1-c3bf-4e45-95e0-6eefac4bc1dc", "metadata": {}, "source": [ "# 2 - Load Text-Fabric app and data \n", "##### [Back to ToC](#TOC)\n", "\n", "The following code will load the Text-Fabric version of the [Biblia Hebraica Stuttgartensia (Amstelodamensis)](https://etcbc.github.io/bhsa/)." ] }, { "cell_type": "code", "execution_count": 1, "id": "21fbcf7c-98da-4319-a344-d644da5cfec5", "metadata": { "tags": [] }, "outputs": [], "source": [ "%load_ext autoreload\n", "%autoreload 2" ] }, { "cell_type": "code", "execution_count": 2, "id": "a290709d-978e-4d29-918c-fddd7d8041e4", "metadata": {}, "outputs": [], "source": [ "# Loading the Text-Fabric code\n", "# Note: it is assumed Text-Fabric is installed in your environment.\n", "from tf.fabric import Fabric\n", "from tf.app import use" ] }, { "cell_type": "code", "execution_count": 3, "id": "14e1cb4c-554a-4785-a4dd-6a89778d5cd3", "metadata": { "scrolled": true, "tags": [] }, "outputs": [ { "data": { "text/markdown": [ "**Locating corpus resources ...**" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "app: ~/text-fabric-data/github/etcbc/BHSA/app" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "data: ~/text-fabric-data/github/etcbc/BHSA/tf/2021" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "data: ~/text-fabric-data/github/tonyjurg/BHSaddons/tf/2021" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "data: ~/text-fabric-data/github/etcbc/phono/tf/2021" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "data: ~/text-fabric-data/github/etcbc/parallels/tf/2021" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n", " TF: TF API 12.6.1, etcbc/BHSA/app v3, Search Reference
\n", " Data: etcbc - BHSA 2021, Character table, Feature docs
\n", "
Node types\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", "\n", "\n", " \n", " \n", " \n", " \n", "\n", "\n", "\n", " \n", " \n", " \n", " \n", "\n", "\n", "\n", " \n", " \n", " \n", " \n", "\n", "\n", "\n", " \n", " \n", " \n", " \n", "\n", "\n", "\n", " \n", " \n", " \n", " \n", "\n", "\n", "\n", " \n", " \n", " \n", " \n", "\n", "\n", "\n", " \n", " \n", " \n", " \n", "\n", "\n", "\n", " \n", " \n", " \n", " \n", "\n", "\n", "\n", " \n", " \n", " \n", " \n", "\n", "\n", "\n", " \n", " \n", " \n", " \n", "\n", "\n", "\n", " \n", " \n", " \n", " \n", "\n", "\n", "\n", " \n", " \n", " \n", " \n", "\n", "\n", "\n", " \n", " \n", " \n", " \n", "\n", "
Name# of nodes# slots / node% coverage
book3910938.21100
chapter929459.19100
lex923046.22100
verse2321318.38100
half_verse451799.44100
sentence637176.70100
sentence_atom645146.61100
clause881314.84100
clause_atom907044.70100
phrase2532031.68100
phrase_atom2675321.59100
subphrase1138501.4238
word4265901.00100
\n", " Sets: no custom sets
\n", " Features:
\n", "
Parallel Passages\n", "
\n", "\n", "
\n", "
\n", "crossref\n", "
\n", "
int
\n", "\n", " 🆗 links between similar passages\n", "\n", "
\n", "\n", "
\n", "
\n", "\n", "
BHSA = Biblia Hebraica Stuttgartensia Amstelodamensis\n", "
\n", "\n", "
\n", "
\n", "book\n", "
\n", "
str
\n", "\n", " ✅ book name in Latin (Genesis; Numeri; Reges1; ...)\n", "\n", "
\n", "\n", "
\n", "
\n", "book@ll\n", "
\n", "
str
\n", "\n", " ✅ book name in amharic (ኣማርኛ)\n", "\n", "
\n", "\n", "
\n", "
\n", "chapter\n", "
\n", "
int
\n", "\n", " ✅ chapter number (1; 2; 3; ...)\n", "\n", "
\n", "\n", "
\n", "
\n", "code\n", "
\n", "
int
\n", "\n", " ✅ identifier of a clause atom relationship (0; 74; 367; ...)\n", "\n", "
\n", "\n", "
\n", "
\n", "det\n", "
\n", "
str
\n", "\n", " ✅ determinedness of phrase(atom) (det; und; NA.)\n", "\n", "
\n", "\n", "
\n", "
\n", "domain\n", "
\n", "
str
\n", "\n", " ✅ text type of clause (? (Unknown); N (narrative); D (discursive); Q (Quotation).)\n", "\n", "
\n", "\n", "
\n", "
\n", "freq_lex\n", "
\n", "
int
\n", "\n", " ✅ frequency of lexemes\n", "\n", "
\n", "\n", "
\n", "
\n", "function\n", "
\n", "
str
\n", "\n", " ✅ syntactic function of phrase (Cmpl; Objc; Pred; ...)\n", "\n", "
\n", "\n", "
\n", "
\n", "g_cons\n", "
\n", "
str
\n", "\n", " ✅ word consonantal-transliterated (B R>CJT BR> >LHJM ...)\n", "\n", "
\n", "\n", "
\n", "
\n", "g_cons_utf8\n", "
\n", "
str
\n", "\n", " ✅ word consonantal-Hebrew (ב ראשׁית ברא אלהים)\n", "\n", "
\n", "\n", "
\n", "
\n", "g_lex\n", "
\n", "
str
\n", "\n", " ✅ lexeme pointed-transliterated (B.:- R;>CIJT B.@R@> >:ELOH ...)\n", "\n", "
\n", "\n", "
\n", "
\n", "g_lex_utf8\n", "
\n", "
str
\n", "\n", " ✅ lexeme pointed-Hebrew (בְּ רֵאשִׁית בָּרָא אֱלֹה)\n", "\n", "
\n", "\n", "
\n", "
\n", "g_word\n", "
\n", "
str
\n", "\n", " ✅ word pointed-transliterated (B.:- R;>CI73JT B.@R@74> >:ELOHI92JM)\n", "\n", "
\n", "\n", "
\n", "
\n", "g_word_utf8\n", "
\n", "
str
\n", "\n", " ✅ word pointed-Hebrew (בְּ רֵאשִׁ֖ית בָּרָ֣א אֱלֹהִ֑ים)\n", "\n", "
\n", "\n", "
\n", "
\n", "gloss\n", "
\n", "
str
\n", "\n", " 🆗 english translation of lexeme (beginning create god(s))\n", "\n", "
\n", "\n", "
\n", "
\n", "gn\n", "
\n", "
str
\n", "\n", " ✅ grammatical gender (m; f; NA; unknown.)\n", "\n", "
\n", "\n", "
\n", "
\n", "label\n", "
\n", "
str
\n", "\n", " ✅ (half-)verse label (half verses: A; B; C; verses: GEN 01,02)\n", "\n", "
\n", "\n", "
\n", "
\n", "language\n", "
\n", "
str
\n", "\n", " ✅ of word or lexeme (Hebrew; Aramaic.)\n", "\n", "
\n", "\n", "
\n", "
\n", "lex\n", "
\n", "
str
\n", "\n", " ✅ lexeme consonantal-transliterated (B R>CJT/ BR>[ >LHJM/)\n", "\n", "
\n", "\n", "
\n", "
\n", "lex_utf8\n", "
\n", "
str
\n", "\n", " ✅ lexeme consonantal-Hebrew (ב ראשׁית֜ ברא אלהים֜)\n", "\n", "
\n", "\n", "
\n", "
\n", "ls\n", "
\n", "
str
\n", "\n", " ✅ lexical set, subclassification of part-of-speech (card; ques; mult)\n", "\n", "
\n", "\n", "
\n", "
\n", "nametype\n", "
\n", "
str
\n", "\n", " ⚠️ named entity type (pers; mens; gens; topo; ppde.)\n", "\n", "
\n", "\n", "
\n", "
\n", "nme\n", "
\n", "
str
\n", "\n", " ✅ nominal ending consonantal-transliterated (absent; n/a; JM, ...)\n", "\n", "
\n", "\n", "
\n", "
\n", "nu\n", "
\n", "
str
\n", "\n", " ✅ grammatical number (sg; du; pl; NA; unknown.)\n", "\n", "
\n", "\n", "
\n", "
\n", "number\n", "
\n", "
int
\n", "\n", " ✅ sequence number of an object within its context\n", "\n", "
\n", "\n", "
\n", "
\n", "otype\n", "
\n", "
str
\n", "\n", " \n", "\n", "
\n", "\n", "
\n", "
\n", "pargr\n", "
\n", "
str
\n", "\n", " 🆗 hierarchical paragraph number (1; 1.2; 1.2.3.4; ...)\n", "\n", "
\n", "\n", "
\n", "
\n", "pdp\n", "
\n", "
str
\n", "\n", " ✅ phrase dependent part-of-speech (art; verb; subs; nmpr, ...)\n", "\n", "
\n", "\n", "
\n", "
\n", "pfm\n", "
\n", "
str
\n", "\n", " ✅ preformative consonantal-transliterated (absent; n/a; J, ...)\n", "\n", "
\n", "\n", "
\n", "
\n", "prs\n", "
\n", "
str
\n", "\n", " ✅ pronominal suffix consonantal-transliterated (absent; n/a; W; ...)\n", "\n", "
\n", "\n", "
\n", "
\n", "prs_gn\n", "
\n", "
str
\n", "\n", " ✅ pronominal suffix gender (m; f; NA; unknown.)\n", "\n", "
\n", "\n", "
\n", "
\n", "prs_nu\n", "
\n", "
str
\n", "\n", " ✅ pronominal suffix number (sg; du; pl; NA; unknown.)\n", "\n", "
\n", "\n", "
\n", "
\n", "prs_ps\n", "
\n", "
str
\n", "\n", " ✅ pronominal suffix person (p1; p2; p3; NA; unknown.)\n", "\n", "
\n", "\n", "
\n", "
\n", "ps\n", "
\n", "
str
\n", "\n", " ✅ grammatical person (p1; p2; p3; NA; unknown.)\n", "\n", "
\n", "\n", "
\n", "
\n", "qere\n", "
\n", "
str
\n", "\n", " ✅ word pointed-transliterated masoretic reading correction\n", "\n", "
\n", "\n", "
\n", "
\n", "qere_trailer\n", "
\n", "
str
\n", "\n", " ✅ interword material -pointed-transliterated (Masoretic correction)\n", "\n", "
\n", "\n", "
\n", "
\n", "qere_trailer_utf8\n", "
\n", "
str
\n", "\n", " ✅ interword material -pointed-transliterated (Masoretic correction)\n", "\n", "
\n", "\n", "
\n", "
\n", "qere_utf8\n", "
\n", "
str
\n", "\n", " ✅ word pointed-Hebrew masoretic reading correction\n", "\n", "
\n", "\n", "
\n", "
\n", "rank_lex\n", "
\n", "
int
\n", "\n", " ✅ ranking of lexemes based on freqnuecy\n", "\n", "
\n", "\n", "
\n", "
\n", "rela\n", "
\n", "
str
\n", "\n", " ✅ linguistic relation between clause/(sub)phrase(atom) (ADJ; MOD; ATR; ...)\n", "\n", "
\n", "\n", "
\n", "
\n", "sp\n", "
\n", "
str
\n", "\n", " ✅ part-of-speech (art; verb; subs; nmpr, ...)\n", "\n", "
\n", "\n", "
\n", "
\n", "st\n", "
\n", "
str
\n", "\n", " ✅ state of a noun (a (absolute); c (construct); e (emphatic).)\n", "\n", "
\n", "\n", "
\n", "
\n", "tab\n", "
\n", "
int
\n", "\n", " ✅ clause atom: its level in the linguistic embedding\n", "\n", "
\n", "\n", "
\n", "
\n", "trailer\n", "
\n", "
str
\n", "\n", " ✅ interword material pointed-transliterated (& 00 05 00_P ...)\n", "\n", "
\n", "\n", "
\n", "
\n", "trailer_utf8\n", "
\n", "
str
\n", "\n", " ✅ interword material pointed-Hebrew (־ ׃)\n", "\n", "
\n", "\n", "
\n", "
\n", "txt\n", "
\n", "
str
\n", "\n", " ✅ text type of clause and surrounding (repetion of ? N D Q as in feature domain)\n", "\n", "
\n", "\n", "
\n", "
\n", "typ\n", "
\n", "
str
\n", "\n", " ✅ clause/phrase(atom) type (VP; NP; Ellp; Ptcp; WayX)\n", "\n", "
\n", "\n", "
\n", "
\n", "uvf\n", "
\n", "
str
\n", "\n", " ✅ univalent final consonant consonantal-transliterated (absent; N; J; ...)\n", "\n", "
\n", "\n", "
\n", "
\n", "vbe\n", "
\n", "
str
\n", "\n", " ✅ verbal ending consonantal-transliterated (n/a; W; ...)\n", "\n", "
\n", "\n", "
\n", "
\n", "vbs\n", "
\n", "
str
\n", "\n", " ✅ root formation consonantal-transliterated (absent; n/a; H; ...)\n", "\n", "
\n", "\n", "
\n", "
\n", "verse\n", "
\n", "
int
\n", "\n", " ✅ verse number\n", "\n", "
\n", "\n", "
\n", "
\n", "voc_lex\n", "
\n", "
str
\n", "\n", " ✅ vocalized lexeme pointed-transliterated (B.: R;>CIJT BR> >:ELOHIJM)\n", "\n", "
\n", "\n", "
\n", "
\n", "voc_lex_utf8\n", "
\n", "
str
\n", "\n", " ✅ vocalized lexeme pointed-Hebrew (בְּ רֵאשִׁית ברא אֱלֹהִים)\n", "\n", "
\n", "\n", "
\n", "
\n", "vs\n", "
\n", "
str
\n", "\n", " ✅ verbal stem (qal; piel; hif; apel; pael)\n", "\n", "
\n", "\n", "
\n", "
\n", "vt\n", "
\n", "
str
\n", "\n", " ✅ verbal tense (perf; impv; wayq; infc)\n", "\n", "
\n", "\n", "
\n", "
\n", "mother\n", "
\n", "
none
\n", "\n", " ✅ linguistic dependency between textual objects\n", "\n", "
\n", "\n", "
\n", "
\n", "oslots\n", "
\n", "
none
\n", "\n", " \n", "\n", "
\n", "\n", "
\n", "
\n", "\n", "
Phonetic Transcriptions\n", "
\n", "\n", "
\n", "
\n", "phono\n", "
\n", "
str
\n", "\n", " 🆗 phonological transcription (bᵊ rēšˌîṯ bārˈā ʔᵉlōhˈîm)\n", "\n", "
\n", "\n", "
\n", "
\n", "phono_trailer\n", "
\n", "
str
\n", "\n", " 🆗 interword material in phonological transcription\n", "\n", "
\n", "\n", "
\n", "
\n", "\n", "
tonyjurg/BHSaddons/tf\n", "
\n", "\n", "
\n", "
\n", "aliyotnum\n", "
\n", "
str
\n", "\n", " The sequence number of the aliyot within the parasha\n", "\n", "
\n", "\n", "
\n", "
\n", "maftir\n", "
\n", "
str
\n", "\n", " Set to 1 if this verse is part of a maftir\n", "\n", "
\n", "\n", "
\n", "
\n", "parashahebr\n", "
\n", "
str
\n", "\n", " The name of the parasha in Hebrew\n", "\n", "
\n", "\n", "
\n", "
\n", "parashanum\n", "
\n", "
int
\n", "\n", " The sequence number of the parasha\n", "\n", "
\n", "\n", "
\n", "
\n", "parashatrans\n", "
\n", "
str
\n", "\n", " Transliteration of the Hebrew parasha name\n", "\n", "
\n", "\n", "
\n", "
\n", "parashaverse\n", "
\n", "
str
\n", "\n", " The sequence number of the verse within the parasha\n", "\n", "
\n", "\n", "
\n", "
\n", "wordboundary\n", "
\n", "
str
\n", "\n", " indicates wordboudaries (spaces OR maqaf)\n", "\n", "
\n", "\n", "
\n", "
\n", "\n", " Settings:
specified
  1. apiVersion: 3
  2. appName: etcbc/BHSA
  3. appPath: C:/Users/tonyj/text-fabric-data/github/etcbc/BHSA/app
  4. commit: gd905e3fb6e80d0fa537600337614adc2af157309
  5. css: ''
  6. dataDisplay:
    • exampleSectionHtml:<code>Genesis 1:1</code> (use <a href=\"https://github.com/{org}/{repo}/blob/master/tf/{version}/book%40en.tf\" target=\"_blank\">English book names</a>)
    • excludedFeatures:
      • g_uvf_utf8
      • g_vbs
      • kq_hybrid
      • languageISO
      • g_nme
      • lex0
      • is_root
      • g_vbs_utf8
      • g_uvf
      • dist
      • root
      • suffix_person
      • g_vbe
      • dist_unit
      • suffix_number
      • distributional_parent
      • kq_hybrid_utf8
      • crossrefSET
      • instruction
      • g_prs
      • lexeme_count
      • rank_occ
      • g_pfm_utf8
      • freq_occ
      • crossrefLCS
      • functional_parent
      • g_pfm
      • g_nme_utf8
      • g_vbe_utf8
      • kind
      • g_prs_utf8
      • suffix_gender
      • mother_object_type
    • noneValues:
      • none
      • unknown
      • no value
      • NA
  7. docs:
    • docBase: {docRoot}/{repo}
    • docExt: ''
    • docPage: ''
    • docRoot: https://{org}.github.io
    • featurePage: 0_home
  8. interfaceDefaults: {}
  9. isCompatible: True
  10. local: local
  11. localDir: C:/Users/tonyj/text-fabric-data/github/etcbc/BHSA/_temp
  12. provenanceSpec:
    • corpus: BHSA = Biblia Hebraica Stuttgartensia Amstelodamensis
    • doi: 10.5281/zenodo.1007624
    • moduleSpecs:
      • :
        • backend: no value
        • corpus: Phonetic Transcriptions
        • docUrl:https://nbviewer.jupyter.org/github/etcbc/phono/blob/master/programs/phono.ipynb
        • doi: 10.5281/zenodo.1007636
        • org: etcbc
        • relative: /tf
        • repo: phono
      • :
        • backend: no value
        • corpus: Parallel Passages
        • docUrl:https://nbviewer.jupyter.org/github/etcbc/parallels/blob/master/programs/parallels.ipynb
        • doi: 10.5281/zenodo.1007642
        • org: etcbc
        • relative: /tf
        • repo: parallels
    • org: etcbc
    • relative: /tf
    • repo: BHSA
    • version: 2021
    • webBase: https://shebanq.ancient-data.org/hebrew
    • webHint: Show this on SHEBANQ
    • webLang: la
    • webLexId: True
    • webUrl:{webBase}/text?book=<1>&chapter=<2>&verse=<3>&version={version}&mr=m&qw=q&tp=txt_p&tr=hb&wget=v&qget=v&nget=vt
    • webUrlLex: {webBase}/word?version={version}&id=<lid>
  13. release: v1.8
  14. typeDisplay:
    • clause:
      • label: {typ} {rela}
      • style: ''
    • clause_atom:
      • hidden: True
      • label: {code}
      • level: 1
      • style: ''
    • half_verse:
      • hidden: True
      • label: {label}
      • style: ''
      • verselike: True
    • lex:
      • featuresBare: gloss
      • label: {voc_lex_utf8}
      • lexOcc: word
      • style: orig
      • template: {voc_lex_utf8}
    • phrase:
      • label: {typ} {function}
      • style: ''
    • phrase_atom:
      • hidden: True
      • label: {typ} {rela}
      • level: 1
      • style: ''
    • sentence:
      • label: {number}
      • style: ''
    • sentence_atom:
      • hidden: True
      • label: {number}
      • level: 1
      • style: ''
    • subphrase:
      • hidden: True
      • label: {number}
      • style: ''
    • word:
      • features: pdp vs vt
      • featuresBare: lex:gloss
  15. writing: hbo
\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n", "\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
TF API: names N F E L T S C TF Fs Fall Es Eall Cs Call directly usable

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# load the app and data\n", "BHSA = use (\"etcbc/BHSA\", mod=\"tonyjurg/BHSaddons/tf/\", hoist=globals())" ] }, { "cell_type": "markdown", "id": "bd939a75-8253-4119-b64d-3d5c403ed096", "metadata": {}, "source": [ "# 3 - Performing the queries \n", "##### [Back to ToC](#TOC)\n", "\n", "The main engine of our queries is the use of Text-Fabric feature `crossref`, part of `Parallel Passages` module. See also [this notebook](https://nbviewer.org/github/etcbc/parallels/blob/master/programs/parallels.ipynb) explaing the concepts and how this feature was created." ] }, { "cell_type": "markdown", "id": "98d90b55-8aed-4691-8a7d-e110c48d4857", "metadata": {}, "source": [ "## 3.1 - Locate the parallels " ] }, { "cell_type": "code", "execution_count": 4, "id": "9f2d4e15-43e8-4ab6-946b-52e2178e0f21", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " 0.01s 106 results\n" ] } ], "source": [ "# find all verse nodes for this parasha using its sequence number\n", "parashaQuery = '''\n", "verse parashanum=11\n", "'''\n", "parashaResults = BHSA.search(parashaQuery)" ] }, { "cell_type": "code", "execution_count": 5, "id": "c26a2bf5-bb27-4bed-a562-3c786bd3835a", "metadata": {}, "outputs": [], "source": [ "# Store parashname, start and end verse for future use\n", "startNode=parashaResults[0][0]\n", "endNode=parashaResults[-1][0]\n", "parashaNameHebrew=F.parashahebr.v(startNode)\n", "parashaNameEnglish=F.parashatrans.v(startNode)\n", "bookStart,chapterStart,startVerse=T.sectionFromNode(startNode)\n", "parashaStart=f'{bookStart} {chapterStart}:{startVerse}'\n", "bookEnd,chapterEnd,startEnd=T.sectionFromNode(endNode)\n", "parashaEnd=f'{chapterEnd}:{startEnd}'\n", "htmlStart=''\n", "htmlFooter=f'

Data generated by `hapax.ipynb` at `github.com/tonyjurg/Parashot`

'" ] }, { "cell_type": "code", "execution_count": 6, "id": "62c96550-4ca8-458c-8fce-3296bd733bd1", "metadata": {}, "outputs": [ { "data": { "text/html": [ "

Lexical parallels for parasha Vayigash (Genesis 44:18-47:27)

Cross-references for Genesis 44:26

וַנֹּ֕אמֶר לֹ֥א נוּכַ֖ל לָרֶ֑דֶת אִם־יֵשׁ֩ אָחִ֨ינוּ הַקָּטֹ֤ן אִתָּ֨נוּ֙ וְיָרַ֔דְנוּ כִּי־לֹ֣א נוּכַ֗ל לִרְאֹות֙ פְּנֵ֣י הָאִ֔ישׁ וְאָחִ֥ינוּ הַקָּטֹ֖ן אֵינֶ֥נּוּ אִתָּֽנוּ׃
ReferenceMatchText
Genesis 43:575%וְאִם־אֵינְךָ֥ מְשַׁלֵּ֖חַ לֹ֣א נֵרֵ֑ד כִּֽי־הָאִ֞ישׁ אָמַ֤ר אֵלֵ֨ינוּ֙ לֹֽא־תִרְא֣וּ פָנַ֔י בִּלְתִּ֖י אֲחִיכֶ֥ם אִתְּכֶֽם׃

Cross-references for Genesis 46:8

וְאֵ֨לֶּה שְׁמֹ֧ות בְּנֵֽי־יִשְׂרָאֵ֛ל הַבָּאִ֥ים מִצְרַ֖יְמָה יַעֲקֹ֣ב וּבָנָ֑יו בְּכֹ֥ר יַעֲקֹ֖ב רְאוּבֵֽן׃
ReferenceMatchText
Exodus 1:181%וְאֵ֗לֶּה שְׁמֹות֙ בְּנֵ֣י יִשְׂרָאֵ֔ל הַבָּאִ֖ים מִצְרָ֑יְמָה אֵ֣ת יַעֲקֹ֔ב אִ֥ישׁ וּבֵיתֹ֖ו בָּֽאוּ׃

Cross-references for Genesis 46:9

וּבְנֵ֖י רְאוּבֵ֑ן חֲנֹ֥וךְ וּפַלּ֖וּא וְחֶצְרֹ֥ון וְכַרְמִֽי׃
ReferenceMatchText
1_Chronicles 5:380%בְּנֵ֥י רְאוּבֵ֖ן בְּכֹ֣ור יִשְׂרָאֵ֑ל חֲנֹ֥וךְ וּפַלּ֖וּא חֶצְרֹ֥ון וְכַרְמִֽי׃

Cross-references for Genesis 46:10

וּבְנֵ֣י שִׁמְעֹ֗ון יְמוּאֵ֧ל וְיָמִ֛ין וְאֹ֖הַד וְיָכִ֣ין וְצֹ֑חַר וְשָׁא֖וּל בֶּן־הַֽכְּנַעֲנִֽית׃
ReferenceMatchText
Exodus 6:1584%וּבְנֵ֣י שִׁמְעֹ֗ון יְמוּאֵ֨ל וְיָמִ֤ין וְאֹ֨הַד֙ וְיָכִ֣ין וְצֹ֔חַר וְשָׁא֖וּל בֶּן־הַֽכְּנַעֲנִ֑ית אֵ֖לֶּה מִשְׁפְּחֹ֥ת שִׁמְעֹֽון׃

Cross-references for Genesis 46:11

וּבְנֵ֖י לֵוִ֑י גֵּרְשֹׁ֕ון קְהָ֖ת וּמְרָרִֽי׃
ReferenceMatchText
Numbers 3:1776%וַיִּֽהְיוּ־אֵ֥לֶּה בְנֵֽי־לֵוִ֖י בִּשְׁמֹתָ֑ם גֵּרְשֹׁ֕ון וּקְהָ֖ת וּמְרָרִֽי׃
1_Chronicles 5:27100%בְּנֵ֖י לֵוִ֑י גֵּרְשֹׁ֕ון קְהָ֖ת וּמְרָרִֽי׃
1_Chronicles 6:194%בְּנֵ֖י לֵוִ֑י גֵּרְשֹׁ֕ם קְהָ֖ת וּמְרָרִֽי׃

Cross-references for Genesis 46:13

וּבְנֵ֖י יִשָׂשכָ֑ר תֹּולָ֥ע וּפֻוָּ֖ה וְיֹ֥וב וְשִׁמְרֹֽון׃
ReferenceMatchText
1_Chronicles 7:186%וְלִבְנֵ֣י יִשָׂשכָ֗ר תֹּולָ֧ע וּפוּאָ֛ה יָשׁ֥וּב וְשִׁמְרֹ֖ון אַרְבָּעָֽה׃ ס

Cross-references for Genesis 46:17

וּבְנֵ֣י אָשֵׁ֗ר יִמְנָ֧ה וְיִשְׁוָ֛ה וְיִשְׁוִ֥י וּבְרִיעָ֖ה וְשֶׂ֣רַח אֲחֹתָ֑ם וּבְנֵ֣י בְרִיעָ֔ה חֶ֖בֶר וּמַלְכִּיאֵֽל׃
ReferenceMatchText
1_Chronicles 7:3078%בְּנֵ֣י אָשֵׁ֗ר יִמְנָ֧ה וְיִשְׁוָ֛ה וְיִשְׁוִ֥י וּבְרִיעָ֖ה וְשֶׂ֥רַח אֲחֹותָֽם׃

Cross-references for Genesis 46:18

אֵ֚לֶּה בְּנֵ֣י זִלְפָּ֔ה אֲשֶׁר־נָתַ֥ן לָבָ֖ן לְלֵאָ֣ה בִתֹּ֑ו וַתֵּ֤לֶד אֶת־אֵ֨לֶּה֙ לְיַעֲקֹ֔ב שֵׁ֥שׁ עֶשְׂרֵ֖ה נָֽפֶשׁ׃
ReferenceMatchText
Genesis 46:2582%אֵ֚לֶּה בְּנֵ֣י בִלְהָ֔ה אֲשֶׁר־נָתַ֥ן לָבָ֖ן לְרָחֵ֣ל בִּתֹּ֑ו וַתֵּ֧לֶד אֶת־אֵ֛לֶּה לְיַעֲקֹ֖ב כָּל־נֶ֥פֶשׁ שִׁבְעָֽה׃

Cross-references for Genesis 46:19

בְּנֵ֤י רָחֵל֙ אֵ֣שֶׁת יַֽעֲקֹ֔ב יֹוסֵ֖ף וּבִנְיָמִֽן׃
ReferenceMatchText
Genesis 35:2480%בְּנֵ֣י רָחֵ֔ל יֹוסֵ֖ף וּבִנְיָמִֽן׃

Cross-references for Genesis 46:23

וּבְנֵי־דָ֖ן חֻשִֽׁים׃
ReferenceMatchText
Ezra 10:3878%וּבָנִ֥י וּבִנּ֖וּי שִׁמְעִֽי׃

Cross-references for Genesis 46:24

וּבְנֵ֖י נַפְתָּלִ֑י יַחְצְאֵ֥ל וְגוּנִ֖י וְיֵ֥צֶר וְשִׁלֵּֽם׃
ReferenceMatchText
1_Chronicles 7:1385%בְּנֵ֣י נַפְתָּלִ֗י יַחֲצִיאֵ֧ל וְגוּנִ֛י וְיֵ֥צֶר וְשַׁלּ֖וּם בְּנֵ֥י בִלְהָֽה׃ פ

Cross-references for Genesis 46:25

אֵ֚לֶּה בְּנֵ֣י בִלְהָ֔ה אֲשֶׁר־נָתַ֥ן לָבָ֖ן לְרָחֵ֣ל בִּתֹּ֑ו וַתֵּ֧לֶד אֶת־אֵ֛לֶּה לְיַעֲקֹ֖ב כָּל־נֶ֥פֶשׁ שִׁבְעָֽה׃
ReferenceMatchText
Genesis 46:1882%אֵ֚לֶּה בְּנֵ֣י זִלְפָּ֔ה אֲשֶׁר־נָתַ֥ן לָבָ֖ן לְלֵאָ֣ה בִתֹּ֑ו וַתֵּ֤לֶד אֶת־אֵ֨לֶּה֙ לְיַעֲקֹ֔ב שֵׁ֥שׁ עֶשְׂרֵ֖ה נָֽפֶשׁ׃

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n", "\n", " \n", "\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "from difflib import SequenceMatcher\n", "from IPython.display import HTML, display\n", "\n", "# Function to find and highlight matching parts between two strings\n", "def highlightMatches(baseText, comparisonText):\n", " matcher = SequenceMatcher(None, baseText, comparisonText)\n", " highlightedComparisonText = \"\"\n", " \n", " for tag, i1, i2, j1, j2 in matcher.get_opcodes():\n", " if tag == \"equal\": # Identical parts\n", " highlightedComparisonText += f\"{comparisonText[j1:j2]}\"\n", " else: # Non-matching parts\n", " highlightedComparisonText += comparisonText[j1:j2]\n", " \n", " return highlightedComparisonText\n", "\n", "# Function to process cross-references and format them into an HTML table\n", "def generateCrossReferencesTable(verseNode):\n", " \"\"\"\n", " Generates an HTML table with cross-references for a single verse node, highlighting identical parts.\n", " The main verse text will be right-aligned.\n", " \"\"\"\n", " # Get cross-references for the specified verseNode\n", " crossRefs = Es(\"crossref\").f(verseNode)\n", " tableContent = \"\"\n", " \n", " # Check if there are any cross-references for this verse\n", " if crossRefs:\n", " verseSection = T.sectionFromNode(verseNode)\n", " mainVerseText = T.text(verseNode)\n", " linkStepBible = (\n", " f\"\"\n", " f\"{verseSection[0]} {verseSection[1]}:{verseSection[2]}\"\n", " ) \n", " # Right-align the main verse text\n", " tableContent += f\"

Cross-references for {linkStepBible}

\"\n", " tableContent += f\"
{mainVerseText}
\"\n", " # Create table header\n", " tableContent += f\"\"\n", " \n", " # Process each cross-reference and add a row to the table\n", " for target, confidence in crossRefs:\n", " targetSection = T.sectionFromNode(target)\n", " targetText = T.text(target)\n", " \n", " targetStepBible = (\n", " f\"\"\n", " f\"{targetSection[0]} {targetSection[1]}:{targetSection[2]}\"\n", " ) \n", " # Highlight identical parts in target verse\n", " highlightedText = highlightMatches(mainVerseText, targetText)\n", " \n", " # Add the row for the cross-reference\n", " tableContent += f\"\"\n", " \n", " # Close the table\n", " tableContent += \"
ReferenceMatchText
{targetStepBible}{confidence}%{highlightedText}

\"\n", "\n", " return tableContent\n", "\n", "# Initialize HTML content\n", "htmlContent = f\"

Lexical parallels for parasha {parashaNameEnglish} ({parashaStart}-{parashaEnd})

\"\n", "\n", "# Process each verse and generate cross-reference tables\n", "for verse in parashaResults:\n", " htmlContent += generateCrossReferencesTable(verse[0])\n", "\n", "# Save the content to an HTML file\n", "fileName = f\"lexical_parallels({parashaNameEnglish.replace(' ','%20')}).html\"\n", "with open(fileName, \"w\", encoding=\"utf-8\") as file:\n", " file.write(htmlContent)\n", "\n", "# Display the HTML content in the notebook\n", "display(HTML(htmlContent))\n", "\n", "# wrap html header and footer and display a download button\n", "htmlContentFull = f'{htmlStart}{htmlContent}{htmlFooter}'\n", "downloadButton = f\"\"\"\n", "', '>').replace('\"', '"').replace(\"'\", ''')}\" target=\"_blank\">\n", " \n", "\n", "\"\"\"\n", "display(HTML(downloadButton))" ] }, { "cell_type": "markdown", "id": "93852912-fa5c-420a-88ed-8be3b090eb3a", "metadata": { "tags": [] }, "source": [ "# 4 - Required libraries \n", "##### [Back to ToC](#TOC)\n", "\n", "The scripts in this notebook require (beside `text-fabric`) the following Python libraries to be installed in the environment:\n", "\n", " difflib\n", "\n", "You can install any missing library from within Jupyter Notebook using either`pip` or `pip3`." ] }, { "cell_type": "markdown", "id": "bc5b6c04-4855-4d2d-aa9a-a1dac0256074", "metadata": {}, "source": [ "# 5 - Further reading \n", "##### [Back to ToC](#TOC)\n", "\n", "For an elaborate treatment of parallel passages, see:\n", "\n", "> Willem Th. van Peursen and Eep Talstra. \"Computer-Assisted Analysis of Parallel Texts in the Bible - The Case of 2 Kings xviii-xix and its Parallels in Isaiah and Chronicles\" in *Vetus Testamentum* 57, pp. 45-72. 2007, Brill, Leiden." ] }, { "cell_type": "markdown", "id": "68573424-b71f-4596-95e7-468cf9ef9c1e", "metadata": {}, "source": [ "# 6 - Notebook version details\n", "##### [Back to ToC](#TOC)\n", "\n", "
\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
AuthorTony Jurg
Version1.1
Date18 November 2024
\n", "
" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.7" } }, "nbformat": 4, "nbformat_minor": 5 }