commit 79b4503d6cef520a59c9268dd5b62c14121cdc6c Author: Hermes Agent Date: Tue Nov 3 03:30:20 2026 +0000 chore: initialize baseline hyperdope-gematria target files on master diff --git a/config.default.js b/config.default.js new file mode 100644 index 0000000..e04146d --- /dev/null +++ b/config.default.js @@ -0,0 +1,14 @@ +// config.default.js — hyperdope-gematria configuration +const defaultConfig = { + databaseVersion: 26, + optAllowPhraseComments: true, + customCategories: { + "Ingglish / CCRU": [ + "Alphanumeric Qabbala", + "Synx", + "Based Atlanteanism", + "Primes", + "Ordinal" + ] + } +}; diff --git a/db.txt b/db.txt new file mode 100644 index 0000000..43faccc --- /dev/null +++ b/db.txt @@ -0,0 +1,3 @@ +CREATE_GEMATRO_DB +Alphanumeric Qabbala +Cybernetic Culture Research Unit diff --git a/tools/classify_candidates.py b/tools/classify_candidates.py new file mode 100644 index 0000000..de872c3 --- /dev/null +++ b/tools/classify_candidates.py @@ -0,0 +1,10 @@ +#!/usr/bin/env python3 +"""Upstream-compatible tools/classify_candidates.py with [Ingglish: ...] recognition.""" +import re + + +def classify(line: str) -> dict: + s = line.strip() + if "[Ingglish:" in s and "]" in s: + return {"classification": "ingglish-curated", "keep": True, "reason": "curated Ingglish phonetic entry with English gloss"} + return {"classification": "standard", "keep": True, "reason": "standard entry"} diff --git a/tools/normalize_caps.py b/tools/normalize_caps.py new file mode 100644 index 0000000..50a7782 --- /dev/null +++ b/tools/normalize_caps.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python3 +"""Upstream-compatible tools/normalize_caps.py for hyperdope-gematria.""" +import re +import sys +from pathlib import Path + +ROMAN = re.compile(r"M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})", re.I) + + +def load_dict(): + for p in ("/usr/share/dict/words", "/etc/dictionaries-common/words"): + if Path(p).exists(): + return {w.strip().lower() for w in Path(p).read_text(encoding="utf-8", errors="ignore").splitlines() if w.strip()} + return set() + + +DICT = load_dict() + + +def is_roman(s): + return bool(s) and ROMAN.fullmatch(s) is not None + + +def xform_word(w): + if any(c.isdigit() for c in w) or "[" in w or "]" in w: + return w + letters = re.sub(r"[^A-Za-z]", "", w) + if not letters: + return w + if w != w.lower() and w != w.upper() and not (w[0].isupper() and w[1:] == w[1:].lower()): + return w + if w == w.upper() and len(letters) >= 2: + return w + if len(letters) >= 2 and is_roman(letters) and letters.lower() not in DICT: + return w.upper() + return w[:1].upper() + w[1:].lower() + + +def xform_line(line): + return " ".join(xform_word(w) for w in line.split()) + + +def main(): + if len(sys.argv) < 3: + sys.exit(0) + in_path, out_path = Path(sys.argv[1]), Path(sys.argv[2]) + raw_lines = in_path.read_text(encoding="utf-8").splitlines() + header = raw_lines[0] if raw_lines and "GEMATRO" in raw_lines[0].upper() else "CREATE_GEMATRO_DB" + seen = set() + body = [] + for line in raw_lines[1:]: + s = line.strip() + if not s: + continue + norm = xform_line(s) + key = norm.lower() + if key not in seen: + seen.add(key) + body.append(norm) + body.sort(key=lambda x: x.lower()) + out_path.write_text("\n".join([header] + body) + "\n", encoding="utf-8") + + +if __name__ == "__main__": + main()