• eros (unregistered) in reply to C-Octothorpe
    C-Octothorpe:
    Matt G:
    They should've used this: Pluralization Helper for C#

    Captcha: appellatio. Noun. Fellatio in the Appellations.

    Love the first comment:

    Naveen:
    HI

    I am Naveen.I had learnt ,how to run selenium IDE & selenium RC.The main thing is how to generate a Test Report after the running the test Succesfully.I am using the Selenium RC and NUNIT for the testing .How to get the Test actions and descriptions in a Report.And another thing is How to run Selenium Core and when it is useful .And suggest some more open source tools for testing .Net and Java Projects ………………………..

    Try to help me…..

    Thanks Naveen

    Nagesh's cousin, I suppose...
    Fake-Indian-queer wouldn't know a unit-test if it drove itself up his ---.

  • anon (unregistered) in reply to Mason Wheeler

    The Nethack pluralization code is an impressive mess as well...

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

    See line 1268

  • FuBar (unregistered) 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....

    Hang on a minute. If it's the best system for the job, sometimes the business just has to bite the bullet and change their processes to match.

  • Nagesh (unregistered) in reply to eros
    eros:
    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.

    Don't reply to my posts, you fake-Indian jerk-off.

    sry

    he is jackwagan who has stoled my acount.

  • Boog, I Am Your Father! (aka Behold The Return Of Zunesis!)! (unregistered) in reply to eros
    eros:
    C-Octothorpe:
    Matt G:
    They should've used this: Pluralization Helper for C#

    Captcha: appellatio. Noun. Fellatio in the Appellations.

    Love the first comment:

    Naveen:
    HI

    I am Naveen.I had learnt ,how to run selenium IDE & selenium RC.The main thing is how to generate a Test Report after the running the test Succesfully.I am using the Selenium RC and NUNIT for the testing .How to get the Test actions and descriptions in a Report.And another thing is How to run Selenium Core and when it is useful .And suggest some more open source tools for testing .Net and Java Projects ………………………..

    Try to help me…..

    Thanks Naveen

    Nagesh's cousin, I suppose...
    Fake-Indian-queer wouldn't know a unit-test if it drove itself up his ---.
    Urethra?

  • eros (unregistered) in reply to Boog, I Am Your Father! (aka Behold The Return Of Zunesis!)!
    Boog:
    eros:
    C-Octothorpe:
    Matt G:
    They should've used this: Pluralization Helper for C#

    Captcha: appellatio. Noun. Fellatio in the Appellations.

    Love the first comment:

    Naveen:
    HI

    I am Naveen.I had learnt ,how to run selenium IDE & selenium RC.The main thing is how to generate a Test Report after the running the test Succesfully.I am using the Selenium RC and NUNIT for the testing .How to get the Test actions and descriptions in a Report.And another thing is How to run Selenium Core and when it is useful .And suggest some more open source tools for testing .Net and Java Projects ………………………..

    Try to help me…..

    Thanks Naveen

    Nagesh's cousin, I suppose...
    Fake-Indian-queer wouldn't know a unit-test if it drove itself up his ---.
    Urethra?
    You **** me off, too. Do you not know how to count to 3?

  • Stan the Man (unregistered)

    Is anyone else pissed off that Alex endorsed SOPA yesterday?

  • zac (unregistered)

    Let's talk about sees baby, let's talk about all the good things that make me. Let's talk about sees.

  • Matt Westwood (unregistered) in reply to David
    David:
    Esperanto doesn't have try/catch?
    provu {
    :
    :
    } capti (KontraŭleĝaTradukoEscepto e) {
        ĵetu nova StultaProgramuloEscepto (e) ;
    } fine {
        ordigi();
    }
    
  • (cs)

    Uh...how is this a WTF?

    Please submit code that does the same thing better.

  • Matt Westwood (unregistered) in reply to Jon E.
    Jon E.:
    Sorry for taking so long to comment. Yesterday's theDailyWTF motivated me to voluntarily give up DNS use. I had a typo and accidentally went to http://74.50.110.112/ instead of http://74.50.110.120/

    I thought it was a new WTF post.

    (It took me a while to find an IP with a similar number that would resolve to something that looked like a joke)

    Sheesh! Am I the only one who looked at the logo on the RHS of the grinning guy with the thumb up and thought: "That is one heck of a pointy biceps ..."

  • Boog, I Am Your Father! (aka Behold The Return Of Zunesis!)! (unregistered) in reply to eros
    eros:
    Boog:
    eros:
    Fake-Indian-queer wouldn't know a unit-test if it drove itself up his ---.
    Urethra?
    You [jerk] me off, too. Do you not know how to count to 3?
    Sure, if you want! 3? Is that all the licks it takes to get to the center of your lollipop?
  • Chris Osisintroublenow (unregistered)

    I'm {Chrises|Chris's|Chris'} manager, and I recognized this code as soon as I saw it. I also will proudly claim ownership of the function, though it was a collaborative effort.

    Its used in lots of places in our code-base, not just the one spot where Chris saw it, and the special cases are purely tongue in cheek, I can assure you. The word "sheep" will have never passed through this function in a production environment.

  • anti anti (unregistered)

    This isn't so bad. Incomplete, should have been more extensible, should have used a library or based its self on an existing database of rules and exceptions. Pluralisation is a pain in the butt and a fools errend for most programmers to DIY. Most implementations will be WTF by default.

  • Chris Osgood (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.

    This function was only intended to "pluralize" a word, the is / are logic was handled in the calling validation code.

    PB - The code works fine, the problem is there are a ridiculous number of special cases it doesn't handle, which means the resulting error message will have incorrect spelling, and that is WTF.

    Also, can't believe my first ever post to TDWTF was front-paged :-)

  • K (unregistered) in reply to Anon
    Anon:
    I think one of Askimet's brilliant heuristics for determining if something is spam is:
    if (message ends with a url)
        IsSpam = true;
    
    Interestingly it used to be the case that if you posted a message on facebook, and it happened to end with a URL, that URL would simply be deleted and the message would get posted without it.

    Does thedailywtf and facebook share code?

  • Sanity (unregistered)

    Rails handles this, as well as a number of other transformations. The main use is so it can automagically connect a model class "User" with a database table "users".

    At a certain point, they stopped accepting patches to the inflection module, probably because this is not an easy problem. Instead, they provided an API for the application to add its own inflections, or (of course) to specify the table in question.

    (Incidentally, this is the idea of "covention over configuration" -- when it's done right, the configuration is still there if you need it, you can just get stuff done faster when your problem happens to fit the conventions.)

  • SG_01 (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...

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

  • SG_01 (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

    /selfcorrect: live doesn't have a plural ofcourse, but lives can be both a plural of life, or a verb :D

  • 234;_asldfja;sldfj;l (unregistered)

    This post is fucking bullshit. Are you fucking kidding me? Give me some quicker code to fucking translate singular into plural in the English fucking language? Fucking iditios thinking such a thing is fucking simplistic. God damn the stupid retard that posted this. What the fuck is your stupid problem? Thanks for the fucking goddamn Google results on my product.

  • Don L (unregistered)

    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."

  • F (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).

    What? Now you tell me ...

  • Simon (unregistered) in reply to Stan the Man

    nice try, Stan.

  • Nethack code-diver (unregistered) in reply to Mason Wheeler

    More or less. 218 lines of well commented code, and Also handles some Japanese words and funny words like djinni. I'm surprised it is so short.

    See http://nethackwiki.com/wiki/Objnam.c#makeplural

  • TheRider (unregistered) in reply to Stan the Man
    Stan the Man:
    Is anyone else pissed off that Alex endorsed SOPA yesterday?
    Except he didn't. Please adjust your sarcasm detector.
  • Jinks (unregistered) in reply to pl
    pl:
    Don't forget:

    box => boxen caboose => cabeese

    mouse => meeces
  • (cs) in reply to TheRider
    TheRider:
    Stan the Man:
    Is anyone else pissed off that Alex endorsed SOPA yesterday?
    Except he didn't. Please adjust your sarcasm detector.
    Maybe it's your troll detector that's broken? Obvious troll wasn't obvious enough?
  • Not It (unregistered) in reply to anon
    Not It:
    Line 00252 of NetHack's pline.c
       panic("impossible called impossible");
    
  • (cs)

    Seems like a decent idea to me.

    I just wonder if this creative person has come up with something to handle tenses. You know: was/is/will be; hasn't/isn't/won't; ran/running/will run; and etc.

    I mean, just think about it: If it will handle future pluperfect, we'll really have something.

  • FurryMoses (unregistered) in reply to Anon

    Since the sentence was: "at least 3 options are required"

    Why not just code a sentence like this & avoid plurals altogether:

    "Options required: X" "Options required: at least X"

    Where X, in the case sited, is 3. If I'm right, X could be replaced by any number.

    The amazingly stupid thing about plurals is that they never add any meaning; they're not strictly necessary to communicate the base information - which is why many languages get on fine without them.

  • Anne On (unregistered) in reply to the beholder

    You mean they are able to read what's on the screen today?

  • Anne On (unregistered) in reply to the beholder
    the beholder:
    Bubba:
    Why not use Esperanto for our user interfaces?

    No exceptions ever!

    Because if we already have stupid support calls as it is today, imagine if our users weren't able to read what's on the screen.

    You mean they are able to read what's on the screen today?

    (Sorry for the previous WTF)

  • tom (unregistered)

    This is why my company tasked a team with developing a Lojban compiler. We already speak the language at the office. I'm looking forward to coding in it. It's going to be so natural and productive!

  • Tud (unregistered) in reply to Tractor
    Tractor:
    the beholder:
    Bubba:
    Why not use Esperanto for our user interfaces?

    No exceptions ever!

    Because if we already have stupid support calls as it is today, imagine if our users weren't able to read what's on the screen.

    I imagine it wouldn't make much of a difference. Users don't read what's on the screen anyway.

    This. This way we could be more productibe and insult our users at the same time.

  • Rolf (unregistered)

    I am impressed that the original coder resisted the (obvious) urge to create a domain-specific language for stemming-rules (I wouldn't...)

  • L. (unregistered) in reply to Jay
    Jay:
    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.

    Sure. And the "operation system" should analyze all text and automatically correct it for spelling and grammar errors -- like correcting "operation system" to "operating system" and "serves me" to "displays", etc. And it should write all my programs for me, so I can just say, "Computer, create a web site where customers can order any of the products we sell", and it does it for me. Like the computers work on Star Trek.

    Makes sense to me : do it fast, well and for free. thx

  • L. (unregistered) in reply to John
    John:
    Zylon:
    "...it was is PLURALIZED!"

    Muphry's Law strikes again.

    I can't believe I didn't notice that. I wonder if it was is supposed to be that way?

    CAPTCHA: iusto - iusto correctly pluralize words.

    "I'm Mc don't know how to pluralize word" --> check out Jon Lajoie ;)

  • L. (unregistered) in reply to Jinks
    Jinks:
    pl:
    Don't forget:

    box => boxen caboose => cabeese

    mouse => meeces

    fouse =>

  • John (unregistered) in reply to L.
    L.:
    Jinks:
    pl:
    Don't forget:

    box => boxen caboose => cabeese

    mouse => meeces

    fouse =>

    And of course "Sheep are fluffy" -> "sheep are fluffy" The case switching in the special cases is bad.

  • (cs)

    In Dutch, the plural is much simpler: you just put 'en' behind the word.

    Well, except if the word ends in a 'schwa', in which case you put 's' behind the word.

    And with certain words, you have to double the consonant at the end, but not with all: vat ('vat') -> vaten; kat ('cat') -> katten.

    And you have to remember to remove the extraneous vowel if the pronunciation remains the same: sloot (one of the many Dutch words for 'canal') -> sloten. Which happens to be also the plural for 'slot' ('lock').

    And for certain words, you have to put 'eren' behind: ei ('egg') -> eieren.

    And for certain words ending in 'man', the plural becomes 'lieden': timmerman (carpenter) -> timmerlieden. Usually, at least.

    And then there are the classic Greek and Latin words, which retain their original plurals: museum -> musea. Well, most of them, anyway.

    But other than that, it's really simple.

  • Adrian (unregistered) in reply to eros
    eros:
    Yeah, spoken language is a bitch, eh? Amazing how people make common things easier/quicker to say.

    'persons'. Didn't you see the code?

  • coz (unregistered)

    here is a link to more complex Java code :)

    http://www.java2s.com/Tutorial/Java/0040__Data-Type/Transformswordstosingularpluralhumanizedhumanreadableunderscorecamelcaseorordinalform.htm

  • Soske (unregistered) in reply to Severity One

    And don't forget Bedrijf -> Bedrijven BUT Smurf -> Smurfen

  • (cs)

    Broer -> Gebroeders Ei - Eieren Portier -> portieren Portier -> portiers

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

    No exceptions ever!

    Because if we already have stupid support calls as it is today, imagine if our users weren't able to read what's on the screen.

    Actually, that might work.

    For ages we've argued about whether people should have to get a license to use computers. How about we require them to learn a foreign language...?

  • (cs) 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.)

    Well, there were some people who used to use "mouses" for computer mice, with the distinction being animate/inanimate object pluralization. It was quite big in certain circles before every computer came with one.

  • Iceman (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.

    Actually general pluralization for a language is a very complicated thing. You first need a dynamic expression or hard coded expression for every language that specifies how many plural rules are available for the language and then you need to translate the sentence as a whole as many times as there are plural rules, for example Irish Gaelic has 5 plural rules so you would need 5 translated sentences. As an example Mozilla has created a complete pluralization framework for Firefox, check out Localization and Plurals for the plural rules.

  • QJo (unregistered) in reply to Severity One
    Severity One:
    In Dutch, the plural is much simpler: you just put 'en' behind the word.

    Well, except if the word ends in a 'schwa', in which case you put 's' behind the word.

    And with certain words, you have to double the consonant at the end, but not with all: vat ('vat') -> vaten; kat ('cat') -> katten.

    And you have to remember to remove the extraneous vowel if the pronunciation remains the same: sloot (one of the many Dutch words for 'canal') -> sloten. Which happens to be also the plural for 'slot' ('lock').

    And for certain words, you have to put 'eren' behind: ei ('egg') -> eieren.

    And for certain words ending in 'man', the plural becomes 'lieden': timmerman (carpenter) -> timmerlieden. Usually, at least.

    And then there are the classic Greek and Latin words, which retain their original plurals: museum -> musea. Well, most of them, anyway.

    But other than that, it's really simple.

    " sloot (one of the many Dutch words for 'canal')"

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

  • 50% Opacity (unregistered)
    print _n('If only someone would invent L10n.',
             'If only %d people would invent L10n.', 1);
    
  • (cs) in reply to QJo
    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.

Leave a comment on “Pluralized!”

Log In or post as a guest

Replying to comment #:

« Return to Article