{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Creating Text-Fabric from LowFat XML trees\n", "The source data for the conversion are the LowFat XML trees files representing the macula-greek version of the Nestle 1904 Greek New Testment. The most recent source data can be found on github https://github.com/Clear-Bible/macula-greek/tree/main/Nestle1904/lowfat. Attribution: \"MACULA Greek Linguistic Datasets, available at https://github.com/Clear-Bible/macula-greek/\". \n", "\n", "The production of the Text-Fabric files consist of two steps. First the creation of piclke files (part 1). Secondly the actual Text-Fabric creation process (part 2). Both steps are independent allowing to start from Part 2 by using the pickle files as input. \n", "\n", "Be advised that this Text-Fabric version is a test version (proof of concept) and requires further finetuning, especialy with regards of nomenclature and presentation of (sub)phrases and clauses." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Table of content \n", "* [Part 1: Read LowFat XML data and store in pickle](#first-bullet)\n", "* [part 2: Sort the nodes](#second-bullet)\n", "* [Part 3: Nestle1904 production from pickle input](#third-bullet)\n", "* [Part 4: Testing the created textfabric data](#fourth-bullet)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Part 1: Read LowFat XML data and store in pickle \n", "##### [back to TOC](#TOC)\n", "\n", "This script harvests all information from the LowFat tree data (XML nodes), puts it into a Panda DataFrame and stores the result per book in a pickle file. Note: pickling (in Python) is serialising an object into a disk file (or buffer). \n", "\n", "In the context of this script, 'Leaf' refers to those node containing the Greek word as data, which happen to be the nodes without any child (hence the analogy with the leaves on the tree). These 'leafs' can also be refered to as 'terminal nodes'. Futher, Parent1 is the leaf's parent, Parent2 is Parent1's parent, etc.\n", "\n", "For a full description of the source data see document [MACULA Greek Treebank for the Nestle 1904 Greek New Testament.pdf](https://github.com/Clear-Bible/macula-greek/blob/main/doc/MACULA%20Greek%20Treebank%20for%20the%20Nestle%201904%20Greek%20New%20Testament.pdf)" ] }, { "cell_type": "markdown", "metadata": { "tags": [] }, "source": [ "### Step 1: import various libraries" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "ExecuteTime": { "end_time": "2022-10-28T02:58:14.739227Z", "start_time": "2022-10-28T02:57:38.766097Z" } }, "outputs": [], "source": [ "import pandas as pd\n", "import sys\n", "import os\n", "import time\n", "import pickle\n", "\n", "import re #regular expressions\n", "from os import listdir\n", "from os.path import isfile, join\n", "import xml.etree.ElementTree as ET" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Step 2: initialize global data\n", "\n", "Change BaseDir, XmlDir and PklDir to match location of the datalocation and the OS used." ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "BaseDir = 'C:\\\\Users\\\\tonyj\\\\my_new_Jupyter_folder\\\\Read_from_lowfat\\\\data\\\\'\n", "XmlDir = BaseDir+'xml\\\\'\n", "PklDir = BaseDir+'pkl\\\\'\n", "XlsxDir = BaseDir+'xlsx\\\\'\n", "# note: create output directory prior running this part\n", "\n", "# key: filename, [0]=book_long, [1]=book_num, [3]=book_short\n", "bo2book = {'01-matthew': ['Matthew', '1', 'Matt'],\n", " '02-mark': ['Mark', '2', 'Mark'],\n", " '03-luke': ['Luke', '3', 'Luke'],\n", " '04-john': ['John', '4', 'John'],\n", " '05-acts': ['Acts', '5', 'Acts'],\n", " '06-romans': ['Romans', '6', 'Rom'],\n", " '07-1corinthians': ['I_Corinthians', '7', '1Cor'],\n", " '08-2corinthians': ['II_Corinthians', '8', '2Cor'],\n", " '09-galatians': ['Galatians', '9', 'Gal'],\n", " '10-ephesians': ['Ephesians', '10', 'Eph'],\n", " '11-philippians': ['Philippians', '11', 'Phil'],\n", " '12-colossians': ['Colossians', '12', 'Col'],\n", " '13-1thessalonians':['I_Thessalonians', '13', '1Thess'],\n", " '14-2thessalonians':['II_Thessalonians','14', '2Thess'],\n", " '15-1timothy': ['I_Timothy', '15', '1Tim'],\n", " '16-2timothy': ['II_Timothy', '16', '2Tim'],\n", " '17-titus': ['Titus', '17', 'Titus'],\n", " '18-philemon': ['Philemon', '18', 'Phlm'],\n", " '19-hebrews': ['Hebrews', '19', 'Heb'],\n", " '20-james': ['James', '20', 'Jas'],\n", " '21-1peter': ['I_Peter', '21', '1Pet'],\n", " '22-2peter': ['II_Peter', '22', '2Pet'],\n", " '23-1john': ['I_John', '23', '1John'],\n", " '24-2john': ['II_John', '24', '2John'],\n", " '25-3john': ['III_John', '25', '3John'], \n", " '26-jude': ['Jude', '26', 'Jude'],\n", " '27-revelation': ['Revelation', '27', 'Rev']}\n", "\n", "bo2book_ = {'25-3john': ['III_John', '25', '3John']}" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### step 3: define Function to add parent info to each node of the XML tree\n", "\n", "In order to traverse from the 'leafs' (terminating nodes) upto the root of the tree, it is required to add information to each node pointing to the parent of each node.\n", "\n", "(concept taken from https://stackoverflow.com/questions/2170610/access-elementtree-node-parent-node)" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "def addParentInfo(et):\n", " for child in et:\n", " child.attrib['parent'] = et\n", " addParentInfo(child)\n", "\n", "def getParent(et):\n", " if 'parent' in et.attrib:\n", " return et.attrib['parent']\n", " else:\n", " return None" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Step 4: read and process the XML data and store panda dataframe in pickle" ] }, { "cell_type": "code", "execution_count": 48, "metadata": { "scrolled": true, "tags": [] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Processing Matthew at C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\xml\\01-matthew.xml\n", "......................................................................................................................................................................................\n", "Found 18299 items in 337.3681836128235 seconds\n", "\n", "Processing Mark at C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\xml\\02-mark.xml\n", "................................................................................................................\n", "Found 11277 items in 144.04719877243042 seconds\n", "\n", "Processing Luke at C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\xml\\03-luke.xml\n", "..................................................................................................................................................................................................\n", "Found 19456 items in 1501.197922706604 seconds\n", "\n", "Processing John at C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\xml\\04-john.xml\n", "............................................................................................................................................................\n", "Found 15643 items in 237.1071105003357 seconds\n", "\n", "Processing Acts at C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\xml\\05-acts.xml\n", ".......................................................................................................................................................................................\n", "Found 18393 items in 384.3644151687622 seconds\n", "\n", "Processing Romans at C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\xml\\06-romans.xml\n", ".......................................................................\n", "Found 7100 items in 71.03568935394287 seconds\n", "\n", "Processing I_Corinthians at C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\xml\\07-1corinthians.xml\n", "....................................................................\n", "Found 6820 items in 58.47511959075928 seconds\n", "\n", "Processing II_Corinthians at C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\xml\\08-2corinthians.xml\n", "............................................\n", "Found 4469 items in 31.848721027374268 seconds\n", "\n", "Processing Galatians at C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\xml\\09-galatians.xml\n", "......................\n", "Found 2228 items in 13.850211143493652 seconds\n", "\n", "Processing Ephesians at C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\xml\\10-ephesians.xml\n", "........................\n", "Found 2419 items in 17.529520511627197 seconds\n", "\n", "Processing Philippians at C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\xml\\11-philippians.xml\n", "................\n", "Found 1630 items in 9.271572589874268 seconds\n", "\n", "Processing Colossians at C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\xml\\12-colossians.xml\n", "...............\n", "Found 1575 items in 10.389309883117676 seconds\n", "\n", "Processing I_Thessalonians at C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\xml\\13-1thessalonians.xml\n", "..............\n", "Found 1473 items in 8.413437604904175 seconds\n", "\n", "Processing II_Thessalonians at C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\xml\\14-2thessalonians.xml\n", "........\n", "Found 822 items in 4.284915447235107 seconds\n", "\n", "Processing I_Timothy at C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\xml\\15-1timothy.xml\n", "...............\n", "Found 1588 items in 10.419771671295166 seconds\n", "\n", "Processing II_Timothy at C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\xml\\16-2timothy.xml\n", "............\n", "Found 1237 items in 7.126454591751099 seconds\n", "\n", "Processing Titus at C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\xml\\17-titus.xml\n", "......\n", "Found 658 items in 3.1472580432891846 seconds\n", "\n", "Processing Philemon at C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\xml\\18-philemon.xml\n", "...\n", "Found 335 items in 1.3175146579742432 seconds\n", "\n", "Processing Hebrews at C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\xml\\19-hebrews.xml\n", ".................................................\n", "Found 4955 items in 44.31139326095581 seconds\n", "\n", "Processing James at C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\xml\\20-james.xml\n", ".................\n", "Found 1739 items in 8.570415496826172 seconds\n", "\n", "Processing I_Peter at C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\xml\\21-1peter.xml\n", "................\n", "Found 1676 items in 10.489561557769775 seconds\n", "\n", "Processing II_Peter at C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\xml\\22-2peter.xml\n", "..........\n", "Found 1098 items in 6.005697250366211 seconds\n", "\n", "Processing I_John at C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\xml\\23-1john.xml\n", ".....................\n", "Found 2136 items in 10.843079566955566 seconds\n", "\n", "Processing II_John at C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\xml\\24-2john.xml\n", "..\n", "Found 245 items in 0.9535031318664551 seconds\n", "\n", "Processing III_John at C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\xml\\25-3john.xml\n", "..\n", "Found 219 items in 1.0913233757019043 seconds\n", "\n", "Processing Jude at C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\xml\\26-jude.xml\n", "....\n", "Found 457 items in 1.8929190635681152 seconds\n", "\n", "Processing Revelation at C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\xml\\27-revelation.xml\n", "..................................................................................................\n", "Found 9832 items in 125.92533278465271 seconds\n", "\n" ] } ], "source": [ "# set some globals\n", "monad=1\n", "CollectedItems= 0\n", "\n", "# process books in order\n", "for bo, bookinfo in bo2book.items():\n", " CollectedItems=0\n", " SentenceNumber=0\n", " WordGroupNumber=0\n", " full_df=pd.DataFrame({})\n", " book_long=bookinfo[0]\n", " booknum=bookinfo[1]\n", " book_short=bookinfo[2]\n", " InputFile = os.path.join(XmlDir, f'{bo}.xml')\n", " OutputFile = os.path.join(PklDir, f'{bo}.pkl')\n", " print(f'Processing {book_long} at {InputFile}')\n", "\n", " # send xml document to parsing process\n", " tree = ET.parse(InputFile)\n", " # Now add all the parent info to the nodes in the xtree [important!]\n", " addParentInfo(tree.getroot())\n", " start_time = time.time()\n", " \n", " # walk over all the XML data\n", " for elem in tree.iter():\n", " if elem.tag == 'sentence':\n", " # add running number to 'sentence' tags\n", " SentenceNumber+=1\n", " elem.set('SN', SentenceNumber)\n", " if elem.tag == 'wg':\n", " # add running number to 'wg' tags\n", " WordGroupNumber+=1\n", " elem.set('WGN', WordGroupNumber)\n", " if elem.tag == 'w':\n", " # all nodes containing words are tagged with 'w'\n", " \n", " # show progress on screen\n", " CollectedItems+=1\n", " if (CollectedItems%100==0): print (\".\",end='')\n", " \n", " #Leafref will contain list with book, chapter verse and wordnumber\n", " Leafref = re.sub(r'[!: ]',\" \", elem.attrib.get('ref')).split()\n", " \n", " #push value for monad to element tree \n", " elem.set('monad', monad)\n", " monad+=1\n", " \n", " # add some important computed data to the leaf\n", " elem.set('LeafName', elem.tag)\n", " elem.set('word', elem.text)\n", " elem.set('book_long', book_long)\n", " elem.set('booknum', int(booknum))\n", " elem.set('book_short', book_short)\n", " elem.set('chapter', int(Leafref[1]))\n", " elem.set('verse', int(Leafref[2]))\n", " \n", " # folling code will trace down parents upto the tree and store found attributes\n", " parentnode=getParent(elem)\n", " index=0\n", " while (parentnode):\n", " index+=1\n", " elem.set('Parent{}Name'.format(index), parentnode.tag)\n", " elem.set('Parent{}Type'.format(index), parentnode.attrib.get('type'))\n", " elem.set('Parent{}Appos'.format(index), parentnode.attrib.get('appositioncontainer'))\n", " elem.set('Parent{}Class'.format(index), parentnode.attrib.get('class'))\n", " elem.set('Parent{}Rule'.format(index), parentnode.attrib.get('rule'))\n", " elem.set('Parent{}Role'.format(index), parentnode.attrib.get('role'))\n", " elem.set('Parent{}Cltype'.format(index), parentnode.attrib.get('cltype'))\n", " elem.set('Parent{}Unit'.format(index), parentnode.attrib.get('unit'))\n", " elem.set('Parent{}Junction'.format(index), parentnode.attrib.get('junction'))\n", " elem.set('Parent{}SN'.format(index), parentnode.attrib.get('SN'))\n", " elem.set('Parent{}WGN'.format(index), parentnode.attrib.get('WGN'))\n", " currentnode=parentnode\n", " parentnode=getParent(currentnode) \n", " elem.set('parents', int(index))\n", " \n", " #this will push all elements found in the tree into a DataFrame\n", " df=pd.DataFrame(elem.attrib, index={monad})\n", " full_df=pd.concat([full_df,df])\n", " \n", " #store the resulting DataFrame per book into a pickle file for further processing\n", " df = df.convert_dtypes(convert_string=True)\n", " \n", " # sort by s=id\n", " sortkey='{http://www.w3.org/XML/1998/namespace}id'\n", " full_df.rename(columns={sortkey: 'id'}, inplace=True)\n", " full_df.sort_values(by=['id'])\n", "\n", " output = open(r\"{}\".format(OutputFile), 'wb')\n", " pickle.dump(full_df, output)\n", " output.close()\n", " print(\"\\nFound \",CollectedItems, \" items in %s seconds\\n\" % (time.time() - start_time)) \n", " " ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# just dump some things to test the result\n", "\n", "\n", "for bo in bo2book:\n", " '''\n", " load all data into a dataframe\n", " process books in order (bookinfo is a list!)\n", " ''' \n", " InputFile = os.path.join(PklDir, f'{bo}.pkl')\n", " \n", " print(f'\\tloading {InputFile}...')\n", " pkl_file = open(InputFile, 'rb')\n", " df = pickle.load(pkl_file)\n", " pkl_file.close()\n", " \n", " # not sure if this is needed\n", " # fill dictionary of column names for this book \n", " IndexDict = {} # init an empty dictionary\n", " ItemsInRow=1\n", " for itemname in df.columns.to_list():\n", " IndexDict.update({'i_{}'.format(itemname): ItemsInRow})\n", " print (itemname)\n", " ItemsInRow+=1\n", " " ] }, { "cell_type": "markdown", "metadata": { "toc": true }, "source": [ "## Part 3: Nestle1904 Text-Fabric production from pickle input \n", "##### [back to TOC](#TOC)\n", "\n", "This script creates the Text-Fabric files by recursive calling the TF walker function.\n", "API info: https://annotation.github.io/text-fabric/tf/convert/walker.html\n", "\n", "The pickle files created by step 1 are stored on Github location T.B.D." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Step 1: Load libraries and initialize some data\n", "\n" ] }, { "cell_type": "code", "execution_count": 11, "metadata": { "ExecuteTime": { "end_time": "2022-10-28T03:01:34.810259Z", "start_time": "2022-10-28T03:01:25.745112Z" } }, "outputs": [], "source": [ "import pandas as pd\n", "import os\n", "import re\n", "import gc\n", "from tf.fabric import Fabric\n", "from tf.convert.walker import CV\n", "from tf.parameters import VERSION\n", "from datetime import date\n", "import pickle\n", "\n", "BaseDir = 'C:\\\\Users\\\\tonyj\\\\my_new_Jupyter_folder\\\\Read_from_lowfat\\\\data\\\\'\n", "XmlDir = BaseDir+'xml\\\\'\n", "PklDir = BaseDir+'pkl\\\\'\n", "XlsxDir = BaseDir+'xlsx\\\\'\n", "\n", "# key: filename, [0]=book_long, [1]=book_num, [3]=book_short\n", "bo2book = {'01-matthew': ['Matthew', '1', 'Matt'],\n", " '02-mark': ['Mark', '2', 'Mark'],\n", " '03-luke': ['Luke', '3', 'Luke'],\n", " '04-john': ['John', '4', 'John'],\n", " '05-acts': ['Acts', '5', 'Acts'],\n", " '06-romans': ['Romans', '6', 'Rom'],\n", " '07-1corinthians': ['I_Corinthians', '7', '1Cor'],\n", " '08-2corinthians': ['II_Corinthians', '8', '2Cor'],\n", " '09-galatians': ['Galatians', '9', 'Gal'],\n", " '10-ephesians': ['Ephesians', '10', 'Eph'],\n", " '11-philippians': ['Philippians', '11', 'Phil'],\n", " '12-colossians': ['Colossians', '12', 'Col'],\n", " '13-1thessalonians':['I_Thessalonians', '13', '1Thess'],\n", " '14-2thessalonians':['II_Thessalonians','14', '2Thess'],\n", " '15-1timothy': ['I_Timothy', '15', '1Tim'],\n", " '16-2timothy': ['II_Timothy', '16', '2Tim'],\n", " '17-titus': ['Titus', '17', 'Titus'],\n", " '18-philemon': ['Philemon', '18', 'Phlm'],\n", " '19-hebrews': ['Hebrews', '19', 'Heb'],\n", " '20-james': ['James', '20', 'Jas'],\n", " '21-1peter': ['I_Peter', '21', '1Pet'],\n", " '22-2peter': ['II_Peter', '22', '2Pet'],\n", " '23-1john': ['I_John', '23', '1John'],\n", " '24-2john': ['II_John', '24', '2John'],\n", " '25-3john': ['III_John', '25', '3John'], \n", " '26-jude': ['Jude', '26', 'Jude'],\n", " '27-revelation': ['Revelation', '27', 'Rev']}\n", "\n", "bo2book_ = {'26-jude': ['Jude', '26', 'Jude']}\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Optional: export to Excel for investigation" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# test: sorting the data\n", "import openpyxl\n", "import pickle\n", "\n", "#if True:\n", "for bo in bo2book:\n", " '''\n", " load all data into a dataframe\n", " process books in order (bookinfo is a list!)\n", " ''' \n", " InputFile = os.path.join(PklDir, f'{bo}.pkl')\n", " #InputFile = os.path.join(PklDir, '01-matthew.pkl')\n", " \n", " print(f'\\tloading {InputFile}...')\n", " pkl_file = open(InputFile, 'rb')\n", " df = pickle.load(pkl_file)\n", " pkl_file.close()\n", " \n", " # not sure if this is needed\n", " # fill dictionary of column names for this book \n", " IndexDict = {} # init an empty dictionary\n", " ItemsInRow=1\n", " for itemname in df.columns.to_list():\n", " IndexDict.update({'i_{}'.format(itemname): ItemsInRow})\n", " ItemsInRow+=1\n", " #print(itemname)\n", " \n", " # sort by id\n", " #print(df)\n", " df_sorted=df.sort_values(by=['id'])\n", " df_sorted.to_excel(os.path.join(XlsxDir, f'{bo}.xlsx'), index=False)\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Step 2 Running the TF walker function\n", "\n", "API info: https://annotation.github.io/text-fabric/tf/convert/walker.html\n", "\n", "The logic of interpreting the data is included in the director function." ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "This is Text-Fabric 11.2.3\n", "48 features found and 0 ignored\n", " 0.00s Importing data from walking through the source ...\n", " | 0.00s Preparing metadata... \n", " | SECTION TYPES: book, chapter, verse\n", " | SECTION FEATURES: book, chapter, verse\n", " | STRUCTURE TYPES: book, chapter, verse\n", " | STRUCTURE FEATURES: book, chapter, verse\n", " | TEXT FEATURES:\n", " | | text-orig-full after, word\n", " | 0.00s OK\n", " | 0.00s Following director... \n", "\tWe are loading C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\pkl\\01-matthew.pkl...\n", "\tWe are loading C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\pkl\\02-mark.pkl...\n", "\tWe are loading C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\pkl\\03-luke.pkl...\n", "\tWe are loading C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\pkl\\04-john.pkl...\n", "\tWe are loading C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\pkl\\05-acts.pkl...\n", "\tWe are loading C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\pkl\\06-romans.pkl...\n", "\tWe are loading C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\pkl\\07-1corinthians.pkl...\n", "\tWe are loading C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\pkl\\08-2corinthians.pkl...\n", "\tWe are loading C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\pkl\\09-galatians.pkl...\n", "\tWe are loading C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\pkl\\10-ephesians.pkl...\n", "\tWe are loading C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\pkl\\11-philippians.pkl...\n", "\tWe are loading C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\pkl\\12-colossians.pkl...\n", "\tWe are loading C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\pkl\\13-1thessalonians.pkl...\n", "\tWe are loading C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\pkl\\14-2thessalonians.pkl...\n", "\tWe are loading C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\pkl\\15-1timothy.pkl...\n", "\tWe are loading C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\pkl\\16-2timothy.pkl...\n", "\tWe are loading C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\pkl\\17-titus.pkl...\n", "\tWe are loading C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\pkl\\18-philemon.pkl...\n", "\tWe are loading C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\pkl\\19-hebrews.pkl...\n", "\tWe are loading C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\pkl\\20-james.pkl...\n", "\tWe are loading C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\pkl\\21-1peter.pkl...\n", "\tWe are loading C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\pkl\\22-2peter.pkl...\n", "\tWe are loading C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\pkl\\23-1john.pkl...\n", "\tWe are loading C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\pkl\\24-2john.pkl...\n", "\tWe are loading C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\pkl\\25-3john.pkl...\n", "\tWe are loading C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\pkl\\26-jude.pkl...\n", "\tWe are loading C:\\Users\\tonyj\\my_new_Jupyter_folder\\Read_from_lowfat\\data\\pkl\\27-revelation.pkl...\n", " | 42s \"edge\" actions: 0\n", " | 42s \"feature\" actions: 268477\n", " | 42s \"node\" actions: 116569\n", " | 42s \"resume\" actions: 4823\n", " | 42s \"slot\" actions: 137779\n", " | 42s \"terminate\" actions: 268450\n", " | 27 x \"book\" node \n", " | 260 x \"chapter\" node \n", " | 31509 x \"clause\" node \n", " | 71106 x \"phrase\" node \n", " | 5724 x \"sentence\" node \n", " | 7943 x \"verse\" node \n", " | 137779 x \"word\" node = slot type\n", " | 254348 nodes of all types\n", " | 42s OK\n", " | 0.00s checking for nodes and edges ... \n", " | 0.00s OK\n", " | 0.00s checking (section) features ... \n", " | 0.26s OK\n", " | 0.00s reordering nodes ...\n", " | 0.04s Sorting 27 nodes of type \"book\"\n", " | 0.05s Sorting 260 nodes of type \"chapter\"\n", " | 0.07s Sorting 31509 nodes of type \"clause\"\n", " | 0.22s Sorting 71106 nodes of type \"phrase\"\n", " | 0.33s Sorting 5724 nodes of type \"sentence\"\n", " | 0.35s Sorting 7943 nodes of type \"verse\"\n", " | 0.38s Max node = 254348\n", " | 0.38s OK\n", " | 0.00s reassigning feature values ...\n", " | | 0.00s node feature \"after\" with 137779 nodes\n", " | | 0.05s node feature \"book\" with 27 nodes\n", " | | 0.05s node feature \"book_long\" with 137779 nodes\n", " | | 0.12s node feature \"book_short\" with 137779 nodes\n", " | | 0.17s node feature \"booknum\" with 137779 nodes\n", " | | 0.23s node feature \"case\" with 137779 nodes\n", " | | 0.28s node feature \"chapter\" with 138039 nodes\n", " | | 0.32s node feature \"clause\" with 169288 nodes\n", " | | 0.38s node feature \"clauserule\" with 31509 nodes\n", " | | 0.40s node feature \"clausetype\" with 31509 nodes\n", " | | 0.41s node feature \"degree\" with 137779 nodes\n", " | | 0.45s node feature \"gloss\" with 137779 nodes\n", " | | 0.50s node feature \"gn\" with 137779 nodes\n", " | | 0.54s node feature \"id\" with 137779 nodes\n", " | | 0.59s node feature \"junction\" with 31508 nodes\n", " | | 0.60s node feature \"lemma\" with 137779 nodes\n", " | | 0.65s node feature \"lex_dom\" with 137779 nodes\n", " | | 0.69s node feature \"ln\" with 137779 nodes\n", " | | 0.73s node feature \"monad\" with 137779 nodes\n", " | | 0.77s node feature \"mood\" with 137779 nodes\n", " | | 0.82s node feature \"morph\" with 137779 nodes\n", " | | 0.86s node feature \"nodeID\" with 137779 nodes\n", " | | 0.91s node feature \"normalized\" with 137779 nodes\n", " | | 0.95s node feature \"nu\" with 137779 nodes\n", " | | 1.00s node feature \"number\" with 137779 nodes\n", " | | 1.04s node feature \"orig_order\" with 137779 nodes\n", " | | 1.09s node feature \"person\" with 137779 nodes\n", " | | 1.13s node feature \"phrase\" with 208885 nodes\n", " | | 1.19s node feature \"phrasefunction\" with 71106 nodes\n", " | | 1.22s node feature \"phrasefunction_long\" with 71106 nodes\n", " | | 1.25s node feature \"phrasetype\" with 71106 nodes\n", " | | 1.27s node feature \"ref\" with 137779 nodes\n", " | | 1.32s node feature \"reference\" with 137779 nodes\n", " | | 1.36s node feature \"sentence\" with 143503 nodes\n", " | | 1.40s node feature \"sp\" with 137779 nodes\n", " | | 1.45s node feature \"sp_full\" with 137779 nodes\n", " | | 1.49s node feature \"strongs\" with 137779 nodes\n", " | | 1.54s node feature \"subj_ref\" with 137779 nodes\n", " | | 1.58s node feature \"tense\" with 137779 nodes\n", " | | 1.63s node feature \"type\" with 137779 nodes\n", " | | 1.67s node feature \"unicode\" with 137779 nodes\n", " | | 1.71s node feature \"verse\" with 145722 nodes\n", " | | 1.76s node feature \"voice\" with 137779 nodes\n", " | | 1.81s node feature \"wg\" with 102614 nodes\n", " | | 1.86s node feature \"word\" with 137779 nodes\n", " | 1.99s OK\n", " 0.00s Exporting 46 node and 1 edge and 1 config features to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data/:\n", " 0.00s VALIDATING oslots feature\n", " 0.02s VALIDATING oslots feature\n", " 0.02s maxSlot= 137779\n", " 0.02s maxNode= 254348\n", " 0.03s OK: oslots is valid\n", " | 0.14s T after to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.00s T book to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.14s T book_long to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.14s T book_short to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.13s T booknum to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.14s T case to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.13s T chapter to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.17s T clause to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.04s T clauserule to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.04s T clausetype to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.13s T degree to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.14s T gloss to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.14s T gn to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.14s T id to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.04s T junction to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.16s T lemma to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.14s T lex_dom to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.14s T ln to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.13s T monad to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.14s T mood to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.14s T morph to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.15s T nodeID to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.16s T normalized to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.15s T nu to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.15s T number to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.14s T orig_order to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.05s T otype to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.15s T person to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.20s T phrase to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.07s T phrasefunction to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.07s T phrasefunction_long to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.07s T phrasetype to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.15s T ref to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.14s T reference to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.14s T sentence to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.14s T sp to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.14s T sp_full to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.14s T strongs to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.14s T subj_ref to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.14s T tense to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.14s T type to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.17s T unicode to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.14s T verse to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.14s T voice to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.14s T wg to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.16s T word to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.37s T oslots to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " | 0.00s M otext to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data\n", " 6.28s Exported 46 node features and 1 edge features and 1 config features to C:/Users/tonyj/my_new_Jupyter_folder/Read_from_lowfat/data/\n", "done\n" ] } ], "source": [ "TF = Fabric(locations=BaseDir, silent=False)\n", "cv = CV(TF)\n", "version = \"0.1.3 (recursive clause generation)\"\n", "\n", "\n", "def sanitize(input):\n", " if isinstance(input, float): return ''\n", " if isinstance(input, type(None)): return ''\n", " else: return (input)\n", " \n", "\n", "\n", "\n", "def director(cv):\n", " \n", " \n", " NoneType = type(None) # needed as tool to validate certain data\n", " prev_book = \"Matthew\" # start at first book\n", " IndexDict = {} # init an empty dictionary\n", " \n", " Arrays2Dump=200\n", " DumpedArrays=0\n", " ClauseDict={} # init a dummy dictionary\n", " PrevClauseSet = []\n", " PrevClauseList = []\n", "\n", " for bo,bookinfo in bo2book.items():\n", " \n", " '''\n", " load all data into a dataframe\n", " process books in order (bookinfo is a list!)\n", " ''' \n", " book=bookinfo[0] \n", " booknum=int(bookinfo[1])\n", " book_short=bookinfo[2]\n", " book_loc = os.path.join(PklDir, f'{bo}.pkl') \n", " \n", " print(f'\\tWe are loading {book_loc}...')\n", " pkl_file = open(book_loc, 'rb')\n", " df_unsorted = pickle.load(pkl_file)\n", " pkl_file.close()\n", " df=df_unsorted.sort_values(by=['id'])\n", " \n", " \n", " FoundWords=0\n", " phrasefunction='TBD'\n", " phrasefunction_long='TBD'\n", " this_clausetype=\"unknown\" #just signal a not found case\n", " this_clauserule=\"unknown\"\n", " this_clauseconst=\"unknown\"\n", " prev_clausetype = \"unknown\"\n", " this_phrasetype=\"unknown\" #just signal a not found case\n", " this_phrasefunction=\"unknown\"\n", " this_phrasefunction_long=\"unknown\"\n", " this_role=\"unknown\"\n", " ClausesSuspended = False\n", " PreSuspendClauseList = {}\n", " phrase_resume = False\n", " ClosedPhrase=''\n", " PhraseToRestoreTo=''\n", " phrase_close=False\n", " \n", " \n", " prev_chapter = int(1) # start at 1\n", " prev_verse = int(1) # start at 1\n", " prev_sentence = int(1) # start at 1\n", " prev_clause = int(1) # start at 1\n", " prev_phrase = int(1) # start at 1\n", " prev_role = int(1) # start at 1\n", " \n", " # ClauseArrayNumbers contains the active clause numbers (wg in the LowFatTree data)\n", " \n", "\n", " \n", " # reset/load the following initial variables (we are at the start of a new book)\n", " sentence_track = clause_track = clauseconst_track = phrase_track = 1\n", " sentence_done = clause_done = clauseconst_done = phrase_done = verse_done = chapter_done = book_done = False\n", " PhraseInterupted = False\n", " wrdnum = 0 # start at 0\n", "\n", " # fill dictionary of column names for this book \n", " ItemsInRow=1\n", " for itemname in df.columns.to_list():\n", " IndexDict.update({'i_{}'.format(itemname): ItemsInRow})\n", " ItemsInRow+=1\n", " \n", " df.sort_values(by=['id'])\n", "\n", " '''\n", " Walks through the texts and triggers\n", " slot and node creation events.\n", " '''\n", " \n", " # iterate through words and construct objects\n", " for row in df.itertuples():\n", " wrdnum += 1\n", " FoundWords +=1\n", " \n", " \n", " '''\n", " First get all the relevant information from the dataframe\n", " ''' \n", " \n", " # get number of parent nodes\n", " parents = row[IndexDict.get(\"i_parents\")]\n", " \n", " \n", " # get chapter and verse from the data\n", " chapter = sanitize(row[IndexDict.get(\"i_chapter\")])\n", " verse = sanitize(row[IndexDict.get(\"i_verse\")])\n", " \n", "\n", " \n", " # experimental (decoding the clause structure)\n", " ClauseList=[] # stores current active clauses (wg numbers)\n", " if True:\n", " for i in range(1,parents-1):\n", " item = IndexDict.get(\"i_Parent{}Class\".format(i))\n", " if row[item]==\"cl\":\n", " WGN=row[IndexDict.get(\"i_Parent{}WGN\".format(i))]\n", " ClauseList.append(WGN)\n", " ClauseDict[(WGN,0)]=WGN\n", " ClauseDict[(WGN,1)]=sanitize(row[IndexDict.get(\"i_Parent{}Rule\".format(i))])\n", " ClauseDict[(WGN,2)]=sanitize(row[IndexDict.get(\"i_Parent{}Cltype\".format(i))])\n", " ClauseDict[(WGN,3)]=sanitize(row[IndexDict.get(\"i_Parent{}Junction\".format(i))])\n", " if not PrevClauseList==ClauseList:\n", " #print ('\\nPrevClauseDict ={',end='')\n", " #for item in PrevClauseDict:\n", " # print (' ',item,'=',PrevClauseDict[item],end='')\n", " #print ('}')\n", " #print('\\nClauseList=',ClauseList, 'PrevClauseList=',PrevClauseList, 'ClausesSuspended=',ClausesSuspended,end='')\n", " #print('\\nAction(s) = ',end=' ')\n", " ResumePhrase=False\n", " if ClausesSuspended==True:\n", " for item in ClauseList:\n", " try:\n", " ItemToResume=ClauseDict[(item,4)]\n", " #print (' resume: '+str(item),end=' ')\n", " cv.resume(ClauseDict[(item,4)])\n", " #ResumePhrase=True\n", " PhraseToRestoreTo=prev_phrasefunction\n", " except:\n", " #print(\"This is the odd condition for wg=\",item)\n", " # CREATE CASE\n", " #print ('\\n create: '+str(item),end=' ')\n", " ClauseDict[(item,4)]=cv.node('clause')\n", " ClauseDict[(item,5)]=clause_track\n", " clause_track += 1\n", " #print ('link=',ClauseDict[(item,4)])\n", " \n", " \n", "\n", " if not bool(ClauseList): # this means it is a part outside a clause\n", " for item in PrevClauseList:\n", " # SUSPEND CASE\n", " #print (' suspend: '+str(item),end=' ')\n", " cv.feature(ClauseDict[(item,4)], clause=ClauseDict[(item,5)], wg=ClauseDict[(item,0)], junction=ClauseDict[(item,3)], clausetype=ClauseDict[(item,2)], clauserule=ClauseDict[(item,1)])\n", " cv.terminate(ClauseDict[(item,4)])\n", " ClausesSuspended= True\n", " PreSuspendClauseList = PrevClauseList\n", " else:\n", " for item in PrevClauseList:\n", " if (item not in ClauseList):\n", " # CLOSE CASE\n", " #print ('\\n close: '+str(item),end=' ')\n", " cv.feature(ClauseDict[(item,4)], clause=ClauseDict[(item,5)], wg=ClauseDict[(item,0)], junction=ClauseDict[(item,3)], clausetype=ClauseDict[(item,2)], clauserule=ClauseDict[(item,1)])\n", " cv.terminate(ClauseDict[item,4])\n", " for k in range(6): del ClauseDict[item,k]\n", " for item in ClauseList:\n", " if (item not in PrevClauseList):\n", " if not ClausesSuspended:\n", " # CREATE CASE\n", " #print ('\\n create: '+str(item),end=' ')\n", " ClauseDict[(item,4)]=cv.node('clause')\n", " ClauseDict[(item,5)]=clause_track\n", " clause_track += 1\n", " #print ('link=',ClauseDict[(item,4)])\n", " ClausesSuspended=False\n", "\n", " PrevClauseList = ClauseList \n", " clause_done=True\n", " #print ('\\nClauseDict=',ClauseDict,end='')\n", " #print ('\\n\\n',book,chapter,\":\",verse,'\\t',row[IndexDict.get(\"i_word\")]+row[IndexDict.get(\"i_after\")],end='')\n", "\n", " #else:\n", " #print (row[IndexDict.get(\"i_word\")]+row[IndexDict.get(\"i_after\")],end='')\n", "\n", "\n", " \n", "\n", " \n", " # determine syntactic categories of clause parts. See also the description in \n", " # \"MACULA Greek Treebank for the Nestle 1904 Greek New Testament.pdf\" page 5&6\n", " # (section 2.4 Syntactic Categories at Clause Level)\n", " prev_phrasefunction=this_phrasefunction\n", " prev_phrasefunction_long=this_phrasefunction_long\n", " role=row[IndexDict.get(\"i_role\")]\n", " ValidRoles=[\"adv\",\"io\",\"o\",\"o2\",\"s\",\"p\",\"v\",\"vc\"]\n", " this_phrasefunction=''\n", " PhraseWGN=''\n", " if isinstance (role,str) and role in ValidRoles: \n", " this_phrasefunction=role\n", " else:\n", " for i in range(1,parents-1):\n", " role = row[IndexDict.get(\"i_Parent{}Role\".format(i))]\n", " if isinstance (role,str) and role in ValidRoles: \n", " this_phrasefunction=role\n", " PhraseWGN=row[IndexDict.get(\"i_Parent{}WGN\".format(i))]\n", " break\n", " if this_phrasefunction!=prev_phrasefunction:\n", " #print ('\\n',chapter,':',verse,' this_phrasefunction=',this_phrasefunction,' prev_phrasefunction=',prev_phrasefunction)\n", " if phrase_close:\n", " cv.resume(ClosedPhrase)\n", " #print ('resume phrase',ClosedPhrase)\n", " if this_phrasefunction!='':\n", " phrase_done = True\n", " else:\n", " phrase_close = True\n", " ClosedPhrase=this_phrase\n", " PhraseToRestoreTo=prev_phrasefunction\n", "\n", "\n", "\n", " if this_phrasefunction==\"adv\": this_phrasefunction_long='Adverbial'\n", " elif this_phrasefunction==\"io\": this_phrasefunction_long='Indirect Object'\n", " elif this_phrasefunction==\"o\": this_phrasefunction_long='Object'\n", " elif this_phrasefunction==\"o2\": this_phrasefunction_long='Second Object'\n", " elif this_phrasefunction==\"s\": this_phrasefunction_long='Subject'\n", " elif this_phrasefunction==\"p\": this_phrasefunction_long='Predicate'\n", " elif this_phrasefunction==\"v\": this_phrasefunction_long='Verbal'\n", " elif this_phrasefunction==\"vc\": this_phrasefunction_long='Verbal Copula'\n", " #print ('this_phrasefunction=',this_phrasefunction, end=\" | \")\n", "\n", " \n", " \n", " '''\n", " determine if conditions are met to trigger some action \n", " action will be executed after next word\n", " ''' \n", " \n", " # detect book boundary\n", " if prev_book != book:\n", " prev_book=book\n", " book_done = True\n", " chapter_done = True\n", " verse_done=True\n", " sentence_done = True\n", " clause_done = True\n", " phrase_done = True\n", "\n", " # detect chapter boundary\n", " if prev_chapter != chapter:\n", " chapter_done = True\n", " verse_done=True\n", " sentence_done = True\n", " clause_done = True\n", " phrase_done = True\n", " \n", " # detect verse boundary\n", " if prev_verse != verse:\n", " verse_done=True\n", " \n", "\n", " # determine syntactic categories at word level. See also the description in \n", " # \"MACULA Greek Treebank for the Nestle 1904 Greek New Testament.pdf\" page 6&7\n", " # (2.2. Syntactic Categories at Word Level: Part of Speech Labels)\n", " sp=sanitize(row[IndexDict.get(\"i_class\")])\n", " if sp=='adj':\n", " sp_full='adjective'\n", " elif sp=='adj':\n", " sp_full='adjective'\n", " elif sp=='conj':\n", " sp_full='conjunction'\n", " elif sp=='det':\n", " sp_full='determiner' \n", " elif sp=='intj':\n", " sp_full='interjection' \n", " elif sp=='noun':\n", " sp_full='noun' \n", " elif sp=='num':\n", " sp_full='numeral' \n", " elif sp=='prep':\n", " sp_full='preposition' \n", " elif sp=='ptcl':\n", " sp_full='particle' \n", " elif sp=='pron':\n", " sp_full='pronoun' \n", " elif sp=='verb':\n", " sp_full='verb' \n", " \n", " \n", " # Manage first word per book\n", " if wrdnum==1: \n", " prev_phrasetype=this_phrasetype\n", " prev_phrasefunction=this_phrasefunction\n", " prev_phrasefunction_long=this_phrasefunction_long\n", " prev_clauserule=this_clauserule\n", " book_done = chapter_done = verse_done = phrase_done = clause_done = sentence_done = False\n", " # create the first set of nodes\n", " this_book = cv.node('book')\n", " cv.feature(this_book, book=prev_book)\n", " this_chapter = cv.node('chapter')\n", " this_verse = cv.node('verse')\n", " this_sentence = cv.node('sentence')\n", " #this_clause = cv.node('clause')\n", " this_phrase = cv.node('phrase')\n", " #print ('new phrase',this_phrase)\n", " sentence_track += 1\n", " #clause_track += 1\n", " phrase_track += 1\n", "\n", " \n", " \n", " '''\n", " -- handle TF events --\n", " Determine what actions need to be done if proper condition is met.\n", " ''' \n", "\n", " # act upon end of phrase (close)\n", " if phrase_done or phrase_close:\n", " cv.feature(this_phrase, phrase=prev_phrase, phrasetype=prev_phrasetype, phrasefunction=prev_phrasefunction, phrasefunction_long=prev_phrasefunction_long,wg=PhraseWGN)\n", " cv.terminate(this_phrase)\n", " #print ('terminate phrase',this_phrase,':',prev_phrasefunction,'\\n')\n", " ClosedPhrase=this_phrase\n", " PhraseToRestoreTo=prev_phrasefunction\n", " phrase_close=False\n", "\n", "\n", " \n", " # cv.feature(this_clause, clause=prev_clause, clausetype=prev_clausetype, clauserule=prev_clauserule)\n", " # cv.terminate(this_clause)\n", " \n", " # act upon end of sentence (close)\n", " if sentence_done:\n", " cv.feature(this_sentence, sentence=prev_sentence)\n", " cv.terminate(this_sentence)\n", " \n", " # act upon end of verse (close)\n", " if verse_done:\n", " cv.feature(this_verse, verse=prev_verse)\n", " cv.terminate(this_verse)\n", " prev_verse = verse \n", "\n", " # act upon end of chapter (close)\n", " if chapter_done:\n", " cv.feature(this_chapter, chapter=prev_chapter)\n", " cv.terminate(this_chapter)\n", " prev_chapter = chapter\n", "\n", " # act upon end of book (close and open new)\n", " if book_done:\n", " cv.terminate(this_book)\n", " this_book = cv.node('book')\n", " cv.feature(this_book, book=book) \n", " prev_book = book\n", " wrdnum = 1\n", " phrase_track = 1\n", " clause_track = 1\n", " sentence_track = 1\n", " book_done = False\n", " \n", " # start of chapter (create new)\n", " if chapter_done:\n", " this_chapter = cv.node('chapter')\n", " chapter_done = False\n", " \n", " # start of verse (create new)\n", " if verse_done:\n", " this_verse = cv.node('verse')\n", " verse_done = False \n", " \n", " # start of sentence (create new)\n", " if sentence_done:\n", " this_sentence= cv.node('sentence')\n", " prev_sentence = sentence_track\n", " sentence_track += 1\n", " sentence_done = False\n", "\n", " \n", " # start of phrase (create new)\n", " if phrase_done and not ResumePhrase:\n", " this_phrase = cv.node('phrase')\n", " #print ('new phrase',this_phrase)\n", " prev_phrase = phrase_track\n", " prev_phrasefunction=this_phrasefunction\n", " prev_phrasefunction_long=this_phrasefunction_long\n", " phrase_track += 1\n", " phrase_done = False\n", " \n", " \n", " # Detect boundaries of sentences\n", " text=sanitize(row[IndexDict.get(\"i_after\")])[-1:]\n", " if text == \".\" : \n", " sentence_done = True\n", " #phrase_done = True\n", " #if text == \";\" or text == \",\":\n", " # phrase_done = True \n", " \n", " \n", " '''\n", " -- create word nodes --\n", " ''' \n", " \n", " # some attributes are not present inside some (small) books. The following is to prevent exceptions.\n", " degree='' \n", " if 'i_degree' in IndexDict: \n", " degree=sanitize(row[IndexDict.get(\"i_degree\")]) \n", " subjref=''\n", " if 'i_subjref' in IndexDict:\n", " subjref=sanitize(row[IndexDict.get(\"i_subjref\")]) \n", " \n", " #print (chapter,':',verse,\" \",row[IndexDict.get(\"i_word\")],' - ',row[IndexDict.get(\"i_gloss\")],' - ', sp,end='\\n')\n", "\n", " # make word object\n", " this_word = cv.slot()\n", " cv.feature(this_word, \n", " after=sanitize(row[IndexDict.get(\"i_after\")]),\n", " id=sanitize(row[IndexDict.get(\"i_id\")]),\n", " unicode=sanitize(row[IndexDict.get(\"i_unicode\")]),\n", " word=sanitize(row[IndexDict.get(\"i_word\")]),\n", " monad=sanitize(row[IndexDict.get(\"i_monad\")]),\n", " orig_order=FoundWords,\n", " book_long=sanitize(row[IndexDict.get(\"i_book_long\")]),\n", " booknum=booknum,\n", " book_short=sanitize(row[IndexDict.get(\"i_book_short\")]),\n", " chapter=chapter,\n", " ref=sanitize(row[IndexDict.get(\"i_ref\")]),\n", " sp=sanitize(sp),\n", " sp_full=sanitize(sp_full),\n", " verse=verse,\n", " sentence=sanitize(prev_sentence),\n", " clause=sanitize(prev_clause),\n", " phrase=sanitize(prev_phrase),\n", " normalized=sanitize(row[IndexDict.get(\"i_normalized\")]),\n", " morph=sanitize(row[IndexDict.get(\"i_morph\")]),\n", " strongs=sanitize(row[IndexDict.get(\"i_strong\")]),\n", " lex_dom=sanitize(row[IndexDict.get(\"i_domain\")]),\n", " ln=sanitize(row[IndexDict.get(\"i_ln\")]),\n", " gloss=sanitize(row[IndexDict.get(\"i_gloss\")]),\n", " gn=sanitize(row[IndexDict.get(\"i_gender\")]),\n", " nu=sanitize(row[IndexDict.get(\"i_number\")]),\n", " case=sanitize(row[IndexDict.get(\"i_case\")]),\n", " lemma=sanitize(row[IndexDict.get(\"i_lemma\")]),\n", " person=sanitize(row[IndexDict.get(\"i_person\")]),\n", " mood=sanitize(row[IndexDict.get(\"i_mood\")]),\n", " tense=sanitize(row[IndexDict.get(\"i_tense\")]),\n", " number=sanitize(row[IndexDict.get(\"i_number\")]),\n", " voice=sanitize(row[IndexDict.get(\"i_voice\")]),\n", " degree=degree,\n", " type=sanitize(row[IndexDict.get(\"i_type\")]),\n", " reference=sanitize(row[IndexDict.get(\"i_ref\")]), \n", " subj_ref=subjref,\n", " nodeID=sanitize(row[1]) #this is a fixed position.\n", " )\n", " cv.terminate(this_word)\n", "\n", " \n", " '''\n", " -- wrap up the book --\n", " ''' \n", " \n", " # close all nodes (phrase, clause, sentence, verse, chapter and book)\n", " cv.feature(this_phrase, phrase=phrase_track, phrasetype=prev_phrasetype,phrasefunction=prev_phrasefunction,phrasefunction_long=prev_phrasefunction_long, wg=PhraseWGN)\n", " cv.terminate(this_phrase)\n", " #print ('terminate phrase',this_phrase,':',prev_phrasetype,'\\n')\n", "\n", " \n", " #print (ClauseDict)\n", " for item in ClauseList:\n", " cv.feature(ClauseDict[(item,4)], clause=ClauseDict[(item,5)], clausetype=prev_clausetype, clauserule=prev_clauserule)\n", " cv.terminate(ClauseDict[item,4])\n", " \n", " \n", " cv.feature(this_sentence, sentence=prev_sentence)\n", " cv.terminate(this_sentence)\n", " cv.feature(this_verse, verse=prev_verse)\n", " cv.terminate(this_verse)\n", " cv.feature(this_chapter, chapter=prev_chapter)\n", " cv.terminate(this_chapter)\n", " cv.feature(this_book, book=prev_book)\n", " cv.terminate(this_book)\n", " \n", " # clear dataframe for this book \n", " del df\n", " # clear the index dictionary\n", " IndexDict.clear()\n", " gc.collect()\n", " \n", " \n", "'''\n", "-- output definitions --\n", "''' \n", " \n", "slotType = 'word' # or whatever you choose\n", "otext = { # dictionary of config data for sections and text formats\n", " 'fmt:text-orig-full':'{word}{after}',\n", " 'sectionTypes':'book,chapter,verse',\n", " 'sectionFeatures':'book,chapter,verse',\n", " 'structureFeatures': 'book,chapter,verse',\n", " 'structureTypes': 'book,chapter,verse',\n", " }\n", "\n", "# configure metadata\n", "generic = { # dictionary of metadata meant for all features\n", " 'Name': 'Greek New Testament (NA1904)',\n", " 'Version': '1904',\n", " 'Editors': 'Nestle',\n", " 'Data source': 'MACULA Greek Linguistic Datasets, available at https://github.com/Clear-Bible/macula-greek/tree/main/Nestle1904/lowfat',\n", " 'Availability': 'Creative Commons Attribution 4.0 International (CC BY 4.0)', \n", " 'Converter_author': 'Tony Jurg, Vrije Universiteit Amsterdam, Netherlands', \n", " 'Converter_execution': 'Tony Jurg, Vrije Universiteit Amsterdam, Netherlands', \n", " 'Convertor_source': 'https://github.com/tonyjurg/n1904_lft',\n", " 'Converter_version': '{}'.format(version),\n", " 'TextFabric version': '{}'.format(VERSION) #imported from tf.parameters\n", " }\n", "\n", "intFeatures = { # set of integer valued feature names\n", " 'booknum',\n", " 'chapter',\n", " 'verse',\n", " 'sentence',\n", " 'clause',\n", " 'phrase',\n", " 'orig_order',\n", " 'monad'\n", " }\n", "\n", "featureMeta = { # per feature dicts with metadata\n", " 'after': {'description': 'Characters (eg. punctuations) following the word'},\n", " 'id': {'description': 'id of the word'},\n", " 'book': {'description': 'Book'},\n", " 'book_long': {'description': 'Book name (fully spelled out)'},\n", " 'booknum': {'description': 'NT book number (Matthew=1, Mark=2, ..., Revelation=27)'},\n", " 'book_short': {'description': 'Book name (abbreviated)'},\n", " 'chapter': {'description': 'Chapter number inside book'},\n", " 'verse': {'description': 'Verse number inside chapter'},\n", " 'sentence': {'description': 'Sentence number (counted per chapter)'},\n", " 'clause': {'description': 'Clause number (counted per chapter)'},\n", " 'clausetype' : {'description': 'Clause type information (verb, verbless, elided, minor, etc.)'},\n", " 'clauserule' : {'description': 'Clause rule information '},\n", " 'phrase' : {'description': 'Phrase number (counted per book)'},\n", " 'phrasetype' : {'description': 'Phrase type information'},\n", " 'phrasefunction' : {'description': 'Phrase function (abbreviated)'},\n", " 'phrasefunction_long' : {'description': 'Phrase function (long description)'},\n", " 'orig_order': {'description': 'Word order within corpus (per book)'},\n", " 'monad':{'description': 'Monad (currently: order of words in XML tree file!)'},\n", " 'word': {'description': 'Word as it appears in the text (excl. punctuations)'},\n", " 'unicode': {'description': 'Word as it arears in the text in Unicode (incl. punctuations)'},\n", " 'ref': {'description': 'ref Id'},\n", " 'sp': {'description': 'Part of Speech (abbreviated)'},\n", " 'sp_full': {'description': 'Part of Speech (long description)'}, \n", " 'normalized': {'description': 'Surface word stripped of punctations'},\n", " 'lemma': {'description': 'Lexeme (lemma)'},\n", " 'morph': {'description': 'Morphological tag (Sandborg-Petersen morphology)'},\n", " # see also discussion on relation between lex_dom and ln @ https://github.com/Clear-Bible/macula-greek/issues/29\n", " 'lex_dom': {'description': 'Lexical domain according to Semantic Dictionary of Biblical Greek, SDBG (not present everywhere?)'},\n", " 'ln': {'description': 'Lauw-Nida lexical classification (not present everywhere?)'},\n", " 'strongs': {'description': 'Strongs number'},\n", " 'gloss': {'description': 'English gloss'},\n", " 'gn': {'description': 'Gramatical gender (Masculine, Feminine, Neuter)'},\n", " 'nu': {'description': 'Gramatical number (Singular, Plural)'},\n", " 'case': {'description': 'Gramatical case (Nominative, Genitive, Dative, Accusative, Vocative)'},\n", " 'person': {'description': 'Gramatical person of the verb (first, second, third)'},\n", " 'mood': {'description': 'Gramatical mood of the verb (passive, etc)'},\n", " 'tense': {'description': 'Gramatical tense of the verb (e.g. Present, Aorist)'},\n", " 'number': {'description': 'Gramatical number of the verb'},\n", " 'voice': {'description': 'Gramatical voice of the verb'},\n", " 'degree': {'description': 'Degree (e.g. Comparitative, Superlative)'},\n", " 'type': {'description': 'Gramatical type of noun or pronoun (e.g. Common, Personal)'},\n", " 'reference': {'description': 'Reference (to nodeID in XML source data, not yet post-processes)'},\n", " 'subj_ref': {'description': 'Subject reference (to nodeID in XML source data, not yet post-processes)'},\n", " 'nodeID': {'description': 'Node ID (as in the XML source data, not yet post-processes)'},\n", " 'junction': {'description': 'Junction data related to a clause'},\n", " 'wg' : {'description': 'wg number in orig xml'}\n", " }\n", "\n", "'''\n", " -- the main function --\n", "''' \n", "\n", "good = cv.walk(\n", " director,\n", " slotType,\n", " otext=otext,\n", " generic=generic,\n", " intFeatures=intFeatures,\n", " featureMeta=featureMeta,\n", " warn=True,\n", " force=True\n", ")\n", "\n", "if good:\n", " print (\"done\")" ] }, { "cell_type": "raw", "metadata": {}, "source": [] }, { "cell_type": "markdown", "metadata": { "tags": [], "toc": true }, "source": [ "## Part 4: Testing the created textfabric data \n", "##### [back to TOC](#TOC)" ] }, { "cell_type": "markdown", "metadata": { "tags": [] }, "source": [ "### Step 1 load the TF data\n", "\n", "The TF will be loaded from github repository https://github.com/tonyjurg/n1904_lft" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "%load_ext autoreload\n", "%autoreload 2" ] }, { "cell_type": "code", "execution_count": 18, "metadata": { "ExecuteTime": { "end_time": "2022-10-21T02:32:54.197994Z", "start_time": "2022-10-21T02:32:53.217806Z" } }, "outputs": [], "source": [ "# First, I have to laod different modules that I use for analyzing the data and for plotting:\n", "import sys, os, collections\n", "import pandas as pd\n", "import numpy as np\n", "import re\n", "\n", "\n", "from tf.fabric import Fabric\n", "from tf.app import use\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The following cell loads the TextFabric files from github repository. " ] }, { "cell_type": "code", "execution_count": 17, "metadata": { "ExecuteTime": { "end_time": "2022-10-21T02:32:55.906200Z", "start_time": "2022-10-21T02:32:55.012231Z" } }, "outputs": [ { "data": { "text/markdown": [ "**Locating corpus resources ...**" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "app: ~/text-fabric-data/github/tonyjurg/n1904_lft/app" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "The requested data is not available offline\n", "\tC:/Users/tonyj/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3 not found\n", "rate limit is 5000 requests per hour, with 4993 left for this hour\n", "\tconnecting to online GitHub repo tonyjurg/n1904_lft ... connected\n", "\tcannot find releases\n", "\tcannot find releases\n", "\ttf/0.1.3/after.tf...downloaded\n", "\ttf/0.1.3/book.tf...downloaded\n", "\ttf/0.1.3/book_long.tf...downloaded\n", "\ttf/0.1.3/book_short.tf...downloaded\n", "\ttf/0.1.3/booknum.tf...downloaded\n", "\ttf/0.1.3/case.tf...downloaded\n", "\ttf/0.1.3/chapter.tf...downloaded\n", "\ttf/0.1.3/clause.tf...downloaded\n", "\ttf/0.1.3/clauserule.tf...downloaded\n", "\ttf/0.1.3/clausetype.tf...downloaded\n", "\ttf/0.1.3/degree.tf...downloaded\n", "\ttf/0.1.3/gloss.tf...downloaded\n", "\ttf/0.1.3/gn.tf...downloaded\n", "\ttf/0.1.3/id.tf...downloaded\n", "\ttf/0.1.3/junction.tf...downloaded\n", "\ttf/0.1.3/lemma.tf...downloaded\n", "\ttf/0.1.3/lex_dom.tf...downloaded\n", "\ttf/0.1.3/ln.tf...downloaded\n", "\ttf/0.1.3/monad.tf...downloaded\n", "\ttf/0.1.3/mood.tf...downloaded\n", "\ttf/0.1.3/morph.tf...downloaded\n", "\ttf/0.1.3/nodeID.tf...downloaded\n", "\ttf/0.1.3/normalized.tf...downloaded\n", "\ttf/0.1.3/nu.tf...downloaded\n", "\ttf/0.1.3/number.tf...downloaded\n", "\ttf/0.1.3/orig_order.tf...downloaded\n", "\ttf/0.1.3/oslots.tf...downloaded\n", "\ttf/0.1.3/otext.tf...downloaded\n", "\ttf/0.1.3/otype.tf...downloaded\n", "\ttf/0.1.3/person.tf...downloaded\n", "\ttf/0.1.3/phrase.tf...downloaded\n", "\ttf/0.1.3/phrasefunction.tf...downloaded\n", "\ttf/0.1.3/phrasefunction_long.tf...downloaded\n", "\ttf/0.1.3/phrasetype.tf...downloaded\n", "\ttf/0.1.3/ref.tf...downloaded\n", "\ttf/0.1.3/reference.tf...downloaded\n", "\ttf/0.1.3/sentence.tf...downloaded\n", "\ttf/0.1.3/sp.tf...downloaded\n", "\ttf/0.1.3/sp_full.tf...downloaded\n", "\ttf/0.1.3/strongs.tf...downloaded\n", "\ttf/0.1.3/subj_ref.tf...downloaded\n", "\ttf/0.1.3/tense.tf...downloaded\n", "\ttf/0.1.3/type.tf...downloaded\n", "\ttf/0.1.3/unicode.tf...downloaded\n", "\ttf/0.1.3/verse.tf...downloaded\n", "\ttf/0.1.3/voice.tf...downloaded\n", "\ttf/0.1.3/wg.tf...downloaded\n", "\ttf/0.1.3/word.tf...downloaded\n", "\tOK\n" ] }, { "data": { "text/html": [ "data: ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ " | 0.27s T otype from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | 2.28s T oslots from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | 0.57s T verse from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | 0.53s T chapter from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | 0.72s T word from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | 0.61s T after from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | 0.01s T book from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | | 0.06s C __levels__ from otype, oslots, otext\n", " | | 1.71s C __order__ from otype, oslots, __levels__\n", " | | 0.07s C __rank__ from otype, __order__\n", " | | 3.44s C __levUp__ from otype, oslots, __rank__\n", " | | 1.91s C __levDown__ from otype, __levUp__, __rank__\n", " | | 0.06s C __characters__ from otext\n", " | | 1.08s C __boundary__ from otype, oslots, __rank__\n", " | | 0.05s C __sections__ from otype, oslots, otext, __levUp__, __levels__, book, chapter, verse\n", " | | 0.27s C __structure__ from otype, oslots, otext, __rank__, __levUp__, book, chapter, verse\n", " | 0.62s T book_long from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | 0.61s T book_short from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | 0.51s T booknum from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | 0.58s T case from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | 0.63s T clause from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | 0.14s T clauserule from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | 0.13s T clausetype from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | 0.52s T degree from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | 0.69s T gloss from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | 0.59s T gn from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | 0.78s T id from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | 0.14s T junction from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | 0.67s T lemma from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | 0.62s T lex_dom from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | 0.65s T ln from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | 0.54s T monad from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | 0.54s T mood from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | 0.62s T morph from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | 0.79s T nodeID from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | 0.71s T normalized from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | 0.60s T nu from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | 0.60s T number from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | 0.56s T orig_order from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | 0.54s T person from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | 0.84s T phrase from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | 0.31s T phrasefunction from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | 0.33s T phrasefunction_long from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | 0.32s T phrasetype from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | 0.80s T ref from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | 0.55s T sentence from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | 0.62s T sp from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | 0.66s T sp_full from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | 0.67s T strongs from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | 0.55s T subj_ref from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | 0.56s T tense from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | 0.57s T type from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | 0.75s T unicode from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | 0.55s T voice from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n", " | 0.50s T wg from ~/text-fabric-data/github/tonyjurg/n1904_lft/tf/0.1.3\n" ] }, { "data": { "text/html": [ "\n", " Text-Fabric: Text-Fabric API 11.2.3, tonyjurg/n1904_lft/app v3, Search Reference
\n", " Data: tonyjurg - n1904_lft 0.1.3, 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", "
Name# of nodes# slots/node% coverage
book275102.93100
chapter260529.92100
sentence572424.07100
verse794317.35100
clause315097.86180
phrase711061.8093
word1377791.00100
\n", " Sets: no custom sets
\n", " Features:
\n", "
Nestle 1904\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\n", "\n", "
\n", "\n", "
\n", "
\n", "book_long\n", "
\n", "
str
\n", "\n", " Book name (fully spelled out)\n", "\n", "
\n", "\n", "
\n", "
\n", "book_short\n", "
\n", "
str
\n", "\n", " Book name (abbreviated)\n", "\n", "
\n", "\n", "
\n", "
\n", "booknum\n", "
\n", "
int
\n", "\n", " NT book number (Matthew=1, Mark=2, ..., Revelation=27)\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", "clause\n", "
\n", "
int
\n", "\n", " Clause number (counted per chapter)\n", "\n", "
\n", "\n", "
\n", "
\n", "clauserule\n", "
\n", "
str
\n", "\n", " Clause rule information \n", "\n", "
\n", "\n", "
\n", "
\n", "clausetype\n", "
\n", "
str
\n", "\n", " Clause type information (verb, verbless, elided, minor, etc.)\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", "id\n", "
\n", "
str
\n", "\n", " id of the word\n", "\n", "
\n", "\n", "
\n", "
\n", "junction\n", "
\n", "
str
\n", "\n", " Junction data related to a clause\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", "monad\n", "
\n", "
int
\n", "\n", " Monad (currently: order of words in XML tree file!)\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, not yet post-processes)\n", "\n", "
\n", "\n", "
\n", "
\n", "normalized\n", "
\n", "
str
\n", "\n", " Surface word stripped of punctations\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\n", "\n", "
\n", "\n", "
\n", "
\n", "orig_order\n", "
\n", "
int
\n", "\n", " Word order within corpus (per book)\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", "phrase\n", "
\n", "
int
\n", "\n", " Phrase number (counted per book)\n", "\n", "
\n", "\n", "
\n", "
\n", "phrasefunction\n", "
\n", "
str
\n", "\n", " Phrase function (abbreviated)\n", "\n", "
\n", "\n", "
\n", " \n", "
str
\n", "\n", " Phrase function (long description)\n", "\n", "
\n", "\n", "
\n", "
\n", "phrasetype\n", "
\n", "
str
\n", "\n", " Phrase type information\n", "\n", "
\n", "\n", "
\n", "
\n", "ref\n", "
\n", "
str
\n", "\n", " ref Id\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 arears 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\n", "\n", "
\n", "\n", "
\n", "
\n", "wg\n", "
\n", "
str
\n", "\n", " wg number in orig xml\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", "oslots\n", "
\n", "
none
\n", "\n", " \n", "\n", "
\n", "\n", "
\n", "
\n", "\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 directly usable

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# Loading-the-New-Testament-Text-Fabric (add a specific version, eg. 0.1.2)\n", "NA = use (\"tonyjurg/n1904_lft\", version=\"0.1.3\", hoist=globals())" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'word': 0,\n", " 'phrase': 1,\n", " 'clause': 2,\n", " 'verse': 3,\n", " 'sentence': 4,\n", " 'chapter': 5,\n", " 'book': 6}" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "N.otypeRank" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Step 2 Perform some basic display \n", "\n", "note: the implementation with regards how phrases need to be displayed (esp. with regards to conjunctions) is still to be done." ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " 0.01s 25 results\n" ] }, { "data": { "text/html": [ "

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

