After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 127338 - spell checking
spell checking
Status: RESOLVED FIXED
Product: gossip
Classification: Deprecated
Component: General
unspecified
Other Linux
: Normal enhancement
: 0.8
Assigned To: Gossip Maintainers
Gossip Maintainers
: 311525 (view as bug list)
Depends on: 127596 157841
Blocks:
 
 
Reported: 2003-11-18 22:16 UTC by Michael Schlüter
Modified: 2005-07-28 21:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch using Gnome Spell instead of GtkSpell (11.20 KB, patch)
2004-10-17 22:56 UTC, Martyn Russell
none Details | Review
updated gtkspell patch to the latest gossip cvs version (2.69 KB, patch)
2004-10-18 12:19 UTC, Michael Schlüter
none Details | Review
Patch to use aspell directly. (6.24 KB, patch)
2004-10-19 20:12 UTC, Martyn Russell
none Details | Review
Patch to use Aspell with suggestions (38.30 KB, patch)
2004-11-10 09:21 UTC, Martyn Russell
none Details | Review
Updated my last patch so it builds on CVS HEAD. (40.95 KB, patch)
2005-01-20 20:21 UTC, Martyn Russell
none Details | Review

Description Michael Schlüter 2003-11-18 22:16:22 UTC
Hi,

it's not really a bug but I prefer a spell checker looking at my words :).
To make it easy for you the changes to the source code could look like this
one (for the version 0.6):
--------------------------------------------------------------------------
diff -r -u gossip/configure.in gossip.spell/configure.in
--- gossip/configure.in 2003-11-18 20:59:53.000000000 +0100
+++ gossip.spell/configure.in   2003-11-18 22:19:01.000000000 +0100
@@ -63,6 +63,7 @@
        loudmouth-1.0 >= $LOUDMOUTH_REQUIRED
        gconf-2.0 >= $GCONF_REQUIRED
        libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED
+       gtkspell-2.0
 ])

 # Sucks that we need to do this
diff -r -u gossip/src/gossip-chat.c gossip.spell/src/gossip-chat.c
--- gossip/src/gossip-chat.c    2003-11-18 12:51:30.000000000 +0100
+++ gossip.spell/src/gossip-chat.c      2003-11-18 22:17:16.000000000 +0100
@@ -25,6 +25,7 @@
 #include <string.h>
 #include <gdk/gdkkeysyms.h>
 #include <gtk/gtk.h>
+#include <gtkspell/gtkspell.h>
 #include <glade/glade.h>
 #include <libgnome/gnome-i18n.h>
 #include <libgnomeui/gnome-href.h>
@@ -365,6 +366,8 @@
        gossip_chat_view_set_margin (priv->view, 3);

        gtk_widget_grab_focus (priv->input_entry);
+
+       gtkspell_new_attach(GTK_TEXT_VIEW(priv->input_text_view), NULL, NULL);
 }

 static void
diff -r -u gossip/src/gossip-group-chat.c gossip.spell/src/gossip-group-chat.c
--- gossip/src/gossip-group-chat.c      2003-11-17 18:47:56.000000000 +0100
+++ gossip.spell/src/gossip-group-chat.c        2003-11-18
22:18:52.000000000 +0100
@@ -23,6 +23,7 @@
 #include <config.h>
 #include <string.h>
 #include <gtk/gtk.h>
+#include <gtkspell/gtkspell.h>
 #include <gdk/gdkkeysyms.h>
 #include <glade/glade.h>
 #include <gconf/gconf-client.h>
@@ -327,6 +328,7 @@
        group_chat_setup_tree (chat);

        gossip_chat_view_set_margin (chat->view, 3);
+       gtkspell_new_attach(GTK_TEXT_VIEW (chat->input_text_view), NULL, NULL);
 }

 GossipGroupChat *
-------------------------------------------------------------------------

