使用 Open Office API for Python (UNO) 的复数单词

发布于 2024-09-12 15:14:03 字数 421 浏览 1 评论 0原文

我想在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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

jJeQQOZ5 2024-09-19 15:14:03

您可以使用 dir(uno) 内省模块,然后在 uno.XXX 上尝试 dir(),无论看起来是否有帮助。您还可以对 uno 及其成员使用 help()。我从未使用过它,也无法在这台计算机上访问 OO,所以我无法提供更多帮助......

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

长梦不多时 2024-09-19 15:14:03

Nodebox Linguistics 包含一个方便的名词复数功能,尽管仅限英语。

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

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

>>> import en
>>> en.noun.plural('table')
'tables'
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文