Get Plural Of Word

G

guate911

Does anyone know of an open source applictation or API I can connect
to, that will allow me to find the plural of a word? For example, if I
type in "mouse", I need it to find the plural.. "mice".

Thanks
 
G

guate911

Take a look at the WordNet semantic database. Somebody has very generously
ported this to SQL Server 2005.
Pete

Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net






- Show quoted text -


Pete,

Thank you for the comment! I checked it out, but from the FAQ of
WordNet's website, it states that it can't find the plural of a word.

"
q.5.3 Can WordNet generate plural forms and other inflected forms?
No. The morphological component of the WordNet library is
unidirectional. Along with a set of irregular forms (e.g. children -
child), it uses a sequence of simple rules, stripping common English
endings until it finds a word form present in WordNet. Furthermore, it
assumes its input is a valid inflected form. So, it will take
"childes" to "child", even though "childes" is not a word. "...


However, I stumbled upon the below article, and it may work. Ryan
Schuft, a developer from google, wrote a javascript that will
pluralize a word on the client side. I was suprised to see that it was
done using regular expressions.

http://code.google.com/p/inflection-js/
 
S

Samuel R. Neff

Be careful with that code, I don't think it will provide coverage for
all English words. It's originally based on a Ruby function, I
believe this one:

http://www.google.com/codesearch?hl...=facets-1.1.0/lib/facet/string/singular.rb#a0

( http://tinyurl.com/2xs8o4 )

However when I converted the above Ruby code it to C# and ran it
through a test of random words, it failed a large percentage of the
time. It looks like the Google set has a few extra regular
expressions, but not enough to be considered comprehensive.

Unfortunately I don't have an alternative suggestion to offer, just
the above warning. If it helps, the test data I used is below (for
converting plural -> singular).

Best regards,

Sam


------------------------------------------------------------
We're hiring! B-Line Medical is seeking .NET
Developers for exciting positions in medical product
development in MD/DC. Work with a variety of technologies
in a relaxed team environment. See ads on Dice.com.



Dictionary<string, string> tests = new Dictionary<string,
string>(128);

tests["Americans"] = "American";
tests["analyses"] = "analysis";
tests["bays"] = "bay";
tests["bureaus"] = "bureau";
tests["businesses"] = "business";
tests["buses"] = "bus";
tests["cacti"] = "cactus";
tests["cactuses"] = "cactus";
tests["calves"] = "calf";
tests["carpets"] = "carpet";
tests["chiefs"] = "chief";
tests["choruses"] = "chorus";
tests["churches"] = "church";
tests["companies"] = "company";
tests["courses"] = "course";
tests["cows"] = "cow";
tests["crashes"] = "crash";
tests["criteria"] = "criterion";
tests["discos"] = "disco";
tests["doors"] = "door";
tests["factories"] = "factory";
tests["farms"] = "farm";
tests["farmers"] = "farmer";
tests["faxes"] = "fax";
tests["firemen"] = "fireman";
tests["fish"] = "fish";
tests["flowers"] = "flower";
tests["forks"] = "fork";
tests["foxes"] = "fox";
tests["friends"] = "friend";
tests["garages"] = "garage";
tests["gardens"] = "garden";
tests["geese"] = "goose";
tests["grown-ups"] = "grown-up";
tests["heroes"] = "hero";
tests["highways"] = "highway";
tests["horses"] = "horse";
tests["hovercraft"] = "hovercraft";
tests["indexes"] = "index";
tests["indices"] = "index";
tests["kisses"] = "kiss";
tests["lives"] = "life";
tests["lights"] = "light";
tests["loaves"] = "loaf";
tests["memos"] = "memo";
tests["mountains"] = "mountain";
tests["mice"] = "mouse";
tests["ovens"] = "oven";
tests["parties"] = "party";
tests["pens"] = "pen";
tests["pennies"] = "penny";
tests["potatoes"] = "potato";
tests["prizes"] = "prize";
tests["proofs"] = "proof";
tests["scarves"] = "scarf";
tests["series"] = "series";
tests["staples"] = "staple";
tests["statuses"] = "status";
tests["stores"] = "store";
tests["Swiss"] = "Swiss";
tests["tables"] = "table";
tests["take-offs"] = "take-off";
tests["teachers"] = "teacher";
tests["theses"] = "thesis";
tests["thieves"] = "thief";
tests["tomatoes"] = "tomato";
tests["torpedoes"] = "torpedo";
tests["videos"] = "video";
tests["watches"] = "watch";
 

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

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top