开发者

Plural of words using Open Office API for Python (UNO)

I would like to retrieve the plural words in different languages in Python.

I know that openoffice has an API called uno (import uno) and it should give me this ability using openoffice's language dictionaries, but I could not find any reference to it.

As a concrete example, I would something like this:

>>> print getPluralOf('table')

tables

One possibility is to download the dictionary files though this 开发者_开发知识库link and write a method to read the dictionary and form the plurals. But i can't believe that this is not available already using uno.

I appreciate any help


You can introspect the module with dir(uno) and then try dir() on uno.XXX, with whatever looks helpful. You can also use help() on uno and its members. I've never used it and I don't have access to OO on this computer so I can't help more than that...


Nodebox Linguistics includes a convenient function for pluralizing nouns, albeit only in English.

>>> import en
>>> en.noun.plural('table')
'tables'
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