This notebook gets you started with using Text-Fabric for coding in cuneiform tablet transcriptions.
Familiarity with the underlying data model is recommended.
For provenance, see the documentation: about.
If you start computing with this tutorial, first copy its parent directory to somewhere else, outside your repository. If you pull changes from the repository later, your work will not be overwritten. Where you put your tutorial directory is up to you. It will work from any directory.
Text-Fabric will get the data for you and store it on your system.
If you have cloned the github repo with the data, Nino-cunei/uruk, your data is already in place, and nothing will be downloaded.
Otherwise, on first run, Text-Fabric will load the data and store it in the folder
text-fabric-data
in your home directory.
This only happens if the data is not already there.
Not only transcription data will be downloaded, also linearts and photos. These images are contained in a zipfile of 550 MB, so take care that you have a good internet connection when it comes to downloading the images.
Navigate to this directory in a terminal and say
jupyter notebook
(just literally).
Your browser opens with a directory view, and you'll see start.ipynb
.
Click on it. A new browser tab opens, and a Python engine has been allocated to this
notebook.
Now we are ready to compute .
The next cell is a code cell that can be executed if you have downloaded this
notebook and have issued the jupyter notebook
command.
You execute a code cell by standing in it and press Shift Enter
.
%load_ext autoreload
%autoreload 2
import sys, os
from tf.app import use
View the next cell as an incantation. You just have to say it to get things underway.
For the very last version, use hot
.
For the latest release, use latest
.
If you have cloned the repos (TF app and data), use clone
.
If you do not want/need to upgrade, leave out the checkout specifiers.
A = use("Nino-cunei/uruk", hoist=globals())
This is Text-Fabric 9.2.2 Api reference : https://annotation.github.io/text-fabric/tf/cheatsheet.html 33 features found and 0 ignored
The output shows some statistics about the images found in the Uruk data.
Then there are links to the documentation.
Tip: open them, and have a quick look.
Every notebook that you set up with Cunei
will have such links.
GitHub and NBViewer
If you have made your own notebook, and used this incantation, and pushed the notebook to GitHub, links to the online version of your notebook on GitHub and NBViewer will be generated and displayed.
By the way, GitHub shows notebooks nicely. Sometimes NBViewer does it better, although it fetches exactly the same notebook from GitHub.
NBViewer is handy to navigate all the notebooks of a particular organization. Try the Nino-cunei starting point.
These links you can share with colleagues.
len(F.otype.s("sign"))
140094
We show the photo and lineart of a tablet, to whet your appetite.
example = T.nodeFromSection(("P005381",))
A.photo(example)
Note that you can click on the photo to see a better version on CDLI.
Here comes the lineart:
A.lineart(example)
A pretty representation of the transcription with embedded lineart for quads and signs:
A.pretty(example, withNodes=True)
We can suppress the lineart:
A.pretty(example, showGraphics=False)
The transliteration:
A.getSource(example)
['&P005381 = MSVO 3, 70', '#atf: lang qpc ', '@obverse ', '@column 1 ', '1.a. 2(N14) , SZE~a SAL TUR3~a NUN~a ', '1.b. 3(N19) , |GISZ.TE| ', '2. 1(N14) , NAR NUN~a SIG7 ', '3. 2(N04)# , PIRIG~b1 SIG7 URI3~a NUN~a ', '@column 2 ', '1. 3(N04) , |GISZ.TE| GAR |SZU2.((HI+1(N57))+(HI+1(N57)))| GI4~a ', '2. , GU7 AZ SI4~f ', '@reverse ', '@column 1 ', '1. 3(N14) , SZE~a ', '2. 3(N19) 5(N04) , ', '3. , GU7 ', '@column 2 ', '1. , AZ SI4~f ']
Now the lines ans cases of this tablet in a table:
table = []
for sub in L.d(example):
if F.otype.v(sub) in {"line", "case"}:
table.append((sub,))
A.table(table, showGraphics=False)
n | p | line |
---|---|---|
1 | P005381 obverse:1:1 | 1a2(N14) SZE~a SAL TUR3~a NUN~a 1b3(N19) |GISZ.TE| |
2 | P005381 obverse:1:1 | 1a2(N14) SZE~a SAL TUR3~a NUN~a |
3 | P005381 obverse:1:1 | 1b3(N19) |GISZ.TE| |
4 | P005381 obverse:1:2 | 1(N14) NAR NUN~a SIG7 |
5 | P005381 obverse:1:3 | 2(N04) PIRIG~b1 SIG7 URI3~a NUN~a |
6 | P005381 obverse:2:1 | 3(N04) |GISZ.TE| GAR |SZU2.((HI+1(N57))+(HI+1(N57)))| GI4~a |
7 | P005381 obverse:2:2 | GU7 AZ SI4~f |
8 | P005381 reverse:1:1 | 3(N14) SZE~a |
9 | P005381 reverse:1:2 | 3(N19) 5(N04) |
10 | P005381 reverse:1:3 | GU7 |
11 | P005381 reverse:2:1 | AZ SI4~f |
We can include the lineart in plain displays:
A.table(table, showGraphics=True)
n | p | line |
---|---|---|
1 | P005381 obverse:1:1 | 1a2(N14) SZE~a SAL TUR3~a NUN~a 1b3(N19) |GISZ.TE| |
2 | P005381 obverse:1:1 | 1a2(N14) SZE~a SAL TUR3~a NUN~a |
3 | P005381 obverse:1:1 | 1b3(N19) |GISZ.TE| |
4 | P005381 obverse:1:2 | 1(N14) NAR NUN~a SIG7 |
5 | P005381 obverse:1:3 | 2(N04) PIRIG~b1 SIG7 URI3~a NUN~a |
6 | P005381 obverse:2:1 | 3(N04) |GISZ.TE| GAR |SZU2.((HI+1(N57))+(HI+1(N57)))| GI4~a |
7 | P005381 obverse:2:2 | GU7 AZ SI4~f |
8 | P005381 reverse:1:1 | 3(N14) SZE~a |
9 | P005381 reverse:1:2 | 3(N19) 5(N04) |
10 | P005381 reverse:1:3 | GU7 |
11 | P005381 reverse:2:1 | AZ SI4~f |
This is just the beginning.
In the next chapters we show you how to