verse:253919 1
clause:167759 1
clauserule=S-IOclausetype=VerbElidedwg=2
phrase:236392 1
phrasefunction_long=Subjectwg=9
127491 Ἰούδας
chapter=1gloss=Judesp=noun
127492 Ἰησοῦ
chapter=1gloss=of Jesussp=noun
127493 Χριστοῦ
chapter=1gloss=Christsp=noun
127494 δοῦλος,
chapter=1gloss=servantsp=noun
127495 ἀδελφὸς
chapter=1gloss=brothersp=noun
127496 δὲ
chapter=1gloss=thensp=conj
127497 Ἰακώβου,
chapter=1gloss=of Jamessp=noun
phrase:236393 2
phrasefunction_long=Indirect Objectwg=13
127498 τοῖς
chapter=1gloss=To thosesp=det
clause:167760 2
clauserule=ADV-Vjunction=coordinatewg=12
phrase:236394 3
phrasefunction_long=Adverbial
127499 ἐν
chapter=1gloss=insp=prep
127500 Θεῷ
chapter=1gloss=Godsp=noun
127501 Πατρὶ
chapter=1gloss=[the] Fathersp=noun
phrase:236395 4
phrasefunction_long=Verbalwg=9
127502 ἠγαπημένοις
chapter=1gloss=having been lovedsp=verb
phrase:236396 5
phrasefunction_long=Indirect Objectwg=17
127503 καὶ
chapter=1gloss=andsp=conj
clause:167761 3
clauserule=ADV-Vjunction=coordinatewg=16
phrase:236397 6
phrasefunction_long=Adverbial
127504 Ἰησοῦ
chapter=1gloss=in Jesussp=noun
127505 Χριστῷ
chapter=1gloss=Christsp=noun
phrase:236398 7
phrasefunction_long=Verbalwg=9
127506 τετηρημένοις
chapter=1gloss=having been keptsp=verb
phrase:236399 8
phrasefunction_long=Indirect Objectwg=20
127507 κλητοῖς.
chapter=1gloss=calledsp=adj
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

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

