%load_ext autoreload
%autoreload 2
from tf.app import use
A = use("Nino-cunei/oldbabylonian", hoist=globals())
This is Text-Fabric 9.2.2 Api reference : https://annotation.github.io/text-fabric/tf/cheatsheet.html 67 features found and 0 ignored
We pick an example face with which we illustrate many ways to represent cuneiform text.
# exampleFace = ('P509373', 'obverse')
# exampleFace = ('P292990', 'obverse')
exampleFace = ("P292987", "reverse")
f = T.nodeFromSection(exampleFace)
lines = L.d(f, otype="line")
The most basic way is to show the source material for each line, which is in the feature srcLn
.
This feature has been filled by mere copying the numbered lines from the CDLI ATF sources.
for ln in lines:
print(F.srcLn.v(ln))
1. nu-uk!(AZ)-ta-la-al-li-mu 2. dumu ku3#-{d}nanna 3. i-he#-[er]-ri# 4. la-ma qa2-as-su2 5. isz#-ku-nu 6. at#-ta hi-i-ri 7. u3 a-na 8. i-szar-ku-bi
The TF API supports text formats. Text formats make selections and apply templates and styles based on the analysed features of the text. For example: a text-format may ignore flags or clusters, or format numerals in special ways.
Text formats are not baked into TF, but they are defined in the feature otext
of the corpus.
Moreover, for this corpus a TF app has been build that defines additional text-formats.
Whereas the formats defined in otext
are strictly plain text formats, the formats
defined in the app are able to use typographic styles to shape the text, such as bold, italic, colours, etc.
Here is the list of all formats.
T.formats
{'text-orig-full': 'sign', 'text-orig-plain': 'sign', 'text-orig-rich': 'sign', 'text-orig-unicode': 'sign', 'layout-orig-rich': 'sign', 'layout-orig-unicode': 'sign'}
for ln in lines:
print(ln, T.text(ln))
A.plain(ln)
239995 nu-uk!(AZ)-ta-la-al-li-mu
239996 dumu ku3#-{d}nanna
239997 i-he#-[er]-ri#
239998 la-ma qa2-as-su2
239999 isz#-ku-nu
240000 at#-ta hi-i-ri
240001 u3 a-na
240002 i-szar-ku-bi
The plain()
function focuses on the contents, and instead of the line number, it gives a full specification
of the location, linked to the online source on CDLI.
But we can omit the locations:
for ln in lines:
A.plain(ln, withPassage=False)
text-orig-plain
¶This is a somewhat reduced format. It omits all flags and bracketing constructs.
For clarity, adjacent signs are separated with a ⁼
character.
for ln in lines:
A.plain(ln, fmt="text-orig-plain")
text-orig-rich
¶This format is a bit prettier: instead of the strict ASCII encoding used by the CDLI archive, it uses characters with diacritics.
There is no flag/cluster information in this representation.
for ln in lines:
A.plain(ln, fmt="text-orig-rich")
text-orig-unicode
¶This format uses the Cuneiform Unicode characters.
Numerals with repeats are represented by placing that many copies of the character in question.
Readings that could not be found in the mapping we use, appear in latin characters.
There is no flag/cluster information in this representation.
for ln in lines:
A.plain(ln, fmt="text-orig-unicode")
for ln in lines:
A.plain(ln, fmt="layout-orig-rich")
layout-orig-unicode
¶This format looks like text-orig-unicode
, but now we re-introduce the flags and clusters by specific
layout devices.
See below for detailed examples.
for ln in lines:
A.plain(ln, fmt="layout-orig-unicode")
Here is the text of the face in each of the plain text formats, i.e. no additional HTML formatting is applied.
The ultimate of graphical display is by means of the pretty()
function.
This display is less useful for reading, but instead optimized for showing all information that you might wish for.
It shows a base representation according to a text format of your choice
(here we choose layout-orig-rich
), and it shows the values
of a standard set of features.
w = F.otype.s("word")[1]
F.atf.v(w)
'_{d}suen_-i-[din-nam]'
A.pretty(w)
A.pretty(w, fmt="layout-orig-unicode", withNodes=True)
By default, pretty displays descend to the word level, but you can also descend to the sign level:
A.pretty(w, baseTypes="sign")
A.pretty(w, fmt="layout-orig-unicode", baseTypes="sign", withNodes=True)
Later on, in the search tutorial we see that pretty()
can also display other features,
even features that you or other people have created and added later.
Here we call for the feature atf
, which shows the original ATF for the sign in question
excluding the bracketing characters.
Consult the feature documentation to see what information is stored in all the features.
We show it with node numbers, but you could leave them out in an obvious way.
A.pretty(f, extraFeatures="atf", fmt="layout-orig-rich", withNodes=True)
We do not see much, because the default condense type is line
, and a document
is bigger than that.
Objects bigger than de condense type will be abbreviated to a label that indicates their identity,
not their contents.
But we can override this by adding full=True
.
See also the documentation on pretty
.
A.pretty(f, extraFeatures="atf", fmt="layout-orig-rich", withNodes=True, full=True)
We give detailed examples of how the material is styled in the layout-
formats.
We show the representation of all kinds of signs and also what the influence of clustering and flags are.
Here are the design principles:
# ? ! *
cause the preceding sign to be in bold#
and missing [ ]
text is blurry and in grey?
and uncertain ( )
text is in italics!
and supplied < >
text is overlined, supplied text is in blue<< >>
text has a strike-through and is in red*
text is underlinedNumerals are written with repeats/fractions and the repeated material is in ⌈ ⌉
.
If represented in cuneiform unicode, repeated material is actually repeated that many times, and the repeat number and
the brackets are not shown.
Ligatures (the x
operator as in kux(DU)
) are written with the ␣
character between the operands, and the second
operand (DU
) is written between ⌈ ⌉
.
Corrections (as in ku!(LU)
) are written as ku=⌈LU⌉
.
Just a quick overview of the sign types:
F.type.freqList("sign")
(('reading', 188292), ('unknown', 8761), ('numeral', 2184), ('ellipsis', 1617), ('grapheme', 1272), ('commentline', 969), ('complex', 122), ('comment', 2))
lines = (
(("P510536", "obverse", "15"), ("cluster: language", [1, 2, 3])),
(("P509373", "obverse", "1"), ("cluster: determinative", [3])),
(("P509375", "obverse", "3"), ("cluster: missing", [1, 2, 3, 6])),
(("P510736", "reverse", "5"), ("cluster: uncertain", [6, 7, 8])),
(("P510526", "obverse", "8"), ("cluster: supplied", [7, 8, 9])),
(("P373056", "obverse", "11"), ("cluster: excised", [9, 10])),
(("P510536", "obverse", "8"), ("flag: damage", [1, 2, 3, 6, 9, 10])),
(("P297171", "reverse", "1"), ("flag: question", [3, 4, 5])),
(("P510536", "obverse", "15"), ("flag: remarkable", [6])),
(("P387299", "obverse", "5"), ("flag: collated", [1])),
(("P510534", "reverse", "20'"), ("flag: damage + question", [3])),
(("P497780", "reverse", "4"), ("flag: damage + remarkable", [1])),
(("P305744", "obverse", "10"), ("flag: damage + collated", [5])),
(("P305799", "left side", "1"), ("flag: collated + remarkable", [3, 5])),
(("P305806", "reverse", "1"), ("flag: remarkable + question + collated", [3])),
(("P305744", "obverse", "10"), ("flag collated in cluster missing", [6, 7])),
(("P275088", "reverse", "2"), ("sign: comment", [1])),
(("P510636", "obverse", "3"), ("sign: grapheme", [9])),
(("P386451", "reverse", "11"), ("sign: correction", [6])),
(("P312032", "left edge", "1"), ("sign: numeral", [4, 6])),
(("P492284", "obverse", "5"), ("sign: ligature", [2, 3])),
(("P509373", "reverse", "18'"), ("sign: unknown and ellipsis", [7, 8])),
)
for (line, (desc, positions)) in lines:
ln = T.nodeFromSection(line)
A.dm("---\n# {}\n\nLocation: {} {}:{}".format(desc, *line))
s = L.d(ln, otype="sign")[0]
highlights = {s + p - 1 for p in positions}
print(*A.getSource(ln), sep="\n")
A.plain(ln, fmt="layout-orig-rich", highlights=highlights)
A.plain(ln, fmt="layout-orig-unicode", highlights=highlights)
A.pretty(
ln,
extraFeatures="atf",
fmt="text-orig-rich",
baseTypes="sign",
highlights=highlights,
)
15. _ma2 hi-a_ as-sa3-ki!-ip
1. [a-na] _{d}suen_-i-[din-nam]
3. [um-ma x]-na-su-[x]-ma
5. ut,-t,e4-eh-[hu-u2-(szu-nu-ti)]
8. a-na da-mi-iq-tim <li-ki-il>
11. pu-ru#-us# a-na-ku i-na <<i-na>>
8. tup#-pi2# ARAD#-i3-li2-szu# [is3-ni]-qa2#-am#
1. ki-ma UD?-AD?-DI? i-na-ad-di-[x]
15. _ma2 hi-a_ as-sa3-ki!-ip
5. _8(gesz2)* sze gur_ i-ib-szu-u2
20'. li#-il#-qe2#?-[szu-ma?]
4. lu#!-usz-ku-un-ma
10. u3 a-na di*-ia#*-[at* t,e*]-e-em
1. ki-ma ta!*-da*-ga!*-li* eb*-szi @left side
1. ia-ti er?!*-ha-tu-szu
10. u3 a-na di*-ia#*-[at* t,e*]-e-em
2. ($ blank space $) 8(disz) _lu2-mesz_ an-nu-ti-in
3. um-ma {d}suen-isz-me-a-ni _ARAD_-ka-ma
11. {disz}pa#-ri-du-um il!(AL)-qe2
1. e-zi-ib _3(u) gur 8(asz) ziz2-an-na_
5. _mu-kux(DU)#_ [x x x]-tum?
18'. u2-ul a-sza-ap-pa-[x ...]
All chapters:
See the cookbook for recipes for small, concrete tasks.
CC-BY Dirk Roorda