{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n", "\n", "\n", "\n", "You might want to consider the [start](search.ipynb) of this tutorial.\n", "\n", "Short introductions to other TF datasets:\n", "\n", "* [Dead Sea Scrolls](https://nbviewer.jupyter.org/github/annotation/tutorials/blob/master/lorentz2020/dss.ipynb),\n", "* [Old Babylonian Letters](https://nbviewer.jupyter.org/github/annotation/tutorials/blob/master/lorentz2020/oldbabylonian.ipynb),\n", "or the\n", "* [Quran](https://nbviewer.jupyter.org/github/annotation/tutorials/blob/master/lorentz2020/quran.ipynb)\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Rich display\n", "\n", "Text-Fabric offers pretty and plain displays of textual objects.\n", "\n", "A **plain** display of an object is a simple reference to that object if it is big, or the text of that object if it is small.\n", "\n", "A **pretty** display of an object is a representation of the structure of that object. It contains text and features of sub objects.\n", "Provided the object is not too big." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "%load_ext autoreload\n", "%autoreload 2" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Incantation\n", "\n", "The ins and outs of installing Text-Fabric, getting the corpus, and initializing a notebook are\n", "explained in the [start tutorial](start.ipynb)." ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "ExecuteTime": { "end_time": "2018-05-24T10:06:39.818664Z", "start_time": "2018-05-24T10:06:39.796588Z" } }, "outputs": [], "source": [ "from tf.app import use" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "ExecuteTime": { "end_time": "2018-05-24T10:06:51.615044Z", "start_time": "2018-05-24T10:06:50.161456Z" } }, "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/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", " Text-Fabric: Text-Fabric API 12.0.4, 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", " Settings:
specified
  1. apiVersion: 3
  2. appName: ETCBC/bhsa
  3. appPath: /Users/me/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: /Users/me/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": [ "
Text-Fabric 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": [ "A = use(\"ETCBC/bhsa\", hoist=globals())" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Arbitrary nodes\n", "We pretty-print some (arbitrary) nodes.\n", "\n", "The first verse." ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1414389" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "v1 = A.nodeFromSectionStr(\"Genesis 1:1\")\n", "v1" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
verse
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "A.pretty(v1)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "With standard features displayed:" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
verse
sentence 1
clause xQtX NA
phrase PP Time
inpdp=prep
beginningpdp=subs
phrase VP Pred
createpdp=verbvs=qalvt=perf
phrase NP Subj
god(s)pdp=subs
phrase PP Objc
<object marker>pdp=prep
thepdp=art
heavenspdp=subs
andpdp=conj
<object marker>pdp=prep
thepdp=art
earthpdp=subs
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "A.pretty(v1, standardFeatures=True)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now a phrase. We display it with little and with much information." ] }, { "cell_type": "code", "execution_count": 7, "metadata": { "ExecuteTime": { "end_time": "2018-04-25T13:57:33.060576Z", "start_time": "2018-04-25T13:57:33.051457Z" } }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
phrase:651605 PP Cmpl
phrase_atom:904808 PP NA
subphrase:1300549
intervalpdp=prep
52 הָ
thepdp=art
lightpdp=subs
54 וּ
andpdp=conj
subphrase:1300550
intervalpdp=prep
56 הַ
thepdp=art
darknesspdp=subs
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "phrase = 651605\n", "A.pretty(phrase, withNodes=False, prettyTypes=False)\n", "A.pretty(phrase, withNodes=True, standardFeatures=True, hideTypes=False)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If we want to see the subphrases but not the phrase atoms:" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
phrase:651605 PP Cmpl
subphrase:1300549
intervalpdp=prep
52 הָ
thepdp=art
lightpdp=subs
54 וּ
andpdp=conj
subphrase:1300550
intervalpdp=prep
56 הַ
thepdp=art
darknesspdp=subs
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "A.pretty(phrase, withNodes=True, standardFeatures=True, hiddenTypes=\"phrase_atom\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Use the following to find out which display options are available and what their current values are." ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ "
current display options\n", "\n", "
1. baseTypes\n", "\n", "\n", "1. `word`\n", "\n", "
\n", "
2. colorMap\n", "\n", "None\n", "\n", "
\n", "
3. condenseType\n", "\n", "`verse`\n", "\n", "
\n", "
4. condensed\n", "\n", "False\n", "\n", "
\n", "
5. end\n", "\n", "None\n", "\n", "
\n", "
6. extraFeatures\n", "\n", "\n", "1. ()\n", "2. {}\n", "\n", "
\n", "
7. fmt\n", "\n", "None\n", "\n", "
\n", "
8. full\n", "\n", "False\n", "\n", "
\n", "
9. hiddenTypes\n", "\n", "\n", "1. `clause_atom`\n", "2. `half_verse`\n", "3. `phrase_atom`\n", "4. `sentence_atom`\n", "5. `subphrase`\n", "\n", "
\n", "
10. hideTypes\n", "\n", "`True`\n", "\n", "
\n", "
11. highlights\n", "\n", "{}\n", "\n", "
\n", "
12. lineNumbers\n", "\n", "None\n", "\n", "
\n", "
13. noneValues\n", "\n", "\n", "1. `none`\n", "2. `unknown`\n", "3. None\n", "4. `NA`\n", "\n", "
\n", "
14. plainGaps\n", "\n", "`True`\n", "\n", "
\n", "
15. prettyTypes\n", "\n", "`True`\n", "\n", "
\n", "
16. queryFeatures\n", "\n", "`True`\n", "\n", "
\n", "
17. showGraphics\n", "\n", "None\n", "\n", "
\n", "
18. skipCols\n", "\n", "set()\n", "\n", "
\n", "
19. standardFeatures\n", "\n", "False\n", "\n", "
\n", "
20. start\n", "\n", "None\n", "\n", "
\n", "
21. suppress\n", "\n", "set()\n", "\n", "
\n", "
22. tupleFeatures\n", "\n", "()\n", "\n", "
\n", "
23. withNodes\n", "\n", "False\n", "\n", "
\n", "
24. withPassage\n", "\n", "`True`\n", "\n", "
\n", "
25. withTypes\n", "\n", "False\n", "\n", "
\n", "
\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "A.displayShow()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Where is this phrase on SHEBANQ?\n", "You can click on the passage reference.\n", "\n", "You can generate a link that points to where a node is on SHEBANQ as follows:" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "ExecuteTime": { "end_time": "2018-04-25T13:57:36.441490Z", "start_time": "2018-04-25T13:57:36.432236Z" } }, "outputs": [ { "data": { "text/html": [ "Genesis 1:4" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "A.webLink(phrase)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "If you want just the URL:" ] }, { "cell_type": "code", "execution_count": 11, "metadata": { "ExecuteTime": { "end_time": "2018-04-25T13:57:36.441490Z", "start_time": "2018-04-25T13:57:36.432236Z" } }, "outputs": [ { "data": { "text/plain": [ "'https://shebanq.ancient-data.org/hebrew/text?book=Genesis&chapter=1&verse=4&version=2021&mr=m&qw=q&tp=txt_p&tr=hb&wget=v&qget=v&nget=vt'" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "A.webLink(phrase, urlOnly=True)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "A link to another passage:" ] }, { "cell_type": "code", "execution_count": 12, "metadata": { "ExecuteTime": { "end_time": "2018-04-25T13:57:46.144712Z", "start_time": "2018-04-25T13:57:46.138983Z" } }, "outputs": [], "source": [ "z = A.nodeFromSectionStr(\"Ezra 3:4\")" ] }, { "cell_type": "code", "execution_count": 13, "metadata": { "ExecuteTime": { "end_time": "2018-04-25T13:57:47.022343Z", "start_time": "2018-04-25T13:57:47.012756Z" } }, "outputs": [ { "data": { "text/html": [ "Ezra 3:4" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "A.webLink(z)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Plain\n", "\n", "We can represent a node in plain representation and highlight specific portions." ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [], "source": [ "firstVerse = F.otype.s(\"verse\")[0]\n", "allPhrases = F.otype.s(\"phrase\")\n", "phrases = {allPhrases[1], allPhrases[3]}\n", "words = (2, 4, 6, 9)" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
Genesis 1:1  בְּרֵאשִׁ֖ית בָּרָ֣א אֱלֹהִ֑ים אֵ֥ת הַשָּׁמַ֖יִם וְאֵ֥ת הָאָֽרֶץ׃
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "firstSentence = F.otype.s(\"sentence\")[0]\n", "A.plain(firstSentence)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "First we highlight some words:" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
Genesis 1:1  בְּרֵאשִׁ֖ית בָּרָ֣א אֱלֹהִ֑ים אֵ֥ת הַשָּׁמַ֖יִם וְאֵ֥ת הָאָֽרֶץ׃
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "highlights = set(words)\n", "A.plain(firstVerse, highlights=highlights)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now some phrases:" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "{651576, 651574}\n" ] }, { "data": { "text/html": [ "
Genesis 1:1  בְּרֵאשִׁ֖ית בָּרָ֣א אֱלֹהִ֑ים אֵ֥ת הַשָּׁמַ֖יִם וְאֵ֥ת הָאָֽרֶץ׃
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "highlights = set(phrases)\n", "print(highlights)\n", "A.plain(firstVerse, highlights=highlights)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "As you see, when we highlight bigger things than words, we put a\n", "highlighted border around the words in those things." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can do both:" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
Genesis 1:1  בְּרֵאשִׁ֖ית בָּרָ֣א אֱלֹהִ֑ים אֵ֥ת הַשָּׁמַ֖יִם וְאֵ֥ת הָאָֽרֶץ׃
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "highlights = set(phrases) | set(words)\n", "A.plain(firstVerse, highlights=highlights)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can also highlight the verse itself." ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
Genesis 1:1  בְּרֵאשִׁ֖ית בָּרָ֣א אֱלֹהִ֑ים אֵ֥ת הַשָּׁמַ֖יִם וְאֵ֥ת הָאָֽרֶץ׃
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "highlights = {firstVerse}\n", "A.plain(firstVerse, highlights=highlights)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can use different colours for highlighting:\n", "\n", "* some words are red\n", "* some other words are green\n", "* phrases are blue" ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
Genesis 1:1  בְּרֵאשִׁ֖ית בָּרָ֣א אֱלֹהִ֑ים אֵ֥ת הַשָּׁמַ֖יִם וְאֵ֥ת הָאָֽרֶץ׃
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "highlights = {i: \"lightsalmon\" for i in [1, 5, 9]}\n", "highlights.update({i: \"mediumaquamarine\" for i in [3, 7]})\n", "highlights.update({i: \"blue\" for i in phrases})\n", "highlights.update({firstVerse: \"#eeeeee\"})\n", "A.plain(firstVerse, highlights=highlights)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Pretty\n", "We define two verse nodes:" ] }, { "cell_type": "code", "execution_count": 21, "metadata": { "ExecuteTime": { "end_time": "2018-04-25T13:57:50.369004Z", "start_time": "2018-04-25T13:57:50.363695Z" } }, "outputs": [], "source": [ "verse1 = A.nodeFromSectionStr(\"Genesis 1:7\")\n", "verse2 = A.nodeFromSectionStr(\"Genesis 1:17\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "and display the first one:" ] }, { "cell_type": "code", "execution_count": 22, "metadata": { "ExecuteTime": { "end_time": "2018-04-25T13:57:53.124725Z", "start_time": "2018-04-25T13:57:53.108960Z" } }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "A.pretty(verse1)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In the next verse we choose a bit more to display: we include standard features:" ] }, { "cell_type": "code", "execution_count": 23, "metadata": { "ExecuteTime": { "end_time": "2018-04-25T13:58:01.798768Z", "start_time": "2018-04-25T13:58:01.787884Z" } }, "outputs": [ { "data": { "text/html": [ "
verse
sentence 46
clause WayX NA
phrase CP Conj
andpdp=conj
phrase VP Pred
givepdp=verbvs=qalvt=wayq
phrase PP Objc
<object marker>pdp=prep
phrase NP Subj
god(s)pdp=subs
phrase PP Cmpl
inpdp=prep
firmamentpdp=subs
thepdp=art
heavenspdp=subs
clause InfC Adju
phrase VP Pred
topdp=prep
be lightpdp=verbvs=hifvt=infc
phrase PP Cmpl
uponpdp=prep
thepdp=art
earthpdp=subs
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "A.pretty(verse2, standardFeatures=True)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The labels of the nodes come from features in the data: hover over a label to see which feature is responsible.\n", "The same holds for the unnamed features below the words, in particular the gloss." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Note that the sentence in this verse continues after the verse ends, that is why it has no left border.\n", "\n", "In the BHSA, sentences, clauses and phrases may be discontinuous.\n", "The designers of the BHSA data (Eep Talstra and Constantijn Sikkel et al.) have added node types\n", "`sentence_atom`, `clause_atom` and `phrase_atom`.\n", "\n", "They are the continuous chunks within the objects of their corresponding non-atom types.\n", "The atom types form a nice nest of building blocks.\n", "\n", "Usually we hide the atom types from view.\n", "But we can make them visible:" ] }, { "cell_type": "code", "execution_count": 24, "metadata": { "ExecuteTime": { "end_time": "2018-04-25T13:58:01.798768Z", "start_time": "2018-04-25T13:58:01.787884Z" } }, "outputs": [ { "data": { "text/html": [ "
verse
half_verse
sentence
sentence_atom
clause
clause_atom
phrase
phrase_atom
phrase
phrase
phrase_atom
phrase
phrase
half_verse
sentence
sentence_atom
clause
clause_atom
phrase
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "A.pretty(verse2, hideTypes=False)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Back to the view without the atoms.\n", "\n", "We can even leave out the node types:" ] }, { "cell_type": "code", "execution_count": 25, "metadata": { "ExecuteTime": { "end_time": "2018-04-25T13:58:01.798768Z", "start_time": "2018-04-25T13:58:01.787884Z" } }, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "A.pretty(verse2, prettyTypes=False)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We put in the features (again) and also add node numbers:" ] }, { "cell_type": "code", "execution_count": 26, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
verse:1414405
sentence:1172353 46
clause:427617 WayX NA
phrase:651751 CP Conj
314 וַ
andpdp=conj
phrase:651752 VP Pred
givepdp=verbvs=qalvt=wayq
phrase:651753 PP Objc
<object marker>pdp=prep
phrase:651754 NP Subj
god(s)pdp=subs
phrase:651755 PP Cmpl
318 בִּ
inpdp=prep
firmamentpdp=subs
320 הַ
thepdp=art
heavenspdp=subs
clause:427618 InfC Adju
phrase:651756 VP Pred
322 לְ
topdp=prep
be lightpdp=verbvs=hifvt=infc
phrase:651757 PP Cmpl
uponpdp=prep
325 הָ
thepdp=art
earthpdp=subs
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "A.pretty(verse2, withNodes=True, standardFeatures=True)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now we selectively remove a few features from the display:" ] }, { "cell_type": "code", "execution_count": 27, "metadata": { "ExecuteTime": { "end_time": "2018-04-25T13:58:07.808474Z", "start_time": "2018-04-25T13:58:07.784567Z" } }, "outputs": [ { "data": { "text/html": [ "
verse
sentence 46
clause NA
phrase Conj
pdp=conj
phrase Pred
pdp=verbvs=qalvt=wayq
phrase Objc
phrase Subj
phrase Cmpl
clause Adju
phrase Pred
pdp=prep
pdp=verbvs=hifvt=infc
phrase Cmpl
pdp=prep
pdp=art
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "A.pretty(verse2, standardFeatures=True, suppress={\"gloss\", \"typ\"})" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now we add features to the display: `lex` and `g_word` :" ] }, { "cell_type": "code", "execution_count": 28, "metadata": {}, "outputs": [], "source": [ "A.displaySetup(extraFeatures=[\"lex\", \"g_word\"], standardFeatures=True)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We also made `standardFeatures=True)` the temporary default." ] }, { "cell_type": "code", "execution_count": 29, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
verse
sentence 46
clause WayX NA
phrase CP Conj
andpdp=conjg_word=WA-lex=W
phrase VP Pred
givepdp=verbvs=qalvt=wayqg_word=J.IT.;71Nlex=NTN[
phrase PP Objc
<object marker>pdp=prepg_word=>OT@91Mlex=>T
phrase NP Subj
god(s)pdp=subsg_word=>:ELOHI73JMlex=>LHJM/
phrase PP Cmpl
inpdp=prepg_word=B.I-lex=B
firmamentpdp=subsg_word=R:QI74J<Alex=RQJ</
thepdp=artg_word=HA-lex=H
heavenspdp=subsg_word=C.@M@92JIMlex=CMJM/
clause InfC Adju
phrase VP Pred
topdp=prepg_word=L:-lex=L
be lightpdp=verbvs=hifvt=infcg_word=H@>I73JRlex=>WR[
phrase PP Cmpl
uponpdp=prepg_word=<ALlex=<L
thepdp=artg_word=H@-lex=H
earthpdp=subsg_word=>@75REYlex=>RY/
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "A.pretty(verse2)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "and we reset the pretty features to the default values:" ] }, { "cell_type": "code", "execution_count": 30, "metadata": {}, "outputs": [], "source": [ "A.displayReset(\"extraFeatures\")" ] }, { "cell_type": "code", "execution_count": 31, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
verse
sentence 46
clause WayX NA
phrase CP Conj
andpdp=conj
phrase VP Pred
givepdp=verbvs=qalvt=wayq
phrase PP Objc
<object marker>pdp=prep
phrase NP Subj
god(s)pdp=subs
phrase PP Cmpl
inpdp=prep
firmamentpdp=subs
thepdp=art
heavenspdp=subs
clause InfC Adju
phrase VP Pred
topdp=prep
be lightpdp=verbvs=hifvt=infc
phrase PP Cmpl
uponpdp=prep
thepdp=art
earthpdp=subs
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "A.pretty(verse2)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can also opt for less detail: suppose we do not want to dig deeper than the phrases:" ] }, { "cell_type": "code", "execution_count": 32, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
verse
sentence 46
clause WayX NA
phrase וַ
phrase יִּתֵּ֥ן
phrase אֹתָ֛ם
phrase אֱלֹהִ֖ים
phrase בִּרְקִ֣יעַ הַשָּׁמָ֑יִם
clause InfC Adju
phrase לְהָאִ֖יר
phrase עַל־הָאָֽרֶץ׃
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "A.pretty(verse2, baseTypes={\"phrase\"})" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "or if clauses are enough:" ] }, { "cell_type": "code", "execution_count": 33, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
verse
sentence 46
clause וַיִּתֵּ֥ן אֹתָ֛ם אֱלֹהִ֖ים בִּרְקִ֣יעַ הַשָּׁמָ֑יִם
clause לְהָאִ֖יר עַל־הָאָֽרֶץ׃
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "A.pretty(verse2, baseTypes={\"clause\"})" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "even sentences are possible:" ] }, { "cell_type": "code", "execution_count": 34, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
verse
sentence וַיִּתֵּ֥ן אֹתָ֛ם אֱלֹהִ֖ים בִּרְקִ֣יעַ הַשָּׁמָ֑יִם לְהָאִ֖יר עַל־הָאָֽרֶץ׃
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "A.pretty(verse2, baseTypes={\"sentence\"})" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Before we go on, we reset the display completely." ] }, { "cell_type": "code", "execution_count": 35, "metadata": {}, "outputs": [], "source": [ "A.displayReset()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Query results\n", "We run a TF query and show some of its results with a lot of pomp and circumstance.\n", "The query is written by Stephen Ku, and he is the one who prompted me to write\n", "rich display function for query results.\n", "\n", "It asks for a sentence in which there are three clauses, each entirely before the next one.\n", "\n", "The first clause has a predicate phrase containing a verb.\n", "\n", "The second clause has a predicate phrase, a verb is not required nor forbidden.\n", "\n", "The third clause has an object phrase containing a (proper) noun or personal/demonstrative/interrogative pronoun." ] }, { "cell_type": "code", "execution_count": 36, "metadata": { "ExecuteTime": { "end_time": "2018-04-25T13:58:11.225978Z", "start_time": "2018-04-25T13:58:11.220671Z" } }, "outputs": [], "source": [ "ellipQuery = \"\"\"\n", "sentence\n", " c1:clause\n", " phrase function=Pred\n", " word pdp=verb\n", " c2:clause\n", " phrase function=Pred\n", " c3:clause typ=Ellp\n", " phrase function=Objc\n", " word pdp=subs|nmpr|prps|prde|prin\n", " c1 << c2\n", " c2 << c3\n", "\"\"\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Above is the query *template*. Now we *run* the query." ] }, { "cell_type": "code", "execution_count": 37, "metadata": { "ExecuteTime": { "end_time": "2018-04-25T13:58:18.022692Z", "start_time": "2018-04-25T13:58:14.862389Z" } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " 1.62s 1473 results\n" ] } ], "source": [ "results = A.search(ellipQuery)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "There are several ways to present the results.\n", "Here are results 10-12 in a table:" ] }, { "cell_type": "code", "execution_count": 38, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", "\n", "\n", "
npsentenceclausephrasewordclausephraseclausephraseword
10Exodus 18:8וַיְסַפֵּ֤ר מֹשֶׁה֙ לְחֹ֣תְנֹ֔ו אֵת֩ כָּל־אֲשֶׁ֨ר עָשָׂ֤ה יְהוָה֙ לְפַרְעֹ֣ה וּלְמִצְרַ֔יִם עַ֖ל אֹודֹ֣ת יִשְׂרָאֵ֑ל אֵ֤ת כָּל־הַתְּלָאָה֙ אֲשֶׁ֣ר מְצָאָ֣תַם בַּדֶּ֔רֶךְ וַיַּצִּלֵ֖ם יְהוָֽה׃ וַיְסַפֵּ֤ר מֹשֶׁה֙ לְחֹ֣תְנֹ֔ו אֵת֩ כָּל־יְסַפֵּ֤ר יְסַפֵּ֤ר אֲשֶׁ֨ר עָשָׂ֤ה יְהוָה֙ לְפַרְעֹ֣ה וּלְמִצְרַ֔יִם עַ֖ל אֹודֹ֣ת יִשְׂרָאֵ֑ל עָשָׂ֤ה אֵ֤ת כָּל־הַתְּלָאָה֙ אֵ֤ת כָּל־הַתְּלָאָה֙ כָּל־
11Exodus 18:8וַיְסַפֵּ֤ר מֹשֶׁה֙ לְחֹ֣תְנֹ֔ו אֵת֩ כָּל־אֲשֶׁ֨ר עָשָׂ֤ה יְהוָה֙ לְפַרְעֹ֣ה וּלְמִצְרַ֔יִם עַ֖ל אֹודֹ֣ת יִשְׂרָאֵ֑ל אֵ֤ת כָּל־הַתְּלָאָה֙ אֲשֶׁ֣ר מְצָאָ֣תַם בַּדֶּ֔רֶךְ וַיַּצִּלֵ֖ם יְהוָֽה׃ וַיְסַפֵּ֤ר מֹשֶׁה֙ לְחֹ֣תְנֹ֔ו אֵת֩ כָּל־יְסַפֵּ֤ר יְסַפֵּ֤ר אֲשֶׁ֨ר עָשָׂ֤ה יְהוָה֙ לְפַרְעֹ֣ה וּלְמִצְרַ֔יִם עַ֖ל אֹודֹ֣ת יִשְׂרָאֵ֑ל עָשָׂ֤ה אֵ֤ת כָּל־הַתְּלָאָה֙ אֵ֤ת כָּל־הַתְּלָאָה֙ תְּלָאָה֙
12Exodus 23:15אֶת־חַ֣ג הַמַּצֹּות֮ תִּשְׁמֹר֒ וְחַ֤ג הַקָּצִיר֙ בִּכּוּרֵ֣י מַעֲשֶׂ֔יךָ אֲשֶׁ֥ר תִּזְרַ֖ע בַּשָּׂדֶ֑ה וְחַ֤ג הָֽאָסִף֙ בְּצֵ֣את הַשָּׁנָ֔ה בְּאָסְפְּךָ֥ אֶֽת־מַעֲשֶׂ֖יךָ מִן־הַשָּׂדֶֽה׃ אֶת־חַ֣ג הַמַּצֹּות֮ תִּשְׁמֹר֒ תִּשְׁמֹר֒ תִּשְׁמֹר֒ אֲשֶׁ֥ר תִּזְרַ֖ע בַּשָּׂדֶ֑ה תִּזְרַ֖ע וְחַ֤ג הָֽאָסִף֙ חַ֤ג הָֽאָסִף֙ חַ֤ג
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "A.table(results, start=10, end=12)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You can also show the results in pretty displays.\n", "The `A.show()` function asks you for some limits (it will not show more than 100 at a time), and then it displays them.\n", "\n", "It lists the results as follows:\n", "\n", "* a heading showing which result in the sequence of all results this is\n", "* a display of all verses that have result material, with the places highlighted that\n", " correspond to a node in the result tuple\n", "\n", "We show result 10 only." ] }, { "cell_type": "code", "execution_count": 39, "metadata": { "ExecuteTime": { "end_time": "2018-04-25T13:58:23.002898Z", "start_time": "2018-04-25T13:58:21.622054Z" } }, "outputs": [ { "data": { "text/html": [ "

result 10

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
verse:1416396
sentence:1178457
clause:435513
typ=WayX
phrase:675504
function=Conjtyp=CP
38605 וַ
pdp=conj
phrase:675505
function=Predtyp=VP
pdp=verb
phrase:675506
function=Subjtyp=PrNP
pdp=nmpr
phrase:675507
function=Cmpltyp=PP
38608 לְ
pdp=prep
pdp=subs
phrase:675508
function=Objctyp=PP
38610 אֵת֩
pdp=prep
pdp=subs
clause:435514
typ=xQtX
phrase:675509
function=Relatyp=CP
pdp=conj
phrase:675510
function=Predtyp=VP
pdp=verb
phrase:675511
function=Subjtyp=PrNP
pdp=nmpr
phrase:675512
function=Cmpltyp=PP
38615 לְ
pdp=prep
pdp=subs
38617 וּ
pdp=conj
38618 לְ
pdp=prep
pdp=nmpr
phrase:675513
function=Adjutyp=PP
38620 עַ֖ל
pdp=prep
pdp=subs
clause:435515
typ=Ellp
phrase:675514
function=Objctyp=PP
38623 אֵ֤ת
pdp=prep
pdp=subs
38625 הַ
pdp=art
pdp=subs
clause:435516
typ=xQt0
phrase:675515
function=Relatyp=CP
pdp=conj
phrase:675516
function=PreOtyp=VP
pdp=verb
phrase:675517
function=Locatyp=PP
38629 בַּ
pdp=prep
38630
pdp=art
pdp=subs
clause:435517
typ=WayX
phrase:675518
function=Conjtyp=CP
38632 וַ
pdp=conj
phrase:675519
function=PreOtyp=VP
pdp=verb
phrase:675520
function=Subjtyp=PrNP
pdp=nmpr
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "A.show(results, start=10, end=10, withNodes=True)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Note that although the *standard* features are not all shown, the features mentioned in the query are shown.\n", "We can suppress that as well:" ] }, { "cell_type": "code", "execution_count": 40, "metadata": { "ExecuteTime": { "end_time": "2018-04-25T13:58:23.002898Z", "start_time": "2018-04-25T13:58:21.622054Z" } }, "outputs": [ { "data": { "text/html": [ "

result 10

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
verse:1416396
sentence:1178457
clause:435513
phrase:675504
38605 וַ
phrase:675505
phrase:675506
phrase:675507
phrase:675508
clause:435514
phrase:675509
phrase:675510
phrase:675511
phrase:675512
clause:435515
phrase:675514
clause:435516
phrase:675515
phrase:675516
phrase:675517
38629 בַּ
38630
clause:435517
phrase:675518
38632 וַ
phrase:675519
phrase:675520
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "A.show(results, start=10, end=10, withNodes=True, queryFeatures=False)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can also package the results tuples in other things than verses, e.g. sentences, and at the same time cut off the displays at phrases:" ] }, { "cell_type": "code", "execution_count": 41, "metadata": { "ExecuteTime": { "end_time": "2018-04-25T13:58:23.002898Z", "start_time": "2018-04-25T13:58:21.622054Z" } }, "outputs": [ { "data": { "text/html": [ "

result 10

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
sentence:1178457
clause:435513
phrase:675504 וַ
phrase:675505 38606יְסַפֵּ֤ר
phrase:675506 מֹשֶׁה֙
phrase:675507 לְחֹ֣תְנֹ֔ו
phrase:675508 אֵת֩ כָּל־
clause:435514
phrase:675509 אֲשֶׁ֨ר
phrase:675510 עָשָׂ֤ה
phrase:675511 יְהוָה֙
phrase:675512 לְפַרְעֹ֣ה וּלְמִצְרַ֔יִם
phrase:675513 עַ֖ל אֹודֹ֣ת יִשְׂרָאֵ֑ל
clause:435515
phrase:675514 אֵ֤ת 38624כָּל־הַתְּלָאָה֙
clause:435516
phrase:675515 אֲשֶׁ֣ר
phrase:675516 מְצָאָ֣תַם
phrase:675517 בַּדֶּ֔רֶךְ
clause:435517
phrase:675518 וַ
phrase:675519 יַּצִּלֵ֖ם
phrase:675520 יְהוָֽה׃
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

result 11

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
sentence:1178457
clause:435513
phrase:675504 וַ
phrase:675505 38606יְסַפֵּ֤ר
phrase:675506 מֹשֶׁה֙
phrase:675507 לְחֹ֣תְנֹ֔ו
phrase:675508 אֵת֩ כָּל־
clause:435514
phrase:675509 אֲשֶׁ֨ר
phrase:675510 עָשָׂ֤ה
phrase:675511 יְהוָה֙
phrase:675512 לְפַרְעֹ֣ה וּלְמִצְרַ֔יִם
phrase:675513 עַ֖ל אֹודֹ֣ת יִשְׂרָאֵ֑ל
clause:435515
phrase:675514 אֵ֤ת כָּל־הַ38626תְּלָאָה֙
clause:435516
phrase:675515 אֲשֶׁ֣ר
phrase:675516 מְצָאָ֣תַם
phrase:675517 בַּדֶּ֔רֶךְ
clause:435517
phrase:675518 וַ
phrase:675519 יַּצִּלֵ֖ם
phrase:675520 יְהוָֽה׃
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

result 12

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
sentence:1178894
clause:436060
phrase:677214 אֶת־חַ֣ג הַמַּצֹּות֮
phrase:677215 41257תִּשְׁמֹר֒
sentence:1178894
clause:436065
phrase:677232 וְ
phrase:677233 חַ֤ג הַקָּצִיר֙
phrase:677234 בִּכּוּרֵ֣י מַעֲשֶׂ֔יךָ
clause:436066
phrase:677235 אֲשֶׁ֥ר
phrase:677236 תִּזְרַ֖ע
phrase:677237 בַּשָּׂדֶ֑ה
clause:436067
phrase:677238 וְ
phrase:677239 41292חַ֤ג הָֽאָסִף֙
clause:436068
phrase:677240 בְּצֵ֣את
phrase:677241 הַשָּׁנָ֔ה
clause:436069
phrase:677242 בְּאָסְפְּךָ֥
phrase:677243 אֶֽת־מַעֲשֶׂ֖יךָ
phrase:677244 מִן־הַשָּׂדֶֽה׃
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "A.displaySetup(queryFeatures=False)\n", "A.show(\n", " results,\n", " start=10,\n", " end=12,\n", " withNodes=True,\n", " condenseType=\"sentence\",\n", " baseTypes={\"phrase\"},\n", ")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Note, that now the phrases are heavily highlighted whereas the highlighted words just have a box around them." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's leave out some information:" ] }, { "cell_type": "code", "execution_count": 42, "metadata": { "ExecuteTime": { "end_time": "2018-04-25T13:58:23.002898Z", "start_time": "2018-04-25T13:58:21.622054Z" } }, "outputs": [ { "data": { "text/html": [ "

result 10

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
וַיְסַפֵּ֤ר מֹשֶׁה֙ לְחֹ֣תְנֹ֔ו אֵת֩ כָּל־
אֲשֶׁ֨ר עָשָׂ֤ה יְהוָה֙ לְפַרְעֹ֣ה וּלְמִצְרַ֔יִם עַ֖ל אֹודֹ֣ת יִשְׂרָאֵ֑ל
אֵ֤ת כָּל־הַתְּלָאָה֙
אֲשֶׁ֣ר מְצָאָ֣תַם בַּדֶּ֔רֶךְ
וַיַּצִּלֵ֖ם יְהוָֽה׃
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

result 11

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
וַיְסַפֵּ֤ר מֹשֶׁה֙ לְחֹ֣תְנֹ֔ו אֵת֩ כָּל־
אֲשֶׁ֨ר עָשָׂ֤ה יְהוָה֙ לְפַרְעֹ֣ה וּלְמִצְרַ֔יִם עַ֖ל אֹודֹ֣ת יִשְׂרָאֵ֑ל
אֵ֤ת כָּל־הַתְּלָאָה֙
אֲשֶׁ֣ר מְצָאָ֣תַם בַּדֶּ֔רֶךְ
וַיַּצִּלֵ֖ם יְהוָֽה׃
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

result 12

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
אֶת־חַ֣ג הַמַּצֹּות֮ תִּשְׁמֹר֒
וְחַ֤ג הַקָּצִיר֙ בִּכּוּרֵ֣י מַעֲשֶׂ֔יךָ
אֲשֶׁ֥ר תִּזְרַ֖ע בַּשָּׂדֶ֑ה
וְחַ֤ג הָֽאָסִף֙
בְּצֵ֣את הַשָּׁנָ֔ה
בְּאָסְפְּךָ֥ אֶֽת־מַעֲשֶׂ֖יךָ מִן־הַשָּׂדֶֽה׃
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "A.show(\n", " results,\n", " start=10,\n", " end=12,\n", " withNodes=False,\n", " prettyTypes=False,\n", " condenseType=\"sentence\",\n", " baseTypes={\"clause\"},\n", " withPassage=False,\n", ")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# All steps\n", "\n", "* **[start](start.ipynb)** your first step in mastering the bible computationally\n", "* **display** become an expert in creating pretty displays of your text structures\n", "* **[search](search.ipynb)** turbo charge your hand-coding with search templates\n", "* **[export Excel](exportExcel.ipynb)** make tailor-made spreadsheets out of your results\n", "* **[share](share.ipynb)** draw in other people's data and let them use yours\n", "* **[export](export.ipynb)** export your dataset as an Emdros database\n", "* **[annotate](annotate.ipynb)** annotate plain text by means of other tools and import the annotations as TF features\n", "* **[map](map.ipynb)** map somebody else's annotations to a new version of the corpus\n", "* **[volumes](volumes.ipynb)** work with selected books only\n", "* **[trees](trees.ipynb)** work with the BHSA data as syntax trees\n", "\n", "CC-BY Dirk Roorda" ] } ], "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.11.1" }, "toc": { "base_numbering": 1, "nav_menu": {}, "number_sections": true, "sideBar": true, "skip_h1_title": true, "title_cell": "Table of Contents", "title_sidebar": "Contents", "toc_cell": true, "toc_position": {}, "toc_section_display": "block", "toc_window_display": false }, "widgets": { "application/vnd.jupyter.widget-state+json": { "state": {}, "version_major": 2, "version_minor": 0 } } }, "nbformat": 4, "nbformat_minor": 4 }