Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pluralize Swedish Words?

Tags:

c#

Is there a way to use PluralizationService to pluralize swedish words?

I tried to use PluralizationService but i got exception that it only supports english.

like image 802
Elvin Avatar asked Oct 23 '12 13:10

Elvin


1 Answers

You need to create your own version of the PluralizationService that supports Swedish. Create a derived class that inherits from PluralizationService and override the methods there to provide the functionality. There does not seem to be a built-in service that supports Swedish. Once this is done, set the new service on the EntityModelSchemaGenerator.PluralizationService property.

This blog post explains the process pretty well.

As you may or may not know, it's a bit tricky to pluralize words in Swedish since there is a gender system on nouns which is basically irregular. For instance:

  • Monkey -> Monkeys is Apa -> Apor
  • Banana -> Bananas is Banan -> Bananer
  • Deer -> Deers is Hjort -> Hjortar

So, the linguistic rules are a bit of effort to make right, and there's a plethora of special cases everywhere like Fot -> Fötter (coincidentally, also a special case in English with foot -> feet).

like image 132
Dervall Avatar answered Sep 28 '22 20:09

Dervall