verse:253920 2
clause:167762 4
clauserule=IO-S-Vwg=19
phrase:236400 9
phrasefunction_long=Subject
127508 ἔλεος
chapter=1gloss=Mercysp=noun
phrase:236401 10
phrasefunction_long=Indirect Objectwg=20
127509 ὑμῖν
chapter=1gloss=to yousp=pron
phrase:236402 11
phrasefunction_long=Subject
127510 καὶ
chapter=1gloss=andsp=conj
127511 εἰρήνη
chapter=1gloss=peacesp=noun
127512 καὶ
chapter=1gloss=andsp=conj
127513 ἀγάπη
chapter=1gloss=lovesp=noun
phrase:236403 12
phrasefunction_long=Verbalwg=27
127514 πληθυνθείη.
chapter=1gloss=be multipliedsp=verb
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

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

verse:253921 3
clause:167763 5
wg=24
127515 Ἀγαπητοί,
chapter=1gloss=Belovedsp=adj
clause:167764 6
clauserule=O-V-ADVjunction=subordinatewg=26
phrase:236404 13
phrasefunction_long=Object
127516 πᾶσαν
chapter=1gloss=allsp=adj
127517 σπουδὴν
chapter=1gloss=diligencesp=noun
phrase:236405 14
phrasefunction_long=Verbal
127518 ποιούμενος
chapter=1gloss=usingsp=verb
clause:167765 7
clauserule=V-IO-ADVjunction=subordinatewg=28
phrase:236405 14
phrasefunction_long=Verbal
127519 γράφειν
chapter=1gloss=to writesp=verb
phrase:236406 15
phrasefunction_long=Indirect Objectwg=29
127520 ὑμῖν
chapter=1gloss=to yousp=pron
phrase:236407 16
phrasefunction_long=Adverbial
127521 περὶ
chapter=1gloss=concerningsp=prep
127522 τῆς
chapter=1gloss=-sp=det
127523 κοινῆς
chapter=1gloss=commonsp=adj
127524 ἡμῶν
chapter=1gloss=of ussp=pron
127525 σωτηρίας,
chapter=1gloss=salvationsp=noun
phrase:236408 17
phrasefunction_long=Object
127526 ἀνάγκην
chapter=1gloss=necessitysp=noun
phrase:236409 18
phrasefunction_long=Verbal
127527 ἔσχον
chapter=1gloss=I hadsp=verb
clause:167766 8
clauserule=V-IO-ADVjunction=subordinatewg=33
phrase:236409 18
phrasefunction_long=Verbal
127528 γράψαι
chapter=1gloss=to writesp=verb
phrase:236410 19
phrasefunction_long=Indirect Object
127529 ὑμῖν
chapter=1gloss=to yousp=pron
clause:167767 9
clauserule=V-Ojunction=subordinatewg=34
phrase:236411 20
phrasefunction_long=Verbalwg=36
127530 παρακαλῶν
chapter=1gloss=exhorting [you]sp=verb
clause:167768 10
clauserule=V-ADVjunction=subordinatewg=35
phrase:236411 20
phrasefunction_long=Verbalwg=36
127531 ἐπαγωνίζεσθαι
chapter=1gloss=to contend earnestlysp=verb
phrase:236412 21
phrasefunction_long=Adverbial
127532 τῇ
chapter=1gloss=for thesp=det
clause:167769 11
clauserule=ADV-V-IOjunction=subordinatewg=38
phrase:236412 21
phrasefunction_long=Adverbial
127533 ἅπαξ
chapter=1gloss=once for allsp=adv
phrase:236413 22
phrasefunction_long=Verbalwg=39
127534 παραδοθείσῃ
chapter=1gloss=having been deliveredsp=verb
phrase:236414 23
phrasefunction_long=Indirect Objectwg=36
127535 τοῖς
chapter=1gloss=to thesp=det
127536 ἁγίοις
chapter=1gloss=saintssp=adj
phrase:236415 24
phrasefunction_long=Adverbial
127537 πίστει.
chapter=1gloss=faithsp=noun
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

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

