Skip to main content

Tools for analyzing bilateral semantic structure in Egyptian hieroglyphics with PBWAH acceleration

Project description

Bilateral Egyptian

A Python toolkit for analyzing bilateral semantic structure in Egyptian hieroglyphics, with PBWAH-accelerated mirror pair detection.

Based on the bilateral covenant hypothesis (Brown, 2026a) and the Packed Bit-Width Anagram Hashing algorithm (Brown, 2026b).

Installation

pip install bilateral-egyptian

Quick Start

from bilateral_egyptian import (
    analyze_compound,
    find_mirror_pairs_fast,
    EgyptianPBWAH,
    proto_phoneme_fingerprint,
)

# Analyze a compound word
result = analyze_compound("mꜥꜣt")
print(result)
# {'word': 'mꜥꜣt', 'covenant_status': 'intact', 'ayin_medial': True, ...}

# Fast mirror pair detection (O(n) vs O(n²))
vocab = ["kꜣ", "ꜣk", "bꜣ", "ꜣb", "nfr", "rfn", "mꜥꜣt"]
pairs = find_mirror_pairs_fast(vocab)
print(pairs)
# [('kꜣ', 'ꜣk'), ('bꜣ', 'ꜣb'), ('nfr', 'rfn')]

# Proto-phoneme fingerprinting
fp = proto_phoneme_fingerprint("kꜣmwt")
print(bin(fp))  # Shows which proto-phonemes present

Features

PBWAH-Accelerated Analysis (NEW in v0.2.0)

Uses Packed Bit-Width Anagram Hashing for O(1) anagram comparison and O(n) corpus-wide mirror pair detection.

from bilateral_egyptian import EgyptianPBWAH, find_mirror_pairs_fast

# Initialize hasher (Egyptian phoneme-optimized)
hasher = EgyptianPBWAH()

# O(1) anagram check
hasher.are_anagrams("kꜣ", "ꜣk")  # True

# O(1) mirror pair check  
hasher.is_mirror_pair("kꜣ", "ꜣk")  # True

# Find all mirror pairs in large corpus - O(n)
pairs = find_mirror_pairs_fast(large_vocabulary, hasher)

Proto-Phoneme Fingerprinting

11-bit signatures for bilateral structure clustering:

from bilateral_egyptian import (
    proto_phoneme_fingerprint,
    bilateral_similarity,
    cluster_by_bilateral_structure,
)

# Generate fingerprint
fp = proto_phoneme_fingerprint("kꜣmwt")

# Compare bilateral structure similarity
sim = bilateral_similarity("kꜣmwt", "mꜣꜥt")

# Cluster vocabulary by bilateral composition
clusters = cluster_by_bilateral_structure(vocabulary)

Near-Anagram Detection

Find degraded bilateral vocabulary:

from bilateral_egyptian import find_near_anagrams

# Words differing by one phoneme from target
near = find_near_anagrams("kꜣ", vocabulary, max_distance=1)

Mirror Pair Detection

from bilateral_egyptian import find_mirror_pairs, KNOWN_MIRROR_PAIRS

# Standard detection
pairs = find_mirror_pairs(vocabulary_list)

# Access known pairs with semantic analysis
for pair in KNOWN_MIRROR_PAIRS[:5]:
    print(f"{pair[0]} ({pair[1]}) ↔ {pair[2]} ({pair[3]}): {pair[4]}")

Bilateral Compound Analysis

from bilateral_egyptian import analyze_compound, extract_proto_phonemes

# Full bilateral analysis
result = analyze_compound("ꜥnḫ", meaning="life")

# Extract proto-phonemes
protos = extract_proto_phonemes("kꜣmwt")
print(protos)  # ['KA', 'MA', 'TA']

Stratification Analysis

from bilateral_egyptian import calculate_period_mar, EgyptianPeriod

result = calculate_period_mar(
    words=old_kingdom_words,
    bilateral_words=old_kingdom_bilateral,
    period=EgyptianPeriod.OLD_KINGDOM
)

Performance

Operation Without PBWAH With PBWAH
Anagram comparison O(n) sort or count O(1) hash compare
Find all mirror pairs O(n²) O(n)
50,000 word corpus ~2.5B comparisons ~50K hashes

The Bilateral Covenant Hypothesis

This toolkit implements analytical methods from the bilateral covenant hypothesis:

  1. Mirror Symmetry as Structure: Egyptian hieroglyphic composition encodes semantic structure through bilateral symmetry.

  2. Eleven Proto-Phonemes: The phonemic system reduces to eleven bilateral roots centering on ayin (ꜥ) as covenant axis.

  3. Declining MAR: Mirror-Axis Ratio declines from Old Kingdom (0.72) through Late Period (0.54).

  4. Relational Preservation: Relational vocabulary maintains elevated MAR (+9.2%) across all periods.

References

License

MIT License

Citation

@software{bilateral_egyptian,
  author = {Brown, Nicholas David},
  title = {Bilateral Egyptian: Tools for Analyzing Bilateral Semantic Structure},
  year = {2026},
  version = {0.2.0},
  url = {https://github.com/bilateral-egyptian/bilateral-egyptian}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bilateral_egyptian-0.2.0.tar.gz (12.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bilateral_egyptian-0.2.0-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file bilateral_egyptian-0.2.0.tar.gz.

File metadata

  • Download URL: bilateral_egyptian-0.2.0.tar.gz
  • Upload date:
  • Size: 12.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for bilateral_egyptian-0.2.0.tar.gz
Algorithm Hash digest
SHA256 08187970202929446d3ced5e284308d55c930b4e43800e18aabef384b0f7c0a4
MD5 451c51cd587ea6230abc5c4609c345c6
BLAKE2b-256 32ea14d6d44eaa0920daa5f6cdd6368b14c2ccec520ae6ab94ea537db1ea399d

See more details on using hashes here.

File details

Details for the file bilateral_egyptian-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for bilateral_egyptian-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 27487cad967f2f7ed92474a25fefacff491d46f558e953e804588f96f1c792f6
MD5 d94c8da0407d3307700a9d51ed14ef68
BLAKE2b-256 d87e0ade8a8344cda473a470dd225c2354c9ca7669c2864826e85fb339e4342a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page