使用 Java 的 Ms Word 插件

发布于 2024-09-19 02:58:33 字数 179 浏览 2 评论 0原文

我正在为某种语言开发高级拼写检查器。 MS Word 针对该语言的默认拼写检查器并不令人满意。所以我决定将我的拼写检查器与 MS Word 集成。不幸的是,我正在研究 Java,据我所知,Ms.Net 可以实现这一点。是否可以使用 Java 做同样的事情,或者可以使用我的 Java 拼写检查器作为 MS.Net 中的库。

谢谢

I'm developing an advanced spellchecker for some language. MS Word's default spellchecker for that language is not satisfactory. So I decided to integrate my spellchecker with MS Word. Unfortunately I'm working on Java and as far as I see this is possible with Ms.Net. Is it possible to do same thing with Java or can use a my Java spellchecker as a library in MS.Net.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

老子叫无熙 2024-09-26 02:58:34

据我所知,没有记录的方法可以用您自己的拼写检查器替换 Word 的内置拼写检查器。

您可以使用自己的代码来模拟 Word 的拼写检查器,但这并不容易。当您在文档中导航时,Word 不会引发任何事件,因此您必须设置一个计时器,然后如果您想要未请求的拼写选项,则不断检查当前光标位置(否则,您必须挂钩 Windows 鼠标)事件来监视右键单击,然后检查您所在的单词并从那里开始。

没有任何简单的方法可以突出显示拼写错误的单词(就像现在 Word 中的红色波浪线一样)。

也 对 Java 了解不多。假设您可以用 java 编写一个公开 COM 接口的 DLL,但根据我对 Java 的了解,这是不可能的,所以您可能必须编写一个 COM 包装器。在.net或C中,通过它连接到你的java代码。

As far as I know, there's not documented way to replace Word's built in spell checker with one of your own.

You could +emulate+ Word's spell checker with your own code, but it won't be easy. Word doesn't raise any events as you navigate in a document, so you'd have to setup a timer, then check the current cursor position constantly if you wanted unrequested spelling options (otherwise, you'd have to hook into the windows mouse events to monitor for a right click, then check what word you were on and go from there.

There also won't be any easy way to highlight the misspelled word (like the red squiggly in Word now).

And finally, I don't know much about Java. Assuming you could write a DLL in java that exposes COM interfaces, you should be able to do it. But from what I know about Java, that's not possible. So you'd likely have to write a COM wrapper in .net or C, the bridge to your java code through it.

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