Test my enchant code_chenxiajian?

From: chenxiajian1985 <chenxiajian1985_at_gmail.com>
Date: Sat Jun 25 2011 - 11:23:18 CEST

Hi all
I have wrote some code about hyphenation using enchant framework
the code needs optimization and more tests.

Now I want to call enchant function in Abiword project

what I do:
I just copy the bulid result of enchant:
enchant\bin\Debug\libenchant_myspell.dll -------> abiword\msvc2008\Debug\lib\enchant\libenchant_myspell.dll
enchant\bin\Debug\libenchant_ispell.dll -------> abiword\msvc2008\Debug\lib\enchant\libenchant_ispell.dll
enchant\bin\Debug\libenchant.dll ------->abiword\msvc2008\Debug\bin\ibenchant.dll

but I also encouter some crashes, I dont know why, need more learning~~
maybe need some copy to abiword\msvc2008\Prefix\lib\enchant

someone who ever does the same thing as me, give me some advices, thanks

Thanks~

chen xiajian



发件人: Urmas
发送时间: 2011-06-14 22:02:23
收件人: abiword-dev
抄送:
主题: Re: chenxiajian_enchant_dict_hyphenationSuggest ?
 
From: "chenxiajian1985" <chenxiajian1985@gmail.com>
Subject: chenxiajian_enchant_dict_hyphenationSuggest ?
> I try to implement hyphenation using enchant. so I add one method in enchant.
> ENCHANT_MODULE_EXPORT (char **)
> enchant_dict_hyphenationSuggest (EnchantDict * dict, const char *const word,
> ssize_t len, size_t * out_n_suggs);
>
No, you'll need a separate object for doing hyphenation, something like:
EnchantHyph* enchant_broker_request_hyph(EnchantBroker*, const char *const lang);
to create an provider-dependant hyphenation object, and
char *enchant_hyph_hyphenate(EnchantHyph *hyphenator, const char *const word);
which would call a virtual method of "hyphenator" to obtain results;
>
> 2. what is the best way to encode hyphenation results from enchant
> now I used (char **) to save the hyphenation results:
> such as : the word "hyphenation" can be save as:
> "hy-phen-ation" "hyphen-ation"....
That's looks like terribly inefficient way, better just to return a string with embedded meta-characters (like '~' or control ones) in most desired and less desired breakpoints.
Received on Sat Jun 25 11:23:20 2011

This archive was generated by hypermail 2.1.8 : Sat Jun 25 2011 - 11:23:20 CEST