Skip to content
Bryan Gallardo.
Back to notes

Nov 2026

Designing the schema behind a Mayo–Yoreme translator

A bilingual corpus needs more than two columns. Notes on variants, orthography and keeping a dictionary useful for teachers.

  • php
  • databases

The Mayo–Yoreme translator is a social-service project at the Universidad Autónoma de Sinaloa: five students, academic advisors, and a public site that has passed 183,000 visits. My part was the database design and the PHP backend. This is what the schema had to survive.

Two columns are not a corpus

The naive model is a table with two columns: Spanish on the left, Mayo–Yoreme on the right. It breaks immediately. A phrase can have more than one valid rendering, spelling varies between speakers, and a dictionary entry is not the same thing as a sentence used in class.

Entries and surface forms

I separated the concept from the text. An entry represents a meaning or a headword. Each entry has one or more surface forms, and each surface form belongs to a language. That allows variants without duplicating the concept, and it gives the linguistic team one place to correct spelling without touching the rest of the record.

Search without breaking orthography

Search normalizes what the user types (case, accents, common variants), but display keeps the original. If you normalize the stored text, you lose the form the community actually uses. If you never normalize, nobody finds anything. Two representations, one lookup key.

Content is not the application

The alphabet, the dictionary and the classroom material all read from the same corpus. Keeping content separate from the PHP application meant the site could grow a new section without a migration, and the academic team could review text without a deploy.

What I would do next

A review queue with diffs, and a small public API so other projects can reuse the corpus. The language belongs to its speakers; the software should make it easier to share, not harder.