• Unregistered (unregistered)

    Frists!

  • Quite (unregistered)

    Anothers goods ones froms Elli Mornings.

    Reminds me of one of my favourite brain teasers: what common English plural noun becomes a common English singular noun by the addition of an s?

  • just me (unregistered)

    And today the "View all 1 comments" link at the bottom of the article has never been more appropriate...

    But now I've spoiled it.

  • GordonFreemanK (unregistered)

    The weakne of thi algorithm i tremendou!

  • GordonFreemanK (unregistered)

    Also as a French native speaker I can't imagine how beautiful the thousand lines of code a clueless dev would output with that same thing in mind, but with a French-named DB instead (tbf using any other language than English for developing might be considered a wtf in the first place but that's for another debate).

  • Some guy (unregistered) in reply to Quite

    what common English plural noun becomes a common English singular noun by the addition of an s?

    princes

  • gleemonk (unregistered)

    Why yes natural language is hard. With this hack the search provide better results than what they would have been without it. Sure you might get hilarious results, but you get those only after the search has failed for the original query. It doesn't need to work for all languages to be useful.

  • singular plural example (unregistered) in reply to Some guy

    people, peoples

  • AnonCow (unregistered)

    I'ms imaginings thes searchs resultss fors 1984s

  • Kuli (unregistered)

    I doubt that you'll get lots of hilarious results as long as there's no hjilarious content in the database.

    It might look strange when the database is queried against "untils" or "hilariou" but since there was already no match for "until" or "hilarious", there will be none for the latter as well. Or maybe it will find a typo by conincidence, but then it's just fine.

    This rather looks like some manager wanted to find singular and plural nouns with a quick check but the project was already over time, so the only thing the developers could do was inventing this dirty hack.

  • gleemonk (unregistered)

    You realize these are fall-backs? The other option would have been not to show any results. Sure if most of the queries are not in English then using those fall-backs will likely confuse more than help. Since we don't know the frequency of languages this was used with, we can't say whether it's a WTF at all. And for other scripts like Chinese these won't do a thing so they are harmless.

  • (nodebb) in reply to Kuli

    "This rather looks like some manager wanted to find singular and plural nouns with a quick check but the project was already over time, so the only thing the developers could do was inventing this dirty hack."

    That's almost certainly what happened. And since the "full" implementation would require a "database" of anomalies(1), doing it right in a hurry is a non-starter. Of course, doing it wrong is easy...

    (1) Words that add -es instead of -s. Words that add -x (bureau(x) and similar). Words that change -y into -ies. Words that add -s to -y without changing the -y. Words that add some other suffix, like child(ren). Words that undergo internal change but don't add anything, like man/men and woman/women. Words that just plain don't change, like "sheep". Words that don't have plurals. Words that are only plural, even if they don't look it (frequently adjectives used as pronouns, e.g. "the blind", "the aged", and so on). Oh, and words that have two different plurals, like penny in British English - pennies if you mean the coin, pence if you mean an amount of money.

  • Roelof (unregistered)

    Actually, things are a bit worse when realize that grammer of one human language are added to both frameworks and programming languages.

    Example 1: SQL The execution order of the query is different than the writing order. SELECT is actually one of the last statements that are executed. And when you write queries long enough, it even starts to feel natural to write queries in execution order instead of English language order.

    Example 2: A lot of ORM's You create an 'object' and suddenly the name of the table is 'objects'. But how the plural form gets created or if it exist at all, is rather language specific.

    • In Indonesia the plural form is the name twice, like 'object' and 'objectobject'.
    • In Dutch, gender specific words can have a different plural forms, depending on the situation.
    • Or in Polish you even have to distinguish between "1", "2 to 4" and "5+". Add their grammer and you get something like: "object", "objact" and "objt".
    • And of course you have the English sheep.

    You could of course use a dictionary to determine the single and plural form of each word, assuming that the language has a plural form that work similar to English plurals.

    Bonus example 3: Functions that capitalize first letter of each word in names How many tutorials have I not seen that claims that their method of capitalizing the first letter of each word is a good method properly spell names. This is a function that creators claim is useful, but one that I have never been able to use. Frankly because this does not work in German, and in Dutch it even gets worse. Example:

    First name: Pieter Middle name: Laurentius Last name: van der Meer

    The last name is tricky as it contains of two parts the prefix "van der" and main part "Meer". And alphabetically, the last name starts with "M". First and last name combined: Mister Pieter van der Meer Only last name: Mister Van Der Meer

  • MiserableOldGit (unregistered)

    I'm not sure even a list of rules would really cut it, especially if we are supposed to support multiple languages (After all, bureaux is French, children is following Saxon conventions, and what the hell do you do with "paninis"? with or without Grocer's apostrophe?). And if it's straight user input, or off a website, you're probably screwed anyway.
    You'd need some sort of dictionary API, with some sort of context awareness to tell apart heteronyms that pluralise differently ... bass (drum), (sea) bass, bass (the sound) ... and equally some way to deal with cross-language heteronyms (if that's the right way to say it).
    It's a mess of complexities you'd never get a 100%, without more explanation this solution may well be messy, but good enough for whatever the purpose was at the time.

  • Quite (unregistered) in reply to MiserableOldGit

    Paninis: without GG apostrophe of course, otherwise is always wrong.

  • Hobbitses (unregistered)

    Anyone else read the title in Toki Wartooth's voice?

  • TokiWartooth (unregistered)

    I sees nothings wrong with its. My bandsmate Skwisgaar agrees with me's!

  • SignalStealer (unregistered)

    Holy sheet, that abomination of a (programming) language.

  • ricecake (unregistered) in reply to TokiWartooth

    Stops copys me.

  • MiserableOldGit (unregistered) in reply to Quite

    Point was, panini is already plural, but sticking the "s" on has become common usage, as has Panini's for that matter, so I'm not sure how universally accepted any rule or dictionary would be with this stuff. In fact, the use of an apostrophe when pluralising is standard usage in the very English-like Dutch language, as there are many shared words you could have a lot of fun automating that distinction.

  • Appalled (unregistered)

    TRWTF here is WHO TF would ever agree to code it that way rather than using a LIKE and letting the users wade thru the occasionally extra results. Boss: "But they might try with a plural and not get a hit" You: "So teach them to try without the plural. In fact teach them to try with only 5-12 or so characters. They'll still get hits but won't have to key so much or chance fumble-fingering 1 of the 37 characters in the full title"

  • Ulli (unregistered)

    I don't go to Mc Donald's, neither to Mc Donald'

  • Eleanor (unregistered)

    mouses gooses octopuses vertexs

  • Herby (unregistered)

    All of this plural stuff makes dates look like a piece of cake. Yes, I know it isn't, but language is difficult, and there are so many of them, and then there is English.

  • (nodebb) in reply to Roelof

    Only last name: Mister Van Der Meer

    Nope, sorry: the correct spelling in this case is “Van der Meer” — only the first preposition is capitalised if there are no first names or initials.

  • PT (unregistered) in reply to Quite

    what common English plural noun becomes a common English singular verb by the addition of an s?

    assess

  • Guest (unregistered) in reply to Some guy

    asses -> assess bras -> brass

  • Vic (unregistered)

    Assuming the language is English, in most cases that the fallback finds a result, it will be a valid one. If the titles are proper English, most of the "hilarious" searches won't find anything. Personally, I think a bigger issue is that a user might become accustomed to successfully getting the alternative result whether they searched for a singular or plural, and then not think about looking for other forms when the title ends in an a word with an irregular plural, or which follows one of the many regular plurals rules other than "add an s".

    Only slightly off-topic, back in the 70's, a friend had some success selling a program which would search a collection of books. It created an inverted full-text index by taking the first few letters of each word along with a hash. Due to the memory limitations of the day, the hash was short - I think it was 16 bits. This resulted in a large number of false positives. However, the product was marketed as having a level of "artificial intelligence". In fact, after getting the "matches", it would then repeat the search for the words found within some range of the match; this would be repeated a few times. The program then returned the paragraphs in which these "matches" were found.

    As you can imagine, most of the results didn't have the word or phrase that was being searched for. But if your target audience was people searching for deep philosophical meaning in particular texts, and who believed in the power of the computer, they'd look at the results, and after a while go "Aha!" and wonder at the remarkable insight they'd received.

  • "Red Eye" Baldarek (unregistered)

    Please, noble Jedis! Not in the faces!

  • (nodebb)

    There's similar code in my codebase that even tries to be "smart" by looking at the last few letters of the word to be pluralised. But a typo with a logic error resulted in Gollum appearing: 1 resultses. 2 results. That bug existed for months before someone's OCD eventually got the better of them and got it fixed.

    To be fair, things like adding "s" to most words or "es" to already ending in "s" (etc) was just the default behaviour; one could pass in the plural form. It still wouldn't handle non-English cases like 1, 2 many or gendered nouns but it could be made to create a grammatically correct sentence involving more words: "1 item is ready/2 items are ready"

  • Gene Wirchenko (unregistered) in reply to Quite

    There are several plural nouns that when you add an S, you get a singular noun. This puzzle was posted on rec.puzzles not too long ago.

  • (nodebb) in reply to Guest

    "Brass" isn't a verb.

  • (nodebb) in reply to Scarlet_Manuka

    From Wiktionary: "To coat with brass."

  • Friendly_Reminder (unregistered)

    "Look at all those motherfucking meese!"

  • Carl Witthoft (google) in reply to Quite

    Hah. What obsolete (hint - Shakespearean) word becomes plural when adding an "l" ?

  • GWO (unregistered) in reply to Gene Wirchenko

    Just looked the rec.puzzles thread - some nice examples I'd not seen before - particularly like "deadlines" and "worldlines"

  • Chakat Firepaw (unregistered)

    "Oh, and words that have two different plurals, like penny in British English - pennies if you mean the coin, pence if you mean an amount of money."

    This happens both ways, if you want to make "cattle" singular you need to know things like what the age and sex of the animal are as there is no generic singular.

  • jgh (unregistered)

    In a former life I used a database that tried to capitalise Mc/Mac surnames. Welcome to Mr MacE.

  • Gene Wirchenko (unregistered) in reply to jgh

    Welcome also to Mr. Mackie who is not Mr. MacKie. (Look at the K's.)

  • Friendly_Reminder (unregistered) in reply to jgh

    "Goodbye Mr. MacKenzie" is an even shittier bandname than "Goodbye Mr. Mackenzie" already is, lol. Ah well, good thing the keyboardist got hired by a band called "Garbage".

  • markm (unregistered)

    I grew up in farm country, so I know the dictionary writers get it wrong with regards to cattle. Among those who raise cattle, the singular of "cattle" is "cow" unless you know the age and sex of the critter, and it is not an adult female - and the plural of "cow" is often "cows". If a mixed herd needs to be moved, they will tell you to drive the cows , not the cattle.

  • remmargorP LQS (unregistered) in reply to Roelof

    You are totally right about SQL being bass-ackwards. These days I almost always write my FROMs, JOINs, and inner queries first. Hell, most of the time, I don't have a clear picture of what fields I want to SELECT until I am halfway done.

Leave a comment on “Plurals Dones Rights”

Log In or post as a guest

Replying to comment #480402:

« Return to Article