Hello Friends,
I just want to know how to find plural of a word in C#
I have one textbox where user will enter his word i.e Text.
Then how to find the plural of that word.
Hello Friends,
I just want to know how to find plural of a word in C#
I have one textbox where user will enter his word i.e Text.
Then how to find the plural of that word.
Plural of word
tech2hardikjoshi
<singular>,<plural>,<remark>
datum, data, plural available
radius, radii, plural available
politics, politics, no plural
If word is not part of the list you apply the 's' or 'es' rule.
Load the file using the first column as index during startup or first use of the feature. This way you don't have to modify your code each time you add a new entry.
Redfox72
<singular>,<plural>,<remark>
datum, data, plural available
radius, radii, plural available
politics, politics, no plural
fish, fish;fishes, context dependent
=Steve D=
Native English speakers have no problem pluralizing words. Just because the rules are complex doesn’t mean the rules don’t exist to cover every situation.
What is difficult is translating those rules into algorithms, as your reference indicates.
bb32223
You could probably come up with an algorithm to handle the basic pluralization rules and handle the exceptions with a dictionary (like foot/feet); but, the context-sensitive pluralization would require a really complex grammar parser.
As I say, not as simple as just a few rules.
Jignesh Desai
You need to find the rules of pluralization for the language of interest and write them into your code.
For example, in English, you need to at least implement the rules to make these words plural:
Punt
Radius
Thief
Mass (the word without the 'M' becomes three assterisks in this forum)
Chevy
Datum
This looks like a homework problem, naked running notwithstanding, eh
phenshaw
You would have to have a dictionary of words you supported and a pural version of the word.
There are no rules in the English Language for puralizing that works for all words.
yi peng
>> you need to at least implement the rules to make these words plural: <<
Depends.... Does the solution need to be all- (or even mostly-) encompassing or just good-enough to cover one particular domain I recently had the reverse problem --given a plural (table name), come up with the singular (record name),-- but since I knew that there would only be about 300 words this would need to be applied to, a few simple rules were enough. The tricky words in the group: Categories, Media, and Bases (for Basis).
As for your sample group, it's remarkably heavy on edge-cases (two Latin words and a proper noun/nickname). (And I'm betting you'd say that "Radiuses" is wrong for the plural of "Radius", although, dictionaries would disagree)
gcannata
Ronan Jordan
Suhayb
Of course(!) there are rules that work for all words, else the language would fall apart.
Hacman
Still, there’s the problem of context. “He fishes.” vs “They fish.”
Not easy.
Jarvism
It would depend on context; which is not a simple rule.
If I caught two salmon, I would have two fish. If I caught a salmon and a tuna, I would have two fishes.
Some other exceptional cases:
Foot: feet
Box: Boxes
Have a look at some of the papers on the subject:
http://www.csse.monash.edu.au/~damian/papers/HTML/Plurals.html
snowbound