[英]Pluralize Swedish Words?
Is there a way to use PluralizationService
to pluralize swedish words? 有没有办法使用
PluralizationService
来复数瑞典语单词?
I tried to use PluralizationService but i got exception that it only supports english. 我尝试使用PluralizationService,但我得到例外,它只支持英语。
You need to create your own version of the PluralizationService
that supports Swedish. 您需要创建自己的支持Swedish的
PluralizationService
版本。 Create a derived class that inherits from PluralizationService
and override the methods there to provide the functionality. 创建一个继承自
PluralizationService
的派生类,并覆盖其中的方法以提供功能。 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. 完成此操作后,在
EntityModelSchemaGenerator.PluralizationService
属性上设置新服务。
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:
例如:
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). 因此,语言规则需要付出一些努力才能做到正确,并且到处都有大量的特殊情况,比如Fot - >Fötter(巧合的是,英语中的特殊情况 - 脚 - >英尺)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.