verse:253922 4
clause:167770 12
clauserule=V-S-ADVwg=42
phrase:236416 25
phrasefunction_long=Verbalwg=43
127538 παρεισεδύησαν
chapter=1gloss=Came in stealthilysp=verb
127539 γάρ
chapter=1gloss=forsp=conj
clause:167770 12
clauserule=V-S-ADVwg=42
phrase:236417 26
phrasefunction_long=Subject
127540 τινες
chapter=1gloss=certainsp=pron
127541 ἄνθρωποι,
chapter=1gloss=mensp=noun
127542 οἱ
chapter=1gloss=thosesp=det
clause:167771 13
clauserule=ADV-V-ADVwg=47
phrase:236418 27
phrasefunction_long=Adverbial
127543 πάλαι
chapter=1gloss=long agosp=adv
phrase:236419 28
phrasefunction_long=Verbalwg=48
127544 προγεγραμμένοι
chapter=1gloss=having been designatedsp=verb
phrase:236420 29
phrasefunction_long=Adverbialwg=43
127545 εἰς
chapter=1gloss=untosp=prep
127546 τοῦτο
chapter=1gloss=thissp=pron
127547 τὸ
chapter=1gloss=-sp=det
127548 κρίμα,
chapter=1gloss=condemnationsp=noun
phrase:236421 30
phrasefunction_long=Subjectwg=53
127549 ἀσεβεῖς,
chapter=1gloss=ungodly [ones]sp=adj
clause:167772 14
clauserule=O-V-ADVjunction=coordinatewg=52
phrase:236422 31
phrasefunction_long=Object
127550 τὴν
chapter=1gloss=thesp=det
127551 τοῦ
chapter=1gloss=of thesp=det
127552 Θεοῦ
chapter=1gloss=Godsp=noun
127553 ἡμῶν
chapter=1gloss=of ussp=pron
127554 χάριτα
chapter=1gloss=gracesp=noun
phrase:236423 32
phrasefunction_long=Verbalwg=57
127555 μετατιθέντες
chapter=1gloss=changingsp=verb
phrase:236424 33
phrasefunction_long=Adverbialwg=60
127556 εἰς
chapter=1gloss=intosp=prep
127557 ἀσέλγειαν
chapter=1gloss=sensualitysp=noun
phrase:236424 33
phrasefunction_long=Adverbialwg=60
127558 καὶ
chapter=1gloss=andsp=conj
clause:167773 15
clauserule=O-Vjunction=coordinatewg=59
phrase:236425 34
phrasefunction_long=Object
127559 τὸν
chapter=1gloss=thesp=det
127560 μόνον
chapter=1gloss=onlysp=adj
127561 Δεσπότην
chapter=1gloss=mastersp=noun
127562 καὶ
chapter=1gloss=andsp=conj
127563 Κύριον
chapter=1gloss=Lordsp=noun
127564 ἡμῶν
chapter=1gloss=of ussp=pron
127565 Ἰησοῦν
chapter=1gloss=Jesussp=noun
127566 Χριστὸν
chapter=1gloss=Christsp=noun
phrase:236426 35
phrasefunction_long=Verbal
127567 ἀρνούμενοι.
chapter=1gloss=denyingsp=verb
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

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

verse:253923 5
clause:167774 17
clauserule=V-ADV-Owg=69
clause:167775 16
clauserule=V-Owg=72
phrase:236426 35
phrasefunction_long=Verbal
127568 Ὑπομνῆσαι
chapter=1gloss=To remindsp=verb
127569 δὲ
chapter=1gloss=nowsp=conj
clause:167774 17
clauserule=V-ADV-Owg=69
clause:167775 16
clauserule=V-Owg=72
phrase:236427 36
phrasefunction_long=Object
127570 ὑμᾶς
chapter=1gloss=yousp=pron
phrase:236428 37
phrasefunction_long=Verbal
127571 βούλομαι,
chapter=1gloss=I wantsp=verb
clause:167776 18
clauserule=V-ADV-Ojunction=subordinatewg=70
phrase:236428 37
phrasefunction_long=Verbal
127572 εἰδότας
chapter=1gloss=having knownsp=verb
phrase:236429 38
phrasefunction_long=Adverbial
127573 ἅπαξ
chapter=1gloss=at one timesp=adv
phrase:236430 39
phrasefunction_long=Object
127574 πάντα,
chapter=1gloss=all thissp=adj
phrase:236430 39
phrasefunction_long=Object
127575 ὅτι
chapter=1gloss=thatsp=conj
clause:167777 19
clauserule=S-ADV-ADV-O-Vjunction=coordinatewg=75
phrase:236431 40
phrasefunction_long=Subject
127576 Κύριος
chapter=1gloss=Jesussp=noun
clause:167778 20
clauserule=O-ADV-Vjunction=subordinatewg=76
phrase:236432 41
phrasefunction_long=Objectwg=77
127577 λαὸν
chapter=1gloss=a peoplesp=noun
phrase:236433 42
phrasefunction_long=Adverbial
127578 ἐκ
chapter=1gloss=out ofsp=prep
127579 γῆς
chapter=1gloss=[the] landsp=noun
127580 Αἰγύπτου
chapter=1gloss=of Egyptsp=noun
phrase:236434 43
phrasefunction_long=Verbalwg=79
127581 σώσας
chapter=1gloss=having savedsp=verb
phrase:236435 44
phrasefunction_long=Adverbialwg=80
127582 τὸ
chapter=1gloss=-sp=det
127583 δεύτερον
chapter=1gloss=afterwardsp=adj
phrase:236436 45
phrasefunction_long=Object
127584 τοὺς
chapter=1gloss=thosesp=det
clause:167779 21
clauserule=ADV-Vwg=81
phrase:236437 46
phrasefunction_long=Adverbial
127585 μὴ
chapter=1gloss=notsp=adv
phrase:236438 47
phrasefunction_long=Verbalwg=84
127586 πιστεύσαντας
chapter=1gloss=having believedsp=verb
phrase:236438 47
phrasefunction_long=Verbalwg=84
127587 ἀπώλεσεν,
chapter=1gloss=He destroyedsp=verb
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

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

