[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Spellchecking in KDE, adding support for a new language
From:       Barış_Metin <baris () uludag ! org ! tr>
Date:       2005-04-19 18:50:37
Message-ID: 200504192150.40897.baris () uludag ! org ! tr
[Download RAW message or body]

[Attachment #2 (multipart/mixed)]


Hello,

We were working for Turkish spellcheking support in free/open source projects 
for a while. Adding support for KDE was one but important part for us in 
Pardus [1] project.

There were projects willing to add Turkish spell checking support via Aspell 
project but they have failed - AFAIK due to the design of Aspell. Now there 
is a new, promissing project called Zemberek[2].

Zemberek is a java library. There are toughts on re-writing it in C/C++ but I 
don't think this will happen soon. So we tried to separate the java part of 
the system from the applications using a daemon and a client. We are testing 
the result for some time and its seems to be working fine[3]. 

The only dependency in the KDE part will be the client called zpspell[4].  And 
I'll provide support for both the KDE part and zpspell. Besides, I'll also 
provide a KSpell2 plugin for KOffice and future releases of KDE.

We don't want this feature to be specific for our distribution. Is it possible 
to apply the attached patch to CVS? There is also support for hspell (Hebrew) 
so I don't think adding support for a specialized client like this will be 
trouble.


1. http://www.uludag.org.tr/eng/index.html
2. https://zemberek.dev.java.net/
3. http://www.uludag.org.tr/eng/projeler/masaustu/zemberek-pardus/index.html
4. http://svn.uludag.org.tr/uludag/trunk/zpspell/

best regards,
-- 
Barış Metin

["kdelibs-3.4.0-zemberek.patch" (text/x-diff)]

diff -ur kdelibs-3.4.0.orig/kdeui/ksconfig.cpp kdelibs-3.4.0/kdeui/ksconfig.cpp
--- kdelibs-3.4.0.orig/kdeui/ksconfig.cpp	2005-02-04 01:33:10.000000000 +0200
+++ kdelibs-3.4.0/kdeui/ksconfig.cpp	2005-03-20 03:14:15.000000000 +0200
@@ -146,6 +146,7 @@
   clientcombo->insertItem( i18n("International Ispell") );
   clientcombo->insertItem( i18n("Aspell") );
   clientcombo->insertItem( i18n("Hspell") );
+  clientcombo->insertItem( i18n("Zemberek") );
   connect( clientcombo, SIGNAL (activated(int)), this,
 	   SLOT (sChangeClient(int)) );
   glay->addMultiCellWidget( clientcombo, 4, 4, 1, 2 );
@@ -231,7 +232,12 @@
       dictcombo->clear();
       dictcombo->insertItem( i18n("Hebrew") );
       sChangeEncoding( KS_E_CP1255 );
-    }
+    } else if ( iclient == KS_CLIENT_ZEMBEREK ) {
+      langfnames.clear();
+      dictcombo->clear();
+      dictcombo->insertItem( i18n("Turkish") );
+      sChangeEncoding( KS_E_UTF8 );
+    } 
     else
       getAvailDictsAspell();
   }
@@ -385,6 +391,11 @@
     dictcombo->clear();
     langfnames.append(""); // Default
     dictcombo->insertItem( i18n("Hebrew") );
+  } else if ( iclient == KS_CLIENT_ZEMBEREK ) {
+    langfnames.clear();
+    dictcombo->clear();
+    langfnames.append("");
+    dictcombo->insertItem( i18n("Turkish") );
   }
   else
     getAvailDictsAspell();
@@ -637,6 +648,11 @@
       box->insertItem( i18n("Hebrew") );
       langfnames.append(""); // Default
       sChangeEncoding( KS_E_CP1255 );
+    } else if ( iclient == KS_CLIENT_ZEMBEREK ) {
+      box->clear();
+      box->insertItem( i18n("Turkish") );
+      langfnames.append("");
+      sChangeEncoding( KS_E_UTF8 );
     }
     else {
       box->clear();
diff -ur kdelibs-3.4.0.orig/kdeui/ksconfig.h kdelibs-3.4.0/kdeui/ksconfig.h
--- kdelibs-3.4.0.orig/kdeui/ksconfig.h	2004-09-09 18:23:53.000000000 +0300
+++ kdelibs-3.4.0/kdeui/ksconfig.h	2005-03-20 03:14:59.000000000 +0200
@@ -56,7 +56,8 @@
 enum KSpellClients {
   KS_CLIENT_ISPELL=0,
   KS_CLIENT_ASPELL=1,
-  KS_CLIENT_HSPELL=2
+  KS_CLIENT_HSPELL=2,
+  KS_CLIENT_ZEMBEREK=3
 };
 
 /**
diff -ur kdelibs-3.4.0.orig/kdeui/kspell.cpp kdelibs-3.4.0/kdeui/kspell.cpp
--- kdelibs-3.4.0.orig/kdeui/kspell.cpp	2005-02-25 16:53:32.000000000 +0200
+++ kdelibs-3.4.0/kdeui/kspell.cpp	2005-03-20 03:16:17.000000000 +0200
@@ -177,6 +177,10 @@
     *proc << "hspell";
     kdDebug(750) << "Using hspell" << endl;
     break;
+  case KS_CLIENT_ZEMBEREK:
+    *proc << "zpspell";
+    kdDebug(750) << "Using zemberek(zpspell)" << endl;
+    break;
   }
 
   if ( ksconfig->client() == KS_CLIENT_ISPELL || ksconfig->client() == KS_CLIENT_ASPELL )
@@ -276,7 +280,7 @@
   // -a : pipe mode
   // -S : sort suggestions by probable correctness
   }
-  else       // hspell doesn't need all the rest of the options
+  else       // hspell and Zemberek(zpspell) doesn't need all the rest of the options
     *proc << "-a";
 
   if (trystart == 0) //don't connect these multiple times
diff -ur kdelibs-3.4.0.orig/kdeui/kspell.h kdelibs-3.4.0/kdeui/kspell.h
--- kdelibs-3.4.0.orig/kdeui/kspell.h	2004-10-10 11:56:18.000000000 +0300
+++ kdelibs-3.4.0/kdeui/kspell.h	2005-03-20 03:16:56.000000000 +0200
@@ -34,8 +34,8 @@
 /**
  * %KDE Spellchecker
  *
- * A %KDE programmer's interface to International ISpell 3.1, ASpell and
- * HSpell.
+ * A %KDE programmer's interface to International ISpell 3.1, ASpell,
+ * HSpell and ZPSpell..
  * A static method, modalCheck() is provided for convenient
  *  access to the spellchecker.
  *

[Attachment #6 (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic