tarkib 2.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. tarkib-2.0.0/LICENSE +176 -0
  2. tarkib-2.0.0/NOTICE +15 -0
  3. tarkib-2.0.0/PKG-INFO +155 -0
  4. tarkib-2.0.0/README.md +119 -0
  5. tarkib-2.0.0/pyproject.toml +63 -0
  6. tarkib-2.0.0/setup.cfg +4 -0
  7. tarkib-2.0.0/tarkib/__init__.py +10 -0
  8. tarkib-2.0.0/tarkib/algebraic_merge.py +1239 -0
  9. tarkib-2.0.0/tarkib/benchmark_diachronic_auditor.py +470 -0
  10. tarkib-2.0.0/tarkib/benchmark_fiber_rag.py +545 -0
  11. tarkib-2.0.0/tarkib/benchmark_llm_algebra.py +615 -0
  12. tarkib-2.0.0/tarkib/benchmark_rasm_restorer.py +351 -0
  13. tarkib-2.0.0/tarkib/benchmark_terminology_qa.py +309 -0
  14. tarkib-2.0.0/tarkib/burhan_experiments.py +2026 -0
  15. tarkib-2.0.0/tarkib/cli.py +639 -0
  16. tarkib-2.0.0/tarkib/colab_bayan_qwen8b.py +347 -0
  17. tarkib-2.0.0/tarkib/colab_burhan_qwen8b.py +369 -0
  18. tarkib-2.0.0/tarkib/colab_master_runner.py +855 -0
  19. tarkib-2.0.0/tarkib/colab_qwen8b_invariance.py +451 -0
  20. tarkib-2.0.0/tarkib/corpus.py +1082 -0
  21. tarkib-2.0.0/tarkib/data/bayan_quranic_furuq_atlas.json +788 -0
  22. tarkib-2.0.0/tarkib/data/bayan_qwen8b_invariance.json +2116 -0
  23. tarkib-2.0.0/tarkib/data/bayan_results_summary.json +1327 -0
  24. tarkib-2.0.0/tarkib/data/burhan_metaphor_pairs.jsonl +138 -0
  25. tarkib-2.0.0/tarkib/data/burhan_multi_asl_fibers.jsonl +4129 -0
  26. tarkib-2.0.0/tarkib/data/burhan_qwen8b_invariance.json +685 -0
  27. tarkib-2.0.0/tarkib/data/burhan_results_summary.json +1768 -0
  28. tarkib-2.0.0/tarkib/data/cache/llm_algebra_ops_v1.npz +0 -0
  29. tarkib-2.0.0/tarkib/data/cache/master_e5_bundle.json.gz +0 -0
  30. tarkib-2.0.0/tarkib/data/cache/quran_span_ngrams.json.gz +0 -0
  31. tarkib-2.0.0/tarkib/data/diachronic_auditor_benchmark.json +149 -0
  32. tarkib-2.0.0/tarkib/data/diwan_results_summary.json +1394 -0
  33. tarkib-2.0.0/tarkib/data/fiber_rag_benchmark.json +118 -0
  34. tarkib-2.0.0/tarkib/data/governed_mt_results_summary.json +479 -0
  35. tarkib-2.0.0/tarkib/data/ijaz_results_summary.json +3733 -0
  36. tarkib-2.0.0/tarkib/data/ijaz_safe_gold_muhmal_atlas.json +998 -0
  37. tarkib-2.0.0/tarkib/data/iqtiran_results_summary.json +2096 -0
  38. tarkib-2.0.0/tarkib/data/iqtiran_verified_witnesses.json +2317 -0
  39. tarkib-2.0.0/tarkib/data/jadwal_periodic_atlas.jsonl +11249 -0
  40. tarkib-2.0.0/tarkib/data/jadwal_results_summary.json +2769 -0
  41. tarkib-2.0.0/tarkib/data/jadwal_verified_witnesses.json +1566 -0
  42. tarkib-2.0.0/tarkib/data/llm_algebra_benchmark.json +662 -0
  43. tarkib-2.0.0/tarkib/data/maqayis_cleaned.jsonl +4798 -0
  44. tarkib-2.0.0/tarkib/data/mizan_ontological_syntheses.json +1063 -0
  45. tarkib-2.0.0/tarkib/data/mizan_qwen8b_invariance.json +913 -0
  46. tarkib-2.0.0/tarkib/data/mizan_results_summary.json +1366 -0
  47. tarkib-2.0.0/tarkib/data/morph_operator_atlas.jsonl +13 -0
  48. tarkib-2.0.0/tarkib/data/ocp_physics_derivation.json +1793 -0
  49. tarkib-2.0.0/tarkib/data/quad_naht_ground_truth.jsonl +72 -0
  50. tarkib-2.0.0/tarkib/data/rasm_restorer_benchmark.json +371 -0
  51. tarkib-2.0.0/tarkib/data/results_summary.json +3817 -0
  52. tarkib-2.0.0/tarkib/data/sarfchat_results_summary.json +6491 -0
  53. tarkib-2.0.0/tarkib/data/subroot_lexicon.jsonl +716 -0
  54. tarkib-2.0.0/tarkib/data/synthetic_roots_atlas.jsonl +1143 -0
  55. tarkib-2.0.0/tarkib/data/tayf_arena_benchmark.json +819 -0
  56. tarkib-2.0.0/tarkib/data/terminology_qa_benchmark.json +105 -0
  57. tarkib-2.0.0/tarkib/data/true_muhmal_mendeleev_atlas.jsonl +605 -0
  58. tarkib-2.0.0/tarkib/diachronic_auditor.py +1728 -0
  59. tarkib-2.0.0/tarkib/experiments.py +1154 -0
  60. tarkib-2.0.0/tarkib/external_lexicons.py +348 -0
  61. tarkib-2.0.0/tarkib/fiber_rag.py +1107 -0
  62. tarkib-2.0.0/tarkib/iqtiran_experiments.py +1277 -0
  63. tarkib-2.0.0/tarkib/iqtiran_tp_worker.py +1068 -0
  64. tarkib-2.0.0/tarkib/jadwal_experiments.py +991 -0
  65. tarkib-2.0.0/tarkib/jadwal_s5_audit.py +1087 -0
  66. tarkib-2.0.0/tarkib/jadwal_tp_worker.py +1807 -0
  67. tarkib-2.0.0/tarkib/kinematic_phonetics.py +758 -0
  68. tarkib-2.0.0/tarkib/lexical_compression.py +1786 -0
  69. tarkib-2.0.0/tarkib/llm_algebra.py +2181 -0
  70. tarkib-2.0.0/tarkib/make_book_figures.py +914 -0
  71. tarkib-2.0.0/tarkib/make_english_figures.py +1215 -0
  72. tarkib-2.0.0/tarkib/make_figures.py +448 -0
  73. tarkib-2.0.0/tarkib/make_figures_v2.py +428 -0
  74. tarkib-2.0.0/tarkib/make_figures_v3.py +404 -0
  75. tarkib-2.0.0/tarkib/make_figures_v4.py +498 -0
  76. tarkib-2.0.0/tarkib/make_figures_v5.py +449 -0
  77. tarkib-2.0.0/tarkib/make_figures_v6.py +474 -0
  78. tarkib-2.0.0/tarkib/make_figures_v7.py +621 -0
  79. tarkib-2.0.0/tarkib/make_figures_v8_book_ext.py +685 -0
  80. tarkib-2.0.0/tarkib/mcp_server.py +633 -0
  81. tarkib-2.0.0/tarkib/mizan_engine.py +802 -0
  82. tarkib-2.0.0/tarkib/morph_operators.py +1194 -0
  83. tarkib-2.0.0/tarkib/multi_asl_fibers.py +661 -0
  84. tarkib-2.0.0/tarkib/phonetics.py +200 -0
  85. tarkib-2.0.0/tarkib/quran_corpus.py +472 -0
  86. tarkib-2.0.0/tarkib/quran_experiments.py +1562 -0
  87. tarkib-2.0.0/tarkib/rasm_restorer.py +991 -0
  88. tarkib-2.0.0/tarkib/run_all.py +119 -0
  89. tarkib-2.0.0/tarkib/run_bayan.py +156 -0
  90. tarkib-2.0.0/tarkib/run_burhan.py +361 -0
  91. tarkib-2.0.0/tarkib/run_ijaz.py +235 -0
  92. tarkib-2.0.0/tarkib/run_iqtiran.py +232 -0
  93. tarkib-2.0.0/tarkib/run_jadwal.py +552 -0
  94. tarkib-2.0.0/tarkib/run_mizan.py +206 -0
  95. tarkib-2.0.0/tarkib/sdk.py +3237 -0
  96. tarkib-2.0.0/tarkib/semantics.py +255 -0
  97. tarkib-2.0.0/tarkib/studio.py +1126 -0
  98. tarkib-2.0.0/tarkib/terminology_qa.py +1129 -0
  99. tarkib-2.0.0/tarkib/validation_v2.py +734 -0
  100. tarkib-2.0.0/tarkib/vocal_tract_ocp_physics.py +848 -0
  101. tarkib-2.0.0/tarkib/zero_llm_graph.py +609 -0
  102. tarkib-2.0.0/tarkib.egg-info/PKG-INFO +155 -0
  103. tarkib-2.0.0/tarkib.egg-info/SOURCES.txt +114 -0
  104. tarkib-2.0.0/tarkib.egg-info/dependency_links.txt +1 -0
  105. tarkib-2.0.0/tarkib.egg-info/entry_points.txt +4 -0
  106. tarkib-2.0.0/tarkib.egg-info/requires.txt +8 -0
  107. tarkib-2.0.0/tarkib.egg-info/top_level.txt +1 -0
  108. tarkib-2.0.0/tests/test_audit_remediation.py +546 -0
  109. tarkib-2.0.0/tests/test_diachronic_and_terminology_qa.py +317 -0
  110. tarkib-2.0.0/tests/test_engineering_sdk.py +363 -0
  111. tarkib-2.0.0/tests/test_fiber_rag_and_rasm.py +209 -0
  112. tarkib-2.0.0/tests/test_ledger_manuscript_sync.py +332 -0
  113. tarkib-2.0.0/tests/test_llm_algebra.py +384 -0
  114. tarkib-2.0.0/tests/test_ocp_physics_derivation.py +128 -0
  115. tarkib-2.0.0/tests/test_openiti_public_mode.py +62 -0
  116. tarkib-2.0.0/tests/test_v2_jadwal_iqtiran_sdk.py +115 -0