There's a rub in it. It only works for GTK_TEXT_VIEW(priv->input_text_view)
     and not for the one line input "input_entry". Maybe gnome-spell is a
better solution but so far I had no look at it.
Comment 1 Mikael Hallendal 2003-11-19 23:40:04 UTC
That is no problem at all! :) Becuase .... *drum rolls s'il vous
plait' .... the entry will be a text entry for the next release :)

Adding PATCH keyword, marking for 0.7. We'll take a closer look at the
patch when things are a bit less hectic.

Thanks!
Comment 2 Mikael Hallendal 2003-11-20 01:13:03 UTC
I obviously shouldn't try to get all the monkeys in line playing the
drums while I talk. I mean that the text entry will be a text area.
Comment 3 Mikael Hallendal 2003-12-10 22:05:33 UTC
Marking as depending on the bug of using textarea always in chat windows.
Comment 4 Thomas Reynolds 2003-12-11 23:38:57 UTC
I know you are probably doing this, but lets make this optional. Check
for it when configuring, if it exists enable the feature. Have a
--disable-spellcheck flag as well.
Comment 5 Richard Hult 2003-12-11 23:45:39 UTC
How should this handle i18n by the way? It would be cool if it would
be usable for those who chat in different languages at the same
time... maybe too hard to do in a nice way, dunno.
Comment 6 Michael Schlüter 2003-12-12 07:19:07 UTC
evolution can handle multi language spell checking but they are using
gnome-spell. 
Comment 7 Richard Hult 2004-01-06 22:38:32 UTC
I just tried this, pretty cool, although there are quite a few
problems with gtkspell.

1. The UI is not translated
2. The UI is pretty rough, doesn't really fit Gossip (the right click
menu for misspelled words are crack)
3. You can't have more than one language spellchecked which I think is
too limited, especially since a lot of people are using Gossip in an
international context (at least the GNOME developers, dunno if we
should care about that though).

So, I vote for using gnome-spell (if it doesn't have the above
problems) or nothing at all.

Comment 8 Richard Hult 2004-01-07 00:46:32 UTC
Conclusion => not for 0.7.
Comment 9 Mikael Hallendal 2004-04-03 10:14:50 UTC
Marking as enhancement and removing the PATCH keyword since we need to try it
out with gnome-spell since gtk-spell doesn't live up to the requirements.
Comment 10 Martyn Russell 2004-10-17 22:56:49 UTC
Created attachment 32708 [details] [review]
Patch using Gnome Spell instead of GtkSpell

I have spent some time this evening looking into this - including the crash
course in Bonobo / ORBit / Corba :S

This adds the nice little red squiggle when words are misspelled.

This patch is very basic.

Current issues:
- No support to show a list of similar words for correcting the spelling yet.
- The language used is taken via the $LANG variable using the gnome-i18n API
and might not be right way of doing it?!?
- The method for looking up incorrect spellings is inefficient at the moment
and could be improved.
Comment 11 Mikael Hallendal 2004-10-18 11:40:04 UTC
We really should look into if we can solve this without the use of bonobo/ORBit.
Richard gave gnome-spell a quick look and said that it looked like it just used
aspell without much extra. Maybe we can go directly against aspell, I really
don't want all the stubs/skels generation stuff in Gossip. 

Been there, done that, not doing it again!

As for possibility to do spell correction I don't think it's needed. I think it
might be enough to just indicate wrongly spelled words. Perhaps with the
possibility to launch gnome-dict and do a search on the specific word. 

Not sure how to best solve which languages it should spell check, maybe per
contact and some global setting. For example I might want to check for english
as default but with Richard I want to have swedish as well...
Comment 12 Michael Schlüter 2004-10-18 12:19:26 UTC
Created attachment 32724 [details] [review]
updated gtkspell patch to the latest gossip cvs version

So maybe we should go the gtkspell way and improve their language selection?
I'm using it for nearly a year and the only feature I've missed so far is to
use more then one language (oh, and the language cooser dialog, of cause).

I've updated my patch to the latest gossip version.
Comment 13 Mikael Hallendal 2004-10-18 12:37:11 UTC
Michael, how about the comments from Richard. Are they fixed yet? Ie. the
roughness of gtk-spell UI and the lack of translation there?

Also, we need to solve the problem where you want to chat in several languages...
Comment 14 Michael Schlüter 2004-10-18 13:35:46 UTC
Micke,

>1. The UI is not translated

that works for me. (see http://www.johalla.de/~michael/images/gossip-gtk-spell.jpg)

>2. The UI is pretty rough, doesn't really fit Gossip (the right click menu for
misspelled words are crack)

It's the same with gnome-spell but there you have to do an extra click to get to
a dialog box. I prefer the gtk-spell way. (see
http://gtkspell.sourceforge.net/screenshot.png and
http://www.johalla.de/~michael/images/evolution-gnome-spell.jpg).

>3. 3. You can't have more than one language spellchecked which I think is too
limited, especially since a lot of people are using Gossip in an international
context (at least the GNOME developers, dunno if we should care about that though).

Jup, that isn't fixed so far. I don't think it's hard to add to gtk-spell
because gtk-spell is not very tricky (see
http://cvs.sourceforge.net/viewcvs.py/gtkspell/gtkspell2/gtkspell/gtkspell.c?rev=1.14&view=auto).
Comment 15 Mikael Hallendal 2004-10-18 13:58:47 UTC
I don't particulary like the popup-menu with suggested words. Why not just show
the word and make it possible to run gnome-dict on a misspelled word?
Comment 16 Martyn Russell 2004-10-19 16:29:13 UTC
Personally I would like to see a list of possible words *somehow* without going
to gnome-dict. How could we replace the word using gnome-dict other than
correcting the word ourselves (which is not really assisting the user)?

There are some other things you can do with the gnome-spell (and probably
gtkspell) stuff, such as adding words particular to you to your dictionary so
they are not highlighed in the future.  Would we want support for that?  But
then, if we did, and you speak in more than one language, which language would
you add the word too?  I guess that would be based on the language for that chat
window.

As far as multi language support is concerned, I guess it is tricky, what
happens if you are talking to richard and you send him some english text?  We
could always allow ALL languages you specify and not be explicit about it? (i.e.
if the word is not found in both Swedish and English, then it is marked as
misspelled).

I can try and do another patch without using corba/ORBit/bonobo if you like.
Comment 17 Martyn Russell 2004-10-19 20:12:24 UTC
Created attachment 32789 [details] [review]
Patch to use aspell directly.

I think this patch is much better than the Gnome Spell patch personally.

Also, when you set the language, you use a string in the format of "en_GB"
instead of "en" like with Gnome Spell.	I have made it use the $LANG
environment variable and if not, fall back to "en_US" for this patch.
Comment 18 Brian Skahan 2004-10-19 22:25:22 UTC
Martyn: very nice, works well here.
Comment 19 Marinus Schraal 2004-10-19 22:49:37 UTC
Using enchant here would probably be the right thing to do
(http://www.abiword.org/enchant/) instead of relying on aspell directly.

gtk-spell in cvs or with patch & gnome-spell with patch already use enchant as
backend.
Comment 20 Michael Schlüter 2004-11-05 15:49:52 UTC
Martyn: Is you patch done or is there something missing? I would love to see
spell checking in gossip as soon as possible. So if it is not ready for the
gossip cvs what features are missing?

And what is with the comment from foser about using enchant instead of aspell?
Comment 21 Mikael Hallendal 2004-11-05 17:03:31 UTC
From what I can see in the patch we need a couple of things before being done:

1) We need to be able to popup a dialog with suggested replacements.

2) Look into using enchant.

3) Need to make an option to turn spell checking on/off

