"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Loading-the-New-Testament-Text-Fabric\n",
"N1904 = use (\"tonyjurg/Nestle1904LFT:clone\", version=\"0.3\", 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": 57,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" 0.32s 3 results\n"
]
}
],
"source": [
"Search0 = '''\n",
"book book=Matthew\n",
" chapter chapter=1\n",
" verse verse=20\n",
" wg1:wg wgclass=cl wglevel*\n",
" a:word wordrole=v\n",
" b:word wordrole=o\n",
"a .containedclause. b\n",
"'''\n",
"Search0 = N1904.search(Search0)\n",
"N1904.show(Search0, start=20, end=21, condensed=True, extraFeatures={'containedclause','wordrole', 'roleclausedistance'}, suppress={'chapter'}, withNodes=False)"
]
},
{
"cell_type": "code",
"execution_count": 66,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" 0.01s 1 result\n"
]
},
{
"data": {
"text/html": [
"verse 1"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"John 1:1
"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"Search0 = '''\n",
"book book=John\n",
" chapter chapter=1\n",
" verse verse=1\n",
"'''\n",
"Search0 = N1904.search(Search0)\n",
"N1904.show(Search0, start=1, end=2, condensed=True, extraFeatures={'wordrole'}, suppress={'chapter','verse'}, 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": 60,
"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": 67,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'Availability': 'Creative Commons Attribution 4.0 International (CC BY 4.0)',\n",
" 'Converter_author': 'Tony Jurg, ReMa Student Vrije Universiteit Amsterdam, Netherlands',\n",
" 'Converter_execution': 'Tony Jurg, ReMa Student Vrije Universiteit Amsterdam, Netherlands',\n",
" 'Converter_version': '0.3',\n",
" 'Convertor_source': 'https://github.com/tonyjurg/Nestle1904LFT/tree/main/tools',\n",
" 'Data source': 'MACULA Greek Linguistic Datasets, available at https://github.com/Clear-Bible/macula-greek/tree/main/Nestle1904/lowfat',\n",
" 'Editors': 'Eberhard Nestle',\n",
" 'Name': 'Greek New Testament (Nestle 1904 based on Low Fat Tree)',\n",
" 'TextFabric version': '11.4.10',\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-06-19T15:13:47Z'}"
]
},
"execution_count": 67,
"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\\Nestle1904LFT`"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {
"scrolled": true
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"^C\n"
]
}
],
"source": [
"!tf app:\\text-fabric-data\\github\\tonyjurg\\Nestle1904LFT\\app data:\\text-fabric-data\\github\\tonyjurg\\Nestle1904LFT\\tf\\0.2"
]
},
{
"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
}