如何将主数转换为有序数 [英] How to convert Cardinal numbers into Ordinal ones
问题描述
有一个简单的方法来将数字1,2,3,...转换为第一,第二,第三,...,这样的方式,我可以给函数a语言,并返回我正确的形式为我的目标语言?标准C ++(stl或boost OK),MFC或ATL,win32 api或一个小型,单用途和免费的库,我可以从某处下载。感谢。
Is there an easy way to convert the number 1, 2, 3, ... to "1st", "2nd", "3rd", ..., and in such a way that I can give the function a language and have it return me the correct form for the language I'm targeting? Either standard C++ (stl or boost OK), MFC or ATL, win32 api or a small, single-purpose and free library that I can download from somewhere. Thanks.
推荐答案
我怀疑是否可能,因为在许多语言中,这种形式将取决于上下文,或者其描述的名词的情况,并且不同的语言将需要不同种类的上下文信息以允许确定正确的形式。
I doubt whether it is possible at all, since in many languages this form will depend on the context, like gender or case of the noun it describes and different languages will require different kind of context information to allow to determine the correct form.
编辑:例如在波兰语中是5-ta klasa(第5类)与5-tymiesiąc(第5个月)对w 5-tymmiesiącu(第5个月)。
E.g. in polish it is "5-ta klasa" (5th class) vs. "5-ty miesiąc" (5th month) vs. "w 5-tym miesiącu" (in the 5th month).
这篇关于如何将主数转换为有序数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!