Hunspell:有什么可靠的例子吗?

发布于 12-18 22:18 字数 274 浏览 4 评论 0原文

我已经下载并编译了 hunspell 。现在我想在 wxWidgets 上制作一个测试应用程序,我开始寻找示例或教程。到目前为止我还没有找到。我可以找到“示例”可执行文件,但没有代码(可能隐藏在未找到的地方?)。在整个互联网上三天我什么也没找到。我发现的最好的就是这个,它是用我的语言编写的无法理解。

我将欣赏任何简单的示例、教程指针或任何有价值的内容。 多谢!

I have downloaded and compiled hunspell fine. Now I want to make a test app on wxWidgets and I started looking for example or tutorial. So far I have found none. I can find "example" executable but no code (May be hidden somewhere haven't found?). In whole internet for three days I have found nothing. The best I have found is this which is in language I cannot understand.

I will appreciate any simple example, pointer to tutorial or anything of value for that matter.
Thanks a lot!

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

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

发布评论

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

评论(2

不爱素颜2024-12-25 22:18:48

如果有人仍然需要一个可靠的示例,至少在 ubuntu 上,libhunspell-dev 包在 /usr/share/doc/libhunspell-dev/examples/example.cxx 中提供了一个示例>。

该文件也可以在线找到,例如: https://www.apt-browse.org/browse/ubuntu/precise/main/i386/libmythes-dev/2:1.2.2-1/file/usr/share/doc/libmythes-dev/examples /example.cxx

基于此,我为 C++ 创建了一个非常小的示例:

#include <iostream>
#include <string>
#include <hunspell/hunspell.hxx>

int main()
{
    Hunspell spell ("/usr/share/hunspell/en_US.aff", "/usr/share/hunspell/en_US.dic");

    std::cout << "Please enter one word:" << std::endl;
    std::string word;
    std::cin >> word;

    if (spell.spell(word.c_str()) == 0) {
            std::cout << "Spelling Error!";
    } else { 
            std::cout << "Correct Spelling!";
    }

    return 0;
}

In case anyone still needs a solid example, at least on ubuntu the package libhunspell-dev provides one in /usr/share/doc/libhunspell-dev/examples/example.cxx.

This file can also be found online, for example here: https://www.apt-browse.org/browse/ubuntu/precise/main/i386/libmythes-dev/2:1.2.2-1/file/usr/share/doc/libmythes-dev/examples/example.cxx

Based on this, I created a very small example for C++:

#include <iostream>
#include <string>
#include <hunspell/hunspell.hxx>

int main()
{
    Hunspell spell ("/usr/share/hunspell/en_US.aff", "/usr/share/hunspell/en_US.dic");

    std::cout << "Please enter one word:" << std::endl;
    std::string word;
    std::cin >> word;

    if (spell.spell(word.c_str()) == 0) {
            std::cout << "Spelling Error!";
    } else { 
            std::cout << "Correct Spelling!";
    }

    return 0;
}
白日梦2024-12-25 22:18:48

你检查过这个网站吗?

http://sourceforge.net/projects/hunspell/files%2FHunspell%2FDocumentation/

它本身不提供代码,但您可以从那里下载完整的信息。
HunSpell 的网页说它基于 MySpell,也许 MySpell 的任何源代码都与 HunSpell< /强>。

Have you checked this site?

http://sourceforge.net/projects/hunspell/files%2FHunspell%2FDocumentation/

It does not provide code by itself, but you can download thorough information from there.
The web page for HunSpell says that it is based on MySpell, maybe any source code out there for MySpell is compatible with HunSpell.

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