【发布时间】:2013-12-13 13:26:28
【问题描述】:
我想在我的 C 程序中使用 hunspell。我在 Unix 环境(shell)中工作,它已经内置了 hunspell。 我知道我可以通过键入来使用 hunspell 文件名 在命令行,但我想知道如何在我的程序中使用它。最终我想存储每个字典单词,但首先我只想知道如何将它导入到我的程序中。 比如有没有#include 类型的东西?
【问题讨论】:
标签: hunspell
我想在我的 C 程序中使用 hunspell。我在 Unix 环境(shell)中工作,它已经内置了 hunspell。 我知道我可以通过键入来使用 hunspell 文件名 在命令行,但我想知道如何在我的程序中使用它。最终我想存储每个字典单词,但首先我只想知道如何将它导入到我的程序中。 比如有没有#include 类型的东西?
【问题讨论】:
标签: hunspell
是的,您可以通过#include <hunspell/hunspell.h> 使用 hunspell API。可以在hunspell documentation page (hunspell3.pdf) 中找到 API 详细信息。示例有点少,但this 或this 应该可以帮助您入门。
【讨论】:
gcc -lhunspell test.c,但它给了我错误
gcc test.c -lhunspell 可能会奏效。
<hunspell/hunspell.h>。
find-ing hunspell 看看你是否有 h 和 so 文件。我不知道你的系统,但是在 Debian 和衍生产品中,如果你丢失了,你需要安装一个 hunspell-dev 包文件。