{ "cells": [ { "cell_type": "markdown", "id": "db95113b-4dc7-4b64-96f9-1f14895ac228", "metadata": {}, "source": [ "# Compare two XML files (Nestle1904GBI)" ] }, { "cell_type": "markdown", "id": "318a0e17-7538-4b54-8001-c129e29fb27d", "metadata": {}, "source": [ "Jupiter Notebook intended to quicly compare the content and structure of two versions of the input XML files." ] }, { "cell_type": "code", "execution_count": 3, "id": "2b34f28b-8848-42ef-a97b-5be863291ac9", "metadata": {}, "outputs": [], "source": [ "# Following variables should contain the relative path and name of the two files to compare\n", "book=\"01-matthew.xml\"\n", "version1=\"oct_27_2022\"\n", "version2=\"apr_6_2023\"\n", "file1_path = \"sourcedata/\"+version1+\"/\"+book\n", "file2_path = \"sourcedata/\"+version2+\"/\"+book\n", "# Set to True if detailed reporting is required\n", "details = True" ] }, { "cell_type": "code", "execution_count": 4, "id": "4dd89b74-80bc-40f4-bfc4-709694acec6a", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Comparing file sourcedata/oct_27_2022/01-matthew.xml with sourcedata/apr_6_2023/01-matthew.xml \n", "\n", "Result:The XML files are different.\n", "\n", "Details:\n", "\n", "\n", "Attribute: LexDomain is present in the second file but not in the first file\n", "Attribute: LN is present in the second file but not in the first file\n", "Tag/Attributes details: Node != Node or {'{http://www.w3.org/XML/1998/namespace}id': 'n40003009006', 'ref': 'MAT 3:9!6', 'Cat': 'pron', 'Start': '5', 'End': '5', 'StrongNumber': '1438', 'UnicodeLemma': 'ἑαυτοῦ', 'Gender': 'Masculine', 'Number': 'Plural', 'FunctionalTag': 'F-2DPM', 'Type': 'Personal', 'morphId': '40003009006', 'NormalizedForm': 'ἑαυτοῖς', 'Case': 'Dative', 'Unicode': 'ἑαυτοῖς', 'FormalTag': 'F-2DPM', 'nodeId': '400030090060010', 'Gloss': 'yourselves', 'Ref': 'n40003007014'} != {'{http://www.w3.org/XML/1998/namespace}id': 'n40003009006', 'ref': 'MAT 3:9!6', 'Cat': 'pron', 'Start': '5', 'End': '5', 'StrongNumber': '1438', 'UnicodeLemma': 'ἑαυτοῦ', 'Gender': 'Masculine', 'Number': 'Plural', 'FunctionalTag': 'F-2DPM', 'Type': 'Personal', 'morphId': '40003009006', 'NormalizedForm': 'ἑαυτοῖς', 'Case': 'Dative', 'Unicode': 'ἑαυτοῖς', 'FormalTag': 'F-2DPM', 'nodeId': '400030090060010', 'Gloss': 'yourselves', 'Ref': 'n40003007014', 'LexDomain': '092004', 'LN': '92.25'}\n", "\n", "\n", "Attribute: Frame - Value in first file: A0:n40003016004 A1:n40003016022;n40003016026, Value in second file: A0:n40003016004 A1:n40003016019;n40003016022\n", "Tag/Attributes details: Node != Node or {'{http://www.w3.org/XML/1998/namespace}id': 'n40003016016', 'ref': 'MAT 3:16!16', 'Cat': 'verb', 'Start': '6', 'End': '6', 'StrongNumber': '3708', 'UnicodeLemma': 'ὁράω', 'Person': 'Third', 'Mood': 'Indicative', 'Tense': 'Aorist', 'Number': 'Singular', 'FunctionalTag': 'V-2AAI-3S', 'Type': '', 'morphId': '40003016016', 'NormalizedForm': 'εἶδεν', 'Unicode': 'εἶδεν', 'FormalTag': 'V-2AAI-3S', 'Voice': 'Active', 'nodeId': '400030160160010', 'Gloss': 'he saw', 'SubjRef': 'n40003016004', 'Frame': 'A0:n40003016004 A1:n40003016022;n40003016026', 'LexDomain': '024001', 'LN': '24.1'} != {'{http://www.w3.org/XML/1998/namespace}id': 'n40003016016', 'ref': 'MAT 3:16!16', 'Cat': 'verb', 'Start': '6', 'End': '6', 'StrongNumber': '3708', 'UnicodeLemma': 'ὁράω', 'Person': 'Third', 'Mood': 'Indicative', 'Tense': 'Aorist', 'Number': 'Singular', 'FunctionalTag': 'V-2AAI-3S', 'Type': '', 'morphId': '40003016016', 'NormalizedForm': 'εἶδεν', 'Unicode': 'εἶδεν', 'FormalTag': 'V-2AAI-3S', 'Voice': 'Active', 'nodeId': '400030160160010', 'Gloss': 'he saw', 'SubjRef': 'n40003016004', 'Frame': 'A0:n40003016004 A1:n40003016019;n40003016022', 'LexDomain': '024001', 'LN': '24.1'}\n", "\n", "\n", "Attribute: Frame - Value in first file: A0:n40004017005 A1:n40004024030, Value in second file: A0:n40004017005 A1:n40004024029\n", "Tag/Attributes details: Node != Node or {'{http://www.w3.org/XML/1998/namespace}id': 'n40004024028', 'ref': 'MAT 4:24!28', 'Cat': 'verb', 'Start': '18', 'End': '18', 'StrongNumber': '2323', 'UnicodeLemma': 'θεραπεύω', 'Person': 'Third', 'Mood': 'Indicative', 'Tense': 'Aorist', 'Number': 'Singular', 'FunctionalTag': 'V-AAI-3S', 'Type': '', 'morphId': '40004024028', 'NormalizedForm': 'ἐθεράπευσεν', 'Unicode': 'ἐθεράπευσεν', 'FormalTag': 'V-AAI-3S', 'Voice': 'Active', 'nodeId': '400040240280010', 'Gloss': 'He healed', 'SubjRef': 'n40004017005', 'Frame': 'A0:n40004017005 A1:n40004024030', 'LexDomain': '023008', 'LN': '23.139'} != {'{http://www.w3.org/XML/1998/namespace}id': 'n40004024028', 'ref': 'MAT 4:24!28', 'Cat': 'verb', 'Start': '18', 'End': '18', 'StrongNumber': '2323', 'UnicodeLemma': 'θεραπεύω', 'Person': 'Third', 'Mood': 'Indicative', 'Tense': 'Aorist', 'Number': 'Singular', 'FunctionalTag': 'V-AAI-3S', 'Type': '', 'morphId': '40004024028', 'NormalizedForm': 'ἐθεράπευσεν', 'Unicode': 'ἐθεράπευσεν', 'FormalTag': 'V-AAI-3S', 'Voice': 'Active', 'nodeId': '400040240280010', 'Gloss': 'He healed', 'SubjRef': 'n40004017005', 'Frame': 'A0:n40004017005 A1:n40004024029', 'LexDomain': '023008', 'LN': '23.139'}\n", "\n", "\n", "Attribute: LexDomain - Value in first file: 078001, Value in second file: 078001 087003\n", "Attribute: LN - Value in first file: 78.2, Value in second file: 78.2 87.22\n", "Tag/Attributes details: Node != Node or {'{http://www.w3.org/XML/1998/namespace}id': 'n40005035018', 'ref': 'MAT 5:35!18', 'Cat': 'adj', 'Start': '26', 'End': '26', 'StrongNumber': '3173', 'UnicodeLemma': 'μέγας', 'Gender': 'Masculine', 'Number': 'Singular', 'FunctionalTag': 'A-GSM', 'Type': '', 'morphId': '40005035018', 'NormalizedForm': 'μεγάλου', 'Case': 'Genitive', 'Unicode': 'μεγάλου', 'FormalTag': 'A-GSM', 'nodeId': '400050350180010', 'Gloss': 'great', 'LexDomain': '078001', 'LN': '78.2'} != {'{http://www.w3.org/XML/1998/namespace}id': 'n40005035018', 'ref': 'MAT 5:35!18', 'Cat': 'adj', 'Start': '26', 'End': '26', 'StrongNumber': '3173', 'UnicodeLemma': 'μέγας', 'Gender': 'Masculine', 'Number': 'Singular', 'FunctionalTag': 'A-GSM', 'Type': '', 'morphId': '40005035018', 'NormalizedForm': 'μεγάλου', 'Case': 'Genitive', 'Unicode': 'μεγάλου', 'FormalTag': 'A-GSM', 'nodeId': '400050350180010', 'Gloss': 'great', 'LexDomain': '078001 087003', 'LN': '78.2 87.22'}\n", "\n", "\n", "Attribute: LexDomain is present in the second file but not in the first file\n", "Attribute: LN is present in the second file but not in the first file\n", "Tag/Attributes details: Node != Node or {'{http://www.w3.org/XML/1998/namespace}id': 'n40006001017', 'ref': 'MAT 6:1!17', 'Cat': 'ptcl', 'Start': '2', 'End': '2', 'StrongNumber': '1490', 'UnicodeLemma': 'μήγε', 'FunctionalTag': 'PRT-N', 'Type': '', 'morphId': '40006001017', 'NormalizedForm': 'μήγε', 'Unicode': 'μήγε,', 'FormalTag': 'PRT-N', 'nodeId': '400060010170010', 'Gloss': 'otherwise'} != {'{http://www.w3.org/XML/1998/namespace}id': 'n40006001017', 'ref': 'MAT 6:1!17', 'Cat': 'ptcl', 'Start': '2', 'End': '2', 'StrongNumber': '1490', 'UnicodeLemma': 'μήγε', 'FunctionalTag': 'PRT-N', 'Type': '', 'morphId': '40006001017', 'NormalizedForm': 'μήγε', 'Unicode': 'μήγε,', 'FormalTag': 'PRT-N', 'nodeId': '400060010170010', 'Gloss': 'otherwise', 'LexDomain': '069003', 'LN': '69.10'}\n", "\n", "\n", "Attribute: LexDomain is present in the second file but not in the first file\n", "Attribute: LN is present in the second file but not in the first file\n", "Tag/Attributes details: Node != Node or {'{http://www.w3.org/XML/1998/namespace}id': 'n40007015005', 'ref': 'MAT 7:15!5', 'Cat': 'pron', 'Start': '4', 'End': '4', 'StrongNumber': '3748', 'UnicodeLemma': 'ὅστις', 'Gender': 'Masculine', 'Number': 'Plural', 'FunctionalTag': 'R-NPM', 'Type': 'Relative', 'morphId': '40007015005', 'NormalizedForm': 'οἵτινες', 'Case': 'Nominative', 'Unicode': 'οἵτινες', 'FormalTag': 'R-NPM', 'nodeId': '400070150050010', 'Gloss': 'who', 'Ref': 'n40007015004'} != {'{http://www.w3.org/XML/1998/namespace}id': 'n40007015005', 'ref': 'MAT 7:15!5', 'Cat': 'pron', 'Start': '4', 'End': '4', 'StrongNumber': '3748', 'UnicodeLemma': 'ὅστις', 'Gender': 'Masculine', 'Number': 'Plural', 'FunctionalTag': 'R-NPM', 'Type': 'Relative', 'morphId': '40007015005', 'NormalizedForm': 'οἵτινες', 'Case': 'Nominative', 'Unicode': 'οἵτινες', 'FormalTag': 'R-NPM', 'nodeId': '400070150050010', 'Gloss': 'who', 'Ref': 'n40007015004', 'LexDomain': '092004', 'LN': '92.18'}\n", "\n", "\n", "Attribute: LexDomain is present in the second file but not in the first file\n", "Attribute: LN is present in the second file but not in the first file\n", "Tag/Attributes details: Node != Node or {'{http://www.w3.org/XML/1998/namespace}id': 'n40008022014', 'ref': 'MAT 8:22!14', 'Cat': 'pron', 'Start': '13', 'End': '13', 'StrongNumber': '1438', 'UnicodeLemma': 'ἑαυτοῦ', 'Gender': 'Masculine', 'Number': 'Plural', 'FunctionalTag': 'F-3GPM', 'Type': 'Personal', 'morphId': '40008022014', 'NormalizedForm': 'ἑαυτῶν', 'Case': 'Genitive', 'Unicode': 'ἑαυτῶν', 'FormalTag': 'F-3GPM', 'nodeId': '400080220140010', 'Gloss': 'their own', 'Ref': 'n40008022011'} != {'{http://www.w3.org/XML/1998/namespace}id': 'n40008022014', 'ref': 'MAT 8:22!14', 'Cat': 'pron', 'Start': '13', 'End': '13', 'StrongNumber': '1438', 'UnicodeLemma': 'ἑαυτοῦ', 'Gender': 'Masculine', 'Number': 'Plural', 'FunctionalTag': 'F-3GPM', 'Type': 'Personal', 'morphId': '40008022014', 'NormalizedForm': 'ἑαυτῶν', 'Case': 'Genitive', 'Unicode': 'ἑαυτῶν', 'FormalTag': 'F-3GPM', 'nodeId': '400080220140010', 'Gloss': 'their own', 'Ref': 'n40008022011', 'LexDomain': '092004', 'LN': '92.25'}\n", "\n", "\n", "Attribute: LexDomain is present in the second file but not in the first file\n", "Attribute: LN is present in the second file but not in the first file\n", "Tag/Attributes details: Node != Node or {'{http://www.w3.org/XML/1998/namespace}id': 'n40009003008', 'ref': 'MAT 9:3!8', 'Cat': 'pron', 'Start': '7', 'End': '7', 'StrongNumber': '1438', 'UnicodeLemma': 'ἑαυτοῦ', 'Gender': 'Masculine', 'Number': 'Plural', 'FunctionalTag': 'F-3DPM', 'Type': 'Personal', 'morphId': '40009003008', 'NormalizedForm': 'ἑαυτοῖς', 'Case': 'Dative', 'Unicode': 'ἑαυτοῖς', 'FormalTag': 'F-3DPM', 'nodeId': '400090030080010', 'Gloss': 'themselves', 'Ref': 'n40009003003'} != {'{http://www.w3.org/XML/1998/namespace}id': 'n40009003008', 'ref': 'MAT 9:3!8', 'Cat': 'pron', 'Start': '7', 'End': '7', 'StrongNumber': '1438', 'UnicodeLemma': 'ἑαυτοῦ', 'Gender': 'Masculine', 'Number': 'Plural', 'FunctionalTag': 'F-3DPM', 'Type': 'Personal', 'morphId': '40009003008', 'NormalizedForm': 'ἑαυτοῖς', 'Case': 'Dative', 'Unicode': 'ἑαυτοῖς', 'FormalTag': 'F-3DPM', 'nodeId': '400090030080010', 'Gloss': 'themselves', 'Ref': 'n40009003003', 'LexDomain': '092005', 'LN': '92.26'}\n", "\n", "\n", "Attribute: LexDomain is present in the second file but not in the first file\n", "Attribute: LN is present in the second file but not in the first file\n", "Tag/Attributes details: Node != Node or {'{http://www.w3.org/XML/1998/namespace}id': 'n40009021004', 'ref': 'MAT 9:21!4', 'Cat': 'pron', 'Start': '3', 'End': '3', 'StrongNumber': '1438', 'UnicodeLemma': 'ἑαυτοῦ', 'Gender': 'Feminine', 'Number': 'Singular', 'FunctionalTag': 'F-3DSF', 'Type': 'Personal', 'morphId': '40009021004', 'NormalizedForm': 'ἑαυτῇ', 'Case': 'Dative', 'Unicode': 'ἑαυτῇ', 'FormalTag': 'F-3DSF', 'nodeId': '400090210040010', 'Gloss': 'herself', 'Ref': 'n40009020003'} != {'{http://www.w3.org/XML/1998/namespace}id': 'n40009021004', 'ref': 'MAT 9:21!4', 'Cat': 'pron', 'Start': '3', 'End': '3', 'StrongNumber': '1438', 'UnicodeLemma': 'ἑαυτοῦ', 'Gender': 'Feminine', 'Number': 'Singular', 'FunctionalTag': 'F-3DSF', 'Type': 'Personal', 'morphId': '40009021004', 'NormalizedForm': 'ἑαυτῇ', 'Case': 'Dative', 'Unicode': 'ἑαυτῇ', 'FormalTag': 'F-3DSF', 'nodeId': '400090210040010', 'Gloss': 'herself', 'Ref': 'n40009020003', 'LexDomain': '092004', 'LN': '92.25'}\n", "\n", "\n", "Attribute: LexDomain is present in the second file but not in the first file\n", "Attribute: LN is present in the second file but not in the first file\n", "Tag/Attributes details: Node != Node or {'{http://www.w3.org/XML/1998/namespace}id': 'n40012039015', 'ref': 'MAT 12:39!15', 'Cat': 'verb', 'Start': '14', 'End': '14', 'StrongNumber': '1325', 'UnicodeLemma': 'δίδωμι', 'Person': 'Third', 'Mood': 'Indicative', 'Tense': 'Future', 'Number': 'Singular', 'FunctionalTag': 'V-FPI-3S', 'Type': '', 'morphId': '40012039015', 'NormalizedForm': 'δοθήσεται', 'Unicode': 'δοθήσεται', 'FormalTag': 'V-FPI-3S', 'Voice': 'Passive', 'nodeId': '400120390150010', 'Gloss': 'will be given', 'Frame': 'A1:n40012039013 A2:n40012039016'} != {'{http://www.w3.org/XML/1998/namespace}id': 'n40012039015', 'ref': 'MAT 12:39!15', 'Cat': 'verb', 'Start': '14', 'End': '14', 'StrongNumber': '1325', 'UnicodeLemma': 'δίδωμι', 'Person': 'Third', 'Mood': 'Indicative', 'Tense': 'Future', 'Number': 'Singular', 'FunctionalTag': 'V-FPI-3S', 'Type': '', 'morphId': '40012039015', 'NormalizedForm': 'δοθήσεται', 'Unicode': 'δοθήσεται', 'FormalTag': 'V-FPI-3S', 'Voice': 'Passive', 'nodeId': '400120390150010', 'Gloss': 'will be given', 'Frame': 'A1:n40012039013 A2:n40012039016', 'LexDomain': '013004', 'LN': '13.142'}\n", "\n", "\n", "Attribute: LexDomain is present in the second file but not in the first file\n", "Attribute: LN is present in the second file but not in the first file\n", "Tag/Attributes details: Node != Node or {'{http://www.w3.org/XML/1998/namespace}id': 'n40013011018', 'ref': 'MAT 13:11!18', 'Cat': 'verb', 'Start': '17', 'End': '17', 'StrongNumber': '1325', 'UnicodeLemma': 'δίδωμι', 'Person': 'Third', 'Mood': 'Indicative', 'Tense': 'Perfect', 'Number': 'Singular', 'FunctionalTag': 'V-RPI-3S', 'Type': '', 'morphId': '40013011018', 'NormalizedForm': 'δέδοται', 'Unicode': 'δέδοται.', 'FormalTag': 'V-REI-3S', 'Voice': 'Passive', 'nodeId': '400130110180010', 'Gloss': 'it has been granted', 'SubjRef': 'n40013011008', 'Frame': 'A1:n40013011008 A2:n40013011015'} != {'{http://www.w3.org/XML/1998/namespace}id': 'n40013011018', 'ref': 'MAT 13:11!18', 'Cat': 'verb', 'Start': '17', 'End': '17', 'StrongNumber': '1325', 'UnicodeLemma': 'δίδωμι', 'Person': 'Third', 'Mood': 'Indicative', 'Tense': 'Perfect', 'Number': 'Singular', 'FunctionalTag': 'V-RPI-3S', 'Type': '', 'morphId': '40013011018', 'NormalizedForm': 'δέδοται', 'Unicode': 'δέδοται.', 'FormalTag': 'V-REI-3S', 'Voice': 'Passive', 'nodeId': '400130110180010', 'Gloss': 'it has been granted', 'SubjRef': 'n40013011008', 'Frame': 'A1:n40013011008 A2:n40013011015', 'LexDomain': '013004', 'LN': '13.142'}\n", "\n", "\n", "Attribute: LexDomain is present in the second file but not in the first file\n", "Attribute: LN is present in the second file but not in the first file\n", "Tag/Attributes details: Node != Node or {'{http://www.w3.org/XML/1998/namespace}id': 'n40013040008', 'ref': 'MAT 13:40!8', 'Cat': 'verb', 'Start': '7', 'End': '7', 'StrongNumber': '2618', 'UnicodeLemma': 'κατακαίω', 'Person': 'Third', 'Mood': 'Indicative', 'Tense': 'Present', 'Number': 'Singular', 'FunctionalTag': 'V-PPI-3S', 'Type': '', 'morphId': '40013040008', 'NormalizedForm': 'κατακαίεται', 'Unicode': 'κατακαίεται,', 'FormalTag': 'V-PEI-3S', 'Voice': 'Passive', 'nodeId': '400130400080010', 'Gloss': 'is consumed', 'SubjRef': 'n40013040005', 'Frame': 'A1:n40013040005'} != {'{http://www.w3.org/XML/1998/namespace}id': 'n40013040008', 'ref': 'MAT 13:40!8', 'Cat': 'verb', 'Start': '7', 'End': '7', 'StrongNumber': '2618', 'UnicodeLemma': 'κατακαίω', 'Person': 'Third', 'Mood': 'Indicative', 'Tense': 'Present', 'Number': 'Singular', 'FunctionalTag': 'V-PPI-3S', 'Type': '', 'morphId': '40013040008', 'NormalizedForm': 'κατακαίεται', 'Unicode': 'κατακαίεται,', 'FormalTag': 'V-PEI-3S', 'Voice': 'Passive', 'nodeId': '400130400080010', 'Gloss': 'is consumed', 'SubjRef': 'n40013040005', 'Frame': 'A1:n40013040005', 'LexDomain': '014008', 'LN': '14.66'}\n", "\n", "\n", "Attribute: LexDomain is present in the second file but not in the first file\n", "Attribute: LN is present in the second file but not in the first file\n", "Tag/Attributes details: Node != Node or {'{http://www.w3.org/XML/1998/namespace}id': 'n40015006008', 'ref': 'MAT 15:6!8', 'Cat': 'det', 'Start': '24', 'End': '24', 'StrongNumber': '3588', 'UnicodeLemma': 'ὁ', 'Gender': 'Feminine', 'Number': 'Singular', 'FunctionalTag': 'T-ASF', 'Type': '', 'morphId': '40015006008', 'NormalizedForm': 'τήν', 'Case': 'Accusative', 'Unicode': 'τὴν', 'FormalTag': 'T-ASF', 'nodeId': '400150060080010', 'Gloss': 'the'} != {'{http://www.w3.org/XML/1998/namespace}id': 'n40015006008', 'ref': 'MAT 15:6!8', 'Cat': 'det', 'Start': '24', 'End': '24', 'StrongNumber': '3588', 'UnicodeLemma': 'ὁ', 'Gender': 'Feminine', 'Number': 'Singular', 'FunctionalTag': 'T-ASF', 'Type': '', 'morphId': '40015006008', 'NormalizedForm': 'τήν', 'Case': 'Accusative', 'Unicode': 'τὴν', 'FormalTag': 'T-ASF', 'nodeId': '400150060080010', 'Gloss': 'the', 'LexDomain': '092004', 'LN': '92.24'}\n", "\n", "\n", "Attribute: LexDomain is present in the second file but not in the first file\n", "Attribute: LN is present in the second file but not in the first file\n", "Tag/Attributes details: Node != Node or {'{http://www.w3.org/XML/1998/namespace}id': 'n40016004010', 'ref': 'MAT 16:4!10', 'Cat': 'verb', 'Start': '9', 'End': '9', 'StrongNumber': '1325', 'UnicodeLemma': 'δίδωμι', 'Person': 'Third', 'Mood': 'Indicative', 'Tense': 'Future', 'Number': 'Singular', 'FunctionalTag': 'V-FPI-3S', 'Type': '', 'morphId': '40016004010', 'NormalizedForm': 'δοθήσεται', 'Unicode': 'δοθήσεται', 'FormalTag': 'V-FPI-3S', 'Voice': 'Passive', 'nodeId': '400160040100010', 'Gloss': 'will be given', 'Frame': 'A1:n40016004008 A2:n40016004011'} != {'{http://www.w3.org/XML/1998/namespace}id': 'n40016004010', 'ref': 'MAT 16:4!10', 'Cat': 'verb', 'Start': '9', 'End': '9', 'StrongNumber': '1325', 'UnicodeLemma': 'δίδωμι', 'Person': 'Third', 'Mood': 'Indicative', 'Tense': 'Future', 'Number': 'Singular', 'FunctionalTag': 'V-FPI-3S', 'Type': '', 'morphId': '40016004010', 'NormalizedForm': 'δοθήσεται', 'Unicode': 'δοθήσεται', 'FormalTag': 'V-FPI-3S', 'Voice': 'Passive', 'nodeId': '400160040100010', 'Gloss': 'will be given', 'Frame': 'A1:n40016004008 A2:n40016004011', 'LexDomain': '013004', 'LN': '13.142'}\n", "\n", "\n", "Attribute: LexDomain is present in the second file but not in the first file\n", "Attribute: LN is present in the second file but not in the first file\n", "Tag/Attributes details: Node != Node or {'{http://www.w3.org/XML/1998/namespace}id': 'n40016019001', 'ref': 'MAT 16:19!1', 'Cat': 'verb', 'Start': '0', 'End': '0', 'StrongNumber': '1325', 'UnicodeLemma': 'δίδωμι', 'Person': 'First', 'Mood': 'Indicative', 'Tense': 'Future', 'Number': 'Singular', 'FunctionalTag': 'V-FAI-1S', 'Type': '', 'morphId': '40016019001', 'NormalizedForm': 'δώσω', 'Unicode': 'δώσω', 'FormalTag': 'V-FAI-1S', 'Voice': 'Active', 'nodeId': '400160190010010', 'Gloss': 'I will give', 'SubjRef': 'n40016017004', 'Frame': 'A0:n40016017004 A2:n40016019002 A1:n40016019004'} != {'{http://www.w3.org/XML/1998/namespace}id': 'n40016019001', 'ref': 'MAT 16:19!1', 'Cat': 'verb', 'Start': '0', 'End': '0', 'StrongNumber': '1325', 'UnicodeLemma': 'δίδωμι', 'Person': 'First', 'Mood': 'Indicative', 'Tense': 'Future', 'Number': 'Singular', 'FunctionalTag': 'V-FAI-1S', 'Type': '', 'morphId': '40016019001', 'NormalizedForm': 'δώσω', 'Unicode': 'δώσω', 'FormalTag': 'V-FAI-1S', 'Voice': 'Active', 'nodeId': '400160190010010', 'Gloss': 'I will give', 'SubjRef': 'n40016017004', 'Frame': 'A0:n40016017004 A2:n40016019002 A1:n40016019004', 'LexDomain': '057008', 'LN': '57.71'}\n", "\n", "\n", "Attribute: LexDomain is present in the second file but not in the first file\n", "Attribute: LN is present in the second file but not in the first file\n", "Tag/Attributes details: Node != Node or {'{http://www.w3.org/XML/1998/namespace}id': 'n40019008005', 'ref': 'MAT 19:8!5', 'Cat': 'prep', 'Start': '4', 'End': '4', 'StrongNumber': '4314', 'UnicodeLemma': 'πρός', 'FunctionalTag': 'PREP', 'Type': '', 'morphId': '40019008005', 'NormalizedForm': 'πρός', 'Unicode': 'πρὸς', 'FormalTag': 'PREP', 'nodeId': '400190080050010', 'Gloss': 'in view of'} != {'{http://www.w3.org/XML/1998/namespace}id': 'n40019008005', 'ref': 'MAT 19:8!5', 'Cat': 'prep', 'Start': '4', 'End': '4', 'StrongNumber': '4314', 'UnicodeLemma': 'πρός', 'FunctionalTag': 'PREP', 'Type': '', 'morphId': '40019008005', 'NormalizedForm': 'πρός', 'Unicode': 'πρὸς', 'FormalTag': 'PREP', 'nodeId': '400190080050010', 'Gloss': 'in view of', 'LexDomain': '089004', 'LN': '89.7'}\n", "\n", "\n", "Attribute: LexDomain is present in the second file but not in the first file\n", "Attribute: LN is present in the second file but not in the first file\n", "Tag/Attributes details: Node != Node or {'{http://www.w3.org/XML/1998/namespace}id': 'n40019011013', 'ref': 'MAT 19:11!13', 'Cat': 'verb', 'Start': '12', 'End': '12', 'StrongNumber': '1325', 'UnicodeLemma': 'δίδωμι', 'Person': 'Third', 'Mood': 'Indicative', 'Tense': 'Perfect', 'Number': 'Singular', 'FunctionalTag': 'V-RPI-3S', 'Type': '', 'morphId': '40019011013', 'NormalizedForm': 'δέδοται', 'Unicode': 'δέδοται.', 'FormalTag': 'V-REI-3S', 'Voice': 'Passive', 'nodeId': '400190110130010', 'Gloss': 'it has been given', 'SubjRef': 'n40019011009', 'Frame': 'A1:n40019011009 A2:n40019011012'} != {'{http://www.w3.org/XML/1998/namespace}id': 'n40019011013', 'ref': 'MAT 19:11!13', 'Cat': 'verb', 'Start': '12', 'End': '12', 'StrongNumber': '1325', 'UnicodeLemma': 'δίδωμι', 'Person': 'Third', 'Mood': 'Indicative', 'Tense': 'Perfect', 'Number': 'Singular', 'FunctionalTag': 'V-RPI-3S', 'Type': '', 'morphId': '40019011013', 'NormalizedForm': 'δέδοται', 'Unicode': 'δέδοται.', 'FormalTag': 'V-REI-3S', 'Voice': 'Passive', 'nodeId': '400190110130010', 'Gloss': 'it has been given', 'SubjRef': 'n40019011009', 'Frame': 'A1:n40019011009 A2:n40019011012', 'LexDomain': '013004', 'LN': '13.142'}\n", "\n", "\n", "Attribute: LexDomain is present in the second file but not in the first file\n", "Attribute: LN is present in the second file but not in the first file\n", "Tag/Attributes details: Node != Node or {'{http://www.w3.org/XML/1998/namespace}id': 'n40019024009', 'ref': 'MAT 19:24!9', 'Cat': 'noun', 'Start': '8', 'End': '8', 'StrongNumber': '5169', 'UnicodeLemma': 'τρῆμα', 'Gender': 'Neuter', 'Number': 'Singular', 'FunctionalTag': 'N-GSN', 'Type': 'Common', 'morphId': '40019024009', 'NormalizedForm': 'τρήματος', 'Case': 'Genitive', 'Unicode': 'τρήματος', 'FormalTag': 'N-GSN', 'nodeId': '400190240090010', 'Gloss': 'eye'} != {'{http://www.w3.org/XML/1998/namespace}id': 'n40019024009', 'ref': 'MAT 19:24!9', 'Cat': 'noun', 'Start': '8', 'End': '8', 'StrongNumber': '5169', 'UnicodeLemma': 'τρῆμα', 'Gender': 'Neuter', 'Number': 'Singular', 'FunctionalTag': 'N-GSN', 'Type': 'Common', 'morphId': '40019024009', 'NormalizedForm': 'τρήματος', 'Case': 'Genitive', 'Unicode': 'τρήματος', 'FormalTag': 'N-GSN', 'nodeId': '400190240090010', 'Gloss': 'eye', 'LexDomain': '006023', 'LN': '6.216'}\n", "\n", "\n", "Attribute: LexDomain is present in the second file but not in the first file\n", "Attribute: LN is present in the second file but not in the first file\n", "Tag/Attributes details: Node != Node or {'{http://www.w3.org/XML/1998/namespace}id': 'n40019029020', 'ref': 'MAT 19:29!20', 'Cat': 'adj', 'Start': '19', 'End': '19', 'StrongNumber': '1699', 'UnicodeLemma': 'ἐμός', 'Gender': 'Neuter', 'Number': 'Singular', 'FunctionalTag': 'S-1SGSN', 'Type': 'Possessive', 'morphId': '40019029020', 'NormalizedForm': 'ἐμοῦ', 'Case': 'Genitive', 'Unicode': 'ἐμοῦ', 'FormalTag': 'S-1SGSN', 'nodeId': '400190290200010', 'Gloss': 'My', 'Ref': 'n40019028003'} != {'{http://www.w3.org/XML/1998/namespace}id': 'n40019029020', 'ref': 'MAT 19:29!20', 'Cat': 'adj', 'Start': '19', 'End': '19', 'StrongNumber': '1699', 'UnicodeLemma': 'ἐμός', 'Gender': 'Neuter', 'Number': 'Singular', 'FunctionalTag': 'S-1SGSN', 'Type': 'Possessive', 'morphId': '40019029020', 'NormalizedForm': 'ἐμοῦ', 'Case': 'Genitive', 'Unicode': 'ἐμοῦ', 'FormalTag': 'S-1SGSN', 'nodeId': '400190290200010', 'Gloss': 'My', 'Ref': 'n40019028003', 'LexDomain': '092001', 'LN': '92.2'}\n", "\n", "\n", "Attribute: LexDomain is present in the second file but not in the first file\n", "Attribute: LN is present in the second file but not in the first file\n", "Tag/Attributes details: Node != Node or {'{http://www.w3.org/XML/1998/namespace}id': 'n40019029022', 'ref': 'MAT 19:29!22', 'Cat': 'adj', 'Start': '21', 'End': '21', 'StrongNumber': '4179', 'UnicodeLemma': 'πολλαπλασίων', 'Gender': 'Neuter', 'Number': 'Plural', 'FunctionalTag': 'A-APN', 'Type': '', 'morphId': '40019029022', 'NormalizedForm': 'πολλαπλασίονα', 'Case': 'Accusative', 'Unicode': 'πολλαπλασίονα', 'FormalTag': 'A-APN', 'nodeId': '400190290220010', 'Gloss': 'a hundredfold'} != {'{http://www.w3.org/XML/1998/namespace}id': 'n40019029022', 'ref': 'MAT 19:29!22', 'Cat': 'adj', 'Start': '21', 'End': '21', 'StrongNumber': '4179', 'UnicodeLemma': 'πολλαπλασίων', 'Gender': 'Neuter', 'Number': 'Plural', 'FunctionalTag': 'A-APN', 'Type': '', 'morphId': '40019029022', 'NormalizedForm': 'πολλαπλασίονα', 'Case': 'Accusative', 'Unicode': 'πολλαπλασίονα', 'FormalTag': 'A-APN', 'nodeId': '400190290220010', 'Gloss': 'a hundredfold', 'LexDomain': '059002', 'LN': '59.20'}\n", "\n", "\n", "Attribute: LexDomain is present in the second file but not in the first file\n", "Attribute: LN is present in the second file but not in the first file\n", "Tag/Attributes details: Node != Node or {'{http://www.w3.org/XML/1998/namespace}id': 'n40020025017', 'ref': 'MAT 20:25!17', 'Cat': 'adj', 'Start': '16', 'End': '16', 'StrongNumber': '3173', 'UnicodeLemma': 'μέγας', 'Gender': 'Masculine', 'Number': 'Plural', 'FunctionalTag': 'A-NPM', 'Type': '', 'morphId': '40020025017', 'NormalizedForm': 'μεγάλοι', 'Case': 'Nominative', 'Unicode': 'μεγάλοι', 'FormalTag': 'A-NPM', 'nodeId': '400200250170010', 'Gloss': 'great ones'} != {'{http://www.w3.org/XML/1998/namespace}id': 'n40020025017', 'ref': 'MAT 20:25!17', 'Cat': 'adj', 'Start': '16', 'End': '16', 'StrongNumber': '3173', 'UnicodeLemma': 'μέγας', 'Gender': 'Masculine', 'Number': 'Plural', 'FunctionalTag': 'A-NPM', 'Type': '', 'morphId': '40020025017', 'NormalizedForm': 'μεγάλοι', 'Case': 'Nominative', 'Unicode': 'μεγάλοι', 'FormalTag': 'A-NPM', 'nodeId': '400200250170010', 'Gloss': 'great ones', 'LexDomain': '087', 'LN': '87.40'}\n", "\n", "\n", "Attribute: LexDomain is present in the second file but not in the first file\n", "Attribute: LN is present in the second file but not in the first file\n", "Tag/Attributes details: Node != Node or {'{http://www.w3.org/XML/1998/namespace}id': 'n40021020007', 'ref': 'MAT 21:20!7', 'Cat': 'adv', 'Start': '6', 'End': '6', 'StrongNumber': '4459', 'UnicodeLemma': 'πῶς', 'FunctionalTag': 'ADV-I', 'Type': '', 'morphId': '40021020007', 'NormalizedForm': 'Πῶς', 'Unicode': 'Πῶς', 'FormalTag': 'ADV-I', 'nodeId': '400210200070010', 'Gloss': 'How'} != {'{http://www.w3.org/XML/1998/namespace}id': 'n40021020007', 'ref': 'MAT 21:20!7', 'Cat': 'adv', 'Start': '6', 'End': '6', 'StrongNumber': '4459', 'UnicodeLemma': 'πῶς', 'FunctionalTag': 'ADV-I', 'Type': '', 'morphId': '40021020007', 'NormalizedForm': 'Πῶς', 'Unicode': 'Πῶς', 'FormalTag': 'ADV-I', 'nodeId': '400210200070010', 'Gloss': 'How', 'LexDomain': '092004', 'LN': '92.16'}\n", "\n", "\n", "Attribute: LexDomain is present in the second file but not in the first file\n", "Attribute: LN is present in the second file but not in the first file\n", "Tag/Attributes details: Node != Node or {'{http://www.w3.org/XML/1998/namespace}id': 'n40021038009', 'ref': 'MAT 21:38!9', 'Cat': 'pron', 'Start': '8', 'End': '8', 'StrongNumber': '1438', 'UnicodeLemma': 'ἑαυτοῦ', 'Gender': 'Masculine', 'Number': 'Plural', 'FunctionalTag': 'F-3DPM', 'Type': 'Personal', 'morphId': '40021038009', 'NormalizedForm': 'ἑαυτοῖς', 'Case': 'Dative', 'Unicode': 'ἑαυτοῖς', 'FormalTag': 'F-3DPM', 'nodeId': '400210380090010', 'Gloss': 'themselves', 'Ref': 'n40021038003'} != {'{http://www.w3.org/XML/1998/namespace}id': 'n40021038009', 'ref': 'MAT 21:38!9', 'Cat': 'pron', 'Start': '8', 'End': '8', 'StrongNumber': '1438', 'UnicodeLemma': 'ἑαυτοῦ', 'Gender': 'Masculine', 'Number': 'Plural', 'FunctionalTag': 'F-3DPM', 'Type': 'Personal', 'morphId': '40021038009', 'NormalizedForm': 'ἑαυτοῖς', 'Case': 'Dative', 'Unicode': 'ἑαυτοῖς', 'FormalTag': 'F-3DPM', 'nodeId': '400210380090010', 'Gloss': 'themselves', 'Ref': 'n40021038003', 'LexDomain': '092005', 'LN': '92.26'}\n", "\n", "\n", "Attribute: LexDomain is present in the second file but not in the first file\n", "Attribute: LN is present in the second file but not in the first file\n", "Tag/Attributes details: Node != Node or {'{http://www.w3.org/XML/1998/namespace}id': 'n40022010020', 'ref': 'MAT 22:10!20', 'Cat': 'noun', 'Start': '3', 'End': '3', 'StrongNumber': '3567', 'UnicodeLemma': 'νυμφών', 'Gender': 'Masculine', 'Number': 'Singular', 'FunctionalTag': 'N-NSM', 'Type': 'Common', 'morphId': '40022010020', 'NormalizedForm': 'νυμφών', 'Case': 'Nominative', 'Unicode': 'νυμφὼν', 'FormalTag': 'N-NSM', 'nodeId': '400220100200010', 'Gloss': 'wedding hall'} != {'{http://www.w3.org/XML/1998/namespace}id': 'n40022010020', 'ref': 'MAT 22:10!20', 'Cat': 'noun', 'Start': '3', 'End': '3', 'StrongNumber': '3567', 'UnicodeLemma': 'νυμφών', 'Gender': 'Masculine', 'Number': 'Singular', 'FunctionalTag': 'N-NSM', 'Type': 'Common', 'morphId': '40022010020', 'NormalizedForm': 'νυμφών', 'Case': 'Nominative', 'Unicode': 'νυμφὼν', 'FormalTag': 'N-NSM', 'nodeId': '400220100200010', 'Gloss': 'wedding hall', 'LexDomain': '007003', 'LN': '7.34'}\n", "\n", "\n", "Attribute: LexDomain - Value in first file: 078001, Value in second file: 078001 087003\n", "Attribute: LN - Value in first file: 78.2, Value in second file: 78.2 87.22\n", "Tag/Attributes details: Node != Node or {'{http://www.w3.org/XML/1998/namespace}id': 'n40024024009', 'ref': 'MAT 24:24!9', 'Cat': 'adj', 'Start': '8', 'End': '8', 'StrongNumber': '3173', 'UnicodeLemma': 'μέγας', 'Gender': 'Neuter', 'Number': 'Plural', 'FunctionalTag': 'A-APN', 'Type': '', 'morphId': '40024024009', 'NormalizedForm': 'μεγάλα', 'Case': 'Accusative', 'Unicode': 'μεγάλα', 'FormalTag': 'A-APN', 'nodeId': '400240240090010', 'Gloss': 'great', 'LexDomain': '078001', 'LN': '78.2'} != {'{http://www.w3.org/XML/1998/namespace}id': 'n40024024009', 'ref': 'MAT 24:24!9', 'Cat': 'adj', 'Start': '8', 'End': '8', 'StrongNumber': '3173', 'UnicodeLemma': 'μέγας', 'Gender': 'Neuter', 'Number': 'Plural', 'FunctionalTag': 'A-APN', 'Type': '', 'morphId': '40024024009', 'NormalizedForm': 'μεγάλα', 'Case': 'Accusative', 'Unicode': 'μεγάλα', 'FormalTag': 'A-APN', 'nodeId': '400240240090010', 'Gloss': 'great', 'LexDomain': '078001 087003', 'LN': '78.2 87.22'}\n", "\n", "\n", "Attribute: LexDomain is present in the second file but not in the first file\n", "Attribute: LN is present in the second file but not in the first file\n", "Tag/Attributes details: Node != Node or {'{http://www.w3.org/XML/1998/namespace}id': 'n40025015004', 'ref': 'MAT 25:15!4', 'Cat': 'verb', 'Start': '17', 'End': '17', 'StrongNumber': '1325', 'UnicodeLemma': 'δίδωμι', 'Person': 'Third', 'Mood': 'Indicative', 'Tense': 'Aorist', 'Number': 'Singular', 'FunctionalTag': 'V-AAI-3S', 'Type': '', 'morphId': '40025015004', 'NormalizedForm': 'ἔδωκεν', 'Unicode': 'ἔδωκεν', 'FormalTag': 'V-AAI-3S', 'Voice': 'Active', 'nodeId': '400250150040010', 'Gloss': 'he gave', 'SubjRef': 'n40025014003', 'Frame': 'A0:n40025014003 A2:n40025015002 A1:n40025015006'} != {'{http://www.w3.org/XML/1998/namespace}id': 'n40025015004', 'ref': 'MAT 25:15!4', 'Cat': 'verb', 'Start': '17', 'End': '17', 'StrongNumber': '1325', 'UnicodeLemma': 'δίδωμι', 'Person': 'Third', 'Mood': 'Indicative', 'Tense': 'Aorist', 'Number': 'Singular', 'FunctionalTag': 'V-AAI-3S', 'Type': '', 'morphId': '40025015004', 'NormalizedForm': 'ἔδωκεν', 'Unicode': 'ἔδωκεν', 'FormalTag': 'V-AAI-3S', 'Voice': 'Active', 'nodeId': '400250150040010', 'Gloss': 'he gave', 'SubjRef': 'n40025014003', 'Frame': 'A0:n40025014003 A2:n40025015002 A1:n40025015006', 'LexDomain': '057008', 'LN': '57.71'}\n", "\n", "\n", "Attribute: LexDomain is present in the second file but not in the first file\n", "Attribute: LN is present in the second file but not in the first file\n", "Tag/Attributes details: Node != Node or {'{http://www.w3.org/XML/1998/namespace}id': 'n40027062004', 'ref': 'MAT 27:62!4', 'Cat': 'pron', 'Start': '3', 'End': '3', 'StrongNumber': '3748', 'UnicodeLemma': 'ὅστις', 'Gender': 'Feminine', 'Number': 'Singular', 'FunctionalTag': 'R-NSF', 'Type': 'Relative', 'morphId': '40027062004', 'NormalizedForm': 'ἥτις', 'Case': 'Nominative', 'Unicode': 'ἥτις', 'FormalTag': 'R-NSF', 'nodeId': '400270620040010', 'Gloss': 'which', 'Ref': 'n40027062003'} != {'{http://www.w3.org/XML/1998/namespace}id': 'n40027062004', 'ref': 'MAT 27:62!4', 'Cat': 'pron', 'Start': '3', 'End': '3', 'StrongNumber': '3748', 'UnicodeLemma': 'ὅστις', 'Gender': 'Feminine', 'Number': 'Singular', 'FunctionalTag': 'R-NSF', 'Type': 'Relative', 'morphId': '40027062004', 'NormalizedForm': 'ἥτις', 'Case': 'Nominative', 'Unicode': 'ἥτις', 'FormalTag': 'R-NSF', 'nodeId': '400270620040010', 'Gloss': 'which', 'Ref': 'n40027062003', 'LexDomain': '092004', 'LN': '92.18'}\n" ] } ], "source": [ "import xml.etree.ElementTree as ET\n", "\n", "def normalize_text(text):\n", " return ' '.join(text.strip().split())\n", "\n", "def compare_xml_files(file1, file2, details):\n", " # Parse the XML files\n", " tree1 = ET.parse(file1)\n", " tree2 = ET.parse(file2)\n", "\n", " # Get the root elements of both trees\n", " root1 = tree1.getroot()\n", " root2 = tree2.getroot()\n", "\n", " # Compare the two root elements and their descendants recursively\n", " differences=compare_elements(root1, root2, details)\n", "\n", " if not differences:\n", " print(\"The XML files are identical.\")\n", " else:\n", " print(\"The XML files are different.\")\n", " if details:\n", " print(\"\\nDetails:\")\n", " for diff in differences:\n", " print(diff)\n", "\n", "def compare_elements(elem1, elem2, details):\n", " differences = []\n", " ReportTag=ReportElement=ReportChildren=ReportChildDiff=True\n", " \n", " # Compare element tags and attributes\n", " if elem1.tag != elem2.tag or elem1.attrib != elem2.attrib:\n", " if details:\n", " differences.append(f\"\\n\")\n", " for attr in elem1.attrib:\n", " if attr not in elem2.attrib:\n", " differences.append(f\"Attribute: {attr} is present in the first file but not in the second file\")\n", "\n", " for attr in elem2.attrib:\n", " if attr not in elem1.attrib:\n", " differences.append(f\"Attribute: {attr} is present in the second file but not in the first file\")\n", " \n", " for attr in elem1.attrib:\n", " if attr in elem2.attrib and elem1.attrib[attr] != elem2.attrib[attr]:\n", " differences.append(f\"Attribute: {attr} - Value in first file: {elem1.attrib[attr]}, Value in second file: {elem2.attrib[attr]}\")\n", " \n", " differences.append(f\"Tag/Attributes details: {elem1.tag} != {elem2.tag} or {elem1.attrib} != {elem2.attrib}\")\n", " \n", " else:\n", " if ReportTag==True:\n", " differences.append(\"Differences in Tag/Attributes found\")\n", " ReportTag=False\n", "\n", " # Normalize and compare element text\n", " text1 = normalize_text(elem1.text)\n", " text2 = normalize_text(elem2.text)\n", " \n", " if text1 != text2:\n", " if details:\n", " differences.append(\"Differences in element Text found\")\n", " differences.append(f\"Text: {elem1.text} != {elem2.text}\\n\")\n", " else:\n", " if ReportElement==True:\n", " differences.append(\"Differences in element Text found\")\n", " ReportElement=False\n", "\n", " # Compare element children recursively\n", " children1 = list(elem1)\n", " children2 = list(elem2)\n", " if len(children1) != len(children2):\n", " if details:\n", " differences.append(\"Differences in number of children\")\n", " differences.append(f\"Number of Children: {len(children1)} != {len(children2)}\\n\")\n", " else:\n", " if ReportChildren==True:\n", " differences.append(\"Differences in number of children\")\n", " ReportChildren=False \n", " else:\n", " for child1, child2 in zip(children1, children2):\n", " child_diff = compare_elements(child1, child2, details)\n", " differences.extend(child_diff)\n", " \n", " return differences\n", "\n", "# this is the main part\n", "print (\"Comparing file \",file1_path,\" with \",file2_path,\"\\n\\nResult:\",end=\"\")\n", "compare_xml_files(file1_path, file2_path, details)" ] }, { "cell_type": "code", "execution_count": null, "id": "f6638381-0020-4157-be97-f45f5ec5ddc7", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "1c42bbba-912a-47c1-ad91-9c55562b0414", "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" } }, "nbformat": 4, "nbformat_minor": 5 }