(Celtic): X dogs in computer speak

< Previous | Next >


Senior Member
Welsh - Northern
When we translate UIs with numerals, it's often the case that the numeral is a variable so that the computer programmer can substitute the appropriate numeral in the right place. So, let's assume we have the English word 'cat' and we have the question:

"How many cats do you have?"

The answers are to be listed as

No cats
1 cat
2 cats
3 cats
4 cats or more

Now, let's assume you can't drop the numeral. The form of the noun is fairly straightforward - 'cat' or 'cats'.

But this can't work in 'Celtic'. Take Welsh for the same grouping.

0 - Dim cath

1 - Un gath
2 - Dwy gath

3 - Tair cath
6 - Chwe chath
10 - Deg o gathod

Here then 1 and 2 followed a pattern, 3 and 6 will follow another (3 doesn't here as 'cat' is fem. , but with a masc. noun it would 'pair with' 6), 4,5, 7, 8, 9 follow a third pattern, and 10+ yet another.

How to convey these other variables to a computer program?

Thanks for any ideas. I have, I think, one solution. See if you agree.

[Edit: The title started off with 'dogs' but then I changed it to 'cats' out of pure favoritism and to show that '3' is sometimes 'paired with '6' but sometimes not. That 3 dogs 'tri chi', 6 dogs 'chwe chi' .... but 3 cats 'tair cath', 6 cats 'chwe chath'.]
Last edited:
  • jimquk

    I suppose the simplest would be to use an unchangeable root form throughout, and then use an algorithm (a grammar, so to speak) to generate the correct verbal output.
    Perhaps that's an Anglocentric perspective though.


    Senior Member
    English - South-East England
    I've never written programs to handle languages other than English - except very basic ones to test myself on grammar - but it's bad enough in English. I often get results like '1 records found' because I was too lazy to allow for the special case of 1. A test for whether to use 'a' or 'an' started with vowels = "aeiou" but then I needed to cater for "a university", so had to have a wordlist with a flag on words like "university".

    In Welsh or Polish or Arabic or whatever, handling the number is the easy part. After five you use the genitive singular - or tens take this or that case - it can be complicated but at least there's a rule. But what is the genitive (yes, Polish, that's you I'm looking at), or the plural (how the hell do Welsh people remember all those plural endings?)? You need some flags for the gender and the plural ending (ending! huh! if it were only so simple - yes, Welsh, that's you with the umlaut and unpredictable endings and singulatives), and you need it for basically every single word - it's not a few exceptional overrides to a rule.

    My wordlists for most languages I study have these 'flags', like g=f, pl=oedd, and the program I wrote to test myself handles these. But in some languages - a lot - you need to flag almost every word. Normal algorithmic rules aren't good enough.
    Last edited:


    Senior Member
    Welsh - Northern
    Welsh plurals aren't that difficult when you do it by number. You can always use the singular - as I've attempted to show.

    1 to 10, is the equivalent of 1 dog, 2 dog, 3 dog, 4 dog etc.
    11+ you can still follow this pattern or use the pattern of 'X of dogs'. (Admittedly, there you have to know the plural form and the appropriate soft mutation after 'of' but that's about all. The singular, although less idiomatic, is not absolutely prohibited, and there is no clearly defined cutting off point.)

    Incidentally, we don't usually refer to umlaut in the context you refer to. Rather we prefer, 'vowel affection'.

    The real headache is the changing by way of initial consonant mutation the form of the (singular) noun after the appropriate numeral.

    We'll use 'cat' and 'dog'

    'cath' (= base form) 'cat'

    1 un gath
    2 dwy gath

    3 tair cath
    4 pedair cath
    5 pum cath

    6 chwe chath

    7 saith cath
    8 wyth cath
    9 naw cath

    'ci' (= base form) 'dog'

    1 un ci

    2 dau gi

    3 tri chi

    4 pedwar ci
    5 pum ci

    6 chwe chi

    7 saith ci
    8 wyth ci
    9 naw ci

    This presentation causes nightmares for UI programmers who, for example, want to input numbers of candidates, students etc. I've tried explaining to them, but invariably the agencies I work with are English speaking ones. My best solution so far is to provide a re-working along the lines of,

    Number of dogs/candidates/students: X (where this is an integer).


    Senior Member
    My best solution so far is to provide a re-working along the lines of,

    Number of dogs/candidates/students: X (where this is an integer).
    This is the best solution: restructure the UI so that you never need to worry about plural forms in different languages.
    Alternatively, if the list of supported languages and/or number of words for which a plural form is potentially required is small, then the forms can be hard-coded in the form of language-specific rules.
    Last edited:
    < Previous | Next >