• (cs)

    I never heard "beek" used for an artificial waterway, it's always a synonym for brook.

    Addendum (2012-01-20 07:31): By the way you forgot the rule for words ending in -s. When there is a double vowel in front of it, remove it and change the s into a z. baas (boss) -> bazen. Otherwise, double the s. bas (bass) -> bassen. Except in the case of exceptions, of course....

  • Someone (unregistered) in reply to Nagesh
    Nagesh:
    eros:
    Anon:
    It's English. English is nothing *but* special cases. Every pattern has at least one exception (mouse -> mice, louse -> lice, but house -/-> hice). And then there's the pluralizations using foreign patterns (cactus -> cacti, etc.)
    Yeah, spoken language is a bitch, eh? Amazing how people make common things easier/quicker to say.

    matter of fact, speaking is easy than writing.

    Speaking is easier than writing. FTFY

  • Mathew (unregistered) in reply to SG_01

    In german we have words that have the same singular but different plural.

  • Mathew (unregistered) in reply to SG_01
    SG_01:
    Rcxdude:
    yup, Nethack has a similar makeplural() it's pretty similar, but more comprehensive. Interestingly it also has makesingular()

    spambot thinks this is spam...

    That second one should be interesting, seeing as how words like life and live have the same plural :D

    In german we have words that have the same singular but different plural.

  • Ru (unregistered) in reply to Bubba
    Bubba:
    Why not use Esperanto for our user interfaces?

    No exceptions ever!

    Using Esperanto might help, but I think you'd be much better off using Lojban. Semantic unambiguity and parsability FTW, and suchlike.

  • 50% Opacity (unregistered) in reply to Mathew
    Mathew:
    SG_01:
    Rcxdude:
    yup, Nethack has a similar makeplural() it's pretty similar, but more comprehensive. Interestingly it also has makesingular()

    spambot thinks this is spam...

    That second one should be interesting, seeing as how words like life and live have the same plural :D

    In german we have words that have the same singular but different plural.

    In Soviet Russia, same singular plurals have you.

  • (cs) in reply to Mathew
    Mathew:
    In german we have words that have the same singular but different plural.
    Same in Dutch, as I wrote on the previous page.
  • Ru (unregistered)

    Doesn't arabic have singular, double and plural forms of words? Properly weird language.

  • Meep (unregistered) in reply to Anon
    Anon:
    It's English. English is nothing *but* special cases. Every pattern has at least one exception (mouse -> mice, louse -> lice, but house -/-> hice). And then there's the pluralizations using foreign patterns (cactus -> cacti, etc.)

    Nope, louse and mouse are both regular English, just regular English from when words where inflected in the middle. They date from the same era as run / ran, slay / slew, throw / threw. When you hear people complaining about how the kids talk and their bad grammar, imagine how it must have sounded when English sentence order changed from subject-object-verb to the modern subject-verb-object. You still get the subject-object-verb order in certain ritual sayings, e.g. "with this ring, I thee wed."

  • 50% Opacity (unregistered) in reply to Ru
    Ru:
    Doesn't arabic have singular, double and plural forms of words? Properly weird language.

    snort If you thought that's weird, you'll be shocked by this list of plural variations among different languages:

    Only one form Two forms, singular used for one only Two forms, singular used for zero and one Three forms, special case for zero Three forms, special cases for one and two Three forms, special case for numbers ending in 00 or [2-9][0-9] Three forms, special case for numbers ending in 1[2-9] Three forms, special cases for numbers ending in 1 and 2, 3, 4, except those ending in 1[1-4] Three forms, special cases for 1 and 2, 3, 4 Three forms, special case for one and some numbers ending in 2, 3, or 4 Four forms, special case for one and all numbers ending in 02, 03, or 04

    http://www.gnu.org/savannah-checkouts/gnu/gettext/manual/html_node/Plural-forms.html

  • Eric (unregistered)

    I'm surprised I'm the first to do this...

    Firsts!

  • Brandon (unregistered) in reply to Anon
    Anon:
    PB:
    I must be WTF, because i don't see anything wrong in this code.

    Is it not enough exception-words, what makes it WTF-y ?

    It's a WTF because it's only called once to turn "item" into "items" and it doesn't even handle the conversion of "is" into "are".

    It's both incomplete as a general function and vastly over-engineered for this one, simple case.

    It shouldn't handle the conversion of "is" into "are" because that's conjugation, not pluralization. There should be a separate function to handle that.

  • (cs) in reply to Jay
    Jay:
    Bubba:
    Why not use Esperanto for our user interfaces?

    No exceptions ever!

    That would be a great idea if our users spoke Esperanto.

    Unfortunately, system developers have to deal with the requirements as they actually exist. We cannot change the requirements to what would be easier to code.

    Hey, here's an even simpler idea: Only allow integers to have the value "1". Like, only allow customers to order one of each item, only allow each company to have one employee, etc. Then we'd never need to worry about plurals!

    It was an example of "stategic" IT thinking. Always try to develop a technicaly ideal solution even if it doesn't actually reflect the users' needs.

  • PB (unregistered)

    So... An insufficient attempt trying to deal with a really complicated task ? This is supposed to be WTF ? Come on people, we all write things like that. As long, as the pluralization itself is not an essential part of a whole project, it can easily slide.

  • Ru (unregistered) in reply to 50% Opacity
    50% Opacity:
    Ru:
    Doesn't arabic have singular, double and plural forms of words? Properly weird language.

    snort If you thought that's weird, you'll be shocked by this list of plural variations among different languages:

    Sure, there are loads of odd little languages, but they are spoken by people who are unlikely to form a target market for anything. I bet they don't even have any oil.

    Arabic on the other hand is widely spoken and positively cosmopolitan which is why is strange that they've kept odd little grammatical features like duals. Its also vastly more likely to be encountered in the real world.

    (Sursurunga has lots of silly plural forms: spoken by 3000 people. The number of Arabic speakers is about 6 orders of magnitude greater. Seriously: only Gnu weenies care)

  • milo (unregistered)

    At least he added comments.

  • Anonymous Bob (unregistered) in reply to Rcxdude
    Rcxdude:
    yup, Nethack has a similar makeplural() it's pretty similar, but more comprehensive. Interestingly it also has makesingular()

    spambot thinks this is spam...

    Hmm, NetHack's makeplural() thinks the plural of "human" is "humen"?

  • Sir Robin The Not-So-Brave (unregistered)

    Whoa, page 3 already, and nobody cared to mention that Pluralization/Inflection is a standard feature of Ruby on Rails? Suppose you have a class 'person', then RoR will want to store that in a table called 'people'.

    Test it for yourself at http://nubyonrails.com/tools/pluralize

  • (cs) in reply to PB
    PB:
    I must be WTF, because i don't see anything wrong in this code.

    Is it not enough exception-words, what makes it WTF-y ?

    Look again:

            // Don't pluralize "by"
            if (result.Length > 2 && !result.EndsWith(" by", StringComparison.InvariantCultureIgnoreCase))
            {
                result = result.Truncate(result.Length - 1) + "ies";
            }
    

    And pointing out that this is a stupid idea is one of my hobby! (On the other hand: Looby!)

  • uns (unregistered) in reply to Maurits
    Maurits:
    dwarfs, dwarves, or dwerrows?

    Dear dwarf,

    In case you can’t tell, this is a grown-up place. The fact that you insist on being pluralized clearly shows that you’re too [strike]young and too stupid[/strike] small to be more of you.

    Go away and grow up. Sincerely, Gimli, son of Gloin

  • Some Java Dev (unregistered) in reply to Bubba
    Bubba:
    Why not use Esperanto for our user interfaces?

    No exceptions ever!

    Ĉu vi parolas Esperanton?

  • L. (unregistered) in reply to Ru
    Ru:
    50% Opacity:
    Ru:
    Doesn't arabic have singular, double and plural forms of words? Properly weird language.

    snort If you thought that's weird, you'll be shocked by this list of plural variations among different languages:

    Sure, there are loads of odd little languages, but they are spoken by people who are unlikely to form a target market for anything. I bet they don't even have any oil.

    Arabic on the other hand is widely spoken and positively cosmopolitan which is why is strange that they've kept odd little grammatical features like duals. Its also vastly more likely to be encountered in the real world.

    (Sursurunga has lots of silly plural forms: spoken by 3000 people. The number of Arabic speakers is about 6 orders of magnitude greater. Seriously: only Gnu weenies care)

    6 orders of magnitude greater .. until the next arab uprising or oil war ;)

  • Anon (unregistered) in reply to Severity One
    Severity One:
    QJo:
    " sloot (one of the many Dutch words for 'canal')"

    Chuckle! Like the 50 words for snow of the Eskimos?

    From what I understand, they don't have that many words for snow; it's more the way the language is constructed.

    http://en.wikipedia.org/wiki/Eskimo_words_for_snow

    The Sami, on the other hand, do have hundreds of words for snow.

    Anyway, a canal is an artificial waterway. Because the Dutch are quite adapt at digging them, they have quite a few words for them, mostly based on the size. The smallest type is 'beek', which can also be used for a natural waterway and would, in that case, translate to brook. A bit bigger is 'sloot', even bigger would be 'kanaal' (big enough to go through with a boat or ship). Somewhere in there, there's also 'greppel', 'geul', 'vliet', 'gracht' (in or around a city, like Amsterdam), 'vaart' and a couple more less often used words.

    That's just artificial waterways. Obviously, there are plenty of other words having to do with water and the sea, such as 'kwelder', which is a piece of land outside the dikes that only submerges during very high tide.

    About half of the country would be submerged if it weren't for dunes and dikes (both against the sea and against rivers). Big pumps get rid of the water on a 24/7 basis. This used to be done by the famous windmills; these days, they mostly run on electricity.

    There's one, built in the 19th century, that runs on steam and is a Unesco World Heritage site. The last time it was used for real (because of all the excess water) was about two weeks ago.

    One can imagine that global warming and rising sea levels are a bit of an issue for the Netherlands.

    Fuck me. That has to be the most boring post ever.

  • Jay (unregistered) in reply to Don L
    Don L:
    Wouldn't the simplest solution just be to invoke a function whenever you had to spit out a count and a word?

    Such as....:

    Function SingularOrPlural(count, singular, plural) If count < 0 Then throw #FileNotFpundException End If If count = 1 Then SingularOrPlural = count & " " & singular Else SingularOrPlural = count & " " & plural End If End Function

    fullsentence = "There's " & SingularOrPlural(n, "bottle", "bottles") & " on the wall."

    That's how I always do it. Then you don't have to worry about whether whoever wrote some big complex function handled this particular special case. Considering how infrequently the problem comes up, this is a clean and simple solution. And, I might point out, how much more work is it to write

    pluralize(n, "bottle", "bottles")
    

    rather than

    pluralize(n, "bottle")
    

    PS I do generally overload the function to take only the singular value, and default to making the plural be the singular +"s". Then all the standard cases are zero effort above having the big complex handles-all-possible-cases function.

    Seems to me this is just an example of the phenomenon we see a lot in this business: "We're going to devote thousands of hours to developing this product, because it's an interesting problem that will be fun to solve, even though the finished product, even if it works as designed, will have little practical use."

  • (cs) in reply to Some Java Dev
    Some Java Dev:
    Bubba:
    Why not use Esperanto for our user interfaces?

    No exceptions ever!

    Ĉu vi parolas Esperanton?

    Mi tute ne parolas Esperanton!
  • Mr. Magenta (unregistered)

    Ah, so now we know what happened to Chris Osgood after he retired from the NHL.

  • Argle (unregistered)
    Buy the Tailor's Goose today!
    Hmmm... I need one of those.
    Dear Sirs, Please send me one Tailor's Goose
    No, no. I'm going to need two. I'll start over:
    Dear Sirs, Please send me two Tailor's Gooses
    Argh! Not right! Try again.
    Dear Sirs, Please send me two Tailor's Geese
    Nuts! It's not the product name! *sigh*
    Dear Sirs, Please send me one Tailor's Goose.

    P.S. Send me another one.

  • Anonymous Bob (unregistered) in reply to Anon
    Anon:
    Fuck me. That has to be the most boring post ever.

    I thought it was quite interesting! And, no, I won't fuck you. But thanks for asking!

  • myName (unregistered)

    Nope, I don't see the problem with it, and when you point out what it is could you also say how you would write the code?

  • geoffrey (unregistered)

    Isn't it the whole point of iterative programming to get something out the door that may not be perfect, and then improve upon it incrementally? This seems to be a good first step toward a useful feature. Where's the WTF in that?

  • (cs) in reply to Sir Robin The Not-So-Brave
    Sir Robin The Not-So-Brave:
    Whoa, page 3 already, and nobody cared to mention that Pluralization/Inflection is a standard feature of Ruby on Rails? Suppose you have a class 'person', then RoR will want to store that in a table called 'people'.

    Test it for yourself at http://nubyonrails.com/tools/pluralize

    Stupid RoR. If I have a class called Foot it wants to tableize it as foots. Thief to thiefs. Leaf to leafs. Even the WTF code in this article did better than than. Octopus to octopi. Sigh. Octopuses is the normal plural, octopodes is also acceptable. Octopi is an erroneous pluralization. This was added by someone who really wanted to seem smart, but couldn't even be arsed to check wikipedia. I write IMMENSE amounts of code around octopus related topics, especially their eight FOOTS, and this why I don't use ruby.

    Final note... Me -> mes? You -> yous? Them -> thems? I -> is? Plural -> plurals? Seriously ruby?

  • (cs) in reply to myName
    myName:
    Nope, I don't see the problem with it, and when you point out what it is could you also say how you would write the code?

    Ignoring Arabic's duals (interesting tidbit I didn't know), you need one sentence for singular, and one sentence for plural. They can be quite different sentences. So detect which case you're dealing with, and insert the appropriate (translated) sentence. For the plural sentence you need a spot to stick in the number. For the singular sentence, and this is important, you do not necessarily need a number. "You have a single turn remaining" vs "You have (5) turns remaining", or "This is your last turn" vs "You have (4) turns remaining", or "You have no turns after this one" versus "You have (3) turns remaining". It is not just a matter of singular/plural. You may be saying entirely different things based on singular plural. Now, you also may not, it may be as small as "You have (1) turn remaining". But categorizing the entire sentence differently allows you to always be able to use the correct sentence structure, conjugation, and meaning.

  • mh (unregistered) in reply to Shinobu

    That is not possible in localized applications. E.g. Japanese uses different number suffix based on class of object (e.g. flat objects are counted differently than other objects). Some slavic languages use 3 different suffixes based on number, not just singular and plural, e.g. in Slovak 1 pes (1 dog), 2-4 psy (2-4 dogs), 5-inf psov (5-inf dogs). That is just what I know, and I am no linguist. I am sure you could find other languages even weirder than that. There is no way you can cover all that in a maintainable way, best is not to even try an design your UI in a way that avoids pluralization.

  • mh (unregistered) in reply to Ru

    AFAIK, Russian is the "Three forms, special cases for 1 and 2, 3, 4" case. A bit more than 3000 using that one. Also they have oil.

  • Expert (unregistered)

    So, this will result in "USes Governments"

  • Expert (unregistered)

    So, this will result in "USes Governments"

  • Luiz Felipe (unregistered) in reply to Shinobu
    Shinobu:
    On the other hand, I cringe every time an application serves me a ‘You have selected 1 item(s).’ Or even worse: ‘1 items’ It's 2012 and we still get crap like that? Really, the operation system should provide a standard service to put things in the right number, and (for some languages) gender/case.

    TrueWTF is human language. Whats difference in saying 0 items, 1 items, 2 items always. Makes no difference, except for redundancy. Why natural language have to have so much redundance. It make me sick.

  • Luiz Felipe (unregistered) in reply to Bubba
    Bubba:
    Why not use Esperanto for our user interfaces?

    No exceptions ever!

    +100

    captcha: saluto, i salute you.

  • Luiz Felipe (unregistered) in reply to anon
    anon:
    The Nethack pluralization code is an impressive mess as well...

    http://celabs.com/nethack/html/objnam_8c_source.html

    See line 1268

    WTF, all local variables have register tag. This is why saying "register" to compiler does nothing. The compiler silent ignore the clueless coders and automatically choose what need to be register variable, better that the coders.

  • Gibbon1 (unregistered) in reply to Luiz Felipe
    Luiz Felipe:
    WTF, all local variables have register tag. This is why saying "register" to compiler does nothing. The compiler silent ignore the clueless coders and automatically choose what need to be register variable, better that the coders.

    That code is really old, written when compilers weren't very smart, to run on machines with pitiful amounts of memory.

  • bob (unregistered) in reply to Nagesh
    Nagesh:
    eros:
    Anon:
    It's English. English is nothing *but* special cases. Every pattern has at least one exception (mouse -> mice, louse -> lice, but house -/-> hice). And then there's the pluralizations using foreign patterns (cactus -> cacti, etc.)
    Yeah, spoken language is a bitch, eh? Amazing how people make common things easier/quicker to say.

    matter of fact, speaking is easy than writing.

    Only an idiot would make that statement, since spoken and written English are identical.

  • A Nonny Mouse (unregistered) in reply to pl

    Why not? I had forgotten both of these by the time I was 8 years old!

  • Code monkey (unregistered)

    I thought it was a reasonable stab to solve a very complicated problem.

  • Troll Goon (unregistered) in reply to Stan the Man
    Stan the Man:
    Is anyone else pissed off that Alex endorsed SOPA yesterday?
    Ok, I'll bite. You're a cock!
  • Xenious (unregistered)

    Captcha: minimim.

  • (cs)
    foots, tomatos, boies, wifes, and etc.

    Haha, what a stupid code. Everyone knows it's tomatoes.

    Addendum (2012-01-23 03:36): Edit: Whoops, my sarcasm appears to have backfired, as that plural is actually correct. I was apparently thinking of the wrong singular "tomatoe".

  • Mr Clever Ideas (unregistered) in reply to Anketam
    Anketam:
    This reminds me of a game I once played, when you are creating your alien species it prompts you to give a name for your species, and in a box next to it, it asks what the plural form is for it.
    QuagAAAs!
  • PB (unregistered)
    spoken and written English are identical.

    Oh, really ? It only depends on how do you pronounce letters. It varies a lot from language to language. From my mother tongue's point of view, spoken english differs a lot from the written one.

  • Deja Vu (unregistered)

    But I was lieked this yes about it was is PLURALIZED! story I am ze germans!

    CAPTCHA: dignissim - not over here, I would say.

  • Blubber (unregistered) in reply to xorsyst

    So say I have 2 mice and they die. I guess then I could say: I once had 2 mice, but now I have merely 2 mouses.

    But what happens if only one of the two dies? Do I then have one mouse and uhm one mouse? Worse still image Schrodingers mice. 4 mice in a box with some contraption that might kill them or not. What do I have in the box? A super position of 4 mice, 3 mice + 1 mouse, 2 mice + 2 mouses, 1 mouse + 3 mice and 4 mouses? Sounds good to me!

Leave a comment on “Pluralized!”

Log In or post as a guest

Replying to comment #:

« Return to Article