Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

deklina-cli

Offline Basque noun declension generator. Generates all 16 Basque noun cases (NOR, NORK, NORI, NON, NORA, ...) for singular and plural definite, using suffix tables and phonological rules derived from Wikipedia's "Basque grammar" article.

No API, no network — everything runs locally.

Install

uv tool install .

Or run directly:

uv run deklina decline gizon

Usage

Decline a noun

# Full paradigm (all 16 cases × 2 numbers):
deklina decline gizon

# Filter by case:
deklina decline mendi --case NOR,NORK,NORI

# Filter by number:
deklina decline neska --number sg

# JSON output (for piping into other tools):
deklina decline etxe --json

Output:

  gizon — man  [consonant-final (-n)]

  Case           Singular             Plural
  ────────────── ──────────────────── ────────────────────
  NOR            gizona             gizonak
  NORK           gizonak            gizonek
  NORI           gizonari           gizonei
  NOREN          gizonaren          gizonen
  NON            gizonean           gizonetan
  ...

List cases

deklina list cases    # all 16 cases with meanings
deklina list nouns    # curated noun list (58 nouns)

Reverse lookup

# First generate the paradigm dataset:
deklina generate

# Then search:
deklina search gizona
# → gizon  NOR  singular  (Absolutive)

Generate paradigm dataset

# Generate from bundled noun list:
deklina generate

# Verify all forms against Hunspell:
deklina generate --verify

# Use custom noun list:
deklina generate --input my-nouns.json --output custom-paradigm.json

Cases

Basque has 16 noun cases, grouped into three categories:

Group Cases Description
Nuclear NOR, NORK, NORI Core grammatical roles (subject, object, recipient)
Local NON, NORA, NONDIK, NORAINO, NORANTZ, NOREKO, NONGO Spatial/temporal relations
Other NOREN, NOREZ, NOREKIN, NORENTZAT, NORENGATIK, ZERIK Possession, means, accompaniment, etc.

How it works

Basque declension is highly regular. All noun phrases inflect identically, with only trivial phonological complications:

  1. Suffix tables: Each case has two suffix variants — one for consonant-final stems, one for vowel-final stems. The difference is an epenthetic -e- in the local cases (e.g., gizon + ean = gizonean vs mendi + an = mendian).

  2. Vowel contractions: When the stem ends in a vowel and the suffix starts with one:

    • A + A → A (neska + a → neska)
    • A + E → E (neska + ek → neskek)
    • E + A → EA (seme + a → semea)
    • I/O/U + V → no contraction
  3. Irregular stems: A small number of nouns undergo consonant gemination (e.g., haurhaurr-: haurra, haurrak, haurrean). These are handled by an exceptions dictionary.

Verification: 435/435 regular forms pass Hunspell eu_ES verification across 8 stem types (consonant-final -n/-l/-r/-tz/-k, vowel-final -a/-e/-i/-o/-u).

Limitations

  • Sets 1 & 2 only: Singular and plural definite. Indefinite (Set 3) and proper noun (Set 4) forms are not generated.
  • No animate local cases: Animate nouns (people, animals) use special local case suffixes (-gan, -gana, -gandik). Not yet implemented.
  • Irregular nouns: Only haur (r-gemination) is handled. Other irregulars may exist — use deklina generate --verify to check.
  • Not a Basque expert tool: Forms are generated mechanically. Always verify against a native speaker or authoritative reference for production use.

Context

Built as part of the itzune Basque language technology project, alongside:

  • aditzak-cli — Basque verb conjugation CLI
  • aditzak-eval — Basque verb conjugation LLM eval benchmark
  • txukun — Browser-based Basque text corrector

License

MIT

About

Offline Basque noun declension generator (16 cases × 2 numbers)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages