mjpn 6.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.
mjpn-6.0.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Dr Yohanan Ouaknine
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
mjpn-6.0.0/PKG-INFO ADDED
@@ -0,0 +1,120 @@
1
+ Metadata-Version: 2.4
2
+ Name: mjpn
3
+ Version: 6.0.0
4
+ Summary: Moroccan Jewish Phonetic Names (MJPN): phonetic root computation for Moroccan Jewish surnames, the engine behind yahasra.org
5
+ Author-email: Dr Yohanan Ouaknine <contact@yahasra.org>
6
+ License: MIT
7
+ Project-URL: Homepage, https://yahasra.org
8
+ Project-URL: Documentation, https://yahasra.org/about
9
+ Keywords: onomastics,phonetic,surnames,genealogy,jewish,morocco,sephardic
10
+ Classifier: Development Status :: 5 - Production/Stable
11
+ Classifier: Intended Audience :: Science/Research
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Topic :: Sociology :: Genealogy
15
+ Classifier: Topic :: Text Processing :: Linguistic
16
+ Requires-Python: >=3.8
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Requires-Dist: openpyxl>=3.0
20
+ Dynamic: license-file
21
+
22
+ # MJPN — Moroccan Jewish Phonetic Names
23
+
24
+ Phonetic root computation for Moroccan Jewish surnames — the exact engine
25
+ behind [yahasra.org](https://yahasra.org)'s search across 32,000+ burial
26
+ records from Jewish cemeteries in Morocco.
27
+
28
+ Moroccan Jewish surnames were written down by French, Spanish and Hebrew
29
+ scribes, each with their own orthography: the same family appears as
30
+ *Ouaknine, Vaknin, Aknin, Boaknin, Oiknine…* MJPN reduces every variant to a
31
+ stable phonetic root (`AKNN`), so records that belong together can be found
32
+ together.
33
+
34
+ ## Install
35
+
36
+ ```
37
+ pip install mjpn
38
+ ```
39
+
40
+ ## Command line
41
+
42
+ ```
43
+ mjpn myfile.xlsx # xlsx with a "Names" column (case-insensitive)
44
+ mjpn # first .xlsx found in the current script folder
45
+ mjpn --name COHEN OUAKNINE "LEVY BENCHETON"
46
+ mjpn --selftest
47
+ ```
48
+
49
+ The xlsx run writes `<input>_mjpn.xlsx` next to the input, with:
50
+
51
+ - sheet **MJPN** — `name, root, root2, subroot, subroot2, special_mapping, status`
52
+ (`status` is `ok` / `compound` / `invalid` / `empty`)
53
+ - sheet **Stats** — totals, family-size distribution, top families,
54
+ roots split by v4 subroot
55
+
56
+ and prints the stats summary to stdout.
57
+
58
+ ## Python API
59
+
60
+ ```python
61
+ from mjpn import normalize_to_phonetic, compute_compound_indices_v4
62
+
63
+ normalize_to_phonetic("OUAKNINE") # 'AKNN'
64
+ normalize_to_phonetic("BENARROCH") # 'HRSH'
65
+ compute_compound_indices_v4("levy bencheton")
66
+ # ('LB', 'SHTN', 'LB~A', 'SHTN~AO') — compound dual index + v4 subroots
67
+ ```
68
+
69
+ ## How it works
70
+
71
+ Four normalization stages (engine v3.5.2, v4 subroot chain):
72
+
73
+ 1. **Start patterns** — Berber orthographic variants (OI→A) before anything else.
74
+ 2. **Prefix stripping** — patronymic prefixes (BEN, IBN, OU, HA, EL…) with
75
+ structural-name exception lists so *Hamou* or *Elfassy* keep their prefix.
76
+ 3. **Phonetic rules** — digraphs (CH→SH…), context-dependent C, V/W→B,
77
+ Spanish plural -IAS→-IA, smart vowel-pair handling (based on Beider's
78
+ *A Dictionary of Jewish Surnames from Maghreb*, 2017).
79
+ 4. **Consonant skeleton** — the root; a vowel-class signature on top yields
80
+ the v4 *subroot* that keeps genuinely different families apart.
81
+
82
+ Plus 149 exact and 2 regex special mappings for families whose variants defy
83
+ the rules (Abuhatzeira, Azoulay, Zrihen…), curated from the yahasra.org
84
+ adjudication process.
85
+
86
+ `mjpn/mjpn_tool.py` is **generated** from the production engine and verified
87
+ against it: identical output on all 3,933 distinct surnames of the yahasra.org
88
+ burials database (0 mismatches).
89
+
90
+ ## Citation
91
+
92
+ If you use MJPN in academic work, please cite:
93
+
94
+ > Ouaknine, Y. (2026). MJPN: Moroccan Jewish Phonetic Names — the phonetic
95
+ > indexing engine of yahasra.org, the Moroccan Jewish cemeteries database.
96
+ > https://yahasra.org
97
+
98
+ ## License
99
+
100
+ MIT © Dr Yohanan Ouaknine
101
+
102
+ ## Provenance and AI disclosure
103
+
104
+ The engine (`app/phonetic_normalizer.py` in the Yahasra codebase) encodes
105
+ orthographic rules authored and adjudicated by Dr Yohanan Ouaknine, tuned
106
+ against Beider (2017) with page references recorded per rule. This package is
107
+ generated mechanically from that engine by `scripts/build_mjpn_tool.py` — no
108
+ hand-maintained copy exists — and each release is parity-checked against the
109
+ full live corpus (5,314 distinct surnames, zero mismatches required).
110
+
111
+ Portions of the engine's implementation code and this package's build
112
+ tooling were produced with assistive AI (Anthropic Claude: Sonnet 4.x and
113
+ Opus 4.x/5, 2025-06 through 2026-08) under human direction and review; all
114
+ linguistic rules, special mappings and adjudications are human decisions.
115
+ This disclosure follows the AI policy of the Journal of Cultural Analytics.
116
+
117
+ ## Version
118
+
119
+ Package 6.0.0 wraps engine 6.0.0 (v4 chain: subroots + compound dual
120
+ indexing), generated 2026-11-16 with 98 exact + 1 regex special mappings.
mjpn-6.0.0/README.md ADDED
@@ -0,0 +1,99 @@
1
+ # MJPN — Moroccan Jewish Phonetic Names
2
+
3
+ Phonetic root computation for Moroccan Jewish surnames — the exact engine
4
+ behind [yahasra.org](https://yahasra.org)'s search across 32,000+ burial
5
+ records from Jewish cemeteries in Morocco.
6
+
7
+ Moroccan Jewish surnames were written down by French, Spanish and Hebrew
8
+ scribes, each with their own orthography: the same family appears as
9
+ *Ouaknine, Vaknin, Aknin, Boaknin, Oiknine…* MJPN reduces every variant to a
10
+ stable phonetic root (`AKNN`), so records that belong together can be found
11
+ together.
12
+
13
+ ## Install
14
+
15
+ ```
16
+ pip install mjpn
17
+ ```
18
+
19
+ ## Command line
20
+
21
+ ```
22
+ mjpn myfile.xlsx # xlsx with a "Names" column (case-insensitive)
23
+ mjpn # first .xlsx found in the current script folder
24
+ mjpn --name COHEN OUAKNINE "LEVY BENCHETON"
25
+ mjpn --selftest
26
+ ```
27
+
28
+ The xlsx run writes `<input>_mjpn.xlsx` next to the input, with:
29
+
30
+ - sheet **MJPN** — `name, root, root2, subroot, subroot2, special_mapping, status`
31
+ (`status` is `ok` / `compound` / `invalid` / `empty`)
32
+ - sheet **Stats** — totals, family-size distribution, top families,
33
+ roots split by v4 subroot
34
+
35
+ and prints the stats summary to stdout.
36
+
37
+ ## Python API
38
+
39
+ ```python
40
+ from mjpn import normalize_to_phonetic, compute_compound_indices_v4
41
+
42
+ normalize_to_phonetic("OUAKNINE") # 'AKNN'
43
+ normalize_to_phonetic("BENARROCH") # 'HRSH'
44
+ compute_compound_indices_v4("levy bencheton")
45
+ # ('LB', 'SHTN', 'LB~A', 'SHTN~AO') — compound dual index + v4 subroots
46
+ ```
47
+
48
+ ## How it works
49
+
50
+ Four normalization stages (engine v3.5.2, v4 subroot chain):
51
+
52
+ 1. **Start patterns** — Berber orthographic variants (OI→A) before anything else.
53
+ 2. **Prefix stripping** — patronymic prefixes (BEN, IBN, OU, HA, EL…) with
54
+ structural-name exception lists so *Hamou* or *Elfassy* keep their prefix.
55
+ 3. **Phonetic rules** — digraphs (CH→SH…), context-dependent C, V/W→B,
56
+ Spanish plural -IAS→-IA, smart vowel-pair handling (based on Beider's
57
+ *A Dictionary of Jewish Surnames from Maghreb*, 2017).
58
+ 4. **Consonant skeleton** — the root; a vowel-class signature on top yields
59
+ the v4 *subroot* that keeps genuinely different families apart.
60
+
61
+ Plus 149 exact and 2 regex special mappings for families whose variants defy
62
+ the rules (Abuhatzeira, Azoulay, Zrihen…), curated from the yahasra.org
63
+ adjudication process.
64
+
65
+ `mjpn/mjpn_tool.py` is **generated** from the production engine and verified
66
+ against it: identical output on all 3,933 distinct surnames of the yahasra.org
67
+ burials database (0 mismatches).
68
+
69
+ ## Citation
70
+
71
+ If you use MJPN in academic work, please cite:
72
+
73
+ > Ouaknine, Y. (2026). MJPN: Moroccan Jewish Phonetic Names — the phonetic
74
+ > indexing engine of yahasra.org, the Moroccan Jewish cemeteries database.
75
+ > https://yahasra.org
76
+
77
+ ## License
78
+
79
+ MIT © Dr Yohanan Ouaknine
80
+
81
+ ## Provenance and AI disclosure
82
+
83
+ The engine (`app/phonetic_normalizer.py` in the Yahasra codebase) encodes
84
+ orthographic rules authored and adjudicated by Dr Yohanan Ouaknine, tuned
85
+ against Beider (2017) with page references recorded per rule. This package is
86
+ generated mechanically from that engine by `scripts/build_mjpn_tool.py` — no
87
+ hand-maintained copy exists — and each release is parity-checked against the
88
+ full live corpus (5,314 distinct surnames, zero mismatches required).
89
+
90
+ Portions of the engine's implementation code and this package's build
91
+ tooling were produced with assistive AI (Anthropic Claude: Sonnet 4.x and
92
+ Opus 4.x/5, 2025-06 through 2026-08) under human direction and review; all
93
+ linguistic rules, special mappings and adjudications are human decisions.
94
+ This disclosure follows the AI policy of the Journal of Cultural Analytics.
95
+
96
+ ## Version
97
+
98
+ Package 6.0.0 wraps engine 6.0.0 (v4 chain: subroots + compound dual
99
+ indexing), generated 2026-11-16 with 98 exact + 1 regex special mappings.
@@ -0,0 +1,36 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "mjpn"
7
+ version = "6.0.0"
8
+ description = "Moroccan Jewish Phonetic Names (MJPN): phonetic root computation for Moroccan Jewish surnames, the engine behind yahasra.org"
9
+ readme = "README.md"
10
+ license = { text = "MIT" }
11
+ authors = [
12
+ { name = "Dr Yohanan Ouaknine", email = "contact@yahasra.org" },
13
+ ]
14
+ requires-python = ">=3.8"
15
+ dependencies = [
16
+ "openpyxl>=3.0",
17
+ ]
18
+ keywords = ["onomastics", "phonetic", "surnames", "genealogy", "jewish", "morocco", "sephardic"]
19
+ classifiers = [
20
+ "Development Status :: 5 - Production/Stable",
21
+ "Intended Audience :: Science/Research",
22
+ "License :: OSI Approved :: MIT License",
23
+ "Programming Language :: Python :: 3",
24
+ "Topic :: Sociology :: Genealogy",
25
+ "Topic :: Text Processing :: Linguistic",
26
+ ]
27
+
28
+ [project.urls]
29
+ Homepage = "https://yahasra.org"
30
+ Documentation = "https://yahasra.org/about"
31
+
32
+ [project.scripts]
33
+ mjpn = "mjpn.mjpn_tool:main"
34
+
35
+ [tool.setuptools.packages.find]
36
+ where = ["src"]
mjpn-6.0.0/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,40 @@
1
+ """MJPN — Moroccan Jewish Phonetic Names.
2
+
3
+ Computes the phonetic root of Moroccan Jewish surnames, exactly the
4
+ pipeline behind yahasra.org's burials.phonetic_index (normalize_to_phonetic
5
+ v3 stages -> v4 subroots -> compound dual indexing).
6
+
7
+ Typical use:
8
+
9
+ >>> from mjpn import normalize_to_phonetic
10
+ >>> normalize_to_phonetic('OUAKNINE')
11
+ 'AKNN'
12
+
13
+ Or from the command line:
14
+
15
+ mjpn myfile.xlsx # xlsx with a "Names" column
16
+ mjpn --name COHEN OUAKNINE
17
+ """
18
+ from .mjpn_tool import (
19
+ __version__ as engine_version,
20
+ normalize_to_phonetic,
21
+ normalize_to_phonetic_v4,
22
+ compute_compound_indices,
23
+ compute_compound_indices_v4,
24
+ check_special_mapping,
25
+ process_name,
26
+ main,
27
+ )
28
+
29
+ __version__ = "6.0.0"
30
+
31
+ __all__ = [
32
+ "engine_version",
33
+ "normalize_to_phonetic",
34
+ "normalize_to_phonetic_v4",
35
+ "compute_compound_indices",
36
+ "compute_compound_indices_v4",
37
+ "check_special_mapping",
38
+ "process_name",
39
+ "main",
40
+ ]