RSS Feed

a playground of art, photos, videos, writing, music, life

 


You are here







Random Quote

Don't wait for inspiration. Work inspires inspiration. If you succeed, keep working. If you fail, keep working. If you're interested, keep working. If you're bored, keep working. It works.
-- Michael Crichton


 

Blog - Blog Archive by Month - Blog Archive by Tag - Search Blog and Comments

<-- Go to Previous Page

Alright You Wordsmiths...

 

I wrote my de-pluralization routine today, and I've decided to put it online here. See if you can beat it. Give the engine a plural word and see if it can come back with the right singular form. If it can't, let me know in the comments - and then gloat a lot.

Here's the engine.

 


Tags: programming
by Brett Rogers, 4/15/2005 2:28:59 AM
Permalink


Comments

Okay, this is so unfair because the internet lets me cheat by searching for obscure grammar points:

kudoi is plural, kudos is singular.

http://dictionary.reference.com/search?q=kudos

http://www.livejournal.com/community/grammar_whores/3291670.html?thread=18566934#t18566934

 

 

Posted by Kris (Random), 4/15/2005 10:30:11 AM


That's very good - I also realize that I completely spaced *us words, so "spacious" becomes "spaciou."

D'oh!

I'll have to address that tonight. Thanks for heads up on the error and the link!

 

 

Posted by Brett Rogers (http://www.beatcanvas.com), 4/15/2005 10:41:33 AM


Yeah, the i plural endings might be an issue.
"Cacti","Platypi", "Censi" (the plural of census, in my opinion---although I found many differing opinions when I asked Jeeves. :->) "Virii" (again one with differing opinions. Also "data" as the plural for "datum"---those that don't change much from the latin to the english are a bear. ("ursa, ursae" in the latin, if I remember right. Hmmm...where is my Latin teacher now that I need him?)

 

 

Posted by Bella, 4/15/2005 4:56:36 PM


Hey Bella :)

Oy! You're right about that. There are a whole mess of those, and who knows how many? Excellent - thanks for the tip.

You had a Latin teacher? Onay itshay...

 

 

Posted by Brett Rogers (http://www.beatcanvas.com), 4/15/2005 5:05:05 PM


In high school AND college, bay-bee! Which makes me a geek without any computer training. :-)

 

 

Posted by Bella, 4/15/2005 7:54:24 PM


"children" should de-pluralize to "child"

The other tough one will be two word plurals where the first word is pluralized. For example, "attorneys general" is the plural form of "attorney general".

Thanks this was a fun little thing to play around with. I love trying to break things.

 

 

Posted by Mikey, 4/15/2005 11:32:48 PM


Also, watch out for false positives. "baby's" was turned into "baby'" Or "its" (showing ownership) gets turned into "it" - of course this last one is context dependent.

 

 

Posted by Mikey, 4/15/2005 11:36:25 PM


Wow this is cool! I got the children error and then saw Mike already caught it. Can you make it go the oppisite direction? Like if I wanted to know what the plural for child was?

 

 

Posted by Anonymous, 4/16/2005 11:53:57 AM


Thanks to everyone for testing it out and breaking it. Y'all are good breaking things!

The purpose of this was to create a smoother search engine, which I'm creating at work for our Intranet. So its purpose is not to render the singular correctly every time, but to be sure that users who search for "loans" or "loan" (for example) get the same results.

This requires analysis for every word in a document to be indexed for the search engine. In prepping the word for the index, I strip apostrophes, such as 's, 'll, 've, 'd, and 're. So for our purpose, false positives are okay. I run the same method on what the user types in, so as long as the translation of the user's input matches the intent of the search and what we have in our index, life is good.

Thanks to your suggestions and a little more research from me, here are my notable plural exceptions:

octopi = octopus
stigmata = stigma
radii = radius
alumni = alumnus
crises = crisis
indices = index
platypi = platypus
matrices = matrix
vertices = vertex
feet = foot
brethren = brother
phenomena = phenomenon
dice = die
diagnoses = diagnosis
kudoi = kudos
men = man
women = woman
children = child
teeth = tooth
mice = mouse
lice = louse
geese = goose
axe = ax
oxen = ox
people = person
cattle = cow
lives = life
wives = wife
strives = strife
knives = knife
thieves = thief
wolves = wolf
elves = elf
shelves = shelf
bookshelves = bookshelf
selves = self
halves = half
calves = calf
halves = half
wharves = wharf
dwarves = dwarf
hooves = hoof
scarves = scarf
loaves = loaf
sheaves = sheaf

Again, thanks for all your help with this! :)

 

 

Posted by Brett Rogers (http://www.beatcanvas.com), 4/16/2005 1:53:24 PM



Add Your Comment:
Name (required):
Web Site:
Remember Me:   
Content: (4000 chars remaining)
To prevent spammers from commenting, please give a one-word answer to the following trivia question:

If you're very sick, what medical professional would you go to see about it?