{ "cells": [ { "cell_type": "markdown", "id": "93db94f1-9db3-43eb-9b18-4203d6796234", "metadata": { "tags": [] }, "source": [ "# Print a specific verse (Nestle1904LFT)" ] }, { "cell_type": "markdown", "id": "688c25d7-0277-4fe3-9d7f-dee0b81ee07c", "metadata": {}, "source": [ "## Table of content \n", "* 1 - Introduction\n", "* 2 - Load Text-Fabric app and data\n", "* 3 - Performing the queries\n", " * 3.1 - Show all object phrases in clauses\n", " * 3.2 - Selecting individual words of the verse\n", " * 3.3 - Available output formats" ] }, { "cell_type": "markdown", "id": "8d234f24-515f-430c-a7ce-709e18605a01", "metadata": { "tags": [] }, "source": [ "# 1 - Introduction \n", "##### [Back to TOC](#TOC)\n", "\n", "This Jupyter Notebook shows the method of selecting a specific verse from the Greek New Testament corpus for display or further processing. " ] }, { "cell_type": "markdown", "id": "1841c53f-ba52-4c6e-ab0b-8ecefee86fb2", "metadata": {}, "source": [ "# 2 - Load Text-Fabric app and data \n", "##### [Back to TOC](#TOC)" ] }, { "cell_type": "code", "execution_count": 1, "id": "b3511ace-56ae-485f-ad9c-43e0b84728c5", "metadata": {}, "outputs": [], "source": [ "%load_ext autoreload\n", "%autoreload 2" ] }, { "cell_type": "code", "execution_count": 2, "id": "756ac563-3d0b-4a31-9d62-604d21a6a909", "metadata": {}, "outputs": [], "source": [ "# Loading the Text-Fabric code\n", "# Note: it is assumed Text-Fabric is installed in your environment\n", "from tf.fabric import Fabric\n", "from tf.app import use" ] }, { "cell_type": "code", "execution_count": 3, "id": "4eb44182-0825-453c-b254-9ea6a83b44ad", "metadata": { "scrolled": true, "tags": [] }, "outputs": [ { "data": { "text/markdown": [ "**Locating corpus resources ...**" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "The requested app is not available offline\n", "\t~/text-fabric-data/github/tonyjurg/Nestle1904LFT/app not found\n" ] }, { "data": { "text/html": [ "Status: latest release online v0.6 versus None locally" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "downloading app, main data and requested additions ..." ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "app: ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/app" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "The requested data is not available offline\n", "\t~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 not found\n" ] }, { "data": { "text/html": [ "Status: latest release online v0.6 versus None locally" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "downloading app, main data and requested additions ..." ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "data: ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ " | 0.21s T otype from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 2.26s T oslots from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.53s T after from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.56s T wordtranslit from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.62s T wordunacc from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.56s T book from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.61s T normalized from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.63s T word from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.63s T unicode from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.47s T verse from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.51s T chapter from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | | 0.06s C __levels__ from otype, oslots, otext\n", " | | 1.80s C __order__ from otype, oslots, __levels__\n", " | | 0.07s C __rank__ from otype, __order__\n", " | | 3.37s C __levUp__ from otype, oslots, __rank__\n", " | | 1.95s C __levDown__ from otype, __levUp__, __rank__\n", " | | 0.21s C __characters__ from otext\n", " | | 0.97s C __boundary__ from otype, oslots, __rank__\n", " | | 0.04s C __sections__ from otype, oslots, otext, __levUp__, __levels__, book, chapter, verse\n", " | | 0.23s C __structure__ from otype, oslots, otext, __rank__, __levUp__, book, chapter, verse\n", " | 0.43s T booknumber from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.50s T bookshort from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.47s T case from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.32s T clausetype from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.56s T containedclause from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.41s T degree from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.58s T gloss from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.47s T gn from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.03s T headverse from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.32s T junction from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.55s T lemma from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.54s T lex_dom from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.57s T ln from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.43s T markafter from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.44s T markbefore from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.43s T markorder from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.45s T monad from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.44s T mood from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.51s T morph from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.53s T nodeID from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.49s T nu from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.49s T number from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.43s T person from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.43s T punctuation from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.66s T ref from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.64s T reference from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.51s T roleclausedistance from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.47s T sentence from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.52s T sp from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.52s T sp_full from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.53s T strongs from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.46s T subj_ref from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.44s T tense from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.45s T type from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.45s T voice from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.39s T wgclass from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.35s T wglevel from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.37s T wgnum from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.36s T wgrole from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.35s T wgrolelong from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.39s T wgrule from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.34s T wgtype from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.49s T wordlevel from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.49s T wordrole from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n", " | 0.50s T wordrolelong from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6\n" ] }, { "data": { "text/html": [ "\n", " TF: TF API 12.1.5, tonyjurg/Nestle1904LFT/app v3, Search Reference
\n", " Data: tonyjurg - Nestle1904LFT 0.6, 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", "
Name# of nodes# slots / node% coverage
book275102.93100
chapter260529.92100
verse794317.35100
sentence801117.20100
wg1054306.85524
word1377791.00100
\n", " Sets: no custom sets
\n", " Features:
\n", "
Nestle 1904 (Low Fat Tree)\n", "
\n", "\n", "
\n", "
\n", "after\n", "
\n", "
str
\n", "\n", " ✅ Characters (eg. punctuations) following the word\n", "\n", "
\n", "\n", "
\n", "
\n", "book\n", "
\n", "
str
\n", "\n", " ✅ Book name (in English language)\n", "\n", "
\n", "\n", "
\n", "
\n", "booknumber\n", "
\n", "
int
\n", "\n", " ✅ NT book number (Matthew=1, Mark=2, ..., Revelation=27)\n", "\n", "
\n", "\n", "
\n", "
\n", "bookshort\n", "
\n", "
str
\n", "\n", " ✅ Book name (abbreviated)\n", "\n", "
\n", "\n", "
\n", "
\n", "case\n", "
\n", "
str
\n", "\n", " ✅ Gramatical case (Nominative, Genitive, Dative, Accusative, Vocative)\n", "\n", "
\n", "\n", "
\n", "
\n", "chapter\n", "
\n", "
int
\n", "\n", " ✅ Chapter number inside book\n", "\n", "
\n", "\n", "
\n", "
\n", "clausetype\n", "
\n", "
str
\n", "\n", " ✅ Clause type details (e.g. Verbless, Minor)\n", "\n", "
\n", "\n", "
\n", "
\n", "containedclause\n", "
\n", "
str
\n", "\n", " 🆗 Contained clause (WG number)\n", "\n", "
\n", "\n", "
\n", "
\n", "degree\n", "
\n", "
str
\n", "\n", " ✅ Degree (e.g. Comparitative, Superlative)\n", "\n", "
\n", "\n", "
\n", "
\n", "gloss\n", "
\n", "
str
\n", "\n", " ✅ English gloss\n", "\n", "
\n", "\n", "
\n", "
\n", "gn\n", "
\n", "
str
\n", "\n", " ✅ Gramatical gender (Masculine, Feminine, Neuter)\n", "\n", "
\n", "\n", "
\n", "
\n", "headverse\n", "
\n", "
str
\n", "\n", " ✅ Start verse number of a sentence\n", "\n", "
\n", "\n", "
\n", "
\n", "junction\n", "
\n", "
str
\n", "\n", " ✅ Junction data related to a wordgroup\n", "\n", "
\n", "\n", "
\n", "
\n", "lemma\n", "
\n", "
str
\n", "\n", " ✅ Lexeme (lemma)\n", "\n", "
\n", "\n", "
\n", "
\n", "lex_dom\n", "
\n", "
str
\n", "\n", " ✅ Lexical domain according to Semantic Dictionary of Biblical Greek, SDBG (not present everywhere?)\n", "\n", "
\n", "\n", "
\n", "
\n", "ln\n", "
\n", "
str
\n", "\n", " ✅ Lauw-Nida lexical classification (not present everywhere?)\n", "\n", "
\n", "\n", "
\n", "
\n", "markafter\n", "
\n", "
str
\n", "\n", " 🆗 Text critical marker after word\n", "\n", "
\n", "\n", "
\n", "
\n", "markbefore\n", "
\n", "
str
\n", "\n", " 🆗 Text critical marker before word\n", "\n", "
\n", "\n", "
\n", "
\n", "markorder\n", "
\n", "
str
\n", "\n", "  Order of punctuation and text critical marker\n", "\n", "
\n", "\n", "
\n", "
\n", "monad\n", "
\n", "
int
\n", "\n", " ✅ Monad (smallest token matching word order in the corpus)\n", "\n", "
\n", "\n", "
\n", "
\n", "mood\n", "
\n", "
str
\n", "\n", " ✅ Gramatical mood of the verb (passive, etc)\n", "\n", "
\n", "\n", "
\n", "
\n", "morph\n", "
\n", "
str
\n", "\n", " ✅ Morphological tag (Sandborg-Petersen morphology)\n", "\n", "
\n", "\n", "
\n", "
\n", "nodeID\n", "
\n", "
str
\n", "\n", " ✅ Node ID (as in the XML source data)\n", "\n", "
\n", "\n", "
\n", "
\n", "normalized\n", "
\n", "
str
\n", "\n", " ✅ Surface word with accents normalized and trailing punctuations removed\n", "\n", "
\n", "\n", "
\n", "
\n", "nu\n", "
\n", "
str
\n", "\n", " ✅ Gramatical number (Singular, Plural)\n", "\n", "
\n", "\n", "
\n", "
\n", "number\n", "
\n", "
str
\n", "\n", " ✅ Gramatical number of the verb (e.g. singular, plural)\n", "\n", "
\n", "\n", "
\n", "
\n", "otype\n", "
\n", "
str
\n", "\n", " \n", "\n", "
\n", "\n", "
\n", "
\n", "person\n", "
\n", "
str
\n", "\n", " ✅ Gramatical person of the verb (first, second, third)\n", "\n", "
\n", "\n", "
\n", "
\n", "punctuation\n", "
\n", "
str
\n", "\n", " ✅ Punctuation after word\n", "\n", "
\n", "\n", "
\n", "
\n", "ref\n", "
\n", "
str
\n", "\n", " ✅ Value of the ref ID (taken from XML sourcedata)\n", "\n", "
\n", "\n", "
\n", "
\n", "reference\n", "
\n", "
str
\n", "\n", " ✅ Reference (to nodeID in XML source data, not yet post-processes)\n", "\n", "
\n", "\n", "
\n", "
\n", "roleclausedistance\n", "
\n", "
str
\n", "\n", " ⚠️ Distance to the wordgroup defining the syntactical role of this word\n", "\n", "
\n", "\n", "
\n", "
\n", "sentence\n", "
\n", "
int
\n", "\n", " ✅ Sentence number (counted per chapter)\n", "\n", "
\n", "\n", "
\n", "
\n", "sp\n", "
\n", "
str
\n", "\n", " ✅ Part of Speech (abbreviated)\n", "\n", "
\n", "\n", "
\n", "
\n", "sp_full\n", "
\n", "
str
\n", "\n", " ✅ Part of Speech (long description)\n", "\n", "
\n", "\n", "
\n", "
\n", "strongs\n", "
\n", "
str
\n", "\n", " ✅ Strongs number\n", "\n", "
\n", "\n", "
\n", "
\n", "subj_ref\n", "
\n", "
str
\n", "\n", " 🆗 Subject reference (to nodeID in XML source data, not yet post-processes)\n", "\n", "
\n", "\n", "
\n", "
\n", "tense\n", "
\n", "
str
\n", "\n", " ✅ Gramatical tense of the verb (e.g. Present, Aorist)\n", "\n", "
\n", "\n", "
\n", "
\n", "type\n", "
\n", "
str
\n", "\n", " ✅ Gramatical type of noun or pronoun (e.g. Common, Personal)\n", "\n", "
\n", "\n", "
\n", "
\n", "unicode\n", "
\n", "
str
\n", "\n", " ✅ Word as it apears in the text in Unicode (incl. punctuations)\n", "\n", "
\n", "\n", "
\n", "
\n", "verse\n", "
\n", "
int
\n", "\n", " ✅ Verse number inside chapter\n", "\n", "
\n", "\n", "
\n", "
\n", "voice\n", "
\n", "
str
\n", "\n", " ✅ Gramatical voice of the verb (e.g. active,passive)\n", "\n", "
\n", "\n", "
\n", "
\n", "wgclass\n", "
\n", "
str
\n", "\n", " ✅ Class of the wordgroup (e.g. cl, np, vp)\n", "\n", "
\n", "\n", "
\n", "
\n", "wglevel\n", "
\n", "
int
\n", "\n", " 🆗 Number of the parent wordgroups for a wordgroup\n", "\n", "
\n", "\n", "
\n", "
\n", "wgnum\n", "
\n", "
int
\n", "\n", " ✅ Wordgroup number (counted per book)\n", "\n", "
\n", "\n", "
\n", "
\n", "wgrole\n", "
\n", "
str
\n", "\n", " ✅ Syntactical role of the wordgroup (abbreviated)\n", "\n", "
\n", "\n", "
\n", "
\n", "wgrolelong\n", "
\n", "
str
\n", "\n", " ✅ Syntactical role of the wordgroup (full)\n", "\n", "
\n", "\n", "
\n", "
\n", "wgrule\n", "
\n", "
str
\n", "\n", " ✅ Wordgroup rule information (e.g. Np-Appos, ClCl2, PrepNp)\n", "\n", "
\n", "\n", "
\n", "
\n", "wgtype\n", "
\n", "
str
\n", "\n", " ✅ Wordgroup type details (e.g. group, apposition)\n", "\n", "
\n", "\n", "
\n", "
\n", "word\n", "
\n", "
str
\n", "\n", " ✅ Word as it appears in the text (excl. punctuations)\n", "\n", "
\n", "\n", "
\n", "
\n", "wordlevel\n", "
\n", "
str
\n", "\n", " 🆗 Number of the parent wordgroups for a word\n", "\n", "
\n", "\n", "
\n", "
\n", "wordrole\n", "
\n", "
str
\n", "\n", " ✅ Syntactical role of the word (abbreviated)\n", "\n", "
\n", "\n", "
\n", "
\n", "wordrolelong\n", "
\n", "
str
\n", "\n", " ✅ Syntactical role of the word (full)\n", "\n", "
\n", "\n", "
\n", "
\n", "wordtranslit\n", "
\n", "
str
\n", "\n", " 🆗 Transliteration of the text (in latin letters, excl. punctuations)\n", "\n", "
\n", "\n", "
\n", "
\n", "wordunacc\n", "
\n", "
str
\n", "\n", " ✅ Word without accents (excl. punctuations)\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: tonyjurg/Nestle1904LFT
  3. appPath:C:/Users/tonyj/text-fabric-data/github/tonyjurg/Nestle1904LFT/app
  4. commit: no value
  5. css: ''
  6. dataDisplay:
    • excludedFeatures:
      • orig_order
      • verse
      • book
      • chapter
    • noneValues:
      • none
      • unknown
      • no value
      • NA
      • ''
    • showVerseInTuple: 0
    • textFormat: text-orig-full
  7. docs:
    • docBase: https://github.com/tonyjurg/Nestle1904LFT/blob/main/docs/
    • docPage: about
    • docRoot: https://github.com/tonyjurg/Nestle1904LFT
    • featureBase:https://github.com/tonyjurg/Nestle1904LFT/blob/main/docs/features/<feature>.md
  8. interfaceDefaults: {fmt: layout-orig-full}
  9. isCompatible: True
  10. local: no value
  11. localDir:C:/Users/tonyj/text-fabric-data/github/tonyjurg/Nestle1904LFT/_temp
  12. provenanceSpec:
    • corpus: Nestle 1904 (Low Fat Tree)
    • doi: notyet
    • org: tonyjurg
    • relative: /tf
    • repo: Nestle1904LFT
    • repro: Nestle1904LFT
    • version: 0.6
    • webBase: https://learner.bible/text/show_text/nestle1904/
    • webHint: Show this on the Bible Online Learner website
    • webLang: en
    • webUrl:https://learner.bible/text/show_text/nestle1904/<1>/<2>/<3>
    • webUrlLex: {webBase}/word?version={version}&id=<lid>
  13. release: no value
  14. typeDisplay:
    • book:
      • condense: True
      • hidden: True
      • label: {book}
      • style: ''
    • chapter:
      • condense: True
      • hidden: True
      • label: {chapter}
      • style: ''
    • sentence:
      • hidden: 0
      • label: #{sentence} (start: {book} {chapter}:{headverse})
      • style: ''
    • verse:
      • condense: True
      • excludedFeatures: chapter verse
      • label: {book} {chapter}:{verse}
      • style: ''
    • wg:
      • hidden: 0
      • label:#{wgnum}: {wgtype} {wgclass} {clausetype} {wgrole} {wgrule} {junction}
      • style: ''
    • word:
      • base: True
      • features: lemma
      • featuresBare: gloss
      • surpress: chapter verse
  15. writing: grc
\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "\n", "\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
TF API: names N F E L T S C TF Fs Fall Es Eall Cs Call directly usable

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# load the N1904 app and data\n", "N1904 = use (\"tonyjurg/Nestle1904LFT\", version=\"0.6\", hoist=globals())" ] }, { "cell_type": "code", "execution_count": 4, "id": "ff942529-c25a-497b-85a8-fa48b2f53e21", "metadata": {}, "outputs": [ { "data": { "text/html": [ "" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# The following will push the Text-Fabric stylesheet to this notebook (to facilitate proper display with notebook viewer)\n", "N1904.dh(N1904.getCss())" ] }, { "cell_type": "code", "execution_count": 5, "id": "03caad3d-8c64-4b7b-b8d5-8ad99e5e7a6a", "metadata": { "tags": [] }, "outputs": [], "source": [ "# Set default view in a way to limit noise as much as possible.\n", "N1904.displaySetup(condensed=True, multiFeatures=False,queryFeatures=False)" ] }, { "cell_type": "markdown", "id": "a29a3dc3-f727-458d-b90b-bee8e4545859", "metadata": {}, "source": [ "# 3 - Performing the queries " ] }, { "cell_type": "markdown", "id": "5b98ec15-fdbe-4b7f-a5fe-8364d26dcb7e", "metadata": { "tags": [] }, "source": [ "## 3.1 - Show a specific verse\n", "##### [Back to TOC](#TOC)\n", "\n", "The following example will query for a specific verte (i.e. Matthew 1:8). As expected, the query yealds one result." ] }, { "cell_type": "code", "execution_count": 11, "id": "7a6b5c40-7a4f-4a8e-bc8c-363c9691c40e", "metadata": { "scrolled": true }, "outputs": [], "source": [ "# Define the query template\n", "VerseQuery = '''\n", "book book=Mark\n", " chapter chapter=1\n", " verse verse=1\n", "'''" ] }, { "cell_type": "code", "execution_count": 12, "id": "334f8f6d-5006-4779-8ec5-5428092dc679", "metadata": { "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " 0.01s 1 result\n" ] } ], "source": [ "# The following will create a list containing ordered tuples consisting of node numbers of the items as they appear in the query\n", "VerseResult = N1904.search(VerseQuery)" ] }, { "cell_type": "code", "execution_count": 9, "id": "ed34eb3a-c748-4fde-8e01-3a9f840569a8", "metadata": { "tags": [] }, "outputs": [ { "data": { "text/html": [ "

verse 1" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

verse Mark 1:1
sentence #1 (start: Mark 1:1)
wg #2: cl Verbless P2CL
wg #3: np p NPofNP
Ἀρχὴ
wg #4: np DetNP
τοῦ
wg #5: np NPofNP
εὐαγγελίου
wg #6: apposition np Np-Appos
wg #7: apposition np Np-Appos
Ἰησοῦ
Χριστοῦ
wg #8: np NPofNP apposition
Υἱοῦ
Θεοῦ.
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# Print some of the results\n", "# Note the options \"condensed=True, multiFeatures=False,queryFeatures=False\" are included below due to the earlier N1904.displaySetup(...)\n", "N1904.show(VerseResult, start=1, end=2)" ] }, { "cell_type": "markdown", "id": "434ae56a-d68e-49b2-af5a-b22346688775", "metadata": {}, "source": [ "## 3.2 - Selecting individual words of the verse \n", "##### [Back to TOC](#TOC)" ] }, { "cell_type": "markdown", "id": "650d23c8-62c1-4954-b6e4-4af5e913ba51", "metadata": {}, "source": [ "A similar (but still different) result can be obtained by selecting all words from the verse individualy. Since counting each word as separate result, the total figure for results is higher (in this case 15). Also note that the found items (i.e. individual words) are coloured yellow. The argument `\"condensed=True\"` combines all found items, limiting the display to just one instance of the verse (since all results are from the same verse). Would the argument `\"condensed=False\"` be suplied, the same verse would be printed 15 times, each time with the next consequent word coloured in yellow." ] }, { "cell_type": "code", "execution_count": 14, "id": "7bfc5821-a5a6-43da-a022-6c1a7a2ca6e3", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " 0.09s 7 results\n" ] }, { "data": { "text/html": [ "

verse 1" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

verse:147146 Mark 1:1
sentence:139200 #1 (start: Mark 1:1)
wg:168001 #2: cl Verbless P2CL
wg:168002 #3: np p NPofNP
18300 Ἀρχὴ
wg:168003 #4: np DetNP
18301 τοῦ
wg:168004 #5: np NPofNP
18302 εὐαγγελίου
wg:168005 #6: apposition np Np-Appos
wg:168006 #7: apposition np Np-Appos
18303 Ἰησοῦ
18304 Χριστοῦ
wg:168007 #8: np NPofNP apposition
18305 Υἱοῦ
18306 Θεοῦ.
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# Define the query template\n", "AltVerseQuery = '''\n", "word book=Mark chapter=1 verse=1\n", "'''\n", "\n", "# The following will create a list containing ordered tuples consisting of node numbers of the items as they appear in the query\n", "AltVerseResult = N1904.search(AltVerseQuery)\n", "\n", "# Print some of the results\n", "N1904.show(AltVerseResult, start=1, end=15, condensed=True, multiFeatures=False, withNodes=True)" ] }, { "cell_type": "markdown", "id": "a5583155-be42-4577-a88d-788c24a0b8d9", "metadata": {}, "source": [ "## 3.3 - Available output formats \n", "##### [Back to TOC](#TOC)\n", "\n", "To check the available formats to display the text:" ] }, { "cell_type": "markdown", "id": "40368900-b40a-4a39-9882-964ef52b0433", "metadata": {}, "source": [ "The same result (although formatted different) can be obtained by the following call:" ] }, { "cell_type": "code", "execution_count": 15, "id": "67344b12-6a53-447d-89c8-19cc62ad498c", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'text-critical': 'word',\n", " 'text-normalized': 'word',\n", " 'text-orig-full': 'word',\n", " 'text-transliterated': 'word',\n", " 'text-unaccented': 'word'}" ] }, "execution_count": 15, "metadata": {}, "output_type": "execute_result" } ], "source": [ "T.formats" ] }, { "cell_type": "code", "execution_count": 16, "id": "b963ca04-3c61-45e1-943b-6649885218b2", "metadata": {}, "outputs": [ { "data": { "text/markdown": [ "format | level | template\n", "--- | --- | ---\n", "`text-critical` | **word** | `{unicode} `\n", "`text-normalized` | **word** | `{normalized}{after}`\n", "`text-orig-full` | **word** | `{word}{after}`\n", "`text-transliterated` | **word** | `{wordtranslit}{after}`\n", "`text-unaccented` | **word** | `{wordunacc}{after}`\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "N1904.showFormats()" ] }, { "cell_type": "code", "execution_count": 17, "id": "fed33b4e-2af3-49a7-839b-6b6f8a0e2504", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'Ἀρχὴ τοῦ εὐαγγελίου Ἰησοῦ Χριστοῦ (Υἱοῦ Θεοῦ). '" ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "T.text(139200,fmt='text-critical')" ] }, { "cell_type": "code", "execution_count": 18, "id": "da796693-2acc-41d2-9196-03ab4cce86a7", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'Ἀρχή τοῦ εὐαγγελίου Ἰησοῦ Χριστοῦ Υἱοῦ Θεοῦ. '" ] }, "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "T.text(139200,fmt='text-normalized')" ] }, { "cell_type": "code", "execution_count": 19, "id": "302e77f6-7483-4b74-a4c9-829b332ed303", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'Ἀρχὴ τοῦ εὐαγγελίου Ἰησοῦ Χριστοῦ Υἱοῦ Θεοῦ. '" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "T.text(139200,fmt='text-orig-full')" ] }, { "cell_type": "code", "execution_count": 20, "id": "b871acc4-4230-4a7c-b1e0-6059c4aafa1b", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'Αρχη του ευαγγελιου Ιησου Χριστου Υιου Θεου. '" ] }, "execution_count": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ "T.text(139200,fmt='text-unaccented')" ] }, { "cell_type": "code", "execution_count": 21, "id": "6482c844-1a29-43ee-be5b-c27e25a657d3", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "'Arkhe tou euaggeliou Iesou Khristou Uiou Theou. '" ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ "T.text(139200,fmt='text-transliterated')" ] }, { "cell_type": "markdown", "id": "595549d4-f2eb-4f18-848e-4d0cdaa38624", "metadata": { "tags": [] }, "source": [ "#### Remark regarding data" ] }, { "cell_type": "markdown", "id": "b9ab279f-991b-4456-9bab-bd6d83ebc5fc", "metadata": {}, "source": [ "Note that this data originates from file `otext.tf`:\n", "\n", "> \n", "```\n", "@config\n", "...\n", "@fmt:text-orig-full={word}{after}\n", "...\n", "```\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.11.5" } }, "nbformat": 4, "nbformat_minor": 5 }