简体   繁体   中英

Pluralize Swedish Words?

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.

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).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM