#!/usr/bin/env python # coding: utf-8 # # Loading Text-Fabric (Nestle1904 GBI nodes) # # Basic instructions on loading the Text-Fabric and start using it on your system. # ## Table of content # # ### Loading program and dataset # * [Step 1: Install Text-Fabric (if not yet installed)](#first-bullet) # * [Step 2: Raise rate limit on Github](#second-bullet) # * [Step 3: Load Text Fabric code](#third-bullet) # * [Step 4: Load app and data](#fourth-bullet) # # ### Some basic usage example # [Example 1: show all object phrases in clauses](#fifth-bullet) # ## Loading program and dataset # # ### Step 1: Install Text-Fabric (if not yet installed) # ##### [back to TOC](#TOC) # #### Python # # You need to have Python on your system. Most systems have it out of the box, # but alas, that is python2 and we need at least python **3.6**. # # Install it from [python.org](https://www.python.org) or from # [Anaconda](https://www.anaconda.com/products/distribution). # # #### TF itself # # ``` # pip3 install text-fabric # ``` # # #### When using Jupyter notebook # # You need [Jupyter](http://jupyter.org) or a platform like [Anaconda](https://www.anaconda.com/products/distribution) which includes Jupyter. # # If it is not already installed: # # ``` # pip3 install jupyter # ``` # ### Step 2: Raise rate limit on Github # ##### [back to TOC](#TOC) # # It may be required to increase rate limit for GitHub. [See instructions](https://annotation.github.io/text-fabric/tf/advanced/repo.html) on aquiring and setting the GHPERS variable. # See [here](https://www.howtogeek.com/789660/how-to-use-windows-cmd-environment-variables/#autotoc_anchor_2) if you want to set the varibale on windows using the command prompt. # ### Step 3: Load TextFabric code # ##### [back to TOC](#TOC) # In[1]: get_ipython().run_line_magic('load_ext', 'autoreload') get_ipython().run_line_magic('autoreload', '2') # In[2]: # Loading the New Testament TextFabric code from tf.fabric import Fabric from tf.app import use # ### Step 4: Load app and data # ##### [back to TOC](#TOC) # In[14]: # load the app and data N1904GBI = use ("tonyjurg/Nestle1904GBI", hoist=globals()) # # Some basic usage example # ##### [back to TOC](#TOC) # # ### Example 1: show all object phrases in clauses # # The following example will query (and indicate) phrases with function 'O' (=Object). This is done by selecting versed containing the value 'O' for feature 'phrasefunction' belonging to node type 'phrase'. See also the [feature description of 'phrasefunction'](https://tonyjurg.github.io/Nestle1904GBI/features/phrasefunction.html). It starts with examining at the first verse of Matthews. The first Object phrase in Matthew is found in verse 2. The display is limited to the first two verses found containing an Object phrase. # In[20]: Search0 = ''' book book=Matthew phrase phrasefunction=O ''' Search0 = NA.search(Search0) N1904GBI.show(Search0, start=1, end=2, condensed=True, extraFeatures={'sp', 'clausetype'}, multiFeatures=True) # In[ ]: