Hi, Pradeenban.
Have you seen my code before about implementation of hyphenation in
Enchant level? Is there some other problemes?
I have tested in Ubuntu environment, it works fine. just some problems
about different function in Windows and Linux(Unix)
If there is some problem, tell me. I will fix it.
Best Regards
Chen Xiajian
2011/7/8 Kathiravelu Pradeeban <kk.pradeeban@gmail.com>
>
> Chen,
> Pls fix this commit going through it. You seem to have committed with
> the svn conflicts as Xun has pointed out.
>
> Go through the code segments like below.
> +<<<<<<< .mine
>
> +=======
>
> +>>>>>>> .theirs
>
> Regards,
> Pradeeban.
>
> On Fri, Jul 8, 2011 at 2:57 PM, <cvs@abisource.com> wrote:
> >
> > Author: chenxiajian1985
> > Date: 2011-07-08 11:27:17 +0200 (Fri, 08 Jul 2011)
> > New Revision: 29997
> >
> > Modified:
> > enchant/branches/gsoc2011hyphenation/src/enchant++.h
> > enchant/branches/gsoc2011hyphenation/src/enchant-provider.h
> > enchant/branches/gsoc2011hyphenation/src/enchant.c
> > enchant/branches/gsoc2011hyphenation/src/enchant.h
> > enchant/branches/gsoc2011hyphenation/src/hspell/hspell_provider.c
> > enchant/branches/gsoc2011hyphenation/src/ispell/ispell_checker.cpp
> > enchant/branches/gsoc2011hyphenation/src/ispell/ispell_checker.h
> > enchant/branches/gsoc2011hyphenation/src/uspell/uspell_provider.cpp
> > enchant/branches/gsoc2011hyphenation/src/voikko/voikko_provider.c
> > enchant/branches/gsoc2011hyphenation/src/zemberek/zemberek.h
> > enchant/branches/gsoc2011hyphenation/src/zemberek/zemberek_provider.cpp
> > Log:
> > patch 0622
> > 1 I think return char * is a better way. like Voikko:
> > char * voikko_hyphenate_cstr(int handle, const char * word);
> > char * voikko_hyphenate_ucs4(int handle, const wchar_t * word);
> > 2 detailed implementation using voikko(need more tests)
> >
> > Modified: enchant/branches/gsoc2011hyphenation/src/enchant++.h
> > ===================================================================
> > --- enchant/branches/gsoc2011hyphenation/src/enchant++.h 2011-07-08 08:45:27 UTC (rev 29996)
> > +++ enchant/branches/gsoc2011hyphenation/src/enchant++.h 2011-07-08 09:27:17 UTC (rev 29997)
> > @@ -112,6 +112,7 @@
> > suggest (utf8word, result);
> > return result;
> > }
> > +<<<<<<< .mine
>
> OOPS.. you have committed your version conflicts!?
>
> >
> > void hyphenate (const std::string & utf8word,
> > std::vector<std::string> & out_suggestions) {
> > @@ -137,6 +138,33 @@
> > hyphenate (utf8word, result);
> > return result;
> > }
> > +=======
> > +
> > + void hyphenate (const std::string & utf8word,
> > + std::string & out_suggestions) {
> > + //not implement yet chenxiajian
> > + }
> > +
> > + std::string hyphenate (const std::string & utf8word) {
> > + std::string result;
> > + hyphenate (utf8word, result);
> > + return result;
> > + }
> > +
> > +
> > +
> > +
> > +
> > +
> > +
> > +
> > +
> > +
> > +
> > +
> > +
> > +
> > +>>>>>>> .theirs
>
> OOPS! You have committed your version conflicts?
> >
> > void add (const std::string & utf8word) {
> > enchant_dict_add (m_dict, utf8word.c_str(),
> >
> > Modified: enchant/branches/gsoc2011hyphenation/src/enchant-provider.h
> > ===================================================================
> > --- enchant/branches/gsoc2011hyphenation/src/enchant-provider.h 2011-07-08 08:45:27 UTC (rev 29996)
> > +++ enchant/branches/gsoc2011hyphenation/src/enchant-provider.h 2011-07-08 09:27:17 UTC (rev 29997)
> > @@ -102,10 +102,17 @@
> >
> > void (*add_to_exclude) (struct str_enchant_dict * me,
> > const char *const word, size_t len);
> > +<<<<<<< .mine
> >
> > char **(*hyphenate) (struct str_enchant_dict * me,
> > const char *const word, size_t len,
> > size_t * out_n_suggs);
> > +=======
> > +
> > + char *(*hyphenate) (struct str_enchant_dict * me,
> > + const char *const word);
> > +
> > +>>>>>>> .theirs
> >
> > void * _reserved[5];
> > };
> >
> > Modified: enchant/branches/gsoc2011hyphenation/src/enchant.c
> > ===================================================================
> > --- enchant/branches/gsoc2011hyphenation/src/enchant.c 2011-07-08 08:45:27 UTC (rev 29996)
> > +++ enchant/branches/gsoc2011hyphenation/src/enchant.c 2011-07-08 09:27:17 UTC (rev 29997)
> > @@ -1012,6 +1012,7 @@
> > return suggs;
> > }
> >
> > +<<<<<<< .mine
> >
> > ENCHANT_MODULE_EXPORT (char **)
> > enchant_dict_hyphenate (EnchantDict * dict, const char *const word,
> > @@ -1056,6 +1057,52 @@
> > return suggs;
> > }
> >
> > +=======
> > +
> > +ENCHANT_MODULE_EXPORT (char *)
> > +enchant_dict_hyphenate (EnchantDict * dict, const char *const word)
> > +{
> > + 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 (dict, NULL);
> > + g_return_val_if_fail (word, NULL);
> > +
> > +
> > + session = ((EnchantDictPrivateData*)dict->enchant_private_data)->session;
> > + enchant_session_clear_error (session);
> > + /* Check for suggestions from provider dictionary */
> > + if (dict->hyphenate)
> > + {
> > + dict_suggs = (*dict->hyphenate) (dict, word);
> > +
> > + }
> > +
> > +
> > + return result;
> > +}
> > +
> > +
> > +
> > +
> > +
> > +
> > +
> > +
> > +
> > +
> > +
> > +
> > +
> > +
> > +
> > +
> > +
> > +>>>>>>> .theirs
> > /**
> > * enchant_dict_add
> > * @dict: A non-null #EnchantDict
> >
> > Modified: enchant/branches/gsoc2011hyphenation/src/enchant.h
> > ===================================================================
> > --- enchant/branches/gsoc2011hyphenation/src/enchant.h 2011-07-08 08:45:27 UTC (rev 29996)
> > +++ enchant/branches/gsoc2011hyphenation/src/enchant.h 2011-07-08 09:27:17 UTC (rev 29997)
> > @@ -112,12 +112,21 @@
> > ENCHANT_MODULE_EXPORT (char **)
> > enchant_dict_suggest (EnchantDict * dict, const char *const word,
> > ssize_t len, size_t * out_n_suggs);
> > +<<<<<<< .mine
> >
> > ENCHANT_MODULE_EXPORT (char **)
> > enchant_dict_hyphenate (EnchantDict * dict, const char *const word,
> > ssize_t len, size_t * out_n_suggs);
> >
> >
> > +=======
> > +
> > +ENCHANT_MODULE_EXPORT (char *)
> > +enchant_dict_hyphenate (EnchantDict * dict, const char *const word);
> > +
> > +
> > +
> > +>>>>>>> .theirs
> > ENCHANT_MODULE_EXPORT (void)
> > enchant_dict_add (EnchantDict * dict, const char *const word,
> > ssize_t len);
> >
> > Modified: enchant/branches/gsoc2011hyphenation/src/hspell/hspell_provider.c
> > ===================================================================
> > --- enchant/branches/gsoc2011hyphenation/src/hspell/hspell_provider.c 2011-07-08 08:45:27 UTC (rev 29996)
> > +++ enchant/branches/gsoc2011hyphenation/src/hspell/hspell_provider.c 2011-07-08 09:27:17 UTC (rev 29997)
> > @@ -181,6 +181,7 @@
> > return sugg_arr;
> > }
> >
> > +<<<<<<< .mine
> > static char **
> > hspell_dict_hyphenate (EnchantDict * me, const char *const word,
> > size_t len, size_t * out_n_suggs)
> > @@ -203,6 +204,30 @@
> > return sugg_arr;
> > }
> >
> > +=======
> > +static char *
> > +hspell_dict_hyphenate (EnchantDict * me, const char *const word)
> > +{
> > +
> > + int res;
> > + gsize length;
> > + char *iso_word;
> > + char **sugg_arr = NULL;
> > + struct corlist cl;
> > + struct dict_radix *hspell_dict;
> > +
> > + hspell_dict = (struct dict_radix *)me->user_data;
> > +///not implement yet! chenxiajian///
> > +
> > +
> > + /* free the word */
> > + g_free (iso_word);
> > +
> > + char*result=0;
> > + return result;
> > +}
> > +
> > +>>>>>>> .theirs
> > static EnchantDict *
> > hspell_provider_request_dict (EnchantProvider * me, const char *const tag)
> > {
> >
> > Modified: enchant/branches/gsoc2011hyphenation/src/ispell/ispell_checker.cpp
> > ===================================================================
> > --- enchant/branches/gsoc2011hyphenation/src/ispell/ispell_checker.cpp 2011-07-08 08:45:27 UTC (rev 29996)
> > +++ enchant/branches/gsoc2011hyphenation/src/ispell/ispell_checker.cpp 2011-07-08 09:27:17 UTC (rev 29997)
> > @@ -272,6 +272,7 @@
> > return sugg_arr;
> > }
> >
> > +<<<<<<< .mine
> >
> > char **
> > ISpellChecker::hyphenate(const char * const utf8Word, size_t length,
> > @@ -288,6 +289,24 @@
> > return sugg_arr;
> > }
> >
> > +=======
> > +
> > +char *
> > +ISpellChecker::hyphenate(const char * const utf8Word)
> > +{
> > + ichar_t iWord[INPUTWORDLEN + MAXAFFIXLEN];
> > + char word8[INPUTWORDLEN + MAXAFFIXLEN];
> > + int c;
> > +
> > + char **sugg_arr = NULL;
> > + ///not implement yet! chenxiajian///
> > +
> > + char*result=0;
> > + return result;
> > +}
> > +
> > +
> > +>>>>>>> .theirs
> > static GSList *
> > ispell_checker_get_dictionary_dirs (EnchantBroker * broker)
> > {
> > @@ -545,6 +564,7 @@
> > return checker->suggestWord (word, len, out_n_suggs);
> > }
> >
> > +<<<<<<< .mine
> > static char **
> > ispell_dict_hyphenate (EnchantDict * me, const char *const word,
> > size_t len, size_t * out_n_suggs)
> > @@ -556,6 +576,19 @@
> > }
> >
> >
> > +=======
> > +static char *
> > +ispell_dict_hyphenate (EnchantDict * me, const char *const word)
> > +{
> > + ISpellChecker * checker;
> > +
> > + checker = (ISpellChecker *) me->user_data;
> > + return checker->hyphenate (word);
> > +}
> > +
> > +
> > +
> > +>>>>>>> .theirs
> > static int
> > ispell_dict_check (EnchantDict * me, const char *const word, size_t len)
> > {
> >
> > Modified: enchant/branches/gsoc2011hyphenation/src/ispell/ispell_checker.h
> > ===================================================================
> > --- enchant/branches/gsoc2011hyphenation/src/ispell/ispell_checker.h 2011-07-08 08:45:27 UTC (rev 29996)
> > +++ enchant/branches/gsoc2011hyphenation/src/ispell/ispell_checker.h 2011-07-08 09:27:17 UTC (rev 29997)
> > @@ -14,8 +14,13 @@
> >
> > bool checkWord(const char * const word, size_t len);
> > char ** suggestWord(const char * const word, size_t len, size_t * out_n_suggs);
> > +<<<<<<< .mine
> > char ** hyphenate(const char * const word, size_t len, size_t * out_n_suggs);
> >
> > +=======
> > + char * hyphenate(const char * const word);
> > +
> > +>>>>>>> .theirs
> > bool requestDictionary (const char * szLang);
> >
> > private:
> >
> > Modified: enchant/branches/gsoc2011hyphenation/src/uspell/uspell_provider.cpp
> > ===================================================================
> > --- enchant/branches/gsoc2011hyphenation/src/uspell/uspell_provider.cpp 2011-07-08 08:45:27 UTC (rev 29996)
> > +++ enchant/branches/gsoc2011hyphenation/src/uspell/uspell_provider.cpp 2011-07-08 09:27:17 UTC (rev 29997)
> > @@ -212,6 +212,7 @@
> > return sugg_arr;
> > } // uspell_dict_suggest
> >
> > +<<<<<<< .mine
> > static char **
> > uspell_dict_hyphenate (EnchantDict * me, const char *const word,
> > size_t len, size_t * out_n_suggs)
> > @@ -236,6 +237,32 @@
> > }
> >
> >
> > +=======
> > +static char *
> > +uspell_dict_hyphenate (EnchantDict * me, const char *const word)
> > +{
> > + uSpell *manager;
> > + utf8_t myWord[MAXCHARS];
> > +
> > + char **sugg_arr = NULL;
> > + const utf8_t *sugg;
> > + wide_t buf[MAXCHARS];
> > + int length;
> > + unsigned int i;
> > + utf8_t **list;
> > +
> > + if (len >= MAXCHARS) // no suggestions; the word is outlandish
> > + return NULL;
> > +
> > + ///not implement yet! chenxiajian///
> > +
> > + free(list);
> > + char*result=0;
> > + return result;
> > +}
> > +
> > +
> > +>>>>>>> .theirs
> > static void
> > uspell_dict_add_to_session (EnchantDict * me, const char *const word,
> > size_t len)
> >
> > Modified: enchant/branches/gsoc2011hyphenation/src/voikko/voikko_provider.c
> > ===================================================================
> > --- enchant/branches/gsoc2011hyphenation/src/voikko/voikko_provider.c 2011-07-08 08:45:27 UTC (rev 29996)
> > +++ enchant/branches/gsoc2011hyphenation/src/voikko/voikko_provider.c 2011-07-08 09:27:17 UTC (rev 29997)
> > @@ -78,6 +78,7 @@
> > return sugg_arr;
> > }
> >
> > +<<<<<<< .mine
> > static char **
> > voikko_dict_hyphenate (EnchantDict * me, const char *const word,
> > size_t len, size_t * out_n_suggs)
> > @@ -88,6 +89,20 @@
> > return sugg_arr;
> > }
> >
> > +
> > +=======
> > +static char *
> > +voikko_dict_hyphenate (EnchantDict * me, const char *const word)
> > +{
> > + char*result=0;
> > + int voikko_handle;
> > + voikko_handle = (long) me->user_data;
> > +
> > + result=voikko_hyphenate_cstr(voikko_handle,word);
> > + return result;
> > +}
> > +
> > +>>>>>>> .theirs
> > static EnchantDict *
> > voikko_provider_request_dict (EnchantProvider * me, const char *const tag)
> > {
> >
> > Modified: enchant/branches/gsoc2011hyphenation/src/zemberek/zemberek.h
> > ===================================================================
> > --- enchant/branches/gsoc2011hyphenation/src/zemberek/zemberek.h 2011-07-08 08:45:27 UTC (rev 29996)
> > +++ enchant/branches/gsoc2011hyphenation/src/zemberek/zemberek.h 2011-07-08 09:27:17 UTC (rev 29997)
> > @@ -41,7 +41,11 @@
> >
> > int checkWord(const char* word) const;
> > char** suggestWord(const char* word, size_t *out_n_suggs);
> > +<<<<<<< .mine
> > char** hyphenate(const char* word, size_t *out_n_suggs);
> > +=======
> > + char* hyphenate(const char* word);
> > +>>>>>>> .theirs
> >
> > private:
> > DBusGConnection *connection;
> >
> > Modified: enchant/branches/gsoc2011hyphenation/src/zemberek/zemberek_provider.cpp
> > ===================================================================
> > --- enchant/branches/gsoc2011hyphenation/src/zemberek/zemberek_provider.cpp 2011-07-08 08:45:27 UTC (rev 29996)
> > +++ enchant/branches/gsoc2011hyphenation/src/zemberek/zemberek_provider.cpp 2011-07-08 09:27:17 UTC (rev 29997)
> > @@ -59,13 +59,12 @@
> > return checker->suggestWord (word, out_n_suggs);
> > }
> >
> > -static char**
> > -zemberek_dict_hyphenate (EnchantDict * me, const char *const word,
> > - size_t len, size_t * out_n_suggs)
> > +static char*
> > +zemberek_dict_hyphenate (EnchantDict * me, const char *const word)
> > {
> > Zemberek *checker;
> > checker = (Zemberek *) me->user_data;
> > - return checker->hyphenate (word, out_n_suggs);
> > + return checker->hyphenate (word);
> > }
> >
> >
> >
> > -----------------------------------------------
> > To unsubscribe from this list, send a message to
> > abisource-cvs-commit-request@abisource.com with the word
> > unsubscribe in the message body.
> >
>
>
>
> --
> Kathiravelu Pradeeban.
> Software Engineer.
> WSO2 Inc.
>
> Blog: [Llovizna] http://kkpradeeban.blogspot.com/
Received on Tue Jul 12 03:49:57 2011
This archive was generated by hypermail 2.1.8 : Tue Jul 12 2011 - 03:49:57 CEST