Make a Plural Word Singular(and vice versa)?

S

Steve - DND

Just wondering if anyone out there has any code to convert a plural word to
it's singular form and vice versa. Most of our database tables are named in
a plural fashion. When we go to create templates to select a single record,
we end up with a class name that sounds as if it's a collection instead of
just one data object. Just wondering if anyone has a nice workaround. I
started working on something, but it quickly turned into a large amount of
code, and I still don't have all of the bases covered.

Thanks,
Steve
 
M

Michael A. Covington

Steve - DND said:
Just wondering if anyone out there has any code to convert a plural word to
its singular form and vice versa.

Not simple, but the beginnings of an algorithm are in the morphology chapter
of my book, "Natural Language Processing for Prolog Programmers," and/or the
tools on www.ai.uga.edu/mc/pronto.

You have several things going on:

(1) Many words can be singularized by just taking off the -s.

dogs -> dog

(2) Others require taking off -es. These are generally words where the -es
is preceded by s, z, x, sh, ch. If it's an s or z, it may be doubled.

foxes -> fox

buses or busses -> bus

quizzes -> quiz

(3) Others require -ies -> -y.

babies -> baby

(4) Others follow other rules or are irregular.

radii -> radius
phenomena -> phenomenon
bacteria -> bacterium
seraphim -> seraph
chateaux -> chateau

(5) Some of them match a pattern but must be blocked from doing it:

rabies is not the plural of raby


I can't give you the exact spelling rules of English plurals off the top of
my head; I've hit the high points. There are reference books (e.g., on
spelling or grammar) that can give you the details. You may find that part
of the system is enough for your purposes.

Welcome to the wild world of computational linguistics!
 
M

Mohamed Enein

One alternative is to find a Morphology Analysis component (Xerox has one i
think). using it you can check if the word is plural and get the singular
form. don't know how much it cost but you may find free limited versions...

Thanks,
Mohamed
--------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top