Skip to main content

Normalize Kapampangan words from Spanish-era (1730s) orthography to modern K-based orthography

Project description

normalize-kap-orthography

A Python utility to normalize Kapampangan words from Spanish-era (1730s) orthography to modern K-based orthography.

Built to make historical Kapampangan texts — like Bergaño's 1732 Vocabulario de la Lengua Pampanga — more accessible to modern readers, researchers, and NLP pipelines.

Background

Before the Spanish conquest, Kapampangans used their own indigenous writing system (Kulitan). Spanish missionaries romanized the language using Spanish orthographic conventions (C, Q, Ñ, LL, etc.). Over the past century, multiple competing romanized orthographies have emerged:

Disclaimer

I am not a linguist — I'm a native Kapampangan speaker who happens to be a computer science graduate. The conversion rules in this tool were identified through patterns I recognized while cleaning historical dictionary data, not through formal linguistic analysis. The script was spot-checked against the dataset and appears accurate, but it has not been exhaustively verified. If you spot errors or have linguistic expertise to contribute, please open an issue or PR.

System Also known as Key features
Spanish-era ("Q & C") Súlat Bacúlud, Old Orthography Uses QU, C, Ñ, LL — the system used in colonial-era texts
ABAKADA ("K") Súlat Wáwâ, New Orthography K-based, aligned with the Philippine national orthography
Samson Hybrid Ámung Samson Retains C before a/o/u, replaces QU→K, adds diacritical marks
Batiáuan Revised Súlat Wáwâ a alâng WA K-based without W, with diacritical marks

This tool converts from the Spanish-era system to a modern K-based form (closest to ABAKADA). For more on the orthography dispute, see Pangilinan (2006).

What it does

The converter applies two phases of transformation:

Phase 1 — Spanish letter substitutions:

  • QUIKI, QUEKE
  • CK (except after SI)
  • ÑN, LLL
  • Word-initial VW

Phase 2 — Vowel cluster and diphthong normalization:

  • AOO, AI/AYE (word-final, non-initial)
  • UAWA, UOWO
  • Various other diphthong simplifications

An exceptions table handles words that don't follow general patterns, and a two-pass conversion catches cascading transformations.

Installation

pip install normalize-kap-orthography

Or just copy normalize_orthography.py into your project.

Usage

from normalize_orthography import convert_orthography

convert_orthography("QUINANG")   # → "KINANG"

convert_orthography("VATAUAT")   # → "WATAWAT"

convert_orthography("QUECAI")    # → "KEKE"

convert_orthography("KINANG")    # → None (already modern)

Returns the normalized form, or None if no conversion is needed.

CLI

python normalize_orthography.py

Runs a small set of built-in test cases.

Limitations

  • Not linguistically verified. The rules were identified through pattern recognition by a native speaker, not through formal linguistic analysis. The script was spot-checked against dictionary data but not exhaustively validated.
  • No diacritical marks. The script does not handle stress marking, which is important in Kapampangan — e.g., masakit (painful) vs. masákit (difficult) vs. másakit (ill) are three distinct words.
  • One-directional. Currently only converts Spanish-era → modern. Reverse conversion is not supported.
  • Uppercase only. Input is converted to uppercase internally; output is always uppercase.

Origin

Originally written in Dart as part of the v2 of Learn Kulitan, then rewritten in Python with Claude Code Opus 4.6.

Real-World Usage

This script was originally used to normalize ~5,000 words extracted from Vocabulario de la Lengua Pampanga by Fray Diego Bergaño, originally published in 1732 — one of the earliest known dictionaries of the Kapampángan language. About 40% of entries (1,989 out of 4,971) had their orthography normalized.

The raw, uncleaned entries and their cleaned, normalized versions are available as part of an open dataset on Hugging Face:

keithmanaloto/kapampangan-dictionary-embeddings

The dataset also includes LLM-enriched metadata and pre-computed embeddings across multiple models — designed for semantic search, retrieval, and clustering over Kapampángan vocabulary. Both the original 1730s spelling and the normalized modern form are preserved in the dataset.

For the full story behind the dataset and what I learned building it, see the article: From a 300-Year-Old Dictionary to Hugging Face: I Built Kapampángan's First Embedding Dataset

Contributing

Contributions are welcome, especially:

  • Expanding the exceptions table
  • Adding test coverage against known word lists
  • Adding diacritical mark support
  • Supporting additional orthographic target systems

License

MIT

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

normalize_kap_orthography-0.1.0.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

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

normalize_kap_orthography-0.1.0-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file normalize_kap_orthography-0.1.0.tar.gz.

File metadata

File hashes

Hashes for normalize_kap_orthography-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7b2362d5f2afd2463d679f65e0da97e28a4daf8de2ee0aa1e308621799ce5288
MD5 feda89404db162563a1ff56b936204ab
BLAKE2b-256 d26e4bff2e42259df65570dc6695e88c4e0d2f9cab0b198fa098c56159ef6888

See more details on using hashes here.

File details

Details for the file normalize_kap_orthography-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for normalize_kap_orthography-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 379843c45363d0af38d086fc9715f96f1168c6a15723390e9a86b5d952ec7981
MD5 c062eb85f46ff664accb9b61f6f2af32
BLAKE2b-256 3162fc10c2f5e73e22eb29e1bc47da3fd3c79ec6b7e539d89ffbcb92e2a01145

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