Re: Re: chenxiajian_enchant_dict_hyphenation?

From: Urmas <davian818_at_gmail.com>
Date: Mon Jun 20 2011 - 19:42:17 CEST

From: "chenxiajian1985" <chenxiajian1985@gmail.com>
Sent: Monday, June 20, 2011 10:35 PM
To: "abiword-dev" <abiword-dev@abisource.com>
Subject: Re: Re: chenxiajian_enchant_dict_hyphenation?

>
> I think we can combine the hyphenation with spell-checking together. so that we can make the code more flexsible.
> In my opinion, we can make code like this:
> EnchantDict* enchant_broker_request_dict (EnchantBroker* broker, const char *const lang); //same as spell-checking
> char *enchant_dict_hyphenate(EnchantDict *dict, const char *const word,size_t len);
>

I don't think it would be more useful, as there's no guarantee that for a certain language both spellchecking an hyphenation will be supported. So we can just return NULL instead of dictionary object in this case, and our clients will detect it and inform user correspondingly, etc. So it's better (and simpler) have separate objects for spelling and hyphenation.

Also, (i|a|hun)spell libraries _do not do_ hyphenation. You'll want to create a separate library, a libhyphen hyphenation provider, which would process requests from enchant to create a 'hyphenator' object basing on TeX hyphenation dictionary for a given language. Later additional providers may be added, like for voikko, but for now that one should be implemented.

Also, why do you want to return a dynamic array of hyphenation suggestions? If you want to prioritize some variants over another, it's more efficient to just encode them with different metacharacters and send back as one string.
Received on Mon Jun 20 19:44:13 2011

This archive was generated by hypermail 2.1.8 : Mon Jun 20 2011 - 19:44:13 CEST