User avatar
ab1jx
Posts: 702
Joined: Thu Sep 26, 2013 1:54 pm
Location: Heath, MA USA
Contact: Website

Is there a little GUI Spell checker program?

Sun Jan 14, 2018 1:32 am

I'm constantly typing a word that doesn't look right, or it sets off Firefox's misspelled word detector. So I bring up Libre Office Writer just to look up 1 word. I want to see the list of likely possibilities and be able to double-click on the one that's right. Then highlight it, ctrl-c to copy and paste it back where I came from.

Just counting, there's 1 click to open Libre Office Writer. Tools -> Spelling and Grammar, 2 clicks, Double-click a selection, click OK that the spellcheck is complete. 4 clicks. Highlight the word and copy, ctrl-a ctrl-c. Ctrl-q to quit, click close without saving, 5 clicks. And 3 ctrl-somethings. To fix 1 word.

If I remember right the spell check happens in a GTK widget which would work the same way if you stuck it in a minimal application. You don't need the bulk of Libre Office Writer. If you've got a lot else open so memory's tight that's probably going to be slow to open as something else gets swapped out. I seem to do this a few times a day. Has anybody found a more minimal approach? I use a Pi a lot, I might use a bigger computer a couple times a month. I'm all for finding little efficient programs that deal well with the 1 GB memory limitation. Remember having a 640KB limitation? :) No swap then at all, 8086/88 days.

Heater
Posts: 10294
Joined: Tue Jul 17, 2012 3:02 pm

Re: Is there a little GUI Spell checker program?

Sun Jan 14, 2018 3:07 am

Use the vim editor. Small, fast, has a spell checker:
https://www.linux.com/learn/using-spell-checking-vim

Yes, I remember the 640K limit. It was a terrible time that required all kind of work arounds. Like LIM memory expansion boards and building programs with overlays.

User avatar
ab1jx
Posts: 702
Joined: Thu Sep 26, 2013 1:54 pm
Location: Heath, MA USA
Contact: Website

Re: Is there a little GUI Spell checker program?

Sun Jan 14, 2018 3:51 am

Umm, I don't really like vim, I'm a Joe editor kind of guy, works like Wordstar and the Borland editors. I could use ispell or aspell with it. But I started looking for something GUI.

This is the widget I'm thinking of http://gtkspell.sourceforge.net/ which looks like this:
Image

It actually shows up in Synaptic but as libgtkspell, not a standalone application. If it will work with Glade it might be possible to put something together. Something dockable to live in Lxpanel you could pop up with a single click would be good. Maybe I could put together enough GTK without Glade. Or use Glade to get it working then unglade it so it works without it. I was wondering if there was already something like that. I guess it's a matter of someone realizing the usefulness of something that's not a word processor. The demonstration program might be sufficient, I'll look.

User avatar
Paeryn
Posts: 2224
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: Is there a little GUI Spell checker program?

Sun Jan 14, 2018 4:46 am

libgtkspell allows you to add spell-checking to a GtkTextView, you attach it to a GtkTextView object and it handles all the highlighting and right-click menu of words.

Basic example of use here (uses gkt+3 and gtkspell-3, you don't need to compile the gtkspell library in the git, use the one in the Raspbian repo) https://github.com/manisandro/gtkspell/ ... s/simple.c
She who travels light — forgot something.

User avatar
ab1jx
Posts: 702
Joined: Thu Sep 26, 2013 1:54 pm
Location: Heath, MA USA
Contact: Website

Re: Is there a little GUI Spell checker program?

Sun Jan 14, 2018 2:44 pm

This road's a little bumpy it seems. I (now) have installed:
ii gir1.2-gtkspell3-3.0 3.0.6-1 armhf GObject introspection data for the GtkSpell library
ii libgtkspell-dev 2.0.16-1.1 armhf Development files for GtkSpell
ii libgtkspell0 2.0.16-1.1 armhf a spell-checking addon for GTK's TextView widget
ii libgtkspell3-3-0 3.0.6-1 armhf spell-checking addon for GTK+'s TextView widget
ii libgtkspell3-3-dev 3.0.6-1 armhf Development files for GtkSpell

In simple.c I replaced:
//#include <gtkspell/gtkspell.h>
#include <gtkspell-3.0/gtkspell/gtkspell.h>

I'm trying to build with
gcc -Wall -Wextra -o ss1 simple.c $(pkg-config gtk+-3.0 --cflags --libs)

And for either gtk2 or 3 I see:
simple.c:(.text+0x64): undefined reference to `gtk_spell_checker_new'
simple.c:(.text+0x7c): undefined reference to `gtk_spell_checker_set_language'
simple.c:(.text+0xe8): undefined reference to `gtk_spell_checker_attach'
collect2: error: ld returned 1 exit status

Like it's not finding a library

(updatedb)
locate libgtkspell | grep .so

/usr/lib/libgtkspell3-3.so
/usr/lib/libgtkspell3-3.so.0
/usr/lib/libgtkspell3-3.so.0.1.0
/usr/lib/libgtkspell.so
/usr/lib/libgtkspell.so.0
/usr/lib/libgtkspell.so.0.0.0

Running ldconfig on /usr/lib didn't seem to help. Maybe I need to update a .pc file to fix the pkg-config magic. Adding -lgtkspell -L/usr/lib made no difference.

I'll probably get it eventually but it's one of those "don't try this at home kids" deals. I don't want to get into the automake stuff, I was hoping to compile 1 C file. But with GTK nothing's ever simple.

Probably this:
locate gtkspell.h
/usr/include/gtkspell-2.0/gtkspell/gtkspell.h
/usr/include/gtkspell-3.0/gtkspell/gtkspell.h

Should have told me that simple.c dates back 3 gtkspell versions and wasn't likely to work out of the box.
Last edited by ab1jx on Sun Jan 14, 2018 3:19 pm, edited 1 time in total.

User avatar
Paeryn
Posts: 2224
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: Is there a little GUI Spell checker program?

Sun Jan 14, 2018 2:54 pm

ab1jx wrote:
Sun Jan 14, 2018 2:44 pm
I'm trying to build with
gcc -Wall -Wextra -o ss1 simple.c $(pkg-config gtk+-3.0 --cflags --libs)
You haven't linked the gtkspell library,

Code: Select all

gcc  -Wall -Wextra -o ss1 simple.c $(pkg-config gtk+-3.0 gtkspell3-3-0 --cflags --libs)
I might have the gtkspell package name wrong there (going off what I remember from last night).
You shouldn't have needed to change the header path in the source code, it worked as it was for me.
She who travels light — forgot something.

User avatar
ab1jx
Posts: 702
Joined: Thu Sep 26, 2013 1:54 pm
Location: Heath, MA USA
Contact: Website

Re: Is there a little GUI Spell checker program?

Sun Jan 14, 2018 5:00 pm

Code: Select all

Package gtkspell3-3-0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtkspell3-3-0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtkspell3-3-0' found
simple.c:3:21: fatal error: gtk/gtk.h: No such file or directory
 #include <gtk/gtk.h>
                     ^
compilation terminated.
There have been a few forks of gtkspell I suspect. And mine came from Sourceforge, not Github. Mine smells old, and the page I found it on says
The latest version is 3.0.9, released on 2016-08-08
Mailing list archives are here: https://sourceforge.net/p/gtkspell/mail ... ell-devel/, nothing since December.

I only have

Code: Select all

/usr/include/gtkspell-2.0/gtkspell/gtkspell.h
/usr/include/gtkspell-3.0/gtkspell/gtkspell.h
they're 1349 and 4040 bytes. No gtkspell.h in /usr/include

I had just started this, hadn't done much with it:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 -->
<interface>
  <requires lib="gtk+" version="3.12"/>
  <object class="GtkWindow" id="window1">
    <property name="can_focus">False</property>
    <child>
      <object class="GtkTextView" id="textview1">
        <property name="visible">True</property>
        <property name="can_focus">True</property>
      </object>
    </child>
  </object>
</interface>
I have a terrible habit of going off on all these diversions, I haven't gotten back to my Motif SDR stuff in a couple months.

User avatar
Paeryn
Posts: 2224
Joined: Wed Nov 23, 2011 1:10 am
Location: Sheffield, England

Re: Is there a little GUI Spell checker program?

Sun Jan 14, 2018 6:21 pm

Yes, 3.0.9-1 is the version in the Raspbian repo and the headers should be in /usr/include/gtkspell-3.0/. I made a slight error in the package name, the final dash should have been a period

Code: Select all

gcc simple.c -o simple $(pkg-config --cflags --libs gtk+-3.0 gtkspell3-3.0)
She who travels light — forgot something.

User avatar
ab1jx
Posts: 702
Joined: Thu Sep 26, 2013 1:54 pm
Location: Heath, MA USA
Contact: Website

Re: Is there a little GUI Spell checker program?

Sun Jan 14, 2018 6:45 pm

Hmm, I've got 3.06-1 but oh well, I'm not up to date.

Yes, this simple little demo does what I'm looking for and it's only 10840 bytes.

Image
Attachments
gtks_ss.png
gtks_ss.png (75.5 KiB) Viewed 592 times

User avatar
ab1jx
Posts: 702
Joined: Thu Sep 26, 2013 1:54 pm
Location: Heath, MA USA
Contact: Website

Re: Is there a little GUI Spell checker program?

Thu Apr 26, 2018 7:05 pm

It also turns out to be a useful little scratchpad area, I find myself using it increasingly. I mostly live in the command-line world with rxvt, mc, Joe. Once in a while I want to get something from that to paste into a web browser to post, my current Firefox doesn't respond at all if I highlight something in an rxvt window and try to paste with a middle-click or shift-insert. I can do a middle-click paste into the spell program, then highlight it in there and do ctrl-C, then paste that into Firefox. Programs like Libre Office Writer work too but this is much less baggage.

Heater
Posts: 10294
Joined: Tue Jul 17, 2012 3:02 pm

Re: Is there a little GUI Spell checker program?

Thu Apr 26, 2018 8:05 pm

I don't know about "little" but have the Chrome browser open all the time. Anything I type into a text box, like this one, gets spell checked.

Or some times I just punch a word into Google search, which soon sets me straight.

All in all, much easier than opening some GUI app spell checker.

User avatar
ab1jx
Posts: 702
Joined: Thu Sep 26, 2013 1:54 pm
Location: Heath, MA USA
Contact: Website

Re: Is there a little GUI Spell checker program?

Thu Apr 26, 2018 8:49 pm

I won't use a browser that tells me I don't need a menu bar. I have Firefox open almost all the time but I have limited patience with Google. I own 2 Android phones, Google's pretty disgusting.

It really is tiny, 10,848 bytes (plus dynamically linked stuff)

I don't have it in a menu, I just type "spell" into any terminal emulator window and it pops up. Anything you type in here gets spell checked too, and you can right click on it to get spelling suggestions. No buttons or menus, and you can resize it.
Attachments
spell.gif
spell.gif (13.94 KiB) Viewed 294 times

Heater
Posts: 10294
Joined: Tue Jul 17, 2012 3:02 pm

Re: Is there a little GUI Spell checker program?

Thu Apr 26, 2018 9:26 pm

I don't understand.
I won't use a browser that tells me I don't need a menu bar. I have Firefox open almost all the time...
I'm typing this into Firefox. I don't see any menu bar anywhere either.
... but I have limited patience with Google. I own 2 Android phones, Google's pretty disgusting.
Well, OK. But spell checking is happening here in Firefox the same as I described for Chrome.
It really is tiny, 10,848 bytes (plus dynamically linked stuff)
That sounds great.

Return to “General discussion”