您的位置:首页 > 编程语言 > C语言/C++

Hunspell API C++

2012-09-19 11:15 323 查看
Hunspell 是一个拼写检查器,OpenOffice 和 Firefox 以及 Thunderbird 默认的都是使用这个拼写检查器。

#include <hunspell/hunspell.hxx> /* or */

#include <hunspell/hunspell.h>

//初始化函数

Hunspell(const char *affpath,const char *dpath);

Hunspell(const char *affpath,const char *dpath,const char *key);

~Hunspell();

//添加额外的字典

int add_dic(const char *dpath);

int add_dic(const char *dpath,const char *key);

//判断字是否拼写错误

int spell(const char *word);

int spell(const char *word,int *info,char **root);

//对错误的词返回修改建议与返回修改单词的个数

int suggest(char***slst,const char *word);

//分析所使用的规则

int analyze(char***slst,const char *word);

//抽取词干

int stem(char***slst,const char *word);

int stem(char***slst,char **morph,intn);

//生成形态分析

int generate(char***slst,const char *word,const char *word2);

int generate(char***slst,const char *word,char **desc,intn);

//清空返回的建议列表

void free_list(char ***slst,intn);

//向个人字典添加单词

int add(const char *word);

//向个人字典添加单词 带词缀

int add_with_affix(const char *word,const char *example);

//删除个人词典中的单词

int remove(const char *word);

//返回ISO8859-1或者是在affix文件中用关键字SET定义的字符编码

char * get_dic_encoding();

//返回在字缀文件中用关键字WORDCHARS定义的用于词语切分的额外字符

const char * get_wordchars();

//返回在字缀文件中用关键字WORDCHARS定义的用于词语切分的额外字符

unsigned short * get_wordchars_utf16(int *len);

//返回8字符的字典编码情况表

struct cs_info*get_csconv();

//返回版本号

const char * get_version();
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息