4) Break the checking code out into it's own file and disable the aspell/enchant 
   calls in there instead of putting lots of #ifdefs all over the code. (for 
   example gossip-spell.[ch] and call that all the time and if we don't have the 
   spell checking layer (or have spell checking turned off) we just return that 
   all words are correctly spelled
Comment 22 Martyn Russell 2004-11-05 18:44:36 UTC
I looked into enchant briefly.

Advantages:
    * Supports multiple backends which has the benefit of providing the best
from the selection of installed dictionaries.
    * Has a pretty clean API from what I can see.

Disadvantages:
    * It is another dependency for Gossip and ASpell is usually already
installed on most systems.

The backends it supports are:
    * Aspell/Pspell (intended to replace Ispell)
    * Ispell (old and could be interpreted as defacto standard)
    * MySpell (an OOo project, also used by Mozilla)
    * Uspell [primarily Yiddish, Hebrew, and Eastern European languages - hosted
in AbiWord's CVS under the module "uspell"]
    * Hspell [Hebrew]


I did install libenchant and it has a pkgconfig .pc file, so adding it to the
list of libraries Gossip uses should be quick and painless.

Personally though, I think we should get something going with aspell first and
then move to use enchant if it suits.

Using aspell is incredibly easy and quick to do and if we have a gossip-spell
module anyway, we can create the functions for the gossip-chat modules to use
and simply change the back end later if needs be.

I'm not sure if I will get to it this week end, but I will do another patch
which does 1), 3) and 4) soon.
Comment 23 Mikael Hallendal 2004-11-05 20:01:14 UTC
Just a comment:

First of all I'm fine with finishing the aspell backend first and later switch
to enchant if that's easier. 

I just wanted to say that if gnome-spell/gtk-spell already use enchant it's
going to already be in the dependency chain for those who want spell checking.
Any possibility of making gnome-spell do what we want and use that?

Anyway, these are just thoughts for the future. Please feel free to go ahead
with the aspell solution if it will be less work.
Comment 24 Martyn Russell 2004-11-06 09:04:12 UTC
On their site they do have a patches to get GtkSpell/Gnome-Spell working with
enchant.
Comment 25 Martyn Russell 2004-11-10 09:21:55 UTC
Created attachment 33630 [details] [review]
Patch to use Aspell with suggestions

This patch adds a "Check Word Spelling" item to the context menu when right
clicking on a misspelled word and shows a dialog with a list of suggested words
to correct the spelling.

The user can also turn the spell checking on or off in the preferences.
Comment 26 Martyn Russell 2005-01-20 19:36:45 UTC
Comment on attachment 33630 [details] [review]
Patch to use Aspell with suggestions

Broken due to changes in CVS over the past few months
Comment 27 Martyn Russell 2005-01-20 20:21:51 UTC
Created attachment 36304 [details] [review]
Updated my last patch so it builds on CVS HEAD.

Any chance we can get this patch OK'd for Gossip 0.9?


Also, for some reason CVS HEAD doesn't build the marshalls for me?  I had to
add the line:

+GLIB_GENMARSHAL = $(shell pkg-config glib-2.0 --variable=glib_genmarshal)

I had to change Makefile.am to use $(GLIB_GENMARSHAL) instead of
%GLIB_GENMARSHAL% too.
Comment 28 Mikael Hallendal 2005-01-20 21:44:16 UTC
Checked in this, did some changes:

1) Removed the accidently included gnomemeeting stuff

2) Fixed static function names in gossip-spell-dialog. should be
spell_dialog_foo,  the dialog part where missing on a few functions.

3) Set the encoding to utf-8 on aspell.

4) Changed so that it was Enable spell check rather than disabling.

5) Added schema entry for the gconf key.

I think we need to make it configurable other than just the locale to which
language to spell check to. For example I speak mostly in english but have
swedish locale.


Comment 29 Guillaume Desmottes 2005-07-28 21:40:45 UTC
*** Bug 311525 has been marked as a duplicate of this bug. ***