views:

46

answers:

2

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

A: 

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

Wayne Werner
A: 

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

>>> import en
>>> en.noun.plural('table')
'tables'
Chris S
Thanks, but I'm looking for more generic. At least, with portuguese (brazil) as well.
duduklein