27
3
There are two forms of nouns, singular and plural. The conversion between these two is quite easy.
Normally, you end it with
s
. ex.car
=>cars
.If it ends with
s
,x
,z
,ch
orsh
, end it withes
. ex.bus
=>buses
.If it ends with
y
with a consonant just before it, change they
toies
. ex.penny
=>pennies
.If it ends with
f
orfe
, change it toves
. ex.knife
=>knives
.If it ends with
o
with a consonant just before it, change it tooes
. ex.potato
=>potatoes
.
Task
You will be given a singular noun. You have to convert the given noun to plural and output it.
Rules
You will not be given irregular nouns, like
mouse
andmoose
.You will not be given exceptions, such as
safe
(safes
; violating #4),piano
(pianos
; violating #5) ando
(oes
, violating #5).You will not be given words which have two or more possible plural forms, such as
mosquito
(mosquitos
ormosquitoes
) androof
(roofs
orrooves
).You will not be given uncountable nouns.
y
doesn't count as a vowel.
Examples
car => cars
bus => buses
potato => potatoes
knife => knives
penny => pennies
exception => exceptions
wolf => wolves
eye => eyes
decoy => decoys
radio => radios
Edited question for clarity. Feel free to rollback. – JungHwan Min – 2017-03-05T17:03:31.793
11Ahh, English - a huge pile of arbitrary rules and special cases :) – Esolanging Fruit – 2017-03-05T23:16:15.093
38@Challenger5 Yep, but you can understand it through tough thorough thoughts, though. ;) – JungHwan Min – 2017-03-05T23:20:56.930
@MatthewRoh I've edited the consonant in front rule to make it clearer. Also added a couple of test cases for the same. If I've misunderstood, please edit it to clarify. – ghosts_in_the_code – 2017-03-06T04:20:55.487
Do we need to handle
o
=>os
oroes
? – DLosc – 2017-03-06T07:37:31.707@DLosc It's stated in Rule 5. o=>oes. – Matthew Roh – 2017-03-06T07:38:40.740
2@Challenger5 If you compare English to Dutch there are barely any rules at all.. Dutch has rules and special cases, and special cases contradicting those special cases, and in some cases even special cases that contradict those special cases that those special cases contradict. ;) – Kevin Cruijssen – 2017-03-06T08:13:47.283
I guess excluding proper nouns? – Viktor Mellgren – 2017-03-07T11:20:40.180
@KevinCruijssen you guys should see French... – Quentin – 2017-03-07T12:32:39.417
@Quentin Yeah, French is a pain as well.. ;) I was glad I could drop the subject when I went to the fourth class in high school.. Always had around a 5 for French and German.. I kinda suck with languages (although I had an 8 for Dutch and English classes..) Ah, the memories.. XD – Kevin Cruijssen – 2017-03-07T12:39:02.593