tarkib-2.0.0/LICENSE ADDED
@@ -0,0 +1,176 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the Work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
tarkib-2.0.0/NOTICE ADDED
@@ -0,0 +1,15 @@
1
+ Tarkīb (تركيب) v2.0.0 — Maqāyīs (مَقاييس) Open-Source Ecosystem
2
+ Copyright 2026 Salah Abdo and successor entity
3
+
4
+ Software & Source Code License:
5
+ Licensed under the Apache License, Version 2.0 (Apache-2.0).
6
+ You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
7
+
8
+ Book, Research Monographs, & Public Linguistic Atlases (`book/`, `paper*/`, `papers_en/`, `data/`):
9
+ Licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0).
10
+ https://creativecommons.org/licenses/by/4.0/
11
+
12
+ Clean-Room Classical Heritage Provenance:
13
+ Public `tarkib` (`TARKIB_OPENITI_ONLY=1`) derives strictly from pre-modern public-domain
14
+ classical Arabic lexicons (170–1205 AH via OpenITI witnesses with `#META#` editorial
15
+ headers stripped). See `DATA_PROVENANCE_BOM.md` and `sources/external/provenance.json`.
tarkib-2.0.0/PKG-INFO ADDED
@@ -0,0 +1,155 @@
1
+ Metadata-Version: 2.4
2
+ Name: tarkib
3
+ Version: 2.0.0
4
+ Summary: Computational Philology, Sub-Lexical Algebraic Semantics, Jadwal & Iqtiran Arabic NLP SDK (Maqayis)
5
+ Author-email: Salah Abdo <Salah.Abdo.Tech@gmail.com>
6
+ License: Apache-2.0
7
+ Project-URL: Homepage, https://maqayis.org
8
+ Project-URL: Repository, https://github.com/maqayis/tarkib
9
+ Project-URL: Mirror, https://codeberg.org/maqayis/tarkib
10
+ Project-URL: Documentation, https://maqayis.org
11
+ Keywords: arabic,nlp,computational-philology,morphology,zero-llm,maqayis,tarkib
12
+ Classifier: Development Status :: 5 - Production/Stable
13
+ Classifier: Intended Audience :: Science/Research
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: Apache Software License
16
+ Classifier: Natural Language :: Arabic
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
23
+ Classifier: Topic :: Text Processing :: Linguistic
24
+ Requires-Python: >=3.10
25
+ Description-Content-Type: text/markdown
26
+ License-File: LICENSE
27
+ License-File: NOTICE
28
+ Requires-Dist: numpy>=1.24
29
+ Requires-Dist: scipy>=1.10
30
+ Requires-Dist: scikit-learn>=1.3
31
+ Provides-Extra: hybrid
32
+ Requires-Dist: torch>=2.1; extra == "hybrid"
33
+ Requires-Dist: transformers>=4.40; extra == "hybrid"
34
+ Requires-Dist: sentence-transformers>=2.6; extra == "hybrid"
35
+ Dynamic: license-file
36
+
37
+ # Tarkīb (`تركيب`) v2.0.0 — هندسة اللسان العربي وجبر المعجم التحت-جذري
38
+
39
+ <div align="center">
40
+
41
+ **Computational Philology, Sub-Lexical Algebraic Semantics, & Zero-LLM Arabic NLP Engine**
42
+ Part of the **Maqāyīs (`مَقاييس`)** Open-Source Ecosystem · [maqayis.org](https://maqayis.org) · [github.com/maqayis/tarkib](https://github.com/maqayis/tarkib)
43
+
44
+ [![License: Apache-2.0](https://img.shields.io/badge/Code-Apache--2.0-blue.svg)](LICENSE)
45
+ [![Data & Book: CC BY 4.0](https://img.shields.io/badge/Book%20%26%20Atlases-CC%20BY%204.0-teal.svg)](NOTICE)
46
+ [![Python 3.10+](https://img.shields.io/badge/Python-3.10%2B-3776AB.svg)](pyproject.toml)
47
+ [![Zero-LLM Ready](https://img.shields.io/badge/Mode-Zero--LLM%20%280%20Neural%20Params%29-success.svg)](DATA_PROVENANCE_BOM.md)
48
+
49
+ </div>
50
+
51
+ ---
52
+
53
+ ## نظرة عامّة | Overview
54
+
55
+ **`tarkib` (`تركيب` v2.0.0)** هو المحرّك الأساسي للفقه الحاسوبي وجبر الدلالة التحت-جذرية والصرف الريماني في منظومة **مَقاييس (`Maqāyīs`)** بقيادة المؤلّف **صلاح عبده (`Salah Abdo`)**. يعمل المحرّك في طوره الافتراضي **`mode="zero_llm"`** بصفر أوزان عصبية وباعتمادٍ نقيّ (`TARKIB_OPENITI_ONLY=1`) على خمسة معاجم تراثية عربية من المشاع العام تمتدّ عبر **1,035 سنة قمرية (`170–1205` هـ)**: *العين*، *الصحاح*، *مقاييس اللغة* لابن فارس، *لسان العرب*، و*تاج العروس*.
56
+
57
+ **`tarkib` (`v2.0.0`)** is the core computational-philology and sub-lexical algebraic Arabic NLP SDK of the **Maqāyīs (`مَقاييس`)** ecosystem by **Salah Abdo**. In its default `mode="zero_llm"`, `TarkibEngine` executes with **zero neural parameters** over a 256-dimensional spectral manifold constructed strictly from five pre-modern public-domain classical Arabic lexicons (`170–1205 AH`), packaged cleanly inside the Python wheel so every API works out of the box with zero external database setup.
58
+
59
+ ---
60
+
61
+ ## التثبيت السريع | Installation
62
+
63
+ ```bash
64
+ pip install tarkib
65
+ # Or with uv:
66
+ uv add tarkib
67
+ ```
68
+
69
+ Optional neural hybrid manifold (`intfloat/multilingual-e5-large` + PyTorch adapter):
70
+
71
+ ```bash
72
+ pip install "tarkib[hybrid]"
73
+ ```
74
+
75
+ ---
76
+
77
+ ## الاستخدام البرمجي الموحَّد (`v2.0.0` SDK) | Quickstart
78
+
79
+ ```python
80
+ from tarkib import TarkibEngine
81
+
82
+ engine = TarkibEngine(mode="zero_llm")
83
+
84
+ # 1. Structural, kinematic, & Grassmannian Root X-Ray (`21,952` Sigma_28^3 cube)
85
+ xray = engine.inspect_root("كتب")
86
+
87
+ # 2. Zero-leakage Furūq near-synonym comparison
88
+ furuq = engine.compare_furuq("سنة", "عام")
89
+
90
+ # 3. Al-Jadwal Periodic Table of Arabic Roots (`11,249` roots across S0–S5 strata)
91
+ jadwal = engine.inspect_jadwal("كتب")
92
+
93
+ # 4. Iqtirān 66-Atom Morpho-Syntactic Phase-Coupling Algebra (`B01–B31 × R01–R35`)
94
+ iqtiran_all = engine.inspect_iqtiran()
95
+ iqtiran_fi = engine.inspect_iqtiran("في")
96
+
97
+ # 5. Paleographic undotted rasm Viterbi restoration (0% post-1205 AH anachronism)
98
+ rasm = engine.restore_rasm("ٮسم الله الرحمں الرحىم")
99
+
100
+ # 6. Six-Gate CI/CD Terminology & Localization Governance QA (legal/financial/technical)
101
+ qa = engine.terminology_qa("msgid \" Encryption\"\nmsgstr \"تعمية\"\n", fmt="po")
102
+ ```
103
+
104
+ ### Unified `TarkibEngine(mode="zero_llm")` Methods (`v2.0.0`)
105
+
106
+ | Method | Subsystem | Description |
107
+ | :--- | :--- | :--- |
108
+ | `inspect_root(token_or_root)` | **Tarkīb · Bayān · Burhān** | Full Root X-Ray across `21,952` cells (`((C1*C2)*C3)`, Sībawayhian 13-feature kinematics, Grassmannian fibers) |
109
+ | `inspect_jadwal(root)` | **Al-Jadwal (`الجدول`)** | Periodic Table lookup across `11,249` roots, `S0–S5` strata, `[C1C2_]` genera, and verified witnesses |
110
+ | `inspect_iqtiran(particle=None)` | **Iqtirān (`اقتران`)** | Closed `66`-atom morpho-syntactic algebra (`31` `B` × `35` `R` = `1,085` cells, `Delta_12`, Laws `ن١١–ن١٦`) |
111
+ | `compare_furuq(a, b, sentence=...)` | **Bayān (`بيان`)** | Zero-leakage contextual & intrinsic *Furūq* ranker (`rank_contextual_furuq`) |
112
+ | `audit_tashif(text)` | **Ījāz (`إيجاز`)** | Shannon guardband anti-*taṣḥīf* & `OCR/ASR` repair (`audit_tashif_and_ocr`) |
113
+ | `coin_term(concept_ar, ...)` | **Ījāz · Dīwān** | Six-gate scientific/technical/regulatory neologism coining (`coin_scientific_term`) |
114
+ | `tokenize_text(text)` | **Mīzān (`ميزان`)** | Non-concatenative `(proclitic, root_3, pattern_id, enclitic)` tokenizer (`0.0%` root fragmentation) |
115
+ | `fiber_rag(query, ...)` | **Burhān · Tayf** | Grassmannian fiber & metaphor-transport `T_majaz` retrieval (`search_fiber_rag`) |
116
+ | `restore_rasm(text, ...)` | **Paleography** | Exact Viterbi undotted *rasm* decoder over `170–1205 AH` lexicons (`restore_undotted_rasm`) |
117
+ | `audit_diachronic(text, ...)` | **Millennium Drift** | 5-epoch (`170→1205 AH`) semantic drift & anachronism detector (`audit_diachronic_anachronism`) |
118
+ | `terminology_qa(content, ...)` | **CI/CD Governance** | 6-gate localization QA for legal, financial, regulatory, & software pipelines (`SARIF 2.1.0`) |
119
+
120
+ ---
121
+
122
+ ## الحصيلة القياسية المجمّدة (`data/*.json`) | Frozen Empirical Benchmarks
123
+
124
+ All headline benchmarks are deterministically synchronized with `data/*.json` and verified by `pytest`:
125
+
126
+ - **First-Principles Vocal-Tract OCP Hamiltonian (`ocp_physics_derivation.json`):** Zero-corpus biomechanical Hamiltonian achieves **`0.8451`** out-of-fold AUROC across `6,963` pan-classical roots vs. **`0.7960`** for the unigram consonant-frequency baseline.
127
+ - **Grassmannian Fiber & Metaphor-Aware RAG (`fiber_rag_benchmark.json`):** Surgical `rigid_jamid_nominal` vs. `eventive_derived` isolation reaches **`53.03%`** `Precision@1` under strict `0%` non-root vocabulary overlap.
128
+ - **Paleographic Rasm Viterbi Restorer (`rasm_restorer_benchmark.json`):** Contextual Viterbi lattice decoding achieves **`+13.64`** percentage-point accuracy gain over unigram baselines on minimal-pair *rasm* traps with `0.00%` modern lexical intrusion.
129
+ - **Millennium Diachronic Anachronism Auditor (`diachronic_auditor_benchmark.json`):** Semantic calque detection achieves **`90.0%`** balanced accuracy with the classical calque atlas (`65.0%` fully unsupervised Leave-One-Root-Out graph coherence).
130
+ - **Six-Gate CI/CD Terminology QA (`terminology_qa_benchmark.json`):** Achieves **`98.04%`** `F1` across all 6 governance gates and **`97.67%`** `F1` under objective-defects-only policy on software, financial, regulatory, and legal localization suites.
131
+
132
+ ---
133
+
134
+ ## الواجهات التنفيذية (`CLI` · `MCP` · `Web Studio`) | Interfaces
135
+
136
+ ```bash
137
+ # Command-line interface
138
+ tarkib inspect يستغفرون
139
+ tarkib qa-gate path/to/translations.po --fail-under 85
140
+
141
+ # Model Context Protocol (MCP) JSON-RPC 2.0 stdio server (11 tools)
142
+ tarkib-mcp --mode zero_llm
143
+
144
+ # Interactive RTL Web Studio
145
+ tarkib-studio --port 8765
146
+ ```
147
+
148
+ ---
149
+
150
+ ## الترخيص ونسب المصادر | License & Provenance
151
+
152
+ - **Code (`Apache-2.0`):** Licensed under the [Apache License, Version 2.0](LICENSE).
153
+ - **Book & Public Linguistic Atlases (`CC BY 4.0`):** `book/`, `paper*/`, `papers_en/`, and `data/` are licensed under [Creative Commons Attribution 4.0 International (`CC BY 4.0`)](https://creativecommons.org/licenses/by/4.0/).
154
+ - **Provenance BOM:** See [`DATA_PROVENANCE_BOM.md`](DATA_PROVENANCE_BOM.md) and [`NOTICE`](NOTICE).
155
+ - **Copyright:** `Copyright 2026 Salah Abdo and successor entity`.
tarkib-2.0.0/README.md ADDED
@@ -0,0 +1,119 @@
1
+ # Tarkīb (`تركيب`) v2.0.0 — هندسة اللسان العربي وجبر المعجم التحت-جذري
2
+
3
+ <div align="center">
4
+
5
+ **Computational Philology, Sub-Lexical Algebraic Semantics, & Zero-LLM Arabic NLP Engine**
6
+ Part of the **Maqāyīs (`مَقاييس`)** Open-Source Ecosystem · [maqayis.org](https://maqayis.org) · [github.com/maqayis/tarkib](https://github.com/maqayis/tarkib)
7
+
8
+ [![License: Apache-2.0](https://img.shields.io/badge/Code-Apache--2.0-blue.svg)](LICENSE)
9
+ [![Data & Book: CC BY 4.0](https://img.shields.io/badge/Book%20%26%20Atlases-CC%20BY%204.0-teal.svg)](NOTICE)
10
+ [![Python 3.10+](https://img.shields.io/badge/Python-3.10%2B-3776AB.svg)](pyproject.toml)
11
+ [![Zero-LLM Ready](https://img.shields.io/badge/Mode-Zero--LLM%20%280%20Neural%20Params%29-success.svg)](DATA_PROVENANCE_BOM.md)
12
+
13
+ </div>
14
+
15
+ ---
16
+
17
+ ## نظرة عامّة | Overview
18
+
19
+ **`tarkib` (`تركيب` v2.0.0)** هو المحرّك الأساسي للفقه الحاسوبي وجبر الدلالة التحت-جذرية والصرف الريماني في منظومة **مَقاييس (`Maqāyīs`)** بقيادة المؤلّف **صلاح عبده (`Salah Abdo`)**. يعمل المحرّك في طوره الافتراضي **`mode="zero_llm"`** بصفر أوزان عصبية وباعتمادٍ نقيّ (`TARKIB_OPENITI_ONLY=1`) على خمسة معاجم تراثية عربية من المشاع العام تمتدّ عبر **1,035 سنة قمرية (`170–1205` هـ)**: *العين*، *الصحاح*، *مقاييس اللغة* لابن فارس، *لسان العرب*، و*تاج العروس*.
20
+
21
+ **`tarkib` (`v2.0.0`)** is the core computational-philology and sub-lexical algebraic Arabic NLP SDK of the **Maqāyīs (`مَقاييس`)** ecosystem by **Salah Abdo**. In its default `mode="zero_llm"`, `TarkibEngine` executes with **zero neural parameters** over a 256-dimensional spectral manifold constructed strictly from five pre-modern public-domain classical Arabic lexicons (`170–1205 AH`), packaged cleanly inside the Python wheel so every API works out of the box with zero external database setup.
22
+
23
+ ---
24
+
25
+ ## التثبيت السريع | Installation
26
+
27
+ ```bash
28
+ pip install tarkib
29
+ # Or with uv:
30
+ uv add tarkib
31
+ ```
32
+
33
+ Optional neural hybrid manifold (`intfloat/multilingual-e5-large` + PyTorch adapter):
34
+
35
+ ```bash
36
+ pip install "tarkib[hybrid]"
37
+ ```
38
+
39
+ ---
40
+
41
+ ## الاستخدام البرمجي الموحَّد (`v2.0.0` SDK) | Quickstart
42
+
43
+ ```python
44
+ from tarkib import TarkibEngine
45
+
46
+ engine = TarkibEngine(mode="zero_llm")
47
+
48
+ # 1. Structural, kinematic, & Grassmannian Root X-Ray (`21,952` Sigma_28^3 cube)
49
+ xray = engine.inspect_root("كتب")
50
+
51
+ # 2. Zero-leakage Furūq near-synonym comparison
52
+ furuq = engine.compare_furuq("سنة", "عام")
53
+
54
+ # 3. Al-Jadwal Periodic Table of Arabic Roots (`11,249` roots across S0–S5 strata)
55
+ jadwal = engine.inspect_jadwal("كتب")
56
+
57
+ # 4. Iqtirān 66-Atom Morpho-Syntactic Phase-Coupling Algebra (`B01–B31 × R01–R35`)
58
+ iqtiran_all = engine.inspect_iqtiran()
59
+ iqtiran_fi = engine.inspect_iqtiran("في")
60
+
61
+ # 5. Paleographic undotted rasm Viterbi restoration (0% post-1205 AH anachronism)
62
+ rasm = engine.restore_rasm("ٮسم الله الرحمں الرحىم")
63
+
64
+ # 6. Six-Gate CI/CD Terminology & Localization Governance QA (legal/financial/technical)
65
+ qa = engine.terminology_qa("msgid \" Encryption\"\nmsgstr \"تعمية\"\n", fmt="po")
66
+ ```
67
+
68
+ ### Unified `TarkibEngine(mode="zero_llm")` Methods (`v2.0.0`)
69
+
70
+ | Method | Subsystem | Description |
71
+ | :--- | :--- | :--- |
72
+ | `inspect_root(token_or_root)` | **Tarkīb · Bayān · Burhān** | Full Root X-Ray across `21,952` cells (`((C1*C2)*C3)`, Sībawayhian 13-feature kinematics, Grassmannian fibers) |
73
+ | `inspect_jadwal(root)` | **Al-Jadwal (`الجدول`)** | Periodic Table lookup across `11,249` roots, `S0–S5` strata, `[C1C2_]` genera, and verified witnesses |
74
+ | `inspect_iqtiran(particle=None)` | **Iqtirān (`اقتران`)** | Closed `66`-atom morpho-syntactic algebra (`31` `B` × `35` `R` = `1,085` cells, `Delta_12`, Laws `ن١١–ن١٦`) |
75
+ | `compare_furuq(a, b, sentence=...)` | **Bayān (`بيان`)** | Zero-leakage contextual & intrinsic *Furūq* ranker (`rank_contextual_furuq`) |
76
+ | `audit_tashif(text)` | **Ījāz (`إيجاز`)** | Shannon guardband anti-*taṣḥīf* & `OCR/ASR` repair (`audit_tashif_and_ocr`) |
77
+ | `coin_term(concept_ar, ...)` | **Ījāz · Dīwān** | Six-gate scientific/technical/regulatory neologism coining (`coin_scientific_term`) |
78
+ | `tokenize_text(text)` | **Mīzān (`ميزان`)** | Non-concatenative `(proclitic, root_3, pattern_id, enclitic)` tokenizer (`0.0%` root fragmentation) |
79
+ | `fiber_rag(query, ...)` | **Burhān · Tayf** | Grassmannian fiber & metaphor-transport `T_majaz` retrieval (`search_fiber_rag`) |
80
+ | `restore_rasm(text, ...)` | **Paleography** | Exact Viterbi undotted *rasm* decoder over `170–1205 AH` lexicons (`restore_undotted_rasm`) |
81
+ | `audit_diachronic(text, ...)` | **Millennium Drift** | 5-epoch (`170→1205 AH`) semantic drift & anachronism detector (`audit_diachronic_anachronism`) |
82
+ | `terminology_qa(content, ...)` | **CI/CD Governance** | 6-gate localization QA for legal, financial, regulatory, & software pipelines (`SARIF 2.1.0`) |
83
+
84
+ ---
85
+
86
+ ## الحصيلة القياسية المجمّدة (`data/*.json`) | Frozen Empirical Benchmarks
87
+
88
+ All headline benchmarks are deterministically synchronized with `data/*.json` and verified by `pytest`:
89
+
90
+ - **First-Principles Vocal-Tract OCP Hamiltonian (`ocp_physics_derivation.json`):** Zero-corpus biomechanical Hamiltonian achieves **`0.8451`** out-of-fold AUROC across `6,963` pan-classical roots vs. **`0.7960`** for the unigram consonant-frequency baseline.
91
+ - **Grassmannian Fiber & Metaphor-Aware RAG (`fiber_rag_benchmark.json`):** Surgical `rigid_jamid_nominal` vs. `eventive_derived` isolation reaches **`53.03%`** `Precision@1` under strict `0%` non-root vocabulary overlap.
92
+ - **Paleographic Rasm Viterbi Restorer (`rasm_restorer_benchmark.json`):** Contextual Viterbi lattice decoding achieves **`+13.64`** percentage-point accuracy gain over unigram baselines on minimal-pair *rasm* traps with `0.00%` modern lexical intrusion.
93
+ - **Millennium Diachronic Anachronism Auditor (`diachronic_auditor_benchmark.json`):** Semantic calque detection achieves **`90.0%`** balanced accuracy with the classical calque atlas (`65.0%` fully unsupervised Leave-One-Root-Out graph coherence).
94
+ - **Six-Gate CI/CD Terminology QA (`terminology_qa_benchmark.json`):** Achieves **`98.04%`** `F1` across all 6 governance gates and **`97.67%`** `F1` under objective-defects-only policy on software, financial, regulatory, and legal localization suites.
95
+
96
+ ---
97
+
98
+ ## الواجهات التنفيذية (`CLI` · `MCP` · `Web Studio`) | Interfaces
99
+
100
+ ```bash
101
+ # Command-line interface
102
+ tarkib inspect يستغفرون
103
+ tarkib qa-gate path/to/translations.po --fail-under 85
104
+
105
+ # Model Context Protocol (MCP) JSON-RPC 2.0 stdio server (11 tools)
106
+ tarkib-mcp --mode zero_llm
107
+
108
+ # Interactive RTL Web Studio
109
+ tarkib-studio --port 8765
110
+ ```
111
+
112
+ ---
113
+
114
+ ## الترخيص ونسب المصادر | License & Provenance
115
+
116
+ - **Code (`Apache-2.0`):** Licensed under the [Apache License, Version 2.0](LICENSE).
117
+ - **Book & Public Linguistic Atlases (`CC BY 4.0`):** `book/`, `paper*/`, `papers_en/`, and `data/` are licensed under [Creative Commons Attribution 4.0 International (`CC BY 4.0`)](https://creativecommons.org/licenses/by/4.0/).
118
+ - **Provenance BOM:** See [`DATA_PROVENANCE_BOM.md`](DATA_PROVENANCE_BOM.md) and [`NOTICE`](NOTICE).
119
+ - **Copyright:** `Copyright 2026 Salah Abdo and successor entity`.
@@ -0,0 +1,63 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68.0"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "tarkib"
7
+ version = "2.0.0"
8
+ description = "Computational Philology, Sub-Lexical Algebraic Semantics, Jadwal & Iqtiran Arabic NLP SDK (Maqayis)"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = {text = "Apache-2.0"}
12
+ authors = [
13
+ {name = "Salah Abdo", email = "Salah.Abdo.Tech@gmail.com"}
14
+ ]
15
+ keywords = ["arabic", "nlp", "computational-philology", "morphology", "zero-llm", "maqayis", "tarkib"]
16
+ classifiers = [
17
+ "Development Status :: 5 - Production/Stable",
18
+ "Intended Audience :: Science/Research",
19
+ "Intended Audience :: Developers",
20
+ "License :: OSI Approved :: Apache Software License",
21
+ "Natural Language :: Arabic",
22
+ "Programming Language :: Python :: 3",
23
+ "Programming Language :: Python :: 3.10",
24
+ "Programming Language :: Python :: 3.11",
25
+ "Programming Language :: Python :: 3.12",
26
+ "Programming Language :: Python :: 3.13",
27
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
28
+ "Topic :: Text Processing :: Linguistic",
29
+ ]
30
+ dependencies = [
31
+ "numpy>=1.24",
32
+ "scipy>=1.10",
33
+ "scikit-learn>=1.3",
34
+ ]
35
+
36
+ [project.optional-dependencies]
37
+ hybrid = [
38
+ "torch>=2.1",
39
+ "transformers>=4.40",
40
+ "sentence-transformers>=2.6",
41
+ ]
42
+
43
+ [project.urls]
44
+ Homepage = "https://maqayis.org"
45
+ Repository = "https://github.com/maqayis/tarkib"
46
+ Mirror = "https://codeberg.org/maqayis/tarkib"
47
+ Documentation = "https://maqayis.org"
48
+
49
+ [project.scripts]
50
+ tarkib = "tarkib.cli:main"
51
+ tarkib-mcp = "tarkib.mcp_server:main"
52
+ tarkib-studio = "tarkib.studio:main"
53
+
54
+ [tool.setuptools.packages.find]
55
+ include = ["tarkib*"]
56
+
57
+ [tool.setuptools.package-data]
58
+ tarkib = [
59
+ "data/*.json",
60
+ "data/*.jsonl",
61
+ "data/cache/*.gz",
62
+ "data/cache/*.npz",
63
+ ]
tarkib-2.0.0/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,10 @@
1
+ """tarkib (تركيب) v2.0.0 — Sub-Lexical Algebraic Arabic NLP & Computational Philology SDK."""
2
+
3
+ from __future__ import annotations
4
+
5
+ __version__ = "2.0.0"
6
+ __author__ = "Salah Abdo"
7
+
8
+ from tarkib.sdk import TarkibEngine, resolve_data_dir
9
+
10
+ __all__ = ["TarkibEngine", "resolve_data_dir", "__author__", "__version__"]