For Italian, there have been tools for years that know what every word is: prenderà is the future tense of prendere, third person singular. For Gallurese, the language of north-eastern Sardinia, nothing like that existed. For gallura.net we built it: a morphological engine that recognises, conjugates and inflects Gallurese words. It knows what it does not know, and says so.
This article describes why that was needed, where it got hard, how we went about it and what it has produced.
Why: a language without digital infrastructure
Gallurese
Gallurese is spoken in Gallura, the north-east of Sardinia, with related varieties in Castelsardo and Sedini and on La Maddalena. It is not a dialect of Sardinian: it belongs to the Corsican-Italian branch. The Region of Sardinia recognises it as a language in its own right (LR 22/2018). In April 2024 it received an official spelling standard (DGR 11/11 of 30 April 2024).
There is a living literature, from the eighteenth-century poetry of Don Baignu Pes to today's magazines, song lyrics and school projects. There are dictionaries, courses and grammars. But almost all of it exists on paper or as scattered PDFs.
What was missing
For large languages the building blocks are taken for granted: a morphological lexicon, a spell checker, tools that recognise words in a text. For Italian there is, for example, Morph-it!, with over 505,000 word forms with their lemma and grammatical features.
For Gallurese none of those building blocks existed. You notice that as soon as you want to offer the language digitally:
- A reader clicks on affunda in a text, but the dictionary only knows the verb affundà.
- A learner wants to know how to say "we found", but no source prints that form.
- A text writes gaddhurési, natturali or l’effetti, while the dictionary knows gaddurési, naturali and effetti, or even only gadduresu and effettu.
What readers and learners need
Gallura.net consists of a dictionary, a library of over 1,200 works with translation (Voci di Gallura) and an app. All three need the same underlying skill: from a written word to the right dictionary word, and back.
That is exactly what a morphological engine does.
The problem
1. The sources show only a fraction of the forms
In our table a Gallurese verb has 81 cells: seven tenses with six persons each, the imperative, the gerund, the participle in three forms and the forms with an attached pronoun. No source prints them all. For most verbs we know the infinitive and at most a handful of conjugated forms.
Across all verbs, the sources document over 10,000 of more than 450,000 cells. A table with only proven forms therefore consists mostly of empty boxes.
2. Every writer spells differently
Until 2024 there was no shared spelling, and even after 2024 not everyone writes according to the standard. The same sound appears as ddh or dd, as chj or cj, with or without an accent, with double or single consonants. A village like Aggius writes z where Tempio writes c (zentu, centu).
An engine that only recognises exact spellings fails to recognise half the corpus.
3. Words merge
Gallurese elides and attaches:
- l’effetti is li + effetti;
- dammillu is dà + mi + lu;
- ’nommu is nommu with its beginning dropped;
- tuni is tu followed by a syllable -ni, which the standard explicitly allows.
Each of these phenomena has rules, and each has exceptions.
4. Inventing is not an option
This is the most important part of the problem. For a small language, every invented form does damage: a learner adopts it, the next tool uses it as a source, and in the end nobody knows any more what the language is and what the software made of it.
That is why one rule applies to everything we build: what comes from a source is set upright; what is generated is set in italics, with its rule; what nobody knows stays empty.
The approach
Starting point: evidence first, and show what is generated
Every form in the system has an origin:
- documented: the form is in a source, with the place where it occurs;
- generated: a rule made the form. It is shown in italics and in amber, with an explanation ("made like pinsà, pensu");
- empty ("–"): no source and no reliable rule.
Rules are general, not lists of exceptions per word. And every rule is first tested on forms we already know, before it may make forms we do not know.
Layer 1: the dictionary as the foundation
Everything starts with the dictionary. We built it from published dictionaries, courses, grammars and the texts themselves, reading the most important dictionaries page by page.
Along the way we learned that even a printed source is not read reliably by itself. In the PDF of a large dictionary, text extraction read about a third of the pages in the wrong order. A cell at the top of a column then belongs to the previous headword, not the next one. So we check every cell against the real layout of the page, and spot-check against the image of the page itself.
The dictionary now has over 32,000 entries:
- over 20,000 nouns;
- over 6,000 adjectives;
- 5,637 verbs;
- plus adverbs, pronouns and function words.
Layer 2: the spelling of the 2024 standard
We read the official spelling standard in full and turned its rules into code. Every rule in the engine refers to the paragraph and the page of the standard it comes from. A few examples:
- accents: optional accents may be missing. The final accent is distinctive: cantà is the infinitive, canta a conjugated form. In the verb tables the engine writes the accent as the standard asks: where the stress does not fall on the second-to-last syllable (càntani, pìddati), with é or è only where the sources show the vowel’s sound;
- variants: ddh counts as dd, and chj/ghj as cj/gj;
- local spellings: fogu beside focu, zentu beside centu;
- elision: l’, m’, c’ before a vowel, within the limits the standard sets (c’è yes, c’à no);
- dropped sounds: lu ’inu is lu vinu;
- the syllable -ni after a stressed final vowel: tuni is tu.
Where texts depart from the standard, the engine reads the difference as a variant of the documented word. It does not correct the text.
Layer 3: taking words apart
When a word is not known as a whole, the engine tries to break it down into:
- an elided article plus a word;
- a verb with attached pronouns;
- a stem with a known ending.
A breakdown only counts if every part is in the dictionary.
Layer 4: the verb table
This is where most of the work is. The table fills up in fixed steps, the strongest first:
- Forms from the sources.
- Endings the sources prove. An ending only becomes a rule if it occurs with at least three verbs from at least two sources and is right in at least two thirds of the cases. Tested by leaving out one verb at a time and predicting it: 96% correct.
- The stem vowel. In stressed forms, the i or u of the stem sometimes becomes e or o (pinsà: pensu) and sometimes not (curà: curu). Where no source shows it, the engine looks at the Italian cognate (pensare: penso): 87% correct on 146 known verbs. Where there is no cognate either, it looks at verbs with the same sounds around the vowel: 83% correct.
- The paradigms from Rubattu's grammar for whatever is left. Those forms are marked as still to be verified in texts.
- Same persons: in irregular verbs eu and iddu share one form in the past remote, the imperfect and the conditional (dì: eu disi, iddu disi). Where the sources give only the iddu form, the engine uses it for eu too, as in every regular verb.
- Derived forms: the participle in the feminine and the plural, and the forms with an attached pronoun. The sources confirm that the infinitive doubles the consonant of the pronoun (cavallu, piddallu), in 347 of 356 cases.
- The passato prossimo: aé or esse in the present with the participle (aggju presu, socu andatu). The auxiliary comes from the texts and from the Italian verb: esse beside a participle is often the passive, so on its own it says too little.
A mistake in one verb often teaches something about all verbs. An example: one source wrote agàtu with one t, and because of that the whole verb agattà counted as irregular. Only when the engine learned to treat double and single consonants as a spelling variant did agattà and thirteen other verbs get their complete table.
Layer 5: nouns and adjectives
- Plural: focu becomes fochi, casa becomes casi.
- Feminine of an adjective: beddu becomes bedda.
- Test: in 75% of the cases the rules give exactly the form the sources document. Almost all other cases are different spellings of the same word, not different endings.
- Degrees of the adjective: comparative and superlative as the course Corsu gadduresu by Rubattu and Garrucciu builds them: più beddu di, lu più beddu di, umbè beddu, beddu beddu. The irregular forms (meddu, òttimu, pèggju) are documented. Left out on purpose: the superlative in -ìssimu. The course does not use it and the texts have it only in set words.
Looking for evidence: blind reading, and letting the source confirm
A generated form becomes a documented form when it turns up in the texts. To find out, we run search rounds through all the texts:
- Blind reading: every passage with a candidate is read twice, independently, without the readers knowing which form we expect.
- Only agreement counts: a form is only recorded if both readings say the same, and we compare it with the meaning of the entry.
- First the engine, then the source: the engine makes its prediction first, and only then do we look in Rubattu's dictionary. If Rubattu confirms the form, we know two things: the form exists, and the engine was right. That is how hundreds of participles were confirmed and thousands of new words added.
- Evidence from the texts, at every import: the engine looks for every form of every verb in the texts of Voci. If a short passage of at most 40 words contains the form, and the Italian translation beside it has the same tense and person, the cell is proven. A generated form proven this way is shown upright, with a link to the passage. This way the texts prove 562 cells in 253 verbs. A sample check gives about 9 right confirmations in 10.
Italian alongside
Every Gallurese form gets the corresponding Italian form from Morph-it!, also marked as generated. So next to mandemu ("we send") stands mandiamo. A learner sees both languages side by side, cell by cell.
Technology
- Language: the engine is written in Go.
- Data: everything lives in one read-only SQLite file, the snapshot, which an importer builds from the archive. The same input gives the same snapshot, byte for byte.
The result
In figures
| Entries in the dictionary | 32,000+ |
|---|---|
| Verbs with a complete table | 5,637 |
| Cells in the verb tables | 456,597 |
| from the sources | 10,376 |
| generated, with a rule | 424,625 |
| empty ("–"), no evidence and no rule | about 21,600 (4.7%) |
| Gallurese words in the texts (names, Italian words, numbers and abbreviations counted apart) | 373,458 |
| of which recognised | 98.6% |
| only thanks to a generated form | 1.7 percentage points |
| read at their place in the passage by two blind readings that agree (other spellings, forms, words written as one, slips) | +1.1 percentage points, together 99.7% |
Compared with Italian
Side by side with Morph-it!, the morphological lexicon of Italian:
| Morph-it! (Italian) | Our engine (Gallurese) | |
|---|---|---|
| Verbs | 6,124 | 5,637 |
| Verb forms | 391,285 | over 435,000 |
| Noun forms | about 38,000 | about 38,000 |
| Superlatives | 34,727 | – in -ìssimu; built with lu più, umbè |
Our verb forms are documented and generated together. For adjectives Italian is ahead. That is mainly down to its superlatives in -issimo: Gallurese builds the superlative with separate words (lu più beddu, umbè beddu), which the dictionary shows under the degrees of the adjective.
What you see of it
- In the dictionary every verb has the same table. What comes from a source is upright, with the place where it occurs. What is generated is in italics, with the rule as its explanation. Nouns show their plural, adjectives their feminine too.
- In the reader of Voci di Gallura a click on a word finds the right entry, even if the word is spelled differently, elided or conjugated. The reader says how, in Italian: «scritta con una consonante doppia» ("written with a double consonant"), «plurale non documentato, generato da gadduresu» ("plural not documented, generated from gadduresu").
- The app has the same data.
What the engine does not do (yet)
- A generated form is not evidence. It is a prediction by rules we have tested, and it is shown in italics. Speakers and new texts turn it into a proven form, or strike it out.
- Empty cells stay empty where the stem vowel cannot be established or a verb is truly irregular. That takes speakers.
- About 1.4% of the words in the texts are not recognised by the engine yet. They are mostly rare words that occur only once, phonetic spellings from older sources and misprints. No rule helps there, only more sources or speakers. In the reader of Voci di Gallura most of them are read at their place in the passage, by two blind readings that agree; about 0.3% stays unread.
- It does not translate. The engine recognises and conjugates, but does not translate running text from Italian to Gallurese or back. That is a next step, which will get a service of its own.
What comes next
The process is not finished. The engine now recognises 98.6% of the Gallurese words in the texts; the goal is at least 99%. Getting there mainly takes more sources and speakers:
- Involving speakers in the forms that are generated or stay empty.
- Opening up more sources: there are still Gallurese dictionaries and grammars we have not read.
- Live translation Italian ↔ Gallurese, built on the same engine, as a separate service.
Technical summary
| Language | Gallurese (sdn), with the varieties of Castelsardo/Sedini and La Maddalena |
|---|---|
| Code | Go |
| Data | Read-only SQLite snapshot, built by an importer from the archive; deterministic |
| Spelling | 2024 standard (DGR 11/11, 30 April 2024); every rule refers to its paragraph and page |
| Verbs | Proven endings (≥ 3 verbs, ≥ 2 sources, ≥ ⅔); the stem vowel via the Italian cognate and via sound groups; paradigms from Rubattu; participle and pronouns; passato prossimo with aé or esse |
| Nouns | Plural and feminine from the ending; 75% equal to the sources |
| Italian | Morph-it! 0.4.8 |
| Evidence | Blind double reading of passages; confirmation by the source after the engine predicted; passages from the texts with the Italian translation beside them |
| Products | dizionario.gallura.net, voci.gallura.net, the Gallura.net app |