verse:253924 6
clause:167774 17
clauserule=V-ADV-Owg=69
clause:167780 22
clauserule=O-ADV-ADV-ADV-Vjunction=coordinatewg=83
phrase:236439 48
phrasefunction_long=Object
127588 ἀγγέλους
chapter=1gloss=[The] angelssp=noun
phrase:236439 48
phrasefunction_long=Object
127589 τε
chapter=1gloss=bothsp=conj
clause:167781 23
clauserule=O-ADV-ADV-ADV-Vjunction=coordinatewg=83
phrase:236439 48
phrasefunction_long=Object
127590 τοὺς
chapter=1gloss=-sp=det
clause:167782 24
clauserule=ADV-V-Ojunction=coordinatewg=87
phrase:236440 49
phrasefunction_long=Adverbial
127591 μὴ
chapter=1gloss=notsp=adv
phrase:236441 50
phrasefunction_long=Verbalwg=88
127592 τηρήσαντας
chapter=1gloss=having keptsp=verb
phrase:236442 51
phrasefunction_long=Object
127593 τὴν
chapter=1gloss=[own]sp=det
127594 ἑαυτῶν
chapter=1gloss=theirsp=pron
127595 ἀρχὴν
chapter=1gloss=domainsp=noun
phrase:236442 51
phrasefunction_long=Object
127596 ἀλλὰ
chapter=1gloss=butsp=conj
clause:167783 25
clauserule=V-Ojunction=coordinatewg=91
phrase:236443 52
phrasefunction_long=Verbalwg=92
127597 ἀπολιπόντας
chapter=1gloss=having leftsp=verb
phrase:236444 53
phrasefunction_long=Objectwg=94
127598 τὸ
chapter=1gloss=thesp=det
127599 ἴδιον
chapter=1gloss=ownsp=adj
127600 οἰκητήριον
chapter=1gloss=dwellingsp=noun
phrase:236445 54
phrasefunction_long=Adverbial
127601 εἰς
chapter=1gloss=untosp=prep
127602 κρίσιν
chapter=1gloss=[the] judgmentsp=noun
127603 μεγάλης
chapter=1gloss=of [the] greatsp=adj
127604 ἡμέρας
chapter=1gloss=daysp=noun
127605 δεσμοῖς
chapter=1gloss=in chainssp=noun
127606 ἀϊδίοις
chapter=1gloss=eternalsp=adj
127607 ὑπὸ
chapter=1gloss=undersp=prep
127608 ζόφον
chapter=1gloss=darknesssp=noun
phrase:236446 55
phrasefunction_long=Verbalwg=99
127609 τετήρηκεν·
chapter=1gloss=He keepssp=verb
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

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

verse:253925 7
clause:167774 17
clauserule=V-ADV-Owg=69
phrase:236447 56
phrasefunction_long=Adverbialwg=101
127610 ὡς
chapter=1gloss=just assp=conj
clause:167784 26
clauserule=S-ADV-V-O-ADVjunction=subordinatewg=100
phrase:236448 57
phrasefunction_long=Subjectwg=109
127611 Σόδομα
chapter=1gloss=Sodomsp=noun
127612 καὶ
chapter=1gloss=andsp=conj
127613 Γόμορρα
chapter=1gloss=Gomorrahsp=noun
127614 καὶ
chapter=1gloss=andsp=conj
127615 αἱ
chapter=1gloss=thesp=det
127616 περὶ
chapter=1gloss=aroundsp=prep
127617 αὐτὰς
chapter=1gloss=themsp=pron
127618 πόλεις,
chapter=1gloss=citiessp=noun
clause:167785 27
clauserule=O-ADV-Vjunction=coordinatewg=108
phrase:236449 58
phrasefunction_long=Object
127619 τὸν
chapter=1gloss=-sp=det
127620 ὅμοιον
chapter=1gloss=in likesp=adj
127621 τρόπον
chapter=1gloss=mannersp=noun
phrase:236450 59
phrasefunction_long=Adverbial
127622 τούτοις
chapter=1gloss=with themsp=pron
phrase:236451 60
phrasefunction_long=Verbalwg=107
127623 ἐκπορνεύσασαι
chapter=1gloss=having indulged in sexual immoralitysp=verb
phrase:236452 61
phrasefunction_long=Adverbial
127624 καὶ
chapter=1gloss=andsp=conj
clause:167786 28
clauserule=V-ADVjunction=coordinatewg=112
phrase:236453 62
phrasefunction_long=Verbalwg=113
127625 ἀπελθοῦσαι
chapter=1gloss=having gonesp=verb
phrase:236454 63
phrasefunction_long=Adverbial
127626 ὀπίσω
chapter=1gloss=aftersp=prep
127627 σαρκὸς
chapter=1gloss=fleshsp=noun
127628 ἑτέρας,
chapter=1gloss=strangesp=adj
phrase:236455 64
phrasefunction_long=Verbal
127629 πρόκεινται
chapter=1gloss=are set forth assp=verb
phrase:236456 65
phrasefunction_long=Object
127630 δεῖγμα
chapter=1gloss=an examplesp=noun
clause:167787 29
clauserule=O-Vjunction=subordinatewg=115
phrase:236456 65
phrasefunction_long=Object
127631 πυρὸς
chapter=1gloss=of firesp=noun
127632 αἰωνίου
chapter=1gloss=eternalsp=adj
127633 δίκην
chapter=1gloss=[the] penaltysp=noun
phrase:236457 66
phrasefunction_long=Verbal
127634 ὑπέχουσαι.
chapter=1gloss=undergoingsp=verb
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

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

verse:253926 8
clause:167788 30
clauserule=ADV-S-Vwg=120
phrase:236458 67
phrasefunction_long=Adverbialwg=121
127635 Ὁμοίως
chapter=1gloss=Likewisesp=adv
127636 μέντοι
chapter=1gloss=yetsp=conj
clause:167788 30
clauserule=ADV-S-Vwg=120
phrase:236459 68
phrasefunction_long=Subject
127637 καὶ
chapter=1gloss=alsosp=adv
127638 οὗτοι
chapter=1gloss=thesesp=pron
clause:167789 31
clauserule=V2CLjunction=subordinatewg=123
phrase:236460 69
phrasefunction_long=Verbal
127639 ἐνυπνιαζόμενοι
chapter=1gloss=dreaming [ones]sp=verb
clause:167790 32
clauserule=O-Vjunction=coordinatewg=126
phrase:236461 70
phrasefunction_long=Objectwg=124
127640 σάρκα
chapter=1gloss=[the] fleshsp=noun
phrase:236462 71
phrasefunction_long=Verbal
127641 μὲν
chapter=1gloss=indeedsp=conj
clause:167791 33
clauserule=O-Vjunction=coordinatewg=126
phrase:236462 71
phrasefunction_long=Verbal
127642 μιαίνουσιν,
chapter=1gloss=defilesp=verb
clause:167792 34
clauserule=O-Vjunction=coordinatewg=128
phrase:236463 72
phrasefunction_long=Objectwg=124
127643 κυριότητα
chapter=1gloss=authoritysp=noun
phrase:236464 73
phrasefunction_long=Verbal
127644 δὲ
chapter=1gloss=thensp=conj
clause:167793 35
clauserule=O-Vjunction=coordinatewg=128
phrase:236464 73
phrasefunction_long=Verbal
127645 ἀθετοῦσιν,
chapter=1gloss=set asidesp=verb
clause:167794 36
clauserule=O-Vjunction=coordinatewg=130
phrase:236465 74
phrasefunction_long=Objectwg=124
127646 δόξας
chapter=1gloss=glorious [ones]sp=noun
phrase:236466 75
phrasefunction_long=Verbalwg=143
127647 δὲ
chapter=1gloss=andsp=conj
clause:167795 37
clauserule=O-Vjunction=coordinatewg=130
phrase:236466 75
phrasefunction_long=Verbalwg=143
127648 βλασφημοῦσιν.
chapter=1gloss=blasphemesp=verb
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

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

verse:253927 9
clause:167796 38
clauserule=S-V-Ojunction=coordinatewg=142
phrase:236467 76
phrasefunction_long=Subjectwg=143
127649
chapter=1gloss=-sp=det
127650 δὲ
chapter=1gloss=Butsp=conj
clause:167796 38
clauserule=S-V-Ojunction=coordinatewg=142
phrase:236468 77
phrasefunction_long=Subjectwg=137
127651 Μιχαὴλ
chapter=1gloss=Michaelsp=noun
127652
chapter=1gloss=thesp=det
127653 ἀρχάγγελος,
chapter=1gloss=archangelsp=noun
127654 ὅτε
chapter=1gloss=whensp=conj
clause:167797 40
clauserule=ADV-V-ADVjunction=subordinatewg=135
clause:167798 39
clauserule=ADV-Vjunction=subordinatewg=136
phrase:236469 78
phrasefunction_long=Adverbial
127655 τῷ
chapter=1gloss=with thesp=det
127656 διαβόλῳ
chapter=1gloss=devilsp=adj
phrase:236470 79
phrasefunction_long=Verbalwg=138
127657 διακρινόμενος
chapter=1gloss=disputingsp=verb
phrase:236470 79
phrasefunction_long=Verbalwg=138
127658 διελέγετο
chapter=1gloss=he was reasoningsp=verb
phrase:236471 80
phrasefunction_long=Adverbial
127659 περὶ
chapter=1gloss=aboutsp=prep
127660 τοῦ
chapter=1gloss=-sp=det
127661 Μωϋσέως
chapter=1gloss=Moses’sp=noun
127662 σώματος,
chapter=1gloss=bodysp=noun
127663 οὐκ
chapter=1gloss=notsp=adv
clause:167796 38
clauserule=S-V-Ojunction=coordinatewg=142
phrase:236472 81
phrasefunction_long=Verbalwg=147
127664 ἐτόλμησεν
chapter=1gloss=did daresp=verb
clause:167799 41
clauserule=V-O-Sjunction=coordinatewg=146
phrase:236473 82
phrasefunction_long=Object
127665 κρίσιν
chapter=1gloss=a judgmentsp=noun
phrase:236474 83
phrasefunction_long=Verbalwg=147
127666 ἐπενεγκεῖν
chapter=1gloss=to bring against [him]sp=verb
phrase:236475 84
phrasefunction_long=Object
127667 βλασφημίας,
chapter=1gloss=blasphemoussp=noun
127668 ἀλλὰ
chapter=1gloss=butsp=conj
clause:167800 42
wg=148
phrase:236476 85
phrasefunction_long=Verbal
127669 εἶπεν
chapter=1gloss=saidsp=verb
clause:167801 43
clauserule=V-O-Swg=149
phrase:236476 85
phrasefunction_long=Verbal
127670 Ἐπιτιμήσαι
chapter=1gloss=Rebukesp=verb
phrase:236477 86
phrasefunction_long=Object
127671 σοι
chapter=1gloss=yousp=pron
phrase:236478 87
phrasefunction_long=Subject
127672 Κύριος.
chapter=1gloss=[the] Lordsp=noun
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

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

verse:253928 10
clause:167802 44
clauserule=S-O-Vjunction=coordinatewg=154
phrase:236478 87
phrasefunction_long=Subject
127673 οὗτοι
chapter=1gloss=Thesesp=pron
127674 δὲ
chapter=1gloss=howeversp=conj
clause:167802 44
clauserule=S-O-Vjunction=coordinatewg=154
clause:167803 45
clauserule=O-ADV-Vjunction=subordinatewg=155
phrase:236479 88
phrasefunction_long=Object
127675 ὅσα
chapter=1gloss=whatever thingssp=pron
127676 μὲν
chapter=1gloss=indeedsp=conj
clause:167802 44
clauserule=S-O-Vjunction=coordinatewg=154
clause:167803 45
clauserule=O-ADV-Vjunction=subordinatewg=155
phrase:236480 89
phrasefunction_long=Adverbial
127677 οὐκ
chapter=1gloss=notsp=adv
phrase:236481 90
phrasefunction_long=Verbal
127678 οἴδασιν
chapter=1gloss=they have seensp=verb
phrase:236481 90
phrasefunction_long=Verbal
127679 βλασφημοῦσιν,
chapter=1gloss=they speak evil ofsp=verb
clause:167804 47
wg=157
clause:167805 46
clauserule=O-ADV-ADV-Vwg=158
phrase:236482 91
phrasefunction_long=Object
127680 ὅσα
chapter=1gloss=whatever thingssp=pron
127681 δὲ
chapter=1gloss=thensp=conj
clause:167804 47
wg=157
clause:167805 46
clauserule=O-ADV-ADV-Vwg=158
phrase:236483 92
phrasefunction_long=Adverbialwg=161
127682 φυσικῶς
chapter=1gloss=naturallysp=adv
127683 ὡς
chapter=1gloss=assp=conj
clause:167806 48
clauserule=S2CLclausetype=VerbElidedjunction=subordinatewg=160
phrase:236484 93
phrasefunction_long=Subject
127684 τὰ
chapter=1gloss=thesp=det
127685 ἄλογα
chapter=1gloss=irrationalsp=adj
127686 ζῷα
chapter=1gloss=animalssp=noun
phrase:236485 94
phrasefunction_long=Verbalwg=163
127687 ἐπίστανται,
chapter=1gloss=they understandsp=verb
phrase:236486 95
phrasefunction_long=Adverbial
127688 ἐν
chapter=1gloss=insp=prep
127689 τούτοις
chapter=1gloss=these thingssp=pron
phrase:236487 96
phrasefunction_long=Verbal
127690 φθείρονται.
chapter=1gloss=they corrupt themselvessp=verb
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

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

verse:253929 11
clause:167807 49
clauserule=S-IOclausetype=VerbElidedwg=166
phrase:236488 97
phrasefunction_long=Subject
127691 οὐαὶ
chapter=1gloss=Woesp=ptcl
phrase:236489 98
phrasefunction_long=Indirect Objectwg=170
127692 αὐτοῖς,
chapter=1gloss=to themsp=pron
127693 ὅτι
chapter=1gloss=becausesp=conj
clause:167808 50
clauserule=ADV-Vjunction=coordinatewg=169
phrase:236490 99
phrasefunction_long=Adverbial
127694 τῇ
chapter=1gloss=in thesp=det
127695 ὁδῷ
chapter=1gloss=waysp=noun
127696 τοῦ
chapter=1gloss=-sp=det
127697 Κάϊν
chapter=1gloss=of Cainsp=noun
phrase:236491 100
phrasefunction_long=Verbalwg=175
127698 ἐπορεύθησαν,
chapter=1gloss=they wentsp=verb
127699 καὶ
chapter=1gloss=andsp=conj
clause:167809 51
clauserule=ADV-Vjunction=coordinatewg=174
phrase:236492 101
phrasefunction_long=Adverbial
127700 τῇ
chapter=1gloss=to thesp=det
127701 πλάνῃ
chapter=1gloss=errorsp=noun
127702 τοῦ
chapter=1gloss=-sp=det
127703 Βαλαὰμ
chapter=1gloss=of Balaamsp=noun
127704 μισθοῦ
chapter=1gloss=for rewardsp=noun
phrase:236493 102
phrasefunction_long=Verbalwg=181
127705 ἐξεχύθησαν,
chapter=1gloss=they rushedsp=verb
127706 καὶ
chapter=1gloss=andsp=conj
clause:167810 52
clauserule=ADV-Vjunction=coordinatewg=180
phrase:236494 103
phrasefunction_long=Adverbial
127707 τῇ
chapter=1gloss=in thesp=det
127708 ἀντιλογίᾳ
chapter=1gloss=rebellionsp=noun
127709 τοῦ
chapter=1gloss=-sp=det
127710 Κόρε
chapter=1gloss=of Korahsp=noun
phrase:236495 104
phrasefunction_long=Verbal
127711 ἀπώλοντο.
chapter=1gloss=they perishedsp=verb
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

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

verse:253930 12
clause:167811 53
wg=185
phrase:236496 105
phrasefunction_long=Subject
127712 Οὗτοί
chapter=1gloss=Thesesp=pron
phrase:236497 106
phrasefunction_long=Verbal Copulawg=186
127713 εἰσιν
chapter=1gloss=aresp=verb
phrase:236498 107
phrasefunction_long=Predicate
127714 οἱ
chapter=1gloss=the onessp=det
127715 ἐν
chapter=1gloss=insp=prep
127716 ταῖς
chapter=1gloss=thesp=det
127717 ἀγάπαις
chapter=1gloss=love feastssp=noun
127718 ὑμῶν
chapter=1gloss=of yousp=pron
127719 σπιλάδες
chapter=1gloss=hidden reefssp=noun
clause:167812 54
clauserule=V-ADVwg=192
phrase:236499 108
phrasefunction_long=Verbal
127720 συνευωχούμενοι
chapter=1gloss=feasting together [with you]sp=verb
phrase:236500 109
phrasefunction_long=Adverbial
127721 ἀφόβως,
chapter=1gloss=fearlesslysp=adv
clause:167813 55
clauserule=O-Vwg=193
phrase:236501 110
phrasefunction_long=Object
127722 ἑαυτοὺς
chapter=1gloss=themselvessp=pron
phrase:236502 111
phrasefunction_long=Verbalwg=195
127723 ποιμαίνοντες,
chapter=1gloss=shepherdingsp=verb
clause:167814 56
clauserule=P2CLclausetype=Verblesswg=194
phrase:236503 112
phrasefunction_long=Predicatewg=199
127724 νεφέλαι
chapter=1gloss=cloudssp=noun
127725 ἄνυδροι
chapter=1gloss=without watersp=adj
clause:167815 57
clauserule=ADV-Vjunction=subordinatewg=198
phrase:236504 113
phrasefunction_long=Adverbial
127726 ὑπὸ
chapter=1gloss=bysp=prep
127727 ἀνέμων
chapter=1gloss=windssp=noun
phrase:236505 114
phrasefunction_long=Verbalwg=195
127728 παραφερόμεναι,
chapter=1gloss=being carried aboutsp=verb
phrase:236506 115
phrasefunction_long=Predicate
127729 δένδρα
chapter=1gloss=treessp=noun
127730 φθινοπωρινὰ
chapter=1gloss=autumnalsp=adj
127731 ἄκαρπα
chapter=1gloss=without fruitsp=adj
clause:167816 58
clauserule=ADV-Vjunction=subordinatewg=204
phrase:236507 116
phrasefunction_long=Adverbial
127732 δὶς
chapter=1gloss=twicesp=adv
phrase:236508 117
phrasefunction_long=Verbalwg=195
127733 ἀποθανόντα
chapter=1gloss=having diedsp=verb
clause:167817 59
clauserule=V2CLjunction=subordinatewg=205
phrase:236508 117
phrasefunction_long=Verbalwg=195
127734 ἐκριζωθέντα,
chapter=1gloss=having been uprootedsp=verb
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

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

verse:253931 13
clause:167811 53
wg=185
clause:167814 56
clauserule=P2CLclausetype=Verblesswg=194
phrase:236509 118
phrasefunction_long=Predicate
127735 κύματα
chapter=1gloss=wavessp=noun
127736 ἄγρια
chapter=1gloss=wildsp=adj
127737 θαλάσσης
chapter=1gloss=of [the] seasp=noun
clause:167818 60
clauserule=V-Ojunction=subordinatewg=209
phrase:236510 119
phrasefunction_long=Verbalwg=210
127738 ἐπαφρίζοντα
chapter=1gloss=foaming outsp=verb
phrase:236511 120
phrasefunction_long=Objectwg=195
127739 τὰς
chapter=1gloss=-sp=det
127740 ἑαυτῶν
chapter=1gloss=of theirsp=pron
127741 αἰσχύνας,
chapter=1gloss=shamesp=noun
phrase:236512 121
phrasefunction_long=Predicate
127742 ἀστέρες
chapter=1gloss=starssp=noun
127743 πλανῆται,
chapter=1gloss=wanderingsp=noun
clause:167819 61
clauserule=IO-S-ADV-Vwg=214
phrase:236513 122
phrasefunction_long=Indirect Objectwg=215
127744 οἷς
chapter=1gloss=to whomsp=pron
phrase:236514 123
phrasefunction_long=Subjectwg=218
127745
chapter=1gloss=thesp=det
127746 ζόφος
chapter=1gloss=gloomsp=noun
127747 τοῦ
chapter=1gloss=-sp=det
127748 σκότους
chapter=1gloss=of darknesssp=noun
phrase:236515 124
phrasefunction_long=Adverbial
127749 εἰς
chapter=1gloss=tosp=prep
127750 αἰῶνα
chapter=1gloss=[the] agesp=noun
phrase:236516 125
phrasefunction_long=Verbalwg=222
127751 τετήρηται.
chapter=1gloss=has been reservedsp=verb
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

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

verse:253932 14
clause:167820 62
clauserule=V-IO-S-ADVwg=221
phrase:236516 125
phrasefunction_long=Verbalwg=222
127752 Ἐπροφήτευσεν
chapter=1gloss=Prophesiedsp=verb
127753 δὲ
chapter=1gloss=thensp=conj
clause:167820 62
clauserule=V-IO-S-ADVwg=221
phrase:236517 126
phrasefunction_long=Indirect Objectwg=223
127754 καὶ
chapter=1gloss=alsosp=adv
127755 τούτοις
chapter=1gloss=as to thesesp=pron
phrase:236518 127
phrasefunction_long=Subject
127756 ἕβδομος
chapter=1gloss=[the] seventhsp=adj
127757 ἀπὸ
chapter=1gloss=fromsp=prep
127758 Ἀδὰμ
chapter=1gloss=Adamsp=noun
127759 Ἑνὼχ
chapter=1gloss=Enochsp=noun
clause:167821 63
wg=226
phrase:236519 128
phrasefunction_long=Verbalwg=227
127760 λέγων
chapter=1gloss=sayingsp=verb
clause:167822 64
wg=227
phrase:236520 129
phrasefunction_long=Object
127761 Ἰδοὺ
chapter=1gloss=Beholdsp=verb
phrase:236521 130
phrasefunction_long=Verbal
127762 ἦλθεν
chapter=1gloss=has comesp=verb
phrase:236522 131
phrasefunction_long=Subjectwg=228
127763 Κύριος
chapter=1gloss=[the] Lordsp=noun
phrase:236523 132
phrasefunction_long=Adverbial
127764 ἐν
chapter=1gloss=amidstsp=prep
127765 ἁγίαις
chapter=1gloss=holy [ones]sp=adj
127766 μυριάσιν
chapter=1gloss=myriadssp=noun
127767 αὐτοῦ,
chapter=1gloss=of Hissp=pron
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

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

verse:253933 15
clause:167820 62
clauserule=V-IO-S-ADVwg=221
clause:167821 63
wg=226
clause:167822 64
wg=227
clause:167823 65
clauserule=V-O-ADVjunction=coordinatewg=232
phrase:236524 133
phrasefunction_long=Verbal
127768 ποιῆσαι
chapter=1gloss=to executesp=verb
phrase:236525 134
phrasefunction_long=Objectwg=233
127769 κρίσιν
chapter=1gloss=judgmentsp=noun
phrase:236526 135
phrasefunction_long=Adverbial
127770 κατὰ
chapter=1gloss=againstsp=prep
127771 πάντων
chapter=1gloss=allsp=adj
phrase:236526 135
phrasefunction_long=Adverbial
127772 καὶ
chapter=1gloss=andsp=conj
clause:167824 66
clauserule=V-O-ADVjunction=coordinatewg=235
phrase:236527 136
phrasefunction_long=Verbalwg=236
127773 ἐλέγξαι
chapter=1gloss=to convictsp=verb
phrase:236528 137
phrasefunction_long=Objectwg=238
127774 πάντας
chapter=1gloss=allsp=adj
127775 τοὺς
chapter=1gloss=thesp=det
127776 ἀσεβεῖς
chapter=1gloss=ungodlysp=adj
phrase:236529 138
phrasefunction_long=Adverbial
127777 περὶ
chapter=1gloss=concerningsp=prep
127778 πάντων
chapter=1gloss=allsp=adj
127779 τῶν
chapter=1gloss=thesp=det
127780 ἔργων
chapter=1gloss=workssp=noun
127781 ἀσεβείας
chapter=1gloss=of ungodlinesssp=noun
127782 αὐτῶν
chapter=1gloss=of themsp=pron
clause:167825 67
clauserule=ADV-Vwg=245
phrase:236529 138
phrasefunction_long=Adverbial
127783 ὧν
chapter=1gloss=whichsp=pron
phrase:236530 139
phrasefunction_long=Verbalwg=238
127784 ἠσέβησαν
chapter=1gloss=they have done in an ungodly waysp=verb
phrase:236531 140
phrasefunction_long=Adverbial
127785 καὶ
chapter=1gloss=andsp=conj
127786 περὶ
chapter=1gloss=concerningsp=prep
127787 πάντων
chapter=1gloss=allsp=adj
127788 τῶν
chapter=1gloss=thesp=det
127789 σκληρῶν
chapter=1gloss=harsh [things]sp=adj
clause:167826 68
clauserule=O-V-ADV-Swg=251
phrase:236532 141
phrasefunction_long=Object
127790 ὧν
chapter=1gloss=thatsp=pron
phrase:236533 142
phrasefunction_long=Verbalwg=252
127791 ἐλάλησαν
chapter=1gloss=have spokensp=verb
phrase:236534 143
phrasefunction_long=Adverbialwg=253
127792 κατ’
chapter=1gloss=againstsp=prep
127793 αὐτοῦ
chapter=1gloss=Himsp=pron
phrase:236535 144
phrasefunction_long=Subject
127794 ἁμαρτωλοὶ
chapter=1gloss=sinnerssp=adj
127795 ἀσεβεῖς.
chapter=1gloss=ungodlysp=adj
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

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

