"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Loading-the-New-Testament-Text-Fabric\n",
"NA = use (\"tonyjurg/n1904_lft:clone\", version=\"0.1.9\", hoist=globals())"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Basic testing of the textfabric data\n",
"##### [Back to TOC](#TOC)\n",
"\n",
"### 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": 52,
"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:4
verse 4
sentence
wg
wg Conj13CL
wg
wg S-V-O coordinate
Ἀρὰμ
containedclause=39wordrole=s
wg
wg S-V-O coordinate
wg DetNP Object
Ναασσών,
containedclause=42wordrole=o
wg
wg S-V-O coordinate
Ναασσὼν
containedclause=45wordrole=s
wg S-V-O coordinate
ἐγέννησεν
containedclause=45wordrole=v
wg DetNP Object
τὸν
containedclause=45wordrole=o
Σαλμών,
containedclause=45wordrole=o
wg
wg S-V-O coordinate
ἐγέννησεν
containedclause=39wordrole=v
wg DetNP Object
τὸν
containedclause=39wordrole=o
Ἀμιναδάβ,
containedclause=39wordrole=o
wg
wg S-V-O coordinate
Ἀμιναδὰβ
containedclause=42wordrole=s
wg S-V-O coordinate
ἐγέννησεν
containedclause=42wordrole=v
wg DetNP Object
τὸν
containedclause=42wordrole=o
"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"verse 21"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"Matthew 1:5
verse 5
sentence
wg
wg Conj13CL
wg
wg S-V-O-ADV coordinate
Σαλμὼν
containedclause=48wordrole=s
wg
wg S-V-O-ADV coordinate
ἐγέννησεν
containedclause=53wordrole=v
wg DetNP Object
τὸν
containedclause=53wordrole=o
Ἰωβὴδ
containedclause=53wordrole=o
wg PrepNp Adverbial
ἐκ
containedclause=53wordrole=adv
wg DetNP
τῆς
containedclause=53wordrole=adv
Ῥούθ,
containedclause=53wordrole=adv
wg
wg S-V-O coordinate
Ἰωβὴδ
containedclause=58wordrole=s
wg S-V-O coordinate
ἐγέννησεν
containedclause=58wordrole=v
wg
wg S-V-O coordinate
wg DetNP Object
τὸν
containedclause=58wordrole=o
Ἰεσσαί,
containedclause=58wordrole=o
wg
wg S-V-O-ADV coordinate
ἐγέννησεν
containedclause=48wordrole=v
wg DetNP Object
τὸν
containedclause=48wordrole=o
Βόες
containedclause=48wordrole=o
wg PrepNp Adverbial
ἐκ
containedclause=48wordrole=adv
wg DetNP
τῆς
containedclause=48wordrole=adv
Ῥαχάβ,
containedclause=48wordrole=adv
wg
wg S-V-O-ADV coordinate
Βόες
containedclause=53wordrole=s
"
],
"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": "code",
"execution_count": 53,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" 0.43s 6 results\n"
]
},
{
"data": {
"text/html": [
"verse 1"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"Matthew 1:20
verse 20
chapter=1verse=20
sentence
chapter=1verse=20
wg
wgclass=to be skipped?wglevel=1
wg Conj-CL
wgclass=cl*wglevel=2
wg
wgclass=clwglevel=3
wg O-S-V
wgclass=clwglevel=4
ταῦτα
chapter=1verse=20wordrole=o
ἐφάνη
chapter=1verse=20wordrole=v
αὐτῷ
chapter=1verse=20wordrole=io
wg Adverbial
wgclass=clwglevel=4
λέγων
chapter=1verse=20wordrole=v
wg CLaCL Object
wgclass=cl*wglevel=5
wg ClCl coordinate
wglevel=6
wg
wgclass=clwglevel=7
wg Np2CL Minor
wgclass=cl*wglevel=8
wg Np-Appos Auxiliar
wglevel=9
Ἰωσὴφ
chapter=1verse=20wordrole=aux
wg NPofNP
wgclass=npwglevel=10
υἱὸς
chapter=1verse=20wordrole=aux
Δαυείδ,
chapter=1verse=20wordrole=aux
μὴ
chapter=1verse=20wordrole=adv
φοβηθῇς
chapter=1verse=20wordrole=v
wg V-O-O2 Object subordinate
wgclass=clwglevel=8
παραλαβεῖν
chapter=1verse=20wordrole=v
Μαρίαν
chapter=1verse=20wordrole=o
wg
wgclass=clwglevel=3
wg Adverbial
wgclass=clwglevel=4
wg CLaCL Object
wgclass=cl*wglevel=5
wg ClCl coordinate
wglevel=6
wg
wgclass=clwglevel=7
wg V-O-O2 Object subordinate
wgclass=clwglevel=8
wg DetNP Second Object
wgclass=npwglevel=9
τὴν
chapter=1verse=20wordrole=o2
wg NPofNP
wgclass=npwglevel=10
γυναῖκά
chapter=1verse=20wordrole=o2
σου,
chapter=1verse=20wordrole=o2
wg sub-CL
wgclass=cl*wglevel=7
wg S-P-VC subordinate
wgclass=clwglevel=8
wg DetCL Subject
wgclass=cl*wglevel=9
τὸ
chapter=1verse=20wordrole=s
γὰρ
chapter=1verse=20wordrole=o
wg S-P-VC subordinate
wgclass=clwglevel=8
wg DetCL Subject
wgclass=cl*wglevel=9
wg ADV-V
wgclass=clwglevel=10
wg PrepNp Adverbial
wgclass=ppwglevel=11
ἐν
chapter=1verse=20wordrole=adv
αὐτῇ
chapter=1verse=20wordrole=adv
γεννηθὲν
chapter=1verse=20wordrole=v
wg PrepNp Predicate
wgclass=ppwglevel=9
ἐκ
chapter=1verse=20wordrole=p
wg NpAdjp
wgclass=npwglevel=10
Πνεύματός
chapter=1verse=20wordrole=p
wg O-S-V
wgclass=clwglevel=4
αὐτοῦ
chapter=1verse=20wordrole=s
wg Adverbial
wgclass=clwglevel=4
wg CLaCL Object
wgclass=cl*wglevel=5
wg ClCl coordinate
wglevel=6
wg sub-CL
wgclass=cl*wglevel=7
wg S-P-VC subordinate
wgclass=clwglevel=8
ἐστιν
chapter=1verse=20wordrole=vc
wg PrepNp Predicate
wgclass=ppwglevel=9
wg NpAdjp
wgclass=npwglevel=10
Ἁγίου·
chapter=1verse=20wordrole=p
wg O-S-V
wgclass=clwglevel=4
ἐνθυμηθέντος
chapter=1verse=20wordrole=v
ἰδοὺ
chapter=1verse=20wordrole=aux
wg NPofNP Subject
wgclass=npwglevel=4
ἄγγελος
chapter=1verse=20wordrole=s
Κυρίου
chapter=1verse=20wordrole=s
wg PrepNp Adverbial
wgclass=ppwglevel=4
κατ’
chapter=1verse=20wordrole=adv
ὄναρ
chapter=1verse=20wordrole=adv
"
],
"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": "markdown",
"metadata": {},
"source": [
"### Step 3 dump some structure information"
]
},
{
"cell_type": "code",
"execution_count": 4,
"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": 5,
"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.9',\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 (N1904 based on Low Fat Tree)',\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-10T18:14:07Z'}"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"TF.features['otext'].metaData"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Running text fabric browser \n",
"\n",
"Note that the normal invocation would be:\n",
"\n",
"`!tf tonyjurg\\n1904_lft`"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {
"scrolled": true
},
"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"
]
}
],
"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
}