473,804 Members | 3,043 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3032
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...@yaho o.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<stri ng, stringtests = new Dictionary<stri ng,
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**********@g mail.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
2443
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 have a field 'search' in a form where user can input a word ; what I want is :
2
2206
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 that an s gets appended only if it's more than 1, I came up with this: Span = lngDays & " day" & String(Abs(Sgn(lngDays - 1)), "s")
2
6834
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 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...
2
2301
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 this example illustrates: 0 files were downloaded (or No files were downloaded) 1 file was downloaded 2 files were downloaded They're all very similar but each is subtlely different. I soon realized that I could write a few related methods...
7
13184
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"; // singular label if (mysql_num_rows($results) == 1) $string = "appointment"; print mysql_num_rows($results) . $string;
0
2065
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' and 'restaurants' Regards,
31
2549
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" (http://www.pcmag.com/article2/0,1759,1987181,00.asp). The discussion starts here: http://discuss.pcmag.com/forums/1/1004331343/ShowPost.aspx#1004331343. Someone suggested that some of you folks might have a thing or two to say about the topic, so I'm inviting everyone to drop by and...
1
6269
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 it does I just take out the us and add an "i" at the end. Otherwise I just throw an "s" to the end of the word. I think I got most of the program down, but for some reason it gives me an error with &&. Could someone take a look at my code and tell...
2
1342
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 people to be seated. I was shot down and told that the word "guest" could mean more than one person and that's the way it is on all programs. Everyone at the meeting agreed with this and I felt like a dummy. Were they correct? Thanks
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9579
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10571
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10326
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10075
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9143
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6851
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4295
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3815
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.