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.
(if not yet installed)
TF itself
pip3 install text-fabric
When using Jupyter notebook
You can install Jupyter Notebook by command:
pip3 install jupyter
When using Anaconda
A platform like Anaconda allows for easy installation of Jupyter.
It is advisable to define a new environment in Anaconda on which Text-Fabric can be installed (documentation).
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 N1904LFT
) 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 N1904LFT
.
# load the app and data
N1904LFT = use ("tonyjurg/Nestle1904LFT", version="0.6", hoist=globals())
Locating corpus resources ...
The requested app is not available offline ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/app not found
The requested data is not available offline ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 not found
| 0.19s T otype from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 2.50s T oslots from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.46s T verse from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.61s T word from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.51s T after from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.60s T wordtranslit from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.50s T chapter from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.62s T normalized from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.61s T unicode from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.57s T book from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.60s T wordunacc from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | | 0.06s C __levels__ from otype, oslots, otext | | 1.82s C __order__ from otype, oslots, __levels__ | | 0.07s C __rank__ from otype, __order__ | | 3.26s C __levUp__ from otype, oslots, __rank__ | | 1.93s C __levDown__ from otype, __levUp__, __rank__ | | 0.22s C __characters__ from otext | | 0.95s C __boundary__ from otype, oslots, __rank__ | | 0.04s C __sections__ from otype, oslots, otext, __levUp__, __levels__, book, chapter, verse | | 0.23s C __structure__ from otype, oslots, otext, __rank__, __levUp__, book, chapter, verse | 0.45s T booknumber from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.51s T bookshort from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.48s T case from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.33s T clausetype from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.58s T containedclause from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.42s T degree from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.58s T gloss from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.49s T gn from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.03s T headverse from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.33s T junction from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.60s T lemma from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.56s T lex_dom from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.58s T ln from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.42s T markafter from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.43s T markbefore from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.44s T markorder from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.46s T monad from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.46s T mood from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.52s T morph from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.54s T nodeID from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.48s T nu from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.48s T number from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.43s T person from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.43s T punctuation from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.64s T ref from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.64s T reference from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.48s T roleclausedistance from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.46s T sentence from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.50s T sp from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.50s T sp_full from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.54s T strongs from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.44s T subj_ref from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.43s T tense from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.45s T type from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.44s T voice from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.39s T wgclass from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.33s T wglevel from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.36s T wgnum from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.35s T wgrole from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.35s T wgrolelong from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.39s T wgrule from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.33s T wgtype from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.50s T wordlevel from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.50s T wordrole from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6 | 0.52s T wordrolelong from ~/text-fabric-data/github/tonyjurg/Nestle1904LFT/tf/0.6
Name | # of nodes | # slots / node | % coverage |
---|---|---|---|
book | 27 | 5102.93 | 100 |
chapter | 260 | 529.92 | 100 |
verse | 7943 | 17.35 | 100 |
sentence | 8011 | 17.20 | 100 |
wg | 105430 | 6.85 | 524 |
word | 137779 | 1.00 | 100 |
3
tonyjurg/Nestle1904LFT
C:/Users/tonyj/text-fabric-data/github/tonyjurg/Nestle1904LFT/app
''
orig_order
verse
book
chapter
none
unknown
NA
''
0
text-orig-full
https://github.com/tonyjurg/Nestle1904LFT/blob/main/docs/
about
https://github.com/tonyjurg/Nestle1904LFT
https://github.com/tonyjurg/Nestle1904LFT/blob/main/docs/features/<feature>.md
layout-orig-full
}True
C:/Users/tonyj/text-fabric-data/github/tonyjurg/Nestle1904LFT/_temp
Nestle 1904 (Low Fat Tree)
10.5281/zenodo.10182594
tonyjurg
/tf
Nestle1904LFT
Nestle1904LFT
0.6
https://learner.bible/text/show_text/nestle1904/
Show this on the Bible Online Learner website
en
https://learner.bible/text/show_text/nestle1904/<1>/<2>/<3>
{webBase}/word?version={version}&id=<lid>
True
True
{book}
''
True
True
{chapter}
''
0
#{sentence} (start: {book} {chapter}:{headverse})
''
True
chapter verse
{book} {chapter}:{verse}
''
0
#{wgnum}: {wgtype} {wgclass} {clausetype} {wgrole} {wgrule} {junction}
''
True
lemma
gloss
chapter verse
grc
# The following will push the Text-Fabric stylesheet to this notebook (to facilitate proper display with notebook viewer)
N1904LFT.dh(N1904LFT.getCss())
# load the app and data with additional features
N1904LFT = use ("tonyjurg/Nestle1904LFT:latest", mod=f"annotation/banks/sim/tf" hoist=globals())
Input In [7] N1904LFT = use ("tonyjurg/Nestle1904LFT:latest", 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:
IMPORTANT: When working with multiple corpora, do not add 'hoist=globals()' to the invocation!. See the comments on section hoist of function use.
In order to access to the variables F
, L
, T
, and TF
for the relevant CORPUS dataset, you need to first issue api = A.api
like in the following example. This example will create two lists containing the nodes for that corpus where feature word
has value λόγος
. See also Hoisting.