{ "cells": [ { "cell_type": "markdown", "id": "ef1d222e-9996-4c9f-bddd-173624840ebc", "metadata": {}, "source": [ "# Differences in MT and SP in parasha #13: Shemot (Exodus 1:1-6:1)" ] }, { "cell_type": "markdown", "id": "00169c3b-05ee-417b-8bc4-950a9914cda7", "metadata": {}, "source": [ "## Table of Content (ToC)\n", "\n", "* 1 - Introduction\n", "* 2 - Load Text-Fabric app and data\n", "* 3 - Compare surface texts of SP and MT\n", "* 4 - Compare texts using minimum Levenshtein distance\n", "* 5 - Comparison of spelling of proper nouns between SP and MT\n", "* 6 - References and acknowledgement\n", "* 7 - Required libraries\n", "* 8 - Notebook version details" ] }, { "cell_type": "markdown", "id": "b9d778e2-a5f4-4f48-acfc-ab657714729c", "metadata": { "tags": [] }, "source": [ "# 1 - Introduction \n", "##### [Back to ToC](#TOC)\n", "\n", "The Samaritan Pentateuch (SP) is a version of the Torah preserved by the Samaritan community, differing from the Masoretic Text (MT) in several aspects, including language, orthography, and occasionally theological emphasis. This notebook compares the text of the Masoretic Text, based on the BHSA dataset in Text-Fabric, with the Samaritan Pentateuch, also available as a Text-Fabric dataset.1\n", "\n", "In this analysis, we focus on comparing the text of the verses in a specific parasha, highlighting differences in wording and orthography. Additionally, special attention is given to spelling variations of proper nouns between the two traditions. This notebook draws inspiration from the notebook provided by Martijn Naaijer2 and aims to explore the textual nuances between these two important versions of the Torah." ] }, { "cell_type": "markdown", "id": "b1c357f7-dcb7-4292-b8f3-8349b5844057", "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 [Samaritan Pentatuch](https://github.com/DT-UCPH/sp), the [Biblia Hebraica Stuttgartensia (Amstelodamensis)](https://etcbc.github.io/bhsa/) together with the additonal parasha related features from [tonyjurg/BHSaddons](https://github.com/tonyjurg/BHSaddons)." ] }, { "cell_type": "code", "execution_count": 1, "id": "b8699903-30cf-4a0b-902d-70622ddeead0", "metadata": {}, "outputs": [ { "data": { "text/markdown": [ "**Locating corpus resources ...**" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "app: ~/text-fabric-data/github/DT-UCPH/sp/app" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "data: ~/text-fabric-data/github/DT-UCPH/sp/tf/3.4" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n", " TF: TF API 12.6.1, DT-UCPH/sp/app v3, Search Reference
\n", " Data: DT-UCPH - sp 3.4, 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", "
Name# of nodes# slots / node% coverage
book579878.40100
chapter1872135.79100
verse584168.38100
word1148903.48100
sign3993921.00100
\n", " Sets: no custom sets
\n", " Features:
\n", "
The Samaritan Pentateuch\n", "
\n", "\n", "
\n", "
\n", "book\n", "
\n", "
str
\n", "\n", " book title\n", "\n", "
\n", "\n", "
\n", "
\n", "chapter\n", "
\n", "
int
\n", "\n", " chapter number\n", "\n", "
\n", "\n", "
\n", "
\n", "g_cons\n", "
\n", "
str
\n", "\n", " word consonantal-transliterated\n", "\n", "
\n", "\n", "
\n", "
\n", "g_cons_raw\n", "
\n", "
str
\n", "\n", " word consonantal-transliterated (without disambiguation of Shin (C) and Sin (F))\n", "\n", "
\n", "\n", "
\n", "
\n", "g_cons_utf8\n", "
\n", "
str
\n", "\n", " word in Hebrew script\n", "\n", "
\n", "\n", "
\n", "
\n", "g_lex\n", "
\n", "
str
\n", "\n", " realized lexeme\n", "\n", "
\n", "\n", "
\n", "
\n", "g_lex_utf8\n", "
\n", "
str
\n", "\n", " realized lexeme in Hebrew script\n", "\n", "
\n", "\n", "
\n", "
\n", "g_nme\n", "
\n", "
str
\n", "\n", " realized nominal ending consonantal\n", "\n", "
\n", "\n", "
\n", "
\n", "g_nme_utf8\n", "
\n", "
str
\n", "\n", " realized nominal ending consonantal in Hebrew script\n", "\n", "
\n", "\n", "
\n", "
\n", "g_pfm\n", "
\n", "
str
\n", "\n", " realized verbal preformative consonantal\n", "\n", "
\n", "\n", "
\n", "
\n", "g_pfm_utf8\n", "
\n", "
str
\n", "\n", " realized verbal preformative consonantal in Hebrew script\n", "\n", "
\n", "\n", "
\n", "
\n", "g_prs\n", "
\n", "
str
\n", "\n", " realized pronominal suffix consonantal\n", "\n", "
\n", "\n", "
\n", "
\n", "g_prs_utf8\n", "
\n", "
str
\n", "\n", " realized pronominal suffix consonantal in Hebrew script\n", "\n", "
\n", "\n", "
\n", "
\n", "g_uvf\n", "
\n", "
str
\n", "\n", " realized univalent final\n", "\n", "
\n", "\n", "
\n", "
\n", "g_uvf_utf8\n", "
\n", "
str
\n", "\n", " realized univalent final in Hebrew script\n", "\n", "
\n", "\n", "
\n", "
\n", "g_vbe\n", "
\n", "
str
\n", "\n", " realized verbal ending consonantal\n", "\n", "
\n", "\n", "
\n", "
\n", "g_vbe_utf8\n", "
\n", "
str
\n", "\n", " realized verbal ending consonantal in Hebrew script\n", "\n", "
\n", "\n", "
\n", "
\n", "g_vbs\n", "
\n", "
str
\n", "\n", " realized verbal stem consonantal\n", "\n", "
\n", "\n", "
\n", "
\n", "g_vbs_utf8\n", "
\n", "
str
\n", "\n", " realized verbal stem consonantal in Hebrew script\n", "\n", "
\n", "\n", "
\n", "
\n", "gn\n", "
\n", "
str
\n", "\n", " gender\n", "\n", "
\n", "\n", "
\n", "
\n", "language\n", "
\n", "
str
\n", "\n", " language\n", "\n", "
\n", "\n", "
\n", "
\n", "lex\n", "
\n", "
str
\n", "\n", " lexeme consonantal-transliterated\n", "\n", "
\n", "\n", "
\n", "
\n", "lex_utf8\n", "
\n", "
str
\n", "\n", " lexeme in Hebrew script\n", "\n", "
\n", "\n", "
\n", "
\n", "mt_feat\n", "
\n", "
str
\n", "\n", " features imposed from MT\n", "\n", "
\n", "\n", "
\n", "
\n", "nu\n", "
\n", "
str
\n", "\n", " grammatical number\n", "\n", "
\n", "\n", "
\n", "
\n", "otype\n", "
\n", "
str
\n", "\n", " \n", "\n", "
\n", "\n", "
\n", "
\n", "prediction\n", "
\n", "
str
\n", "\n", " neural network prediction\n", "\n", "
\n", "\n", "
\n", "
\n", "prs_gn\n", "
\n", "
str
\n", "\n", " pronominal suffix gender\n", "\n", "
\n", "\n", "
\n", "
\n", "prs_nu\n", "
\n", "
str
\n", "\n", " pronominal suffix number\n", "\n", "
\n", "\n", "
\n", "
\n", "prs_ps\n", "
\n", "
str
\n", "\n", " pronominal suffix person\n", "\n", "
\n", "\n", "
\n", "
\n", "ps\n", "
\n", "
str
\n", "\n", " grammatical person\n", "\n", "
\n", "\n", "
\n", "
\n", "sign\n", "
\n", "
str
\n", "\n", " consonantal letter\n", "\n", "
\n", "\n", "
\n", "
\n", "sp\n", "
\n", "
str
\n", "\n", " part of speech\n", "\n", "
\n", "\n", "
\n", "
\n", "trailer\n", "
\n", "
str
\n", "\n", " interword material\n", "\n", "
\n", "\n", "
\n", "
\n", "verse\n", "
\n", "
int
\n", "\n", " verse number\n", "\n", "
\n", "\n", "
\n", "
\n", "vt\n", "
\n", "
str
\n", "\n", " verbal tense\n", "\n", "
\n", "\n", "
\n", "
\n", "oslots\n", "
\n", "
none
\n", "\n", " \n", "\n", "
\n", "\n", "
\n", "
\n", "\n", " Settings:
specified
  1. apiVersion: 3
  2. appName: DT-UCPH/sp
  3. appPath: C:/Users/tonyj/text-fabric-data/github/DT-UCPH/sp/app
  4. commit: g0c9b2fff6448228af93ed6c466ba95e6c0bb3547
  5. css: ''
  6. dataDisplay:
  7. \n", " textFormats:\n", "
  8. \n", " layout-orig-full:\n", "
    • method: layoutRich
    • style: orig
    \n", "
  9. \n", "
  10. docs:
    • docBase: {docRoot}/bhsa
    • docExt: ''
    • docPage: ''
    • docRoot: https://etcbc.github.io
    • featurePage: 0_home
  11. interfaceDefaults: {}
  12. isCompatible: True
  13. local: local
  14. localDir: C:/Users/tonyj/text-fabric-data/github/DT-UCPH/sp/_temp
  15. provenanceSpec:
    • corpus: The Samaritan Pentateuch
    • org: DT-UCPH
    • relative: /tf
    • repo: sp
    • version: 3.4
  16. release: v3.4
  17. typeDisplay:
    • verse:
      • label: {verse}
      • template: {verse}
      • verselike: True
    • word: {features: lex}
  18. 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/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" } ], "source": [ "from tf.app import use\n", "\n", "# Load the SP data, and rename the node features class F,\n", "# the locality class L and the text class T, \n", "# then they cannot be overwritten while loading the MT.\n", "SP = use('DT-UCPH/sp', version='3.4')\n", "Fsp, Lsp, Tsp = SP.api.F, SP.api.L, SP.api.T\n", "\n", "# Do the same for the MT dataset (BHSA) together with BHSaddons \n", "MT = use('etcbc/bhsa', version='2021',mod=\"tonyjurg/BHSaddons/tf/\")\n", "Fmt, Lmt, Tmt = MT.api.F, MT.api.L, MT.api.T" ] }, { "cell_type": "markdown", "id": "f0086270", "metadata": {}, "source": [ "# 3 - Compare surface texts of SP and MT \n", "##### [Back to ToC](#TOC)\n", "\n", "In this section, we compare the surface texts of the Samaritan Pentateuch (SP) and the Masoretic Text (MT) at the verse level. By analyzing the wording and structure of these texts, we aim to identify variations." ] }, { "cell_type": "code", "execution_count": 2, "id": "3b399f27-1f11-4efc-94e6-db55fe87a684", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " 0.01s 124 results\n" ] } ], "source": [ "# find all word nodes for this parasha (we can either use the transliterated name or the sequence number)\n", "parashaQuery = '''\n", "verse parashanum=13\n", "'''\n", "parashaResults = MT.search(parashaQuery)" ] }, { "cell_type": "code", "execution_count": 3, "id": "e064e73f-8ca2-4d78-ac65-2b518e1dc4aa", "metadata": {}, "outputs": [], "source": [ "# Extract book, chapter, and verse information\n", "bookChapterVerseList = [\n", " Tmt.sectionFromNode(verse[0]) for verse in parashaResults\n", "]\n", "\n", "# Store parashname, start and end verse for future use\n", "startNode=parashaResults[0][0]\n", "endNode=parashaResults[-1][0]\n", "parashaNameHebrew=Fmt.parashahebr.v(startNode)\n", "parashaNameEnglish=Fmt.parashatrans.v(startNode)\n", "bookStart,chapterStart,startVerse=Tmt.sectionFromNode(startNode)\n", "parashaStart=f'{bookStart} {chapterStart}:{startVerse}'\n", "bookEnd,chapterEnd,startEnd=Tmt.sectionFromNode(endNode)\n", "parashaEnd=f'{chapterEnd}:{startEnd}'\n", "htmlStart=''\n", "htmlFooter=f'

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

`'" ] }, { "cell_type": "code", "execution_count": 4, "id": "06e216e5-a5b1-47d6-994c-f4e8c6a66e90", "metadata": {}, "outputs": [], "source": [ "# Function to reconstruct verses\n", "def reconstructVerses(F, L, T, textFeature, inputList):\n", " \"\"\"Reconstruct text for each verse.\"\"\"\n", " verseTexts = {}\n", " for verseName in inputList:\n", " verseText = ''\n", " verseNode = T.nodeFromSection(verseName)\n", " wordNodes = L.d(verseNode, 'word')\n", " for wordNode in wordNodes:\n", " wordText = eval(f'F.{textFeature}.v(wordNode)')\n", " trailer = F.trailer.v(wordNode)\n", " if wordText:\n", " verseText += wordText + (trailer if trailer else ' ')\n", " verseTexts[verseName] = verseText.strip()\n", " return verseTexts\n", " \n", "SPverses = reconstructVerses(Fsp, Lsp, Tsp, 'g_cons', bookChapterVerseList)\n", "MTverses = reconstructVerses(Fmt, Lmt, Tmt, 'g_cons', bookChapterVerseList)" ] }, { "cell_type": "code", "execution_count": 5, "id": "492e7cbe-2b84-48a9-a44c-6b6d051b0c5d", "metadata": {}, "outputs": [ { "data": { "text/html": [ "

Differences between MT and SP for parasha Shemot (Exodus 1:1-6:1)

Exodus 1:2

SP: ראובן ושמעון ולוי ויהודה
MT: ראובן שׁמעון לוי ויהודה

Exodus 1:3

SP: ויששכר וזבולן ובנימים
MT: ישׂשׂכר זבולן ובנימן

Exodus 1:5

SP: ויהיו כל נפש יצאי ירך יעקב שבעים נפש ויוסף היה במצרים
MT: ויהי כל נפשׁ יצאי ירך יעקב שׁבעים נפשׁ ויוסף היה במצרים

Exodus 1:9

SP: ויאמר אל עמו הן עם בני ישראל רב ועצום ממנו
MT: ויאמר אל עמו הנה עם בני ישׂראל רב ועצום ממנו

Exodus 1:10

SP: הבה נתחכם לו פן ירבה והיה כי תקראנו מלחמה ונוסף גם הוא על שנאינו ונלחם בנו ועלה מן הארץ
MT: הבה נתחכמה לו פן ירבה והיה כי תקראנה מלחמה ונוסף גם הוא על שׂנאינו ונלחם בנו ועלה מן הארץ

Exodus 1:11

SP: וישמו עליו שרי מסים למען ענותם בסבלותם ויבנו ערי מסכנת לפרעה את פיתון ואת רעמסס
MT: וישׂימו עליו שׂרי מסים למען ענתו בסבלתם ויבן ערי מסכנות לפרעה את פתם ואת רעמסס

Exodus 1:12

SP: וכאשר יענו אתו כן יפרה וכן יפרץ ויקצו מפני בני ישראל
MT: וכאשׁר יענו אתו כן ירבה וכן יפרץ ויקצו מפני בני ישׂראל

Exodus 1:14

SP: וימררו את חייהם בעבדה קשה בחימר ובלבנים ובכל עבדה בשדה את כל עבדתם אשר עבדו בהם בפרך
MT: וימררו את חייהם בעבדה קשׁה בחמר ובלבנים ובכל עבדה בשׂדה את כל עבדתם אשׁר עבדו בהם בפרך

Exodus 1:15

SP: ויאמר מלך מצרים למילדות העבריות אשר שם האחת שפרה ושם השנית פועה
MT: ויאמר מלך מצרים למילדת העברית אשׁר שׁם האחת שׁפרה ושׁם השׁנית פועה

Exodus 1:16

SP: ויאמר בילדכן את העבריות וראיתן על האבנים אם בן הוא והמתן אתו ואם בת היא וחיתה
MT: ויאמר בילדכן את העבריות וראיתן על האבנים אם בן הוא והמתן אתו ואם בת היא וחיה

Exodus 1:17

SP: ותיראנה המילדות את האלהים ולא עשו כאשר דבר אליהן מלך מצרים ותחינה את הילדים
MT: ותיראן המילדת את האלהים ולא עשׂו כאשׁר דבר אליהן מלך מצרים ותחיין את הילדים

Exodus 1:18

SP: ויקרא פרעה למילדות ויאמר להן מדוע עשיתן את הדבר הזה ותחינה את הילדים
MT: ויקרא מלך מצרים למילדת ויאמר להן מדוע עשׂיתן הדבר הזה ותחיין את הילדים

Exodus 1:19

SP: ותאמרנה המילדות אל פרעה כי לא כנשים המצריות העבריות כי חיות הנה בטרם תבוא אליהן המילדות וילדו
MT: ותאמרן המילדת אל פרעה כי לא כנשׁים המצרית העברית כי חיות הנה בטרם תבוא אלהן המילדת וילדו

Exodus 1:20

SP: וייטב אלהים למילדות וירבו העם ויעצמו מאד
MT: וייטב אלהים למילדת וירב העם ויעצמו מאד

Exodus 1:21

SP: ויהי כי יראו המילדות את האלהים ויעש להם בתים
MT: ויהי כי יראו המילדת את האלהים ויעשׂ להם בתים

Exodus 1:22

SP: ויצו פרעה לכל עמו לאמר כל הבן הילד לעברים היאר תשליכון וכל הבת תחיון
MT: ויצו פרעה לכל עמו לאמר כל הבן הילוד היארה תשׁליכהו וכל הבת תחיון

Exodus 2:3

SP: ולא יכלה עוד הצפנהו ותקח לו אמו תבת גמא ותחמרה בחימר ובזפת ותשם בה את הילד ותשם בסף על שפת היאר
MT: ולא יכלה עוד הצפינו ותקח לו תבת גמא ותחמרה בחמר ובזפת ותשׂם בה את הילד ותשׂם בסוף על שׂפת היאר

Exodus 2:4

SP: ותתיצב אחותו מרחק לדעת מה יעשה לו
MT: ותתצב אחתו מרחק לדעה מה יעשׂה לו

Exodus 2:5

SP: ותרד בת פרעה לרחץ על היאר ונערתיה הלכת על יד היאר ותרא את התבה בתוך הסף ותשלח את אמתה ותקחה
MT: ותרד בת פרעה לרחץ על היאר ונערתיה הלכת על יד היאר ותרא את התבה בתוך הסוף ותשׁלח את אמתה ותקחה

Exodus 2:6

SP: ותפתחה ותרא את הילד והנה נער בכה ותחמל עליו בת פרעה ותאמר מילדי העברים זה
MT: ותפתח ותראהו את הילד והנה נער בכה ותחמל עליו ותאמר מילדי העברים זה

Exodus 2:7

SP: ותאמר אחותו אל בת פרעה האלך וקראתי ליך אשה מינקות מן העבריות ותינק ליך את הילד
MT: ותאמר אחתו אל בת פרעה האלך וקראתי לך אשׁה מינקת מן העברית ותינק לך את הילד

Exodus 2:9

SP: ותאמר לה בת פרעה הלכי את הילד הזה והנקהו לי ואני אתן את שכריך ותקח האשה את הילד ותינקהו
MT: ותאמר לה בת פרעה היליכי את הילד הזה והינקהו לי ואני אתן את שׂכרך ותקח האשׁה הילד ותניקהו

Exodus 2:10

SP: ויגדל הנער ותבאהו אל בת פרעה ויהי לה לבן ותקרא את שמו משה ותאמר כי מן המים משיתיו
MT: ויגדל הילד ותבאהו לבת פרעה ויהי לה לבן ותקרא שׁמו משׁה ותאמר כי מן המים משׁיתהו

Exodus 2:11

SP: ויהי בימים ההם ויגדל משה ויצא אל אחיו וירא בסבלותם וירא איש מצרי מכה איש עברי מאחיו
MT: ויהי׀ בימים ההם ויגדל משׁה ויצא אל אחיו וירא בסבלתם וירא אישׁ מצרי מכה אישׁ עברי מאחיו

Exodus 2:14

SP: ויאמר מי שמך לאיש שר ולשופט עלינו הלהרגני אתה אמר כאשר הרגת את המצרי ויירא משה ויאמר אכן נודע הדבר
MT: ויאמר מי שׂמך לאישׁ שׂר ושׁפט עלינו הלהרגני אתה אמר כאשׁר הרגת את המצרי ויירא משׁה ויאמר אכן נודע הדבר

Exodus 2:16

SP: ולכהן מדין שבע בנות ותבאנה ותדלאנה ותמלאנה את הרחטים להשקות את צאן אביהן
MT: ולכהן מדין שׁבע בנות ותבאנה ותדלנה ותמלאנה את הרהטים להשׁקות צאן אביהן

Exodus 2:17

SP: ויבאו הרעים ויגרשום ויקם משה ויושיענה וישק את צאנם
MT: ויבאו הרעים ויגרשׁום ויקם משׁה ויושׁען וישׁק את צאנם

Exodus 2:19

SP: ותאמרנה איש מצרי הצילנו מיד הרעים וגם דלא דלא לנו וישק את הצאן
MT: ותאמרן אישׁ מצרי הצילנו מיד הרעים וגם דלה דלה לנו וישׁק את הצאן

Exodus 2:20

SP: ויאמר אל בנתיו ואיה למה זה עזבתן את האיש קראן לו ויאכל לחם
MT: ויאמר אל בנתיו ואיו למה זה עזבתן את האישׁ קראן לו ויאכל לחם

Exodus 2:21

SP: ויאל משה לשבת את האיש ויתן את צפורה בתו למשה לאשה
MT: ויואל משׁה לשׁבת את האישׁ ויתן את צפרה בתו למשׁה

Exodus 2:23

SP: ויהי בימים הרבים ההם וימת מלך מצרים וינחו בני ישראל מן העבדה ויצעקו ותעל שועתם אל האלהים מן העבדה
MT: ויהי בימים הרבים ההם וימת מלך מצרים ויאנחו בני ישׂראל מן העבדה ויזעקו ותעל שׁועתם אל האלהים מן העבדה

Exodus 2:24

SP: וישמע אלהים את נקאתם ויזכר אלהים את בריתו את אברהם ואת יצחק ואת יעקב
MT: וישׁמע אלהים את נאקתם ויזכר אלהים את בריתו את אברהם את יצחק ואת יעקב

Exodus 3:1

SP: ומשה היה רעה את צאן יתרו חתנו כהן מדין וינהג את הצאן אחר המדבר ויבא אל הר האלהים חורבה
MT: ומשׁה היה רעה את צאן יתרו חתנו כהן מדין וינהג את הצאן אחר המדבר ויבא אל הר האלהים חרבה

Exodus 3:2

SP: וירא אליו מלאך יהוה בלהבת אש מתוך הסנה וירא והנה הסנה בער באש והסנה איננו אכל
MT: וירא מלאך יהוה אליו בלבת אשׁ מתוך הסנה וירא והנה הסנה בער באשׁ והסנה איננו אכל

Exodus 3:3

SP: ויאמר משה אסור נא ואראה את המראה הגדול הזה מדוע לא יבער הסנה
MT: ויאמר משׁה אסרה נא ואראה את המראה הגדל הזה מדוע לא יבער הסנה

Exodus 3:4

SP: וירא אלהים כי סר לראות ויקרא אליו אלהים מתוך הסנה ויאמר משה משה ויאמר הנני
MT: וירא יהוה כי סר לראות ויקרא אליו אלהים מתוך הסנה ויאמר משׁה משׁה ויאמר הנני

Exodus 3:5

SP: ויאמר אל תקרב הלם של נעליך מעל רגליך כי המקום אשר אתה עמד עליו אדמת קדש היא
MT: ויאמר אל תקרב הלם שׁל נעליך מעל רגליך כי המקום אשׁר אתה עומד עליו אדמת קדשׁ הוא

Exodus 3:6

SP: ויאמר אנכי אלהי אבתיך אלהי אברהם ואלהי יצחק ואלהי יעקב ויסתר משה פניו כי ירא מהביט אל האלהים
MT: ויאמר אנכי אלהי אביך אלהי אברהם אלהי יצחק ואלהי יעקב ויסתר משׁה פניו כי ירא מהביט אל האלהים

Exodus 3:7

SP: ויאמר יהוה ראו ראיתי את עני עמי אשר במצרים ואת צעקתם שמעתי מפני נגשיו כי ידעתי את מכאבו
MT: ויאמר יהוה ראה ראיתי את עני עמי אשׁר במצרים ואת צעקתם שׁמעתי מפני נגשׂיו כי ידעתי את מכאביו

Exodus 3:8

SP: וארדה להצילו מיד מצרים ולהעלותו מן הארץ ההיא אל ארץ טובה ורחבה אל ארץ זבת חלב ודבש אל מקום הכנעני החתי והאמרי והפרזי והגרגשי והחוי והיבוסי
MT: וארד להצילו׀ מיד מצרים ולהעלתו מן הארץ ההוא אל ארץ טובה ורחבה אל ארץ זבת חלב ודבשׁ אל מקום הכנעני והחתי והאמרי והפרזי והחוי והיבוסי

Exodus 3:10

SP: ועתה לך ואשלחך אל פרעה והוצאת את עמי בני ישראל ממצרים
MT: ועתה לכה ואשׁלחך אל פרעה והוצא את עמי בני ישׂראל ממצרים

Exodus 3:13

SP: ויאמר משה אל האלהים הנה אנכי בא אל בני ישראל ואמרתי להם אלהי אבתיכם שלחני אליכם ואמרו לי מה שמו מה אמר אליהם
MT: ויאמר משׁה אל האלהים הנה אנכי בא אל בני ישׂראל ואמרתי להם אלהי אבותיכם שׁלחני אליכם ואמרו לי מה שׁמו מה אמר אלהם

Exodus 3:14

SP: ויאמר אלהים אל משה אהיה אשר אהיה ויאמר כה תאמר אל בני ישראל אהיה שלחני אליכם
MT: ויאמר אלהים אל משׁה אהיה אשׁר אהיה ויאמר כה תאמר לבני ישׂראל אהיה שׁלחני אליכם

Exodus 3:15

SP: ויאמר עוד אלהים אל משה כה תאמר אל בני ישראל יהוה אלהי אבתיכם אלהי אברהם ואלהי יצחק ואלהי יעקב שלחני אליכם זה שמי לעולם וזה זכרי לדר ודר
MT: ויאמר עוד אלהים אל משׁה כה תאמר אל בני ישׂראל יהוה אלהי אבתיכם אלהי אברהם אלהי יצחק ואלהי יעקב שׁלחני אליכם זה שׁמי לעלם וזה זכרי לדר דר

Exodus 3:16

SP: לך ואספת את זקני בני ישראל ואמרת אליהם יהוה אלהי אבתיכם נראה אלי אלהי אברהם ויצחק ויעקב לאמר פקד פקדתי אתכם ואת העשוי לכם במצרים
MT: לך ואספת את זקני ישׂראל ואמרת אלהם יהוה אלהי אבתיכם נראה אלי אלהי אברהם יצחק ויעקב לאמר פקד פקדתי אתכם ואת העשׂוי לכם במצרים

Exodus 3:17

SP: ואמרה אעלה אתכם מעני מצרים אל ארץ הכנעני החתי והאמרי והפרזי והגרגשי והחוי והיבוסי אל ארץ זבת חלב ודבש
MT: ואמר אעלה אתכם מעני מצרים אל ארץ הכנעני והחתי והאמרי והפרזי והחוי והיבוסי אל ארץ זבת חלב ודבשׁ

Exodus 3:18

SP: ושמעו לקולך ובאת אתה וזקני ישראל אל מלך מצרים ואמרתם אליו יהוה אלהי העברים נקרא עלינו נלכה נא דרך שלשת ימים במדבר ונזבחה ליהוה אלהינו
MT: ושׁמעו לקלך ובאת אתה וזקני ישׂראל אל מלך מצרים ואמרתם אליו יהוה אלהי העבריים נקרה עלינו ועתה נלכה נא דרך שׁלשׁת ימים במדבר ונזבחה ליהוה אלהינו

Exodus 3:19

SP: ואני ידעתי כי לא יתן אתכם מלך מצרים להלך הלוא ביד חזקה
MT: ואני ידעתי כי לא יתן אתכם מלך מצרים להלך ולא ביד חזקה

Exodus 3:20

SP: ושלחתי את ידי והכיתי את מצרים בכל נפלאותי אשר אעשה בקרבו ואחרי כן ישלח אתכם
MT: ושׁלחתי את ידי והכיתי את מצרים בכל נפלאתי אשׁר אעשׂה בקרבו ואחרי כן ישׁלח אתכם

Exodus 3:21

SP: ונתתי את חן העם הזה בעיני מצרים והיה כי תלכון לא תלכון רקים
MT: ונתתי את חן העם הזה בעיני מצרים והיה כי תלכון לא תלכו ריקם

Exodus 3:22

SP: ושאל איש מאת רעהו ואשה מאת רעותה משכינתה ומגירת ביתה כלי כסף וכלי זהב ושמלות ושמתם על בניכם ועל בנתיכם ונצלתם את מצרים
MT: ושׁאלה אשׁה משׁכנתה ומגרת ביתה כלי כסף וכלי זהב ושׂמלת ושׂמתם על בניכם ועל בנתיכם ונצלתם את מצרים

Exodus 4:1

SP: ויען משה ויאמר והן לא יאמנו לי ולא ישמעו לקולי כי יאמרו לא נראה אליך יהוה
MT: ויען משׁה ויאמר והן לא יאמינו לי ולא ישׁמעו בקלי כי יאמרו לא נראה אליך יהוה

Exodus 4:2

SP: ויאמר אליו יהוה מה זה בידך ויאמר מטה
MT: ויאמר אליו יהוה מזה בידך ויאמר מטה

Exodus 4:3

SP: ויאמר השליכהו ארצה וישלכהו ארצה ויהי לנחש וינס משה מפניו
MT: ויאמר השׁליכהו ארצה וישׁליכהו ארצה ויהי לנחשׁ וינמשׁה מפניו

Exodus 4:5

SP: למען יאמנו כי נראה אליך יהוה אלהי אבותם אלהי אברהם ואלהי יצחק ואלהי יעקב
MT: למען יאמינו כי נראה אליך יהוה אלהי אבתם אלהי אברהם אלהי יצחק ואלהי יעקב

Exodus 4:6

SP: ויאמר יהוה לו עוד הבא נא ידך בחיקך ויבא ידו בחיקו ויוציאה מחיקו והנה ידו מצרעת כשלג
MT: ויאמר יהוה לו עוד הבא נא ידך בחיקך ויבא ידו בחיקו ויוצאה והנה ידו מצרעת כשׁלג

Exodus 4:7

SP: ויאמר השב ידך אל חיקך וישב ידו אל חיקו ויוציאה מחיקו והנה שבה כבשרו
MT: ויאמר השׁב ידך אל חיקך וישׁב ידו אל חיקו ויוצאה מחיקו והנה שׁבה כבשׂרו

Exodus 4:8

SP: והיה אם לא יאמנו לך ולא ישמעו לקול האות הראישון והאמנו לקול האות האחרון
MT: והיה אם לא יאמינו לך ולא ישׁמעו לקל האת הראשׁון והאמינו לקל האת האחרון

Exodus 4:9

SP: והיה אם לא יאמנו גם לשני האתות האלה ולא ישמעו לקולך ולקחת ממימי היאר ושפכת היבשה והיו המים אשר תקח מן היאר יהיו לדם ביבשת
MT: והיה אם לא יאמינו גם לשׁני האתות האלה ולא ישׁמעון לקלך ולקחת ממימי היאר ושׁפכת היבשׁה והיו המים אשׁר תקח מן היאר והיו לדם ביבשׁת

Exodus 4:10

SP: ויאמר משה אל יהוה בי אדני לא איש דברים אנכי גם מתמול גם משלשום גם מאז דברך אל עבדך כי כבד פה וכבד לשון אנכי
MT: ויאמר משׁה אל יהוה בי אדני לא אישׁ דברים אנכי גם מתמול גם משׁלשׁם גם מאז דברך אל עבדך כי כבד פה וכבד לשׁון אנכי

Exodus 4:11

SP: ויאמר יהוה אליו מי שם פה לאדם או מי ישים אלם או חרש או פקח או עור הלוא אנכי יהוה
MT: ויאמר יהוה אליו מי שׂם פה לאדם או מי ישׂום אלם או חרשׁ או פקח או עור הלא אנכי יהוה

Exodus 4:14

SP: ויחר אף יהוה במשה ויאמר הלוא אהרן אחיך הלוי ידעתי כי דבר ידבר הוא וגם הנה הוא יצא לקראתך וראך ושמח בלבבו
MT: ויחר אף יהוה במשׁה ויאמר הלא אהרן אחיך הלוי ידעתי כי דבר ידבר הוא וגם הנה הוא יצא לקראתך וראך ושׂמח בלבו

Exodus 4:15

SP: ודברת אליו ושמת את הדברים בפיו ואנכי אהיה עם פיך ועם פיו והוריתי אתכם את אשר תעשון
MT: ודברת אליו ושׂמת את הדברים בפיו ואנכי אהיה עם פיך ועם פיהו והוריתי אתכם את אשׁר תעשׂון

Exodus 4:17

SP: ואת המטה הזה תקח בידך אשר תעשה בו את האתות
MT: ואת המטה הזה תקח בידך אשׁר תעשׂה בו את האתת

Exodus 4:18

SP: וילך משה וישב אל יתרו חתנו ויאמר לו אלכה נא ואשובה אל אחי אשר במצרים ואראה העודם חיים ויאמר יתרו למשה לך לשלום
MT: וילך משׁה וישׁב׀ אל יתר חתנו ויאמר לו אלכה נא ואשׁובה אל אחי אשׁר במצרים ואראה העודם חיים ויאמר יתרו למשׁה לך לשׁלום

Exodus 4:19

SP: ויאמר יהוה אל משה במדין לך שוב מצרימה כי מתו כל האנשים המבקשים את נפשך
MT: ויאמר יהוה אל משׁה במדין לך שׁב מצרים כי מתו כל האנשׁים המבקשׁים את נפשׁך

Exodus 4:20

SP: ויקח משה את אשתו ואת בניו וירכבם על החמור וישב ארץ מצרים ויקח משה את מטה האלהים בידו
MT: ויקח משׁה את אשׁתו ואת בניו וירכבם על החמר וישׁב ארצה מצרים ויקח משׁה את מטה האלהים בידו

Exodus 4:21

SP: ויאמר יהוה אל משה בלכתך לשוב מצרימה ראה את כל המופתים אשר שמתי בידך ועשיתם לפני פרעה ואני אחזיק את לבו ולא ישלח את העם
MT: ויאמר יהוה אל משׁה בלכתך לשׁוב מצרימה ראה כל המפתים אשׁר שׂמתי בידך ועשׂיתם לפני פרעה ואני אחזק את לבו ולא ישׁלח את העם

Exodus 4:22

SP: ואמרת אל פרעה כה אמר יהוה בני בכורי ישראל
MT: ואמרת אל פרעה כה אמר יהוה בני בכרי ישׂראל

Exodus 4:23

SP: ואמר אליך שלח את בני ויעבדני ותמאן לשלחו הנה אנכי הרג את בנך בכורך
MT: ואמר אליך שׁלח את בני ויעבדני ותמאן לשׁלחו הנה אנכי הרג את בנך בכרך

Exodus 4:25

SP: ותקח צפורה צר ותכרת את ערלת בנה ותגיע לרגליו ותאמר כי חתן דמים אתה לי
MT: ותקח צפרה צר ותכרת את ערלת בנה ותגע לרגליו ותאמר כי חתן דמים אתה לי

Exodus 4:26

SP: וירף ממנה אז אמרה חתן דמים למלות
MT: וירף ממנו אז אמרה חתן דמים למולת

Exodus 4:28

SP: ויגד משה לאהרן את כל דברי יהוה אשר שלחו ואת כל האתות אשר צוהו
MT: ויגד משׁה לאהרן את כל דברי יהוה אשׁר שׁלחו ואת כל האתת אשׁר צוהו

Exodus 4:29

SP: וילכו משה ואהרן ויאספו את כל זקני בני ישראל
MT: וילך משׁה ואהרן ויאספו את כל זקני בני ישׂראל

Exodus 4:30

SP: וידבר אהרן את כל הדברים אשר דבר יהוה אל משה ויעש האתות לעיני העם
MT: וידבר אהרן את כל הדברים אשׁר דבר יהוה אל משׁה ויעשׂ האתת לעיני העם

Exodus 4:31

SP: ויאמנו העם וישמעו כי פקד יהוה את בני ישראל וכי ראה את ענים ויקדו וישתחוו
MT: ויאמן העם וישׁמעו כי פקד יהוה את בני ישׂראל וכי ראה את ענים ויקדו וישׁתחוו

Exodus 5:2

SP: ויאמר פרעה מי יהוה אשר אשמע בקולו לשלח את ישראל לא ידעתי את יהוה וגם את ישראל לא אשלח
MT: ויאמר פרעה מי יהוה אשׁר אשׁמע בקלו לשׁלח את ישׂראל לא ידעתי את יהוה וגם את ישׂראל לא אשׁלח

Exodus 5:3

SP: ויאמרו אלהי העברים נקרא עלינו נלכה נא המדברה דרך שלשת ימים ונזבחה ליהוה אלהינו פן יפגענו בדבר או בחרב
MT: ויאמרו אלהי העברים נקרא עלינו נלכה נא דרך שׁלשׁת ימים במדבר ונזבחה ליהוה אלהינו פן יפגענו בדבר או בחרב

Exodus 5:4

SP: ויאמר אליהם מלך מצרים למה משה ואהרן תפרידו את העם ממעשיו לכו לסבלתיכם
MT: ויאמר אלהם מלך מצרים למה משׁה ואהרן תפריעו את העם ממעשׂיו לכו לסבלתיכם

Exodus 5:5

SP: ויאמר פרעה הן רבים עתה מעם הארץ והשבתם אתם מסבלותם
MT: ויאמר פרעה הן רבים עתה עם הארץ והשׁבתם אתם מסבלתם

Exodus 5:6

SP: ויצו פרעה ביום ההוא את הנגשים בעם ואת שוטריו לאמר
MT: ויצו פרעה ביום ההוא את הנגשׂים בעם ואת שׁטריו לאמר

Exodus 5:7

SP: לא תוסיפון לתת תבן לעם ללבן לבנים כתמול שלשום הם ילכו יקששו להם תבן
MT: לא תאספון לתת תבן לעם ללבן הלבנים כתמול שׁלשׁם הם ילכו וקשׁשׁו להם תבן

Exodus 5:8

SP: ואת מתכנת הלבנים אשר הם עשים תמול שלשום תשימו עליהם לא תגרעו ממנו כי נרפים הם על כן הם צעקים לאמר נלכה נזבחה לאלהינו
MT: ואת מתכנת הלבנים אשׁר הם עשׂים תמול שׁלשׁם תשׂימו עליהם לא תגרעו ממנו כי נרפים הם על כן הם צעקים לאמר נלכה נזבחה לאלהינו

Exodus 5:9

SP: תכבד העבדה על האנשים וישעו בה ולא ישעו בדברי שקר
MT: תכבד העבדה על האנשׁים ויעשׂו בה ואל ישׁעו בדברי שׁקר

Exodus 5:10

SP: ויצאו נגשי העם ושוטריו וידברו אל העם לאמר כה אמר פרעה אינני נתן לכם תבן
MT: ויצאו נגשׂי העם ושׁטריו ויאמרו אל העם לאמר כה אמר פרעה אינני נתן לכם תבן

Exodus 5:13

SP: והנגשים אצוים בעם לאמר כלו מעשיכם דבר יום ביומו כאשר בהיות התבן נתן לכם
MT: והנגשׂים אצים לאמר כלו מעשׂיכם דבר יום ביומו כאשׁר בהיות התבן

Exodus 5:14

SP: ויכו שוטרי בני ישראל אשר שמו עליהם נגשי פרעה לאמר מדוע לא כליתם חקכם ללבן כתמול שלשום גם תמול גם היום
MT: ויכו שׁטרי בני ישׂראל אשׁר שׂמו עלהם נגשׂי פרעה לאמר מדוע לא כליתם חקכם ללבן כתמול שׁלשׁם גם תמול גם היום

Exodus 5:15

SP: ויבאו שוטרי בני ישראל ויצעקו אל פרעה לאמר למה תעשה כה לעבדיך
MT: ויבאו שׁטרי בני ישׂראל ויצעקו אל פרעה לאמר למה תעשׂה כה לעבדיך

Exodus 5:18

SP: ועתה לכו עבדו ותבן לא ינתן לכם ותכן הלבנים תתנו
MT: ועתה לכו עבדו ותבן לא ינתן לכם ותכן לבנים תתנו

Exodus 5:19

SP: ויראו שוטרי בני ישראל אתם ברע לאמר לא יגרע מלבניכם דבר יום ביומו
MT: ויראו שׁטרי בני ישׂראל אתם ברע לאמר לא תגרעו מלבניכם דבר יום ביומו

Exodus 5:20

SP: ויפגעו את משה ואת אהרן נצבים לקראתם בצאתם מאת פני פרעה
MT: ויפגעו את משׁה ואת אהרן נצבים לקראתם בצאתם מאת פרעה

Exodus 5:21

SP: ויאמרו אליהם יראה יהוה עליכם וישפט אשר הבאשתם את ריחנו בעיני פרעה ובעיני עבדיו לתת חרב בידו להרגנו
MT: ויאמרו אלהם ירא יהוה עליכם וישׁפט אשׁר הבאשׁתם את ריחנו בעיני פרעה ובעיני עבדיו לתת חרב בידם להרגנו

Exodus 5:22

SP: וישב משה אל יהוה ויאמר אדני למה הרעת לעם הזה ולמה זה שלחתני
MT: וישׁב משׁה אל יהוה ויאמר אדני למה הרעתה לעם הזה למה זה שׁלחתני

Exodus 5:23

SP: ומאז באתי אל פרעה לדבר בשמך הרע לעם הזה והצל לא הצלת את עמך
MT: ומאז באתי אל פרעה לדבר בשׁמך הרע לעם הזה והצל לא הצלת את עמך

Exodus 6:1

SP: ויאמר יהוה אל משה אתה תראה את אשר אעשה לפרעה כי ביד חזקה ישלחם וביד חזקה יגרשם מארצו
MT: ויאמר יהוה אל משׁה עתה תראה אשׁר אעשׂה לפרעה כי ביד חזקה ישׁלחם וביד חזקה יגרשׁם מארצו

" ], "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", "def highlightMatches(baseText, comparisonText):\n", " matcher = SequenceMatcher(None, baseText, comparisonText)\n", " highlightedComparisonText = \"\" \n", " for tag, i1, i2, j1, j2 in matcher.get_opcodes():\n", " if tag == \"equal\": # Identical parts\n", " highlightedComparisonText += comparisonText[j1:j2]\n", " else: # Non-matching parts\n", " highlightedComparisonText += f'{comparisonText[j1:j2]}' \n", " return highlightedComparisonText\n", "\n", "def cleanText(text):\n", " replacements = [\n", " # for the transcoded strings\n", " ('00_P', ''), # Remove '00_P'\n", " ('00_S', ''), # Remove '00_S'\n", " ('00', ''), # Remove '00'\n", " ('&', ' '), # Replace '&' with a space\n", " # for the Hebrew strings\n", " ('ס ', ''), # Final Samekh\n", " ('פ ', ''), # Final Pe\n", " ('׃', ''), # End of verse\n", " ('־',' ') # maqaf\n", " ]\n", " # Apply each replacement\n", " for old, new in replacements:\n", " text = text.replace(old, new)\n", " return text\n", "\n", "# Function to format and highlight verse differences between MT and SP\n", "def formatAndHighlight(label, MTverseText, SPverseText):\n", " book, chapter, verse = label\n", " MTverseNode = Tmt.nodeFromSection(label)\n", " MTtext = cleanText(Tmt.text(MTverseNode, \"text-orig-plain\"))\n", " SPverseNode = Tsp.nodeFromSection(label)\n", " SPtext = Tsp.text(SPverseNode)\n", " SPmarkedText = highlightMatches(MTtext, SPtext)\n", " MTmarkedText = highlightMatches(SPtext, MTtext)\n", " formattedDiff = (\n", " f'

{book} {chapter}:{verse}

'\n", " f'

SP: {SPmarkedText}
MT: {MTmarkedText}

'\n", " )\n", " return formattedDiff\n", "\n", "# Gather differences into an HTML string\n", "htmlContent = f'

Differences between MT and SP for parasha {parashaNameEnglish} ({parashaStart}-{parashaEnd})

'\n", "for label, MTverseText in MTverses.items():\n", " SPverseText = SPverses.get(label, '')\n", " MTverseText = cleanText(MTverseText)\n", " if MTverseText != SPverseText: # Check for differences\n", " difference = formatAndHighlight(label, MTverseText, SPverseText)\n", " htmlContent += difference\n", "\n", "# Save the content to an HTML file\n", "fileName = f\"differences_MT_SP({parashaNameEnglish.replace(' ','%20')}).html\"\n", "with open(fileName, \"w\", encoding=\"utf-8\") as file:\n", " file.write(htmlContent)\n", "\n", "# Display the 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": "da916301", "metadata": {}, "source": [ "# 4 - Compare texts using minimum Levenshtein distance\n", "##### [Back to ToC](#TOC)" ] }, { "cell_type": "markdown", "id": "f516dc36-754b-4b37-b2d7-7f07b18310ac", "metadata": {}, "source": [ "The Levenshtein distance measures the minimum number of single-character edits (insertions, deletions, or substitutions) needed to transform one text into another, providing a quantitative way to compare textual differences. For comparing the Masoretic Text and Samaritan Pentateuch, it highlights variations in spelling, word order, or minor textual changes. \n", "In the context of the Levenshtein distance (in the script below `threshold`), a higher number indicates greater dissimilarity between two texts, meaning more edits (insertions, deletions, or substitutions) are needed to transform one text into the other." ] }, { "cell_type": "code", "execution_count": 6, "id": "e71c202d-a845-4e35-89a4-02d6a45fff31", "metadata": {}, "outputs": [ { "data": { "text/markdown": [ "### Levenshtein distance >15 between MT and SP for parasha Shemot (Exodus 1:1-6:1)" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/markdown": [ "

Exodus 1:18

SP: ויקרא פרעה למילדות ויאמר להן מדוע עשיתן את הדבר הזה ותחינה את הילדים
MT: ויקרא מלך מצרים למילדת ויאמר להן מדוע עשׂיתן הדבר הזה ותחיין את הילדים

Levenshtein Distance: 17

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/markdown": [ "

Exodus 1:22

SP: ויצו פרעה לכל עמו לאמר כל הבן הילד לעברים היאר תשליכון וכל הבת תחיון
MT: ויצו פרעה לכל עמו לאמר כל הבן הילוד היארה תשׁליכהו וכל הבת תחיון

Levenshtein Distance: 19

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/markdown": [ "

Exodus 3:8

SP: וארדה להצילו מיד מצרים ולהעלותו מן הארץ ההיא אל ארץ טובה ורחבה אל ארץ זבת חלב ודבש אל מקום הכנעני החתי והאמרי והפרזי והגרגשי והחוי והיבוסי
MT: וארד להצילו׀ מיד מצרים ולהעלתו מן הארץ ההוא אל ארץ טובה ורחבה אל ארץ זבת חלב ודבשׁ אל מקום הכנעני והחתי והאמרי והפרזי והחוי והיבוסי

Levenshtein Distance: 23

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/markdown": [ "

Exodus 3:17

SP: ואמרה אעלה אתכם מעני מצרים אל ארץ הכנעני החתי והאמרי והפרזי והגרגשי והחוי והיבוסי אל ארץ זבת חלב ודבש
MT: ואמר אעלה אתכם מעני מצרים אל ארץ הכנעני והחתי והאמרי והפרזי והחוי והיבוסי אל ארץ זבת חלב ודבשׁ

Levenshtein Distance: 17

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/markdown": [ "

Exodus 3:22

SP: ושאל איש מאת רעהו ואשה מאת רעותה משכינתה ומגירת ביתה כלי כסף וכלי זהב ושמלות ושמתם על בניכם ועל בנתיכם ונצלתם את מצרים
MT: ושׁאלה אשׁה משׁכנתה ומגרת ביתה כלי כסף וכלי זהב ושׂמלת ושׂמתם על בניכם ועל בנתיכם ונצלתם את מצרים

Levenshtein Distance: 35

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/markdown": [ "

Exodus 5:3

SP: ויאמרו אלהי העברים נקרא עלינו נלכה נא המדברה דרך שלשת ימים ונזבחה ליהוה אלהינו פן יפגענו בדבר או בחרב
MT: ויאמרו אלהי העברים נקרא עלינו נלכה נא דרך שׁלשׁת ימים במדבר ונזבחה ליהוה אלהינו פן יפגענו בדבר או בחרב

Levenshtein Distance: 18

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n", "\n", " \n", "\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "from Levenshtein import distance\n", "from IPython.display import HTML, display\n", "\n", "threshold = 15\n", "\n", "# Create an HTML string to store the output\n", "htmlContent = f'

Levenshtein distance >{threshold} between MT and SP for parasha {parashaNameEnglish} ({parashaStart}-{parashaEnd})

'\n", "\n", "# Create header\n", "MT.dm(f'### Levenshtein distance >{threshold} between MT and SP for parasha {parashaNameEnglish} ({parashaStart}-{parashaEnd})')\n", "\n", "# Generate the HTML content\n", "for label, MTverseText in MTverses.items():\n", " SPverseText = SPverses.get(label, '')\n", " levDistance = distance(MTverseText, SPverseText) # Calculate the distance\n", " if levDistance > threshold:\n", " formattedDiff = formatAndHighlight(label, MTverseText, SPverseText)\n", " formattedDiff += f'

Levenshtein Distance: {levDistance}

' # Add the distance\n", " MT.dm(formattedDiff)\n", " htmlContent += formattedDiff # Append to the HTML content\n", "\n", "# Save the content to an HTML file\n", "fileName = f\"levenshtein_differences_MT_SP({parashaNameEnglish.replace(' ','%20')}).html\"\n", "with open(fileName, \"w\", encoding=\"utf-8\") as file:\n", " file.write(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": "63886933", "metadata": {}, "source": [ "# 5 - Comparison of spelling of proper nouns between SP and MT\n", "##### [Back to ToC](#TOC)\n", "\n", "This section focuses on comparing the spelling of proper nouns between the Samaritan Pentateuch (SP) and the Masoretic Text (MT). Proper nouns, including names of people, places, and unique terms, often exhibit variations in spelling" ] }, { "cell_type": "code", "execution_count": 7, "id": "a4011f7c", "metadata": {}, "outputs": [], "source": [ "import collections\n", "\n", "def collectProperNounSpellings(F, L, T, inputList):\n", " \"\"\"\n", " Collect proper noun spellings and their associated word node numbers.\n", " Ensures only one tuple is stored for each lexeme-to-spelling mapping.\n", " \"\"\"\n", " properNounsSpellings = {}\n", " for bookChapterVerse in inputList:\n", " verseNode = T.nodeFromSection(bookChapterVerse)\n", " wordNodes = L.d(verseNode, 'word')\n", " for wordNode in wordNodes:\n", " if F.sp.v(wordNode) == 'nmpr': # Check if the word is a proper noun\n", " lex = F.lex.v(wordNode) # Lexical form\n", " spelling = F.g_cons.v(wordNode) # Spelling\n", " # Store only the first occurrence for each lex-to-cons mapping\n", " if lex not in properNounsSpellings or spelling not in {item[0] for item in properNounsSpellings[lex]}:\n", " properNounsSpellings.setdefault(lex, []).append((spelling, wordNode))\n", " return properNounsSpellings\n", " \n", "SPspellingDict = collectProperNounSpellings(Fsp, Lsp, Tsp, bookChapterVerseList) \n", "MTspellingDict = collectProperNounSpellings(Fmt, Lmt, Tmt, bookChapterVerseList)" ] }, { "cell_type": "code", "execution_count": 8, "id": "4f596918-087e-4658-bc57-0ffc85779cb7", "metadata": {}, "outputs": [ { "data": { "text/html": [ "

Spelling differences in proper nouns between SP and MT for parasha Shemot (Exodus 1:1-6:1)

Word: Benjamin Exodus 1:3

  • MT Spelling: בנימן
  • SP Spelling: בנימים

Word: Pithom Exodus 1:11

  • MT Spelling: פתם
  • SP Spelling: פיתון

Word: Nile Exodus 1:22

  • MT Spelling: יארה
  • SP Spelling: יאר

Word: Zipporah Exodus 2:21

  • MT Spelling: צפרה
  • SP Spelling: צפורה

Word: Horeb Exodus 3:1

  • MT Spelling: חרבה
  • SP Spelling: חורבה

Word: Jether Exodus 4:18

  • MT Spelling: יתר
  • SP Spelling: None
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n", "\n", " \n", "\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "from IPython.display import HTML, display\n", "\n", "# Initialize HTML content\n", "htmlContent = f'

Spelling differences in proper nouns between SP and MT for parasha {parashaNameEnglish} ({parashaStart}-{parashaEnd})

'\n", "\n", "# Generate the HTML output\n", "for lex, MTspellings in MTspellingDict.items():\n", " # Retrieve SP spellings, defaulting to an empty set if lex is not found\n", " SPspellings = SPspellingDict.get(lex, set())\n", "\n", " # Extract only the spellings (ignoring node numbers) for comparison\n", " MTspellingSet = {spelling for spelling, _ in MTspellings}\n", " SPspellingSet = {spelling for spelling, _ in SPspellings}\n", "\n", " # Compare the sets of spellings\n", " if MTspellingSet != SPspellingSet:\n", " # Print MT spelling with reference\n", " MTnode = list(MTspellings)[0][1] # Get first tuple's node number\n", " book, chapter, verse = Tmt.sectionFromNode(MTnode)\n", " MTgloss = Fmt.gloss.v(MTnode)\n", " MTspelling = Fmt.g_cons_utf8.v(MTnode)\n", "\n", " # Build HTML output\n", " output = (\n", " f'

Word: {MTgloss} '\n", " f''\n", " f'{book} {chapter}:{verse}

'\n", " f'
  • MT Spelling: {MTspelling}
  • '\n", " )\n", "\n", " # Print SP spellings with reference\n", " if SPspellings:\n", " SPnode = list(SPspellings)[0][1] # Get first tuple's node number\n", " SPspelling = Fsp.g_cons_utf8.v(SPnode)\n", " output += f'
  • SP Spelling: {SPspelling}
'\n", " else:\n", " output += '
  • SP Spelling: None
  • '\n", "\n", " # Append the output to the HTML content\n", " htmlContent += output\n", "\n", "# Save the HTML content to a file\n", "fileName = f\"spelling_differences_SP_MT({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": "0fbcc828-2880-4d36-bd66-5a9f085b616d", "metadata": {}, "source": [ "# 6 - References and acknowledgement \n", "##### [Back to ToC](#TOC)\n", "\n", "1 Christian Canu Højgaard, Martijn Naaijer, & Stefan Schorch. (2023). Text-Fabric Dataset of the Samaritan Pentateuch. Zenodo. https://doi.org/10.5281/zenodo.7734632\n", "\n", "2 [Notebook created by Martijn Naaijer](https://github.com/DT-UCPH/sp/blob/main/notebooks/combine_sp_with_mt_data.ipynb)" ] }, { "cell_type": "markdown", "id": "4e319feb-814e-4903-922a-58bae953224c", "metadata": { "tags": [] }, "source": [ "# 7 - 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", " collections\n", " difflib\n", " Levenshtein\n", "\n", "You can install any missing library from within Jupyter Notebook using either`pip` or `pip3`." ] }, { "cell_type": "markdown", "id": "68f75bc4-7bc2-42f1-af91-fe6e5b83a277", "metadata": {}, "source": [ "# 8 - 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
    Date5 March 2025
    \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 }