"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Loading-the-New-Testament-Text-Fabric (add a specific version, eg. 0.1.2)\n",
"NA = use (\"tonyjurg/n1904_lft\", version=\"0.1.8\", hoist=globals())"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'word': 0, 'wg': 1, 'sentence': 2, 'verse': 3, 'chapter': 4, 'book': 5}"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"N.otypeRank\n"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'text-orig-full': 'word'}"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"T.formats"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Step 2 Perform some basic display \n",
"\n",
"note: the implementation with regards how phrases need to be displayed (esp. with regards to conjunctions) is still to be done."
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" 0.01s 25 results\n"
]
},
{
"data": {
"text/html": [
"verse 20"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"Matthew 1:20
verse 20
sentence
wg
wg Conj-CL
wg
wg O-S-V
ταῦτα
containedclause=234wordrole=o
wg
wg O-S-V
αὐτοῦ
containedclause=234wordrole=s
ἐνθυμηθέντος
containedclause=234wordrole=v
ἰδοὺ
containedclause=233wordrole=aux
wg NPofNP Subject
ἄγγελος
containedclause=233wordrole=s
Κυρίου
containedclause=233wordrole=s
wg PrepNp Adverbial
κατ’
containedclause=233wordrole=adv
ὄναρ
containedclause=233wordrole=adv
ἐφάνη
containedclause=233wordrole=v
αὐτῷ
containedclause=233wordrole=io
wg Adverbial
λέγων
containedclause=237wordrole=v
wg CLaCL Object
wg
wg Np2CL Minor
wg Np-Appos Auxiliar
Ἰωσὴφ
containedclause=240wordrole=aux
wg NPofNP apposition
υἱὸς
containedclause=240wordrole=aux
Δαυείδ,
containedclause=240wordrole=aux
μὴ
containedclause=239wordrole=adv
φοβηθῇς
containedclause=239wordrole=v
wg V-O-O2 Object subordinate
παραλαβεῖν
containedclause=243wordrole=v
Μαρίαν
containedclause=243wordrole=o
wg DetNP Second Object
τὴν
containedclause=243wordrole=o2
wg NPofNP
γυναῖκά
containedclause=243wordrole=o2
σου,
containedclause=243wordrole=o2
wg sub-CL Adverbial
wg S-P-VC subordinate
wg DetCL Subject
τὸ
containedclause=248wordrole=s
γὰρ
containedclause=246wordrole=adv
wg S-P-VC subordinate
wg DetCL Subject
wg ADV-V
wg PrepNp Adverbial
ἐν
containedclause=249wordrole=adv
αὐτῇ
containedclause=249wordrole=adv
γεννηθὲν
containedclause=249wordrole=v
wg PrepNp Predicate
ἐκ
containedclause=247wordrole=p
wg NpAdjp
Πνεύματός
containedclause=247wordrole=p
ἐστιν
containedclause=247wordrole=vc
wg PrepNp Predicate
wg NpAdjp
Ἁγίου·
containedclause=247wordrole=p
"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"verse 21"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"Matthew 1:21
verse 21
sentence
wg
wg Conj-CL
wg
wg Adverbial
wg CLaCL Object
wg
wg CLaCL coordinate
wg V-O coordinate
τέξεται
containedclause=255wordrole=v
δὲ
containedclause=238wordrole=o
wg CLaCL coordinate
wg V-O coordinate
υἱὸν
containedclause=255wordrole=o
wg
καὶ
containedclause=254wordrole=o
wg
καλέσεις
containedclause=257wordrole=v
wg DetNP Object
τὸ
containedclause=257wordrole=o
wg NPofNP
ὄνομα
containedclause=257wordrole=o
αὐτοῦ
containedclause=257wordrole=o
Ἰησοῦν·
containedclause=257wordrole=o2
wg sub-CL Adverbial
wg S-V-O-ADV subordinate
αὐτὸς
containedclause=261wordrole=s
γὰρ
containedclause=260wordrole=adv
wg S-V-O-ADV subordinate
σώσει
containedclause=261wordrole=v
wg DetNP Object
τὸν
containedclause=261wordrole=o
wg NPofNP
λαὸν
containedclause=261wordrole=o
αὐτοῦ
containedclause=261wordrole=o
wg PrepNp Adverbial
ἀπὸ
containedclause=261wordrole=adv
wg DetNP
τῶν
containedclause=261wordrole=adv
wg NPofNP
ἁμαρτιῶν
containedclause=261wordrole=adv
αὐτῶν.
containedclause=261wordrole=adv
"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"Search0 = '''\n",
"book book=Matthew\n",
" chapter chapter=1\n",
" \n",
" \n",
" verse \n",
"'''\n",
"Search0 = NA.search(Search0)\n",
"NA.show(Search0, start=20, end=21, condensed=True, extraFeatures={'containedclause','wordrole'}, suppress={'chapter'}, withNodes=False)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Step 3 dump some structure information"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"A heading is a tuple of pairs (node type, feature value)\n",
"\tof node types and features that have been configured as structural elements\n",
"These 3 structural elements have been configured\n",
"\tnode type book with heading feature book\n",
"\tnode type chapter with heading feature chapter\n",
"\tnode type verse with heading feature verse\n",
"You can get them as a tuple with T.headings.\n",
"\n",
"Structure API:\n",
"\tT.structure(node=None) gives the structure below node, or everything if node is None\n",
"\tT.structurePretty(node=None) prints the structure below node, or everything if node is None\n",
"\tT.top() gives all top-level nodes\n",
"\tT.up(node) gives the (immediate) parent node\n",
"\tT.down(node) gives the (immediate) children nodes\n",
"\tT.headingFromNode(node) gives the heading of a node\n",
"\tT.nodeFromHeading(heading) gives the node of a heading\n",
"\tT.ndFromHd complete mapping from headings to nodes\n",
"\tT.hdFromNd complete mapping from nodes to headings\n",
"\tT.hdMult are all headings with their nodes that occur multiple times\n",
"\n",
"There are 8230 structural elements in the dataset.\n",
"\n"
]
}
],
"source": [
"T.structureInfo()"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'Availability': 'Creative Commons Attribution 4.0 International (CC BY 4.0)',\n",
" 'Converter_author': 'Tony Jurg, Vrije Universiteit Amsterdam, Netherlands',\n",
" 'Converter_execution': 'Tony Jurg, Vrije Universiteit Amsterdam, Netherlands',\n",
" 'Converter_version': '0.1.8',\n",
" 'Convertor_source': 'https://github.com/tonyjurg/n1904_lft',\n",
" 'Data source': 'MACULA Greek Linguistic Datasets, available at https://github.com/Clear-Bible/macula-greek/tree/main/Nestle1904/lowfat',\n",
" 'Editors': 'Nestle',\n",
" 'Name': 'Greek New Testament (NA1904)',\n",
" 'TextFabric version': '11.4.10',\n",
" 'Version': '1904',\n",
" 'fmt:text-orig-full': '{word}{after}',\n",
" 'sectionFeatures': 'book,chapter,verse',\n",
" 'sectionTypes': 'book,chapter,verse',\n",
" 'structureFeatures': 'book,chapter,verse',\n",
" 'structureTypes': 'book,chapter,verse',\n",
" 'writtenBy': 'Text-Fabric',\n",
" 'dateWritten': '2023-05-09T19:42:40Z'}"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"TF.features['otext'].metaData\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Running text fabric browser \n",
"##### [Back to TOC](#TOC)"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"This is Text-Fabric 11.4.10\n",
"Connecting to running kernel via 19685\n",
"Connecting to running webserver via 29685\n",
"Opening app in browser\n",
"Press to stop the TF browser\n"
]
}
],
"source": [
"!text-fabric app "
]
},
{
"cell_type": "code",
"execution_count": 45,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"^C\n"
]
}
],
"source": [
"!text-fabric app\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": 20,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" 0.42s 9 results\n"
]
},
{
"data": {
"text/html": [
"verse 1"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"Matthew 1:20
verse
chapter=1verse=20
sentence
chapter=1verse=20
wg
wgclass=to be skipped?wglevel=1
wg
wgclass=cl*wglevel=2
wg
wgclass=clwglevel=3
wg
wgclass=clwglevel=4
ταῦτα
chapter=1verse=20wordrole=o
δὲ
chapter=1verse=20wordrole=
wg
wgclass=clwglevel=3
wg
wgclass=clwglevel=4
αὐτοῦ
chapter=1verse=20wordrole=s
ἐνθυμηθέντος
chapter=1verse=20wordrole=v
ἰδοὺ
chapter=1verse=20wordrole=aux
wg
wgclass=npwglevel=4
ἄγγελος
chapter=1verse=20wordrole=s
Κυρίου
chapter=1verse=20wordrole=s
wg
wgclass=ppwglevel=4
κατ’
chapter=1verse=20wordrole=adv
ὄναρ
chapter=1verse=20wordrole=adv
ἐφάνη
chapter=1verse=20wordrole=v
αὐτῷ
chapter=1verse=20wordrole=io
wg
wgclass=clwglevel=4
λέγων
chapter=1verse=20wordrole=v
wg
wgclass=cl*wglevel=5
wg
wgclass=clwglevel=6
wg
wgclass=cl*wglevel=7
wg
wgclass=npwglevel=8
Ἰωσὴφ
chapter=1verse=20wordrole=aux
wg
wgclass=npwglevel=9
υἱὸς
chapter=1verse=20wordrole=aux
Δαυείδ,
chapter=1verse=20wordrole=aux
μὴ
chapter=1verse=20wordrole=adv
φοβηθῇς
chapter=1verse=20wordrole=v
wg
wgclass=clwglevel=7
παραλαβεῖν
chapter=1verse=20wordrole=v
Μαρίαν
chapter=1verse=20wordrole=o
wg
wgclass=npwglevel=8
τὴν
chapter=1verse=20wordrole=o2
wg
wgclass=npwglevel=9
γυναῖκά
chapter=1verse=20wordrole=o2
σου,
chapter=1verse=20wordrole=o2
wg
wgclass=cl*wglevel=7
wg
wgclass=clwglevel=8
wg
wgclass=cl*wglevel=9
τὸ
chapter=1verse=20wordrole=s
γὰρ
chapter=1verse=20wordrole=adv
wg
wgclass=clwglevel=8
wg
wgclass=cl*wglevel=9
wg
wgclass=clwglevel=10
wg
wgclass=ppwglevel=11
ἐν
chapter=1verse=20wordrole=adv
αὐτῇ
chapter=1verse=20wordrole=adv
γεννηθὲν
chapter=1verse=20wordrole=v
wg
wgclass=ppwglevel=9
ἐκ
chapter=1verse=20wordrole=p
wg
wgclass=npwglevel=10
Πνεύματός
chapter=1verse=20wordrole=p
ἐστιν
chapter=1verse=20wordrole=vc
wg
wgclass=ppwglevel=9
wg
wgclass=npwglevel=10
Ἁγίου·
chapter=1verse=20wordrole=p
"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"Search0 = '''\n",
"book book=Matthew\n",
" chapter chapter=1\n",
" verse verse=20\n",
" wg1:wg wgclass=cl wglevel*\n",
" word wordrole=v\n",
" word wordrole=o\n",
" word wordrole=aux\n",
"\n",
"'''\n",
"Search0 = NA.search(Search0)\n",
"NA.show(Search0, start=1, end=1, condensed=True, colorMap={4:'pink', 5:'turquoise', 6:'lightblue', 7:'red'}, multiFeatures=False)"
]
},
{
"cell_type": "code",
"execution_count": 18,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"^C\n"
]
}
],
"source": [
"!text-fabric app"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"!tf CenterBLC/NA"
]
},
{
"cell_type": "code",
"execution_count": 43,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"This is Text-Fabric 11.4.10\n",
"Connecting to running kernel via 11185\n",
"Connecting to running webserver via 21185\n",
"Opening ETCBC/bhsa-min in browser\n",
"Press to stop the TF browser\n"
]
}
],
"source": [
"!tf ETCBC/bhsa-min"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"^C\n"
]
}
],
"source": [
"!tf CenterBLC/NA"
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"This is Text-Fabric 11.4.10\n",
"Connecting to running kernel via 10074\n",
"Connecting to running webserver via 20074\n",
"Opening tonyjurg/n1904_lft in browser\n",
"Press to stop the TF browser\n"
]
}
],
"source": [
"!text-fabric tonyjurg/n1904_lft"
]
},
{
"cell_type": "code",
"execution_count": 48,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"This is Text-Fabric 11.4.10\n",
"Connecting to running kernel via 10074\n",
"Connecting to running webserver via 20074\n",
"Opening tonyjurg/n1904_lft in browser\n",
"Press to stop the TF browser\n"
]
}
],
"source": [
"!tf tonyjurg/n1904_lft"
]
},
{
"cell_type": "code",
"execution_count": 47,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"This is Text-Fabric 11.4.10\n",
"Connecting to running kernel via 18794\n",
"Connecting to running webserver via 28794\n",
"Opening app:/text-fabric-data/github/tonyjurg/n1904_lft/app in browser\n",
"Press to stop the TF browser\n"
]
}
],
"source": [
"!tf app:\\text-fabric-data\\github\\tonyjurg\\n1904_lft\\app data:\\text-fabric-data\\github\\tonyjurg\\n1904_lft\\tf\\0.1.8"
]
},
{
"cell_type": "code",
"execution_count": 42,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"This is Text-Fabric 11.4.10\n",
"Connecting to running kernel via 10074\n",
"Connecting to running webserver via 20074\n",
"Opening tonyjurg/n1904_lft in browser\n",
"Press to stop the TF browser\n"
]
}
],
"source": [
"!tf tonyjurg/n1904_lft"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.12"
},
"toc": {
"base_numbering": 1,
"nav_menu": {},
"number_sections": true,
"sideBar": true,
"skip_h1_title": false,
"title_cell": "Table of Contents",
"title_sidebar": "Contents",
"toc_cell": true,
"toc_position": {
"height": "calc(100% - 180px)",
"left": "10px",
"top": "150px",
"width": "321.391px"
},
"toc_section_display": true,
"toc_window_display": true
}
},
"nbformat": 4,
"nbformat_minor": 4
}