473,395 Members | 1,668 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Get Plural Of Word

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

May 21 '07 #1
4 3011
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


"guate911" wrote:
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

May 21 '07 #2
On May 21, 11:27 am, Peter Bromberg [C# MVP]
<pbromb...@yahoo.yabbadabbadoo.comwrote:
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

"guate911" wrote:
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- Hide quoted text -

- 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/
May 21 '07 #3

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=...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, stringtests = 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";


On 21 May 2007 12:42:43 -0700, guate911 <gu**********@gmail.com>
wrote:
>
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/
May 22 '07 #4
Thanks Samuel!

I appreciate the comments.
May 23 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: denisb | last post by:
hello all, for a search engine, I'm looking for a regexp than can do the job it is just (!) a 's' problem (frequent in french) : I have a field 'thesaurus' in a table MySQL (3.23.56) ; I...
2
by: Trevor Best | last post by:
I posted this from work but I don't think it got through so apologies if this is duplicated. I'm trying to avoid the old chestnut where you go something like: Span = lngDays & " day(s)" so...
2
by: Steve - DND | last post by:
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...
2
by: Robert W. | last post by:
In my current work I noticed that I have several circumstances where I need to create little if/else constructs to handle the phrasing of a message. This typically involves a ternary situation like...
7
by: Bosconian | last post by:
This might seem like a trivial thing, but has anyone has come up with a better way of outputting a singular vs. plural string? For example: // default plural label $string = "appointments";...
0
by: Slypig | last post by:
Can anyone enlighten me on how to include plural searches with a fulltext mysql database search? For example, if someone searches 'restaurant' I want it to search the database for 'restaurant'...
31
by: Bill Norton | last post by:
Over at PCMag.com there is a debate going on over the usability of CSS. The discussion was initiated by an article by John Dvorak called "Why CSS Bugs Me"...
1
by: tryce430 | last post by:
Hi, I've actually been working on a homework assignment which asks me to turn words into their plural forms. The first task is to check if the words are more than 3 characters and end in "us". If...
2
by: daphne | last post by:
Hi everyone, I was recently at a meeting where a social event was being planned. One item on the program was "seating of guest". I said the word should be "guests" because there were quite a few...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.