使用 Open Office API for Python (UNO) 的复数单词
我想在Python中检索不同语言的复数单词。
我知道 openoffice 有一个名为 uno (import uno
) 的 API,它应该为我提供使用 openoffice 的语言词典的这种能力,但我找不到任何对它的引用。
作为一个具体的例子,我想要这样的东西:
>>> print getPluralOf('table')
tables
一种可能性是通过这个 链接下载字典文件 并编写一个读取字典并形成复数的方法。但我不敢相信这已经不能使用 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用
dir(uno)
内省模块,然后在uno.XXX
上尝试dir()
,无论看起来是否有帮助。您还可以对 uno 及其成员使用help()
。我从未使用过它,也无法在这台计算机上访问 OO,所以我无法提供更多帮助......You can introspect the module with
dir(uno)
and then trydir()
onuno.XXX
, with whatever looks helpful. You can also usehelp()
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 包含一个方便的名词复数功能,尽管仅限英语。
Nodebox Linguistics includes a convenient function for pluralizing nouns, albeit only in English.