Spell Check

ub
ubersoft
Posts: 133
Joined: Sun Nov 14, 2010 3:54 am
Platform: Linux

Tue Aug 27, 2013 7:48 pm Post

... you might be my hero.

Bd
Bdillahu
Posts: 54
Joined: Wed May 25, 2011 3:36 am
Platform: Mac, Win + Linux
Location: Atlanta, GA
Contact:

Wed Aug 28, 2013 2:30 am Post

Thank you so much for this! Took a couple of try's (my mistake rebuilding the *.rws stuff), but it works!

Ubuntu 64bit

ne
neillydun
Posts: 5
Joined: Thu Aug 29, 2013 9:09 am
Platform: Linux

Thu Aug 29, 2013 9:17 am Post

I went through the very detail procedure fromthe other thread (thanks), but I keep getting an error when trying to generate the 32bit dictionary files.

Code: Select all

aspell: error while loading shared libraries: libaspell.so.15: wrong ELF class: ELFCLASS64


It seems the aspell bin, from the 32 bit debian package won't run on my system (Ubuntu 12.10) even though i have the 32 bit library support installed (ia32-libs).

Anyone have any ideas? Or even had it running on 12.10?


Cheers.

ed
edf
Posts: 99
Joined: Thu Oct 19, 2006 7:45 pm
Platform: Linux
Location: New York, NY

Thu Aug 29, 2013 11:00 pm Post

This error indicates that you are running the 32-bit version of the aspell utility, but it is trying to load or link to the 64-bit libraries.

In order to run the 32-bit executables (to generate 32-bit dictionaries), you have to set the environment variables AC_CONF, LD_LIBRARY_PATH, and PATH.

Example:

Code: Select all

export LD_LIBRARY_PATH="/usr/share/scrivener/lib"
export PATH="/usr/share/scrivener/bin:$PATH"
export AC_CONF="/usr/share/scrivener"
sudo /usr/sbin/aspell-autobuildhash --dry-run  --force 2>&1 | grep zcat | sed -e 's/var\/lib/usr\/share\/scrivener\/lib/' -e 's/usr\/lib/usr\/share\/scrivener\/lib/' > /tmp/gen_32_aspell_dicts.sh
chmod +x /tmp/gen_32_aspell_dicts.sh
sudo /tmp/gen_32_aspell_dicts.sh


It sounds like either AC_CONF or LD_LIBRARY_PATH is not set correctly when you are generating the dictionaries -- I'd mess around with those to try getting it to work. Also, use LD_DEBUG=libs in order to see where the libraries are being loaded from.

Code: Select all

export LD_DEBUG="libs"

ne
neillydun
Posts: 5
Joined: Thu Aug 29, 2013 9:09 am
Platform: Linux

Fri Aug 30, 2013 6:49 am Post

Thanks for the help. That allowed me to create the dictionary files. I can now see 3 English dictionary options in my spell-checking section, but its not doing any spell-checking...ho-hum.

But you are a scholar and a gentleman for providing the help you have :)

ed
edf
Posts: 99
Joined: Thu Oct 19, 2006 7:45 pm
Platform: Linux
Location: New York, NY

Fri Aug 30, 2013 7:12 am Post

Ever have been ;)

Make sure, when you start scrivener, that it is using the 32-bit libraries and support files (especially the dictionaries).

This requires that the ASPELL_CONF environment variable be set to /usr/share/scrivener . I put the modifications to /usr/share/scrivener/bin/scrivener.sh in the other thread, but here they are again:

Code: Select all

bindir=`dirname "$me"`
libdir=`cd "$bindir/../lib" ; pwd`
LD_LIBRARY_PATH=$libdir
export LD_LIBRARY_PATH
# ======================================
# Add these three lines here:
basedir=`cd "$bindir/.." ; pwd`
ASPELL_CONF="prefix $basedir"
export ASPELL_CONF
# ======================================
unset QT_PLUGIN_PATH
exec "$bindir/Scrivener" ${1+"$@"}   


Also, I added a symlink in /usr/lib/i386-linux-gnu to the 32-bit aspell library. This is the command:

Code: Select all

sudo ln -s /usr/share/scrivener/lib/libpspell.so.15.2.0 /usr/lib/i386-linux-gnu/libpspell.so


...although the 32-bit library directory may be very different on your system. I only had to do this during testing though; the LD_LIBRARY_PATH setting in /usr/share/scrivener/bin/scrivener.sh should take care of this.

ne
neillydun
Posts: 5
Joined: Thu Aug 29, 2013 9:09 am
Platform: Linux

Fri Aug 30, 2013 7:30 am Post

Yeah, i've done all that but still no joy.

Oh well, thanks for the help anyway. Much appreciated.

ed
edf
Posts: 99
Joined: Thu Oct 19, 2006 7:45 pm
Platform: Linux
Location: New York, NY

Fri Aug 30, 2013 7:51 am Post

Hmm.

When I had the choice of dictionaries in scrivener, and there was no actual spell-checking, it was because the 64-bit dictionaries were being used (instead of the 32-bit ones).

Take a look at /usr/share/scrivener/lib/aspell, and make sure the .rws files are not symlinks to /var/lib/aspell. Ideally, there should be 64-bit dictionaries in /var/lib/aspell and 32-bit dictionaries in /usr/share/scrivener/lib/aspell.

