The spelling grammar
Every candidate is written in a fixed set of characters, in a fixed form. The grammar says which, and every row of the universe passes it. Passing fixes how a string is written, never whether it is a word.
The characters as typed
- tU+0074letter
- ’U+2019right quotation mark
- aU+0061letter
- nU+006Eletter
- gU+0067letter
The normalization, step by step
- ComposeUnicode NFC: a letter and its combining accent become 1 characterno change
- CanonicalizeU+2019 becomes U+0027 and U+00A0 becomes U+0020; nothing else is foldedt'ang
- Lowerlower case, never a case fold, so ß stays ß and failsno change
- Compose againNFC again, because lowering can split a letterno change
Passes the grammar. Its key:
t'ang
Passing fixes how a candidate is written. It says nothing about whether the string is a word.
The box runs the same rules as the dataset's code, pipeline/ceol/grammar.py, which is the
grammar's specification. The site's tests compare the two on every vetted example, every sample row, and those
strings altered by every rule.
The characters
47 letters and 3 marks. A character outside them fails the grammar instead of being changed into something close.
Base letters 26
a b c d e f g h i j k l m n o p q r s t u v w x y z
a to z
Accented letters 19
á à â ä é è ê ë í î ï ñ ó ô ö ú û ü ç
a closed list, extended only by a recorded decision
Ligatures 2
æ œ
ash and ethel
Marks 3
-
U+002Dhyphen-minus, the only hyphen -
U+0027apostrophe, the only apostrophe -
U+0020space, the only space between tokens
Two characters are rewritten, and nothing else
The typographic apostrophe, U+2019, becomes the plain one, U+0027. The no-break space,
U+00A0, becomes the plain space, U+0020. Each is the same character in a different
dress, and treating them apart would list a string twice.
Every other look-alike fails instead: the left quotation mark U+2018, the modifier apostrophe
U+02BC, the grave and acute accents standing alone, the dashes U+2010,
U+2013, and U+2014, and every other kind of space. Folding a character the grammar does
not declare would invent data.
Composed, lowered, and never folded
A string is composed with Unicode's NFC form, so a letter and an accent typed separately become 1 character. It
is never decomposed with NFKC, which would turn a presentation ligature such as U+FB03 into 3
letters; that ligature fails instead.
Letters are lowered, never case-folded. A case fold turns the German sharp s into "ss" and makes a foreign spelling look English; lowering leaves it in place, where it fails as an undeclared character. The string is composed again after lowering, because lowering can split a letter in two.
The form
- Every token holds at least 1 letter.
- A hyphen sits between 2 parts that each hold a letter: never first, never last, never 2 in a row.
- An apostrophe may begin a token, as in a leading elision, but never ends one and never doubles. So this version holds no plural possessive, which ends in an apostrophe; a form that ends in an apostrophe and s is held. Plural possessives may come in a later version, generated from their stems once the dataset has parts of speech, and that version would record the change to the grammar.
- Spaces are single and between tokens, never first or last, and each token passes these rules on its own.
- The underscore is never a character. Sources that write a space as an underscore are read with the space before the grammar sees them.
The spelling classes
A string that passes is given flags for what its characters and tokens hold. The flags combine: a string can be hyphenated and accented at once. A string with none is plain a to z.
| Class | A string holds | From the vetted examples |
|---|---|---|
| Hyphenated | a hyphen joins parts that each hold a letter | cyber-terrorism |
| Accented | a letter of the accent inventory, other than the diaeresis | débriding |
| Diaeresis | ä, ë, ï, ö, or ü | jägers |
| Ligature | æ or œ | No vetted example holds one; the characters are æ and œ. |
| Apostrophe | an apostrophe anywhere | t'ang |
| Contraction | a clipped not, will, have, are, would, had, or am at the end, or a leading apostrophe | dasn't |
| Ends in 's | a token ending in 's | gounod's |
| Multiword | more than 1 token, each passing the rules on its own | calla lily |