User avatar
ab1jx
Posts: 449
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: 8393
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: 449
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: 1710
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: 449
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: 1710
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: 449
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: 1710
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: 449
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 74 times

Return to “General discussion”

Who is online

Users browsing this forum: Dangermoth, mattmiller, procount and 40 guests