Work in progress
Basic instructions on loading the Text-Fabric and start using it on your system. It will provide examples of the various ways you can invoke Text-Fabric.
Some discussion related to versions
The instructions in this section are only required once to be executed. This will result in the Text-Fabric code being available for loading into memory of your system.
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 or from Anaconda.
It may be required to increase rate limit for GitHub. See instructions on aquiring and setting the GHPERS variable. See here if you want to set the varibale on windows using the command prompt.
The instructions in this section are required once to be executed each time you want to use Text_Fabric. It will load the Text-Fabric code and data into memory.
%load_ext autoreload
%autoreload 2
# Loading the Text-Fabric code
# Note: it is assumed Text-Fabric is installed in your environment
from tf.fabric import Fabric
from tf.app import use
The following invocation of function use
loads all features of the corpus (and extra modules, see section 4). It creates an variable (in this example N1904GBI
) with its associated methods and function, the 'Advanced API'. In the 'cheat sheet' there are many references to A.*something*
. In this notebook they should be read as N1904GBI
.
# load the app and data
N1904GBI = use ("tonyjurg/Nestle1904GBI", version="0.4", hoist=globals())
Locating corpus resources ...
Name | # of nodes | # slots/node | % coverage |
---|---|---|---|
book | 27 | 5102.93 | 100 |
chapter | 260 | 529.92 | 100 |
sentence | 5720 | 24.09 | 100 |
verse | 7943 | 17.35 | 100 |
clause | 16124 | 8.54 | 100 |
phrase | 72674 | 1.90 | 100 |
word | 137779 | 1.00 | 100 |
This step is stricly speaking not required when using Text-Fabric only localy. However, when making it available for tools like nbviewer, including this statement will show very handy since it ensures proper formatting. It is using function getCss
to obtain all style information and uses function dh
to push it as HTML towards the Jupyter NoteBook.
# The following will push the Text-Fabric stylesheet to this notebook (to facilitate proper display with notebook viewer)
N1904GBI.dh(N1904GBI.getCss())
# load the app and data with ad
N1904GBIMOD = use ("tonyjurg/Nestle1904GBI", version="0.4", mod=f"annotation/banks/sim/tf" hoist=globals())
Input In [6] N1904GBIMOD = use ("tonyjurg/Nestle1904GBI", version="0.4", mod=f"annotation/banks/sim/tf" hoist=globals()) ^ SyntaxError: invalid syntax
Warning: to use this method it is critical to verify that ALL the following match:
F.otype.all
or values found in file otype.tf
).If these conditions are met, it is possible to copy the .tf files from the donor dataset to your local Text-Fabric directory..
Some additional dataset that should work with this Text-Fabric implementation are:
Dataset location | additions |
---|---|
CenterBLC | additional grammatical features, Bible Online Learner details |
Further reference module tf.about.datasharing
When using multiple Text-Fabric corpora there are a few things to take care of.
The most important are to invocate function use
twice using a different variables (name) to create two Advanced API's. In the following example two A
(Advanced API) objects are created named CORPUS1 and CORPUS2:
CORPUS1 = use ()
CORPUS2 = use ()
IMPORTANT: When working with multiple corpora, do not add 'hoist=globals()' to the invocation!. See the comments on section hoist of function use.