diff options
author | chenxiajian <chenxiajian1985@gmail.com> | 2011-08-15 15:04:47 +0000 |
---|---|---|
committer | chenxiajian <chenxiajian1985@gmail.com> | 2011-08-15 15:04:47 +0000 |
commit | c2836304dee8c4da5eaba20c1bc6f53647cce820 (patch) | |
tree | cf5dd68cb57a7124ee8ac20963d4de809fe5d33d | |
parent | 6f70bdec72b480ac5eebae45ad64b3147b43615c (diff) | |
download | enchant-c2836304dee8c4da5eaba20c1bc6f53647cce820.tar.gz |
dealt with Urmas mentioned problem: when the spell-checking dict is missing ,the hyphenaiton function can be used also
git-svn-id: svn+ssh://svn.abisource.com/svnroot/enchant/branches/gsoc2011hyphenation@30216 bcba8976-2d24-0410-9c9c-aab3bd5fdfd6
-rw-r--r-- | src/enchant.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/src/enchant.c b/src/enchant.c index 3efadfc..98a94e6 100644 --- a/src/enchant.c +++ b/src/enchant.c @@ -25,7 +25,7 @@ * respects for all of the code used other than said providers. If you modify * this file, you may extend this exception to your version of the * file, but you are not obligated to do so. If you do not wish to - * do so, delete this exception statement from your version. + * do so, delete this exception statement from your version. */ #include <stdio.h> @@ -42,6 +42,7 @@ #include "enchant-provider.h" #include "pwl.h" + #ifdef XP_TARGET_COCOA #import "enchant_cocoa.h" #endif @@ -112,6 +113,7 @@ typedef void (*EnchantPreConfigureFunc) (EnchantProvider * provider, #define path_cmp strcmp #endif + static GSList* enchant_slist_prepend_unique_path (GSList *slist, gchar* data) { if (NULL == g_slist_find_custom (slist, data, (GCompareFunc)path_cmp)) @@ -1020,14 +1022,35 @@ enchant_dict_hyphenate (EnchantDict * dict, const char *const word, ssize_t len) /* Check for suggestions from provider dictionary */ if (dict->hyphenate) { - dict_suggs = (*dict->hyphenate) (dict, word); + dict_suggs = (*dict->hyphenate) (dict, word); } return dict_suggs; } +ENCHANT_MODULE_EXPORT (char*) +enchant_dict_hyphenateWithoutDic (EnchantDict * dict, const char *const word, ssize_t len) +{ + EnchantSession * session; + size_t n_suggs = 0, n_dict_suggs = 0, n_pwl_suggs = 0, n_suggsT = 0; + char **suggs, *dict_suggs = NULL, **pwl_suggs = NULL, **suggsT; + + + char*result=0; + g_return_val_if_fail (word, NULL); + g_return_val_if_fail (dict, NULL); + + //without dic we can also m_dict + // but only in ispell now + if (dict->hyphenate) + { + dict_suggs = (*dict->hyphenate) (dict, word); + } + + return dict_suggs; +} /** * enchant_dict_add * @dict: A non-null #EnchantDict |