- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
class Void extends nullptr { static IntPtr target = null; }
Admin
error: expected initializer before 'nullptr'
Admin
I presume that last line is ironic. "Titmice"? It should obviously be "titsmouse." And "snaggleteeth" is definitely not an acceptable plural for "snaggletooth," which is more of an adjectival noun than anything.
What does this most excellent library do with "octopus?"
And is there a parallel library for apostrophization?
Admin
Apparently not "octopodes".
Admin
Wouldn't it be easier to use an API to Google translator, translate to Esperanto, add a j, and translate back to English?
Or save the trouble, and switch to Esperanto right away?
We humen have strange languages, anyway.
Test for "-ese": What would be the plural of e. g. "Scorsese"? Or the singular of "geese"?
Did they test for "-lf" -> "lves", "-ife" -> "-ives" anywhere? "gulves", "dwarves" (ok, this might be correct meanwhile, although JRRT himself asserts it isn't), "fife"
Admin
Is this ironic, or do you need help to get your mind out the gutter?
Admin
Maybe an earlier version gave the plural of "cow" as "kine", until someone pointed out that no one actually says that any more, outside of folk-rock lyrics?
Admin
As a meat lover, I'm thoroughly satisfied by the fact that most commonly eaten animals are mentioned: cow, sheep, goose, etc.
Admin
"completely WTF- and bug-free code that our that our world-class engineers create"
Keep dreaming. That's just impossible.
Admin
This code is also from this pluralization service:
#region Utils ///
Admin
A bit of both, really. I do maintain that the plural of "titmouse" is, in fact, "titmouses." Since it isn't a mouse, but a tit, one could feasibly use the plural of "tit" and add what this WTFery considers a "suffix," producing my puerile alternative. Which leads me to wonder what the supposed plural of "aide-de-camp" or "lieutenant-general" might be.
Frankly the whole thing is a cretinous idea, as Alex points out. The only sensible way of implementing this is on a lookup basis, rather than a crummy brittle algorithm. I'd use a patricia tree with the singular as the key and the plural as the node value -- and you can avoid bloat by stipulating that any key not found is pluralised with either a "s" or an "es", depending upon a couple of simple and unambiguous rules.
Admin
Microsoft seems to have the same problem as Apple: there are only children left for developing software.
How else can you explain that in the new Microsoft To Do drag-and-drop of images into the app is too hard and isn't possible any more. The app also has a really weird bug: overnight the window gets much broader and the left sidebar gets very narrow. How can you do such lovely stuff?
Admin
So what specific action should the caller define here? And why does he need to pass an action if he just wants to capitalize the word passed?
Admin
Not necessarily the programmer's fault this was attempted, leaving aside the crummy WTFs in there.
I have been asked (read:told) to do several similarly stupid things and, having pointed out the insanity, ended up having to hack at it anyway. Usually after someone else on the team had tried, realised they couldn't do it, and managed to off-load it to me to "troubleshoot and finish off". At least twice it was because the PHB had taken the project on personally to prove the idiot programmers were just being awkward .... I pity the people who inherited those things from me, I may or may not have coded them well, but the basic concept was not fit for a general solution so they will forever generate "bugs" to be investigated.
I think I'll reserve final judgement on this atrocity until I see what it does with the proper noun Lego, then it may be time for the big red button.
Admin
Everyone knows the plural of cow is kine, and the plural of crowd is crwth.
Admin
Everyone knows you just add a z to a word and boomz you have pluralz. My Commentz are alwayz correct.
Admin
I still insist that it should be "hexadecapus".
Admin
Alex, I hate to say it, but there's a well-known algorithm for English plurals that's about as accurate as a native speaker without special training (ie. its accuracy is comparable to me or Alex but loses to a professional editor or translator). Admittedly, it does rely on a whole glob of lookup tables and regex, but that's about what you'd expect.
There's still plenty of WTF in this code (and they're also reinventing the wheel, see above) and I have to agree that seeing this in the field is a nice piece of sangfroid :)
Admin
The swines!
Admin
How does it handle phrases like "Attorney General" or "mother in law"?
Admin
I used LINQPad a lot in a previous job, which also tried to auto-pluralize (and capitalize) table names with some apparently simple rules, often leading to some very amusing Gollum-ish nameses for the tableses.
As a side note - perhaps the tools that work with the DB ought to simply respect the existing names and not try to make any "helpful" transformations? Especially tools that are intended to help you write code against those tables... kind of annoying to copy your LINQPad code into your VS editor and then have to go through and change all the names back to what they should be.
Admin
I'm just glad to see that pneumonoultramicroscopicsilicovolcanoconiosis made the list.
Admin
When we switched to entity framework my team ran a Microsoft tool to generate a stub class for every table we had, so the tool had to figure out singular forms of our table names. We got a nice chuckle when our "FooChanges" table had a "FooChanx" class generated for it...
Admin
private List<string> _knownSingluarWords;
Admin
I know Rails does automated pluralisation and capitalisation, but it also has the good sense to have a place in the settings where you can put in your own plurals.
Admin
Wow. It doesn't even get the hard-coded examples right, the plural of "cloth" is not "clothes", it's "cloths". It also has no hope of handling homonyms correctly ("die" -> "dice/dies", "medium" -> "media/mediums", etc.).
Admin
and I am guessing "brothers" used to say "brethren" too.
Admin
I'm also suspecting non-native English coder here:
Not 'money' and, 'gasses'?
Admin
According to the company itself, the plural should be "Lego bricks", but quite frankly that's a long-lost cause.
Admin
Well you can say monies under certain circumstances but like with gasses, the rule on when to pluralise is a bit different.
Admin
Depends where you live. In the countries which invented the language and the construction toy you'll be chased to the hills for that crime. My finger is hovering, I need your coordinates ...
Although it does highlight that the pluralisation service needs to be region sensitive, best raise a work order for that.
Admin
This was signaled by Cabbage on the forums: https://what.thedailywtf.com/topic/25428/microsoft-s-cl-ic-mistake?_=1580227766908
Admin
s/louse$/lice/;s/mouse$/mice/;s/tooth$/teeth/;s/goose$/geese/;s/foot$/feet/
Yeah, tell me again how regexes (regexen? ;) are so cumbersome. Used right, they're compact, readable and probably much faster than that code. (Sure, I could also say s/([lm])ouse$/\1ice/ to keep close to that code, but why bother?)
I don't know what else this great library does that isn't shown here, but I guess it would make for a really nice and simple (though not necessarily short) sed script.
Admin
Some of the keys in the _irregularPluralsDictionary actually do have acceptable irregular plurals. For example: cow -> cattle, brother -> brethern.
Some of the others that end in 's' have irregular but seldom used (at least, not anymore) plurals that have been replaced by more standard pluralization in modern usage. For example: bus -> busses, gas -> gasses.
Similarly for some words ending in vowels, which usually take 's' but can take 'es' in the plural. For example, casino -> casinoes. Casinos, if I recall, can also be casini, but that might just be borrowing from Italian and never was a common English plural. Anyway, the rule "'es' after a vowel, except silent 'e'"* was beaten into my head in the 4th grade by a teacher who in turn was born around the turn of that century, and was likely educated using texts from the middle of the century before that one (entirely likely, given how parsimonious the school board in that state was about acquiring new textbooks - more than once I was assigned one with a first 'Assigned to student' entry from 20 years or more before I was born). Decades later, I'm still trying to shake that rule and similar ones.
Admin
The first thing I do when using Entity Framework is disable this stupid misfeature, because I speak Spanish, and I work at a local company in a country that speaks Spanish, so all the table names are in Spanish, so I don't want any English pluralization dammit! Thanks god EF Core ditched this feature.
Admin
So ... you're proposing to take an impracticable design decision, badly implemented by a cretin in a portable, compiled, language, and turn it into an impracticable design decision, badly implemented by yourself in a non-portable, non-compiled language that uses an archaic form of regexps (backslash num for substition)?
As improvements go, this doesn't. At a minimum I'd want it in Python or Perl (portable, can be compiled, have modern standard regexp syntax), and even then it would suffer from every last one of the issues that Alex brought up, with the additional fun feature that it doesn't even work as a .NET library. Remember the .NET library thing? It was kinda a requirement.
Admin
There's already a Perl library that does this: https://metacpan.org/pod/Lingua::EN::Inflexion
Admin
For those curious about this subject, I highly recommend "The Language Instinct" by Steven Pinker. There's some good info on how we add things like plurals to words.
Also, this brings to mind my first contract programming job. Back when Windows 2 was a thing. A small company was scanning docs and making CD-ROMs. Very new at the time. Modern spell-checkers were still some years off and scan-to-text was really still in its infancy. The glitches, however, were predictable. They had a program which would read scanned documents and swap common errors. For example "Califomia" -> "California" or "car5"->"cars". How simple is that, right? However, their programmer wrote it in 8086 assembler (???!!! WTF?, right?) and embedded all the word pairs inside. I was young and naive enough to not have realized that there were catastrophically bad professional programmers out there. I asked why. I was told he did it for performance. I said no way in heck I was going to tweak assembler. I'll re-write it in C. Might not run as fast, but it will get the job done. Normally, the asm version took about 30 minutes a Mb. I ran mine against a Mb file and it was done in less than a minute. I actually shocked myself. My clients asked me how this was possible. Since I actively refused to look at the code, I was never really sure. But it was my first intro to "WTF?"
Admin
My company adopted some MVC framework based on "configuration by convention". During basic training we were instructed to handle irregular pluralisation by creating a custom rule in the builtin inflector, which surely lead to very productive development hours since the codebase was not even in English. I eventually realised that singular-to-plural transformations were only used in one place: the code to find a database table given a model name. And you could just set the table name in model properties.
Admin
Wouldn't it be "nonapus"?
Admin
The plural of Attorney General is Attorneys General. The, uhh, past tense of Attorney General is Attorneyed General?
Admin
The old Nethack game has its own make-plural function. It's primarily aimed at objects found in the game, but is also (somewhat) generalized in order to deal with words provided by the player (e.g. your favorite fruit).
https://nethackwiki.com/wiki/Source:NetHack_3.6.1/src/objnam.c#makeplural
Admin
Discussion of propers pluralsensera: https://www.youtube.com/watch?v=QWzYaZDK6Is
Admin
Plurals In English are hard!
In general, we look at the original language and follow the same rule in English (medium => media, panino => panini). In this list, remember the oddity which is octopus (octo is Latin for 8 and pus is Greek for foot). Octopoda would be correct when describe different types of octopus
Fish can be singular or plural, but fishes indicates multiple species of fish. Person can be pluralized as persons or people. If "people" is singular, its plural is "peoples". The plural of mouse when referring to the computer apparatus is "mouses", but "mice" is correct for animals.
After looking at the usual irregular plurals, codifying -s or -es can be hard because its based on the word's terminal sound instead of simply looking at the last few letters.
Admin
Why and who says so? I'd always say mice and I never heard "mouses" anywhere in my travels.
Try plurals in Dutch, it's an irregular mishmash of the English approach, randomly mixed between British and American, together with a lot of French and German pluralisation logic. Well, there is no logic, it is case by case.
Admin
I once wrote a depluralizer, which has even more weirdness than a pluralizer. Mind you, this was a Greasemonkey script for an online game, so the stakes were rather lower, and I did a lot of hard-coding for the irregular plurals (loaves -> loaf, knives -> knife, etc.). But that was okay, because the game wasn't huge.
I stuffed the results into a DB (I was tracking monster drops), so a bad script would lead to bad data, but the DB was small enough that I could still manually fix the DB when I hit another depluralization error.
Admin
I strongly suspect that the coder learned English at the university because of their textbook approach to it, not to mention not knowing a bunch of the plurals.
However, I don't think the basic approach is bad--it appears to be apply rules to the common cases and a lookup table to the rest. That's a lot smaller than a lookup table for every English word.
Admin
I would go with a nightmare storm of really tight acceptance criteria, with the tortured cynical sunlight of a soul piercing through: !!!jakenapes!!!
"We view ourselves as the Olympic athletes of computer programming."
... ... ...
Tonya Harding was an Olympic athlete. And Mike Tyson. Ryan Lochte. Barkley.
And that's not even touching upon House Kardashian.
Admin
Wouldn't the modern approach be to train a neural network?
Admin
Since when has "clothes" been the plural of "cloth"? That's not an irregular plural, it's a different word!