"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# The following will push the Text-Fabric stylesheet to this notebook (to facilitate proper display with notebook viewer)\n",
"N1904.dh(N1904.getCss())"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "b0cad62d-1bd1-4ac6-be06-849c5cdb5004",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"# Set default view in a way to limit noise as much as possible.\n",
"N1904.displaySetup(condensed=True, multiFeatures=False,queryFeatures=False)"
]
},
{
"cell_type": "markdown",
"id": "9c74deeb-8543-4cee-acf6-0cef0f1bb386",
"metadata": {
"tags": []
},
"source": [
"# 3 - Performing the queries \n",
"##### [Back to TOC](#TOC)"
]
},
{
"cell_type": "markdown",
"id": "0a6ed41d-a3e2-454c-b6fe-a22e521f31ce",
"metadata": {
"tags": []
},
"source": [
"## 3.1 - Identify appositions in Mat. 1:1 for LFT\n",
"\n",
"The following will select the first verse of Matthew and put it into the list VerseResult."
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "c76726c3-f686-4ec8-977b-9fbfedffa15f",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" 0.01s 1 result\n"
]
}
],
"source": [
"# Define the query template\n",
"VerseQuery = '''\n",
"book book=Matthew\n",
" chapter chapter=1\n",
" verse verse=1\n",
"'''\n",
"\n",
"# The following will create a list containing ordered tuples consisting of node numbers of the items as they appear in the query\n",
"VerseResult = N1904.search(VerseQuery)"
]
},
{
"cell_type": "markdown",
"id": "5b5111f2-312a-4c13-9808-954bcc6e48e2",
"metadata": {},
"source": [
"First print the text of the verse:"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "6aea1916-2e4c-489a-9b0e-8a239f636b36",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"'Βίβλος γενέσεως Ἰησοῦ Χριστοῦ υἱοῦ Δαυεὶδ υἱοῦ Ἀβραάμ. '"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# The verse node is the third item (hence the '2') of the first tuple (hence the '0')\n",
"T.text(VerseResult[0][2]) "
]
},
{
"cell_type": "markdown",
"id": "2388afe2-cab2-490b-83e2-8f91799937c3",
"metadata": {},
"source": [
"Now lets show the synatactical tree for this verse:"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "9a9b9da2-793f-45d8-82dd-21f4c75e1b5d",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"verse 1"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"text/html": [
"verse Matthew 1:1
sentence #1 (start: Matthew 1:1)
wg #2: cl Verbless P2CL
wg #3: np p NPofNP
wg #4: np NPofNP
wg #5: apposition np Np-Appos
wg #6: apposition np Np-Appos
wg #7: apposition np Np-Appos
wg #8: np NPofNP apposition
wg #9: np NPofNP apposition
"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Print the result\n",
"# Note the options \"condensed=True, multiFeatures=False,queryFeatures=False\" are included below due to the earlier N1904.displaySetup(...)\n",
"N1904.show(VerseResult)"
]
},
{
"cell_type": "markdown",
"id": "7fdad723-bb9a-4ea6-9f1f-713d5b11f416",
"metadata": {},
"source": [
"## 3.2 - Other interpretation (GBI)\n",
"##### [Back to TOC](#TOC)"
]
},
{
"cell_type": "markdown",
"id": "77969ac3-e7a2-4d64-b9e4-3988a7e58eeb",
"metadata": {},
"source": [
"The LFT Text-Fabric data presents 'υἱοῦ Δαυεὶδ' as apposition to 'Ἰησοῦ Χριστοῦ' and 'υἱοῦ Ἀβραάμ' as apposition to 'Ἰησοῦ Χριστοῦ υἱοῦ Δαυεὶδ'. Another choice of apposition can also be argued: both 'υἱοῦ Δαυεὶδ' and 'υἱοῦ Ἀβραάμ' being appositions to 'Ἰησοῦ Χριστοῦ'. This actualy the case in the XML data for the GBI nodes. \n",
"\n",
"See the following simplified XML code of file [`01-matthew.xml`](https://github.com/tonyjurg/Nestle1904GBI/blob/main/resources/sourcedata/apr_6_2023/01-matthew.xml):"
]
},
{
"cell_type": "markdown",
"id": "82654c05-1b30-422a-85a2-672b4ef2dd88",
"metadata": {},
"source": [
"```\n",
" \n",
" \n",
" \n",
" \n",
" \n",
" \n",
" Βίβλος\n",
" \n",
" \n",
" \n",
" γενέσεως\n",
" \n",
" \n",
" \n",
" \n",
" \n",
" Ἰησοῦ\n",
" \n",
" \n",
" Χριστοῦ\n",
" \n",
" \n",
" \n",
" \n",
" υἱοῦ\n",
" \n",
" \n",
" Δαυεὶδ\n",
" \n",
" \n",
" \n",
" υἱοῦ\n",
" \n",
" \n",
" Ἀβραάμ.\n",
" \n",
" \n",
" \n",
" \n",
" \n",
" \n",
" \n",
" \n",
" \n",
"```"
]
},
{
"cell_type": "markdown",
"id": "e3eb74e7-9b0e-4fcb-8e6c-1f88b79676bb",
"metadata": {},
"source": [
"The appostion structure can be visualized by the following image:\n",
"\n",
""
]
},
{
"cell_type": "markdown",
"id": "69f4c12a-54fc-4a72-b13d-3d55cde6583a",
"metadata": {
"tags": []
},
"source": [
"\n",
"\n"
]
},
{
"cell_type": "markdown",
"id": "bf071372-4a8a-4e59-b62b-0582925ee6a9",
"metadata": {},
"source": [
"# 4 - Discussion\n",
"##### [Back to TOC](#TOC)\n",
"\n",
"There is inherent ambiguity in sentences where the text includes a nested apposition. A comparison of how the GBI and LFT treebanks render these structures highlights this issue. It appears that grammatical rules alone cannot decisively determine the 'correct' rendering in such cases."
]
},
{
"cell_type": "markdown",
"id": "e3cf5b10-3831-40c4-86b1-29c39a5f62e6",
"metadata": {
"tags": []
},
"source": [
"# 5 - Footnotes and attribution\n",
"##### [Back to TOC](#TOC)\n",
"\n",
"None."
]
},
{
"cell_type": "markdown",
"id": "8f3242fb-e9a8-4f9d-b47e-af865803a6d2",
"metadata": {
"tags": []
},
"source": [
"# 6 - Required libraries\n",
"##### [Back to TOC](#TOC)\n",
"\n",
"The scripts in this notebook require (beside `text-fabric`) the following Python libraries to be installed in the environment:\n",
"\n",
" {none}\n",
"\n",
"You can install any missing library from within Jupyter Notebook using either`pip` or `pip3`."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "2b4d65b0-f0ce-4d78-a1dc-9ce911d3054e",
"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.11.5"
}
},
"nbformat": 4,
"nbformat_minor": 5
}