Note that the 64-bit aspell can read 32-bit dictionaries (but not vice-versa), so it is possible to just generate 32-bit dictionaries in /var/lib/. These will get overwritten the next time the aspell dictionary packes are upgraded, though.

ne
neillydun
Posts: 5
Joined: Thu Aug 29, 2013 9:09 am
Platform: Linux

Fri Aug 30, 2013 8:56 am Post

Hmm. Maybe I compiled the dictionaries as 64 bit. Would they have the same physiical size as the 32 bit ones? Because the ones i have in my scrivener aspell library are exactly the same size as those in /var/lib/aspell (they aren't simlinks btw)


I'm probably doing something stupid. It is Friday after all.

ne
neillydun
Posts: 5
Joined: Thu Aug 29, 2013 9:09 am
Platform: Linux

Fri Aug 30, 2013 9:27 am Post

Got it!!!

I think the shell script starts of with default environment variables, so the command line exports I made had no real effect and I was using the 64bit aspell to compile the libraries :) So I added the LD_LIBRARY, PATH etc exports you mentioned into the script and I now have red squiggly lines :)


Once again. Thanks for all your help. You are a gentleman, a scholar, and now a connoisseur of fine wines :D

ni
nibor
Posts: 3
Joined: Sat Oct 26, 2013 5:28 am
Platform: Mac + Linux

Sat Oct 26, 2013 5:48 am Post

Hello. Gut no spil cheker.

I understand that you need install 2 things.

I do the terminal dance and copy and paste the command into it.

Nothing seems to happen.

I am running elementary luna (ubuntu 12 something) 32 bit.

Everything else with exception of templates seems to runs really well.

Step by step and I will make you a cake. ;O)

ed
edf
Posts: 99
Joined: Thu Oct 19, 2006 7:45 pm
Platform: Linux
Location: New York, NY

Mon Oct 28, 2013 6:46 pm Post


ur
urasni
Posts: 5
Joined: Thu Oct 31, 2013 4:27 pm
Platform: Linux

Thu Oct 31, 2013 4:31 pm Post

I've tried all of this but no dice. Still not seeing any spell checking going on. No error messages, but no spell checking either. :(

Ubuntu 13.10 64bit

Is there any way of checking what scrivener is actually using in terms of dictionaries etc. It gives me the option to select dictionaries so that bit looks to have worked. I have to admit to being at a loss right now

ed
edf
Posts: 99
Joined: Thu Oct 19, 2006 7:45 pm
Platform: Linux
Location: New York, NY

Thu Oct 31, 2013 6:53 pm Post

I do no know of any way to list the location of dictionaries being used by Scrivener.

The ASPELL_CONF variable can be used to override pretty much all of aspell's configuration. See http://aspell.net/0.50-doc/man-html/4_Customizing.htmlfor the details.

Basically, there are two possible problems with aspell:

a) the wrong dictionary location is being used
(i.e. /var/lib/aspell instead of /usr/share/scrivener/lib/aspell)
b) the dictionaries are 64-bit instead of 32-bit

You can verify a) by simply moving the dictionary files and seeing if they disappear from the preferences (e.g. mv /var/lib/aspell /var/lib/aspell.old; mkdir /var/lib/aspell). If you find the dictionaries are being read from /var/lib, use ASPELL_CONF to override this.

If the correct location is being used, rebuild the dictionaries in /usr/share/scrivener as follows:

Code: Select all

echo '#!/bin/sh' > /tmp/gen_32_aspell_dicts.sh
echo "ASPELL_CONF='prefix /usr/share/scrivener'" >> /tmp/gen_32_aspell_dicts.sh
echo 'PATH="/usr/share/scrivener/bin:$PATH"' >> /tmp/gen_32_aspell_dicts.sh
echo export PATH ASPELL_CONF >> /tmp/gen_32_aspell_dicts.sh
chmod +x /tmp/gen_32_aspell_dicts.sh
sudo /usr/sbin/aspell-autobuildhash --dry-run  --force 2>&1 | grep zcat | sed -e 's/var\/lib/usr\/share\/scrivener\/lib/' -e 's/usr\/lib/usr\/share\/scrivener\/lib/' >> /tmp/gen_32_aspell_dicts.sh
sudo bash /tmp/gen_32_aspell_dicts.sh


This is the same command as in the step-by=step post, only it has been modified to use the .deb package path instead of the tarball path.

ur
urasni
Posts: 5
Joined: Thu Oct 31, 2013 4:27 pm
Platform: Linux

Fri Nov 01, 2013 11:56 am Post

Done it. I just uninstalled everything and started again this time taking extra care over each step. I also added:

Code: Select all

echo 'LD_LIBRARY_PATH="/usr/share/scrivener/lib"' >> /tmp/gen_32_aspell_dicts.sh
echo 'AC_CONF="/usr/share/scrivener"' >> /tmp/gen_32_aspell_dicts.sh
to the dictionary fix script generator.
I also added the AC_CONF directive to the scrivener,sh launch script as well. Not sure if they made a difference but it worked for me so I'm not complaining! I think the AC_CONF thing is superfluous but I definitely needed the LD_LIBRARY_PATH export as it was picking up the 64 bit libs :)

Anyway - it's all good now! Thanks for your help.