GSoC 2011 - Hyphenation

From AbiWiki

(Difference between revisions)
Jump to: navigation, search
(Summary of What I have done in GSoc2011)
(Summary of What I have done in GSoc2011)
Line 47: Line 47:
 Debug coding problem
 Debug coding problem
-
 
7. User interface to manage hyphenation
7. User interface to manage hyphenation
Line 86: Line 85:
1 In order to achieve this, we need to add concreate function in EnchantDict firstly. Something like:
1 In order to achieve this, we need to add concreate function in EnchantDict firstly. Something like:
-
char **(*hyphenate) (struct str_enchant_dict * me,
+
            char **(*hyphenate) (struct str_enchant_dict * me,
                           const char *const word, size_t len,
                           const char *const word, size_t len,
                           size_t * out_n_suggs);
                           size_t * out_n_suggs);
Line 92: Line 91:
2 the function is implement by the backend.
2 the function is implement by the backend.
-
static char **
+
            static char **
-
ispell_dict_hyphenate (EnchantDict * me, const char *const word,
+
            ispell_dict_hyphenate (EnchantDict * me, const char *const word,
                     size_t len, size_t * out_n_suggs)
                     size_t len, size_t * out_n_suggs)
-
{
+
            {
-
      ISpellChecker * checker;
+
                  ISpellChecker * checker;
-
      checker = (ISpellChecker *) me->user_data;
+
                  checker = (ISpellChecker *) me->user_data;
-
      return checker->hyphenate (word, len, out_n_suggs);
+
                  return checker->hyphenate (word, len, out_n_suggs);
-
}
+
            }
3 we set the connetion with dic
3 we set the connetion with dic
-
dict->hyphenate = ispell_dict_hyphenate;
+
            dict->hyphenate = ispell_dict_hyphenate;
-
dict->suggest = hspell_dict_hyphenate;
+
            dict->suggest = hspell_dict_hyphenate;
-
dict->suggest = zemberek_dict_hyphenate;
+
            dict->suggest = zemberek_dict_hyphenate;
== Hyphenation module in Enchant ==
== Hyphenation module in Enchant ==

Revision as of 08:52, 21 August 2011

Summary of What I have done in GSoc2011

Contents

Summary of What I have done in GSoc2011

Until now, my works in GSoc2011 including seven parts as following:

1. How to Support more languages

 How to support more languages in ISpell

 How to support more languages in mySepll

2. How to extend the enchant function

3.Hyphenation module in Enchant

 Read and get totally understand the source code of Enchant

 Reuse the abstract layer of Enchant and add Hyphenation function in Enchant, so that we can add more language easily

 Deal with more languages

 Add five backend implementation, including ispell, myspell, zemberek, voikko, uspell

 Deal with the spelling-checking module

4.Call the Hyphenation function in Abiword.

 Find split info using enchant_dict_hyphenate

 Split Text_Run to split word pass the line width and keep their format

 Deal with user's operation(select, delete, cut, paste)

 User can select weather to enable the hyphenation function

5. Simple Implementation of Chinese Spell-Checking in Enchant

 Add a simple spell-check framework for Chinese in Enchant

 Add library to support

 Some survey about Chinese Spell-checking

6. Code Re-factor and debug

 Code Re-factor, include keep the code flexible

 Debug coding problem

7. User interface to manage hyphenation

 Windows, Linux, and Cocoa

The detail things:

How to reuse my works

I have created two patch files including all my coding in GSoc2011.

Chenxiajian_enchant.diff

Chenxiajian_abiword.diff

Chenxiajian_enchant.diff is about the jobs that I have done in the Enchant framework to provider an abstract level of hyphenation function for abiword.

Chenxiajian_abiword.diff is the concreate jobs that call the hyphenation function in abiword to implement hyphenation.

How to use?

You can just apply the diff files in SVN.

How to Support more languages

As mentioned before, we use Enchant to support more languages. So we have five backend to support more language. Take ISpell and mySpell for example.

In the folder “abiword\msvc2008\Debug\” there are the folder for hyphenation: Spell and mySpell. And there is two folder for their dictionary.

How to support more languages in ISpell

Go into the ISpell, you will see the folder language; you can just copy your languages’ hyphenation dictionary into it. So that our abiword will support your language’s hyphenation.

Now we support de, en, es, and fr.

How to support more languages in mySepll

The same as ISpell, to support more languages in mySpell, we can refer to the myspell folder.

How to extend the enchant function

I have read much codes in enchant. So I think enchant is a very useful framework for you to support dictionary-need function, such as spell-check, hyphenation. To extend the function in Enchant, we need to do the following things:

1 In order to achieve this, we need to add concreate function in EnchantDict firstly. Something like:

           char **(*hyphenate) (struct str_enchant_dict * me,
                         const char *const word, size_t len,
                         size_t * out_n_suggs);

2 the function is implement by the backend.

           static char **
           ispell_dict_hyphenate (EnchantDict * me, const char *const word,
                   size_t len, size_t * out_n_suggs)
           {
                  ISpellChecker * checker;
                  checker = (ISpellChecker *) me->user_data;
                 return checker->hyphenate (word, len, out_n_suggs);
           }

3 we set the connetion with dic

           dict->hyphenate = ispell_dict_hyphenate;
           dict->suggest = hspell_dict_hyphenate;
           dict->suggest = zemberek_dict_hyphenate;

Hyphenation module in Enchant

Add hyphenation function in Enchant

Add five backends to support hyphenation

ISpell

MySpell

zemberek

voikko

Deploy of enchant in Abiword

Test in Linux

Call the Hyphenation function in Abiword.

Simple Implementation of Chinese Spell-Check in Enchant

Code Re-factor and debug

User interface to manage hyphenation