verse:253934 16
clause:167827 69
clauserule=S-VC-Pjunction=coordinatewg=256
phrase:236535 144
phrasefunction_long=Subject
127796 Οὗτοί
chapter=1gloss=Thesesp=pron
phrase:236536 145
phrasefunction_long=Verbal Copulawg=257
127797 εἰσιν
chapter=1gloss=aresp=verb
phrase:236537 146
phrasefunction_long=Predicatewg=260
127798 γογγυσταί,
chapter=1gloss=grumblerssp=noun
127799 μεμψίμοιροι,
chapter=1gloss=discontentedsp=adj
clause:167828 70
clauserule=ADV-Vjunction=subordinatewg=259
phrase:236538 147
phrasefunction_long=Adverbial
127800 κατὰ
chapter=1gloss=aftersp=prep
127801 τὰς
chapter=1gloss=thesp=det
127802 ἐπιθυμίας
chapter=1gloss=lustssp=noun
127803 αὐτῶν
chapter=1gloss=ownsp=pron
phrase:236539 148
phrasefunction_long=Verbalwg=265
127804 πορευόμενοι,
chapter=1gloss=followingsp=verb
127805 καὶ
chapter=1gloss=andsp=conj
clause:167829 71
clauserule=S-V-O-ADVjunction=coordinatewg=264
phrase:236540 149
phrasefunction_long=Subject
127806 τὸ
chapter=1gloss=thesp=det
127807 στόμα
chapter=1gloss=mouthsp=noun
127808 αὐτῶν
chapter=1gloss=of themsp=pron
phrase:236541 150
phrasefunction_long=Verbal
127809 λαλεῖ
chapter=1gloss=speakssp=verb
phrase:236542 151
phrasefunction_long=Object
127810 ὑπέρογκα,
chapter=1gloss=great swelling [words]sp=adj
clause:167830 72
clauserule=V-O-ADVjunction=subordinatewg=267
phrase:236543 152
phrasefunction_long=Verbal
127811 θαυμάζοντες
chapter=1gloss=flatteringsp=verb
phrase:236544 153
phrasefunction_long=Objectwg=268
127812 πρόσωπα
chapter=1gloss=facessp=noun
phrase:236545 154
phrasefunction_long=Adverbial
127813 ὠφελείας
chapter=1gloss=profitsp=noun
127814 χάριν.
chapter=1gloss=for the sake ofsp=prep
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

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

verse:253935 17
clause:167831 73
wg=271
phrase:236546 155
phrasefunction_long=Subject
127815 Ὑμεῖς
chapter=1gloss=Yousp=pron
127816 δέ,
chapter=1gloss=howeversp=conj
clause:167831 73
wg=271
127817 ἀγαπητοί,
chapter=1gloss=belovedsp=adj
phrase:236547 156
phrasefunction_long=Verbalwg=273
127818 μνήσθητε
chapter=1gloss=remembersp=verb
phrase:236548 157
phrasefunction_long=Object
127819 τῶν
chapter=1gloss=thesp=det
127820 ῥημάτων
chapter=1gloss=wordssp=noun
127821 τῶν
chapter=1gloss=-sp=det
clause:167832 74
clauserule=V-ADVwg=276
phrase:236549 158
phrasefunction_long=Verbalwg=277
127822 προειρημένων
chapter=1gloss=having been spoken beforehandsp=verb
phrase:236550 159
phrasefunction_long=Adverbial
127823 ὑπὸ
chapter=1gloss=bysp=prep
127824 τῶν
chapter=1gloss=thesp=det
127825 ἀποστόλων
chapter=1gloss=apostlessp=noun
127826 τοῦ
chapter=1gloss=of thesp=det
127827 Κυρίου
chapter=1gloss=Lordsp=noun
127828 ἡμῶν
chapter=1gloss=of ussp=pron
127829 Ἰησοῦ
chapter=1gloss=Jesussp=noun
127830 Χριστοῦ,
chapter=1gloss=Christsp=noun
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

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

verse:253936 18
127831 ὅτι
chapter=1gloss=thatsp=conj
clause:167833 75
wg=286
phrase:236551 160
phrasefunction_long=Verbal
127832 ἔλεγον
chapter=1gloss=they were sayingsp=verb
phrase:236552 161
phrasefunction_long=Indirect Objectwg=288
127833 ὑμῖν
chapter=1gloss=to yousp=pron
clause:167834 76
clauserule=P-VC-Swg=287
phrase:236553 162
phrasefunction_long=Predicate
127834 Ἐπ’
chapter=1gloss=Insp=prep
127835 ἐσχάτου
chapter=1gloss=[the] lastsp=adj
127836 τοῦ
chapter=1gloss=-sp=det
127837 χρόνου
chapter=1gloss=timesp=noun
phrase:236554 163
phrasefunction_long=Verbal Copulawg=291
127838 ἔσονται
chapter=1gloss=there will besp=verb
phrase:236555 164
phrasefunction_long=Subjectwg=293
127839 ἐμπαῖκται
chapter=1gloss=scofferssp=noun
clause:167835 77
clauserule=V-ADVjunction=subordinatewg=292
phrase:236556 165
phrasefunction_long=Adverbial
127840 κατὰ
chapter=1gloss=aftersp=prep
127841 τὰς
chapter=1gloss=-sp=det
127842 ἑαυτῶν
chapter=1gloss=their ownsp=pron
127843 ἐπιθυμίας
chapter=1gloss=passionssp=noun
phrase:236557 166
phrasefunction_long=Verbalwg=293
127844 πορευόμενοι
chapter=1gloss=followingsp=verb
phrase:236558 167
phrasefunction_long=Adverbial
127845 τῶν
chapter=1gloss=-sp=det
127846 ἀσεβειῶν.
chapter=1gloss=of ungodlinessessp=noun
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

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

verse:253937 19
clause:167836 78
clauserule=S-VC-Pwg=299
phrase:236559 168
phrasefunction_long=Subject
127847 Οὗτοί
chapter=1gloss=Thesesp=pron
phrase:236560 169
phrasefunction_long=Verbal Copulawg=300
127848 εἰσιν
chapter=1gloss=aresp=verb
phrase:236561 170
phrasefunction_long=Predicate
127849 οἱ
chapter=1gloss=thosesp=det
clause:167837 79
clauserule=V2CLwg=302
phrase:236562 171
phrasefunction_long=Verbalwg=300
127850 ἀποδιορίζοντες,
chapter=1gloss=causing divisionssp=verb
phrase:236563 172
phrasefunction_long=Predicate
127851 ψυχικοί,
chapter=1gloss=worldly-mindedsp=adj
clause:167838 80
clauserule=O-ADV-Vjunction=subordinatewg=303
phrase:236564 173
phrasefunction_long=Object
127852 Πνεῦμα
chapter=1gloss=[the] Spiritsp=noun
phrase:236565 174
phrasefunction_long=Adverbial
127853 μὴ
chapter=1gloss=notsp=adv
phrase:236566 175
phrasefunction_long=Verbal
127854 ἔχοντες.
chapter=1gloss=havingsp=verb
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "

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

verse:253938 20
clause:167839 81
wg=306
phrase:236567 176
phrasefunction_long=Subject
127855 ὑμεῖς
chapter=1gloss=Yousp=pron
127856 δέ,
chapter=1gloss=howeversp=conj
clause:167839 81
wg=306
127857 ἀγαπητοί,
chapter=1gloss=belovedsp=adj
clause:167840 82
wg=308
phrase:236568 177
phrasefunction_long=Verbal
127858 ἐποικοδομοῦντες
chapter=1gloss=building upsp=verb
phrase:236569 178
phrasefunction_long=Objectwg=309
127859 ἑαυτοὺς
chapter=1gloss=yourselvessp=pron
phrase:236570 179
phrasefunction_long=Adverbial
127860 τῇ
chapter=1gloss=in thesp=det
127861 ἁγιωτάτῃ
chapter=1gloss=most holysp=adj
127862 ὑμῶν
chapter=1gloss=of yousp=pron
127863 πίστει,
chapter=1gloss=faithsp=noun
clause:167841 83
clauserule=ADV-Vwg=312
phrase:236570 179
phrasefunction_long=Adverbial
127864 ἐν
chapter=1gloss=insp=prep
127865 Πνεύματι
chapter=1gloss=[the] Spiritsp=noun
127866 Ἁγίῳ
chapter=1gloss=Holysp=adj
phrase:236571 180
phrasefunction_long=Verbal
127867 προσευχόμενοι,
chapter=1gloss=prayingsp=verb
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "Search0 = '''\n", "book book=Jude\n", " chapter chapter=1\n", " \n", " verse \n", "'''\n", "Search0 = NA.search(Search0)\n", "NA.show(Search0, start=1, end=20, condensed=True, extraFeatures={'sp','wg','clausetype','gloss','clauserule', 'junction','phrasefunction_long', }, withNodes=True)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Step 3 dump some structure information" ] }, { "cell_type": "code", "execution_count": 233, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "A heading is a tuple of pairs (node type, feature value)\n", "\tof node types and features that have been configured as structural elements\n", "These 3 structural elements have been configured\n", "\tnode type book with heading feature book\n", "\tnode type chapter with heading feature chapter\n", "\tnode type verse with heading feature verse\n", "You can get them as a tuple with T.headings.\n", "\n", "Structure API:\n", "\tT.structure(node=None) gives the structure below node, or everything if node is None\n", "\tT.structurePretty(node=None) prints the structure below node, or everything if node is None\n", "\tT.top() gives all top-level nodes\n", "\tT.up(node) gives the (immediate) parent node\n", "\tT.down(node) gives the (immediate) children nodes\n", "\tT.headingFromNode(node) gives the heading of a node\n", "\tT.nodeFromHeading(heading) gives the node of a heading\n", "\tT.ndFromHd complete mapping from headings to nodes\n", "\tT.hdFromNd complete mapping from nodes to headings\n", "\tT.hdMult are all headings with their nodes that occur multiple times\n", "\n", "There are 1097 structural elements in the dataset.\n", "\n" ] } ], "source": [ "T.structureInfo()" ] }, { "cell_type": "code", "execution_count": 234, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "20619 is an phrase which is not configured as a structure type\n" ] } ], "source": [ "T.structure(20619)" ] }, { "cell_type": "code", "execution_count": 232, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'Availability': 'Creative Commons Attribution 4.0 International (CC BY 4.0)',\n", " 'Converter_author': 'Tony Jurg, Vrije Universiteit Amsterdam, Netherlands',\n", " 'Converter_execution': 'Tony Jurg, Vrije Universiteit Amsterdam, Netherlands',\n", " 'Converter_version': '0.1 (Initial)',\n", " 'Convertor_source': 'https://github.com/tonyjurg/n1904_lft',\n", " 'Data source': 'MACULA Greek Linguistic Datasets, available at https://github.com/Clear-Bible/macula-greek/tree/main/Nestle1904/lowfat',\n", " 'Editors': 'Nestle',\n", " 'Name': 'Greek New Testament (NA1904)',\n", " 'TextFabric version': '11.2.3',\n", " 'Version': '1904',\n", " 'fmt:text-orig-full': '{word}',\n", " 'sectionFeatures': 'book,chapter,verse',\n", " 'sectionTypes': 'book,chapter,verse',\n", " 'structureFeatures': 'book,chapter,verse',\n", " 'structureTypes': 'book,chapter,verse',\n", " 'writtenBy': 'Text-Fabric',\n", " 'dateWritten': '2023-04-06T16:41:52Z'}" ] }, "execution_count": 232, "metadata": {}, "output_type": "execute_result" } ], "source": [ "TF.features['otext'].metaData\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Running text fabric browser \n", "##### [back to TOC](#TOC)" ] }, { "cell_type": "code", "execution_count": 33, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "This is Text-Fabric 11.2.3\n", "Connecting to running kernel via 19685\n", "Connecting to running webserver via 29685\n", "Opening app in browser\n", "Press to stop the TF browser\n" ] } ], "source": [ "!text-fabric app " ] }, { "cell_type": "code", "execution_count": 34, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "This is Text-Fabric 11.2.3\n", "Killing processes:\n", "kernel % 10804: 19685 app: terminated\n", "web % 3564: 29685 app: terminated\n", "text-fabric % 10076 app: terminated\n", "3 processes done.\n" ] } ], "source": [ "!text-fabric app -k" ] }, { "cell_type": "code", "execution_count": 44, "metadata": {}, "outputs": [ { "ename": "NameError", "evalue": "name 'tf' is not defined", "output_type": "error", "traceback": [ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)", "Input \u001b[1;32mIn [44]\u001b[0m, in \u001b[0;36m\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[0m \u001b[43mtf\u001b[49m\u001b[38;5;241m.\u001b[39mcore\u001b[38;5;241m.\u001b[39mnodes\u001b[38;5;241m.\u001b[39mNodes\u001b[38;5;241m.\u001b[39motypeRank\n", "\u001b[1;31mNameError\u001b[0m: name 'tf' is not defined" ] } ], "source": [ "tf.core.nodes.Nodes.otypeRank" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "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.9.12" }, "toc": { "base_numbering": 1, "nav_menu": {}, "number_sections": true, "sideBar": true, "skip_h1_title": false, "title_cell": "Table of Contents", "title_sidebar": "Contents", "toc_cell": true, "toc_position": { "height": "calc(100% - 180px)", "left": "10px", "top": "150px", "width": "321.391px" }, "toc_section_display": true, "toc_window_display": true } }, "nbformat": 4, "nbformat_minor": 4 }