You are not logged in.

#1 2016-04-17 17:19:38

Sector11
Conky 1.9er Mod Squid
From: Upstairs
Registered: 2015-08-20
Posts: 6,591

HowTo: Nano and spellchecking c/w suggestions

If you do none of this and you invoke the spell checker nano only to get an error just install: 'spell', I have no idea if it uses British or US spelling though.  It doesn't pickup differences with colour or color, neighbour or neighbor, tyre or tire - so maybe both OR I have both dictionaries installed not knowing what 'spell' uses.

With 'spell' there is no spelling suggestions.  Not cool!  OK, so I mistype or spell "circumlocution" wrong it doesn't tell me what the correct spelling is ... that's not a lot of help.

Nano and spellchecking c/w suggestions

First up: nano with aspell
2016_04_17_10_52_04_Scrot11.jpg

sudo apt-get install aspell

There is a doc file as well: aspell-doc if you are interested.

Install an aspell dictionary of your choice.  I did a quick sort by the "language" vs the aspell name.
Otherwise Spanish (aspell-es) is listed under "E":

aspell-am            Amharic
aspell-ar            Arabic
aspell-ar-large      Arabic (large)
aspell-hy            Armenian
aspell-eu-es         Basque (Euskera)
aspell-bg            Bulgarian
aspell-bn            Bengali (bn)
aspell-br            Breton
aspell-ca            Catalan
aspell-hr            Croatian
aspell-cs            Czech
aspell-da            Danish - Comprehensive Dictionary (DSDO)
aspell-nl            Dutch
aspell-en            English
aspell-eo            Esperanto
aspell-eo-cx7        Esperanto, "cx" 7bit encoding
aspell-et            Estonian
aspell-fo            Faroese
aspell-fr            French
aspell-gl-minimos    Galician (minimos)
aspell-de            German
aspell-de-alt        German (old spelling)
aspell-el            Greek
aspell-gu            Gujarati (gu)
aspell-ga            Irish (Gaeilge)
aspell-he            Hebrew
aspell-hi            Hindi (hi)
aspell-hu            Hungarian
aspell-is            Icelandic
aspell-it            Italian
aspell-kk            Kazakh
aspell-kn            Kannada (kn)
aspell-ku            Kurdish
aspell-lt            Lithuanian (LT)
aspell-lv            Latvian
aspell-ml            Malayalam (ml)
aspell-mr            Marathi (mr)
aspell-no            Norwegian
aspell-or            Oriya (or)
aspell-fa            Persian
aspell-pl            Polish
aspell-pt            Portuguese (old package)
aspell-pt-br         Portuguese (Brazilian)
aspell-pt-pt         Portuguese (European)
aspell-pa            Punjabi (pa)
aspell-ro            Romanian
aspell-ru            Russian
aspell-sk            Slovak
aspell-sl            Slovenian
aspell-hsb           Sorbian (Upper)
aspell-es            Spanish
aspell-sv            Swedish
aspell-ta            Tamil (ta)
aspell-te            Telugu (te)
aspell-tl            Tagalog
aspell-uk            Ukrainian
aspell-uz            Uzbek
aspell-cy            Welsh

I grabbed English and Spanish with the doc file:

sudo apt-get install aspell-en aspell-es aspell-doc

Now you have to edit the file /etc/nanorc as root:

sudo nano /etc/nanorc

Find and uncomment this line:

#set speller "aspell -x -c"

like this:

set speller "aspell -x -c"

save and quit nano. ie: [Ctrl]+x +y[enter]

Now, while editing a text file hitting [Ctrl]+t ( ^t ) will launch spellchecking with suggestions.

Next up: nano with hunspell
I started with aspell earlier because of the 'aspell' line commented out in the /etc/nanorc file.  But you can just as easily use hunspell and a hunspell dictionary - like: hunspell-en-ca (English - Canadian)  My choice.

Again edit /etc/nanorc as root and add a line:

## Use this spelling checker instead of the internal one.  This option
## does not properly have a default value.
##
# set speller "aspell -x -c"
set speller "hunspell -x -c"

2016_04_17_11_38_46_Scrot11.jpg
Looks and acts (keys to use) different than aspell but maybe you prefer the hunspell dictionaries over the aspell ones.  Options are always good.

I am having problems with ispell - just cannot get it to work

Next up: nano and commandline spelling choices:

With nothing active in /etc/nanorc:

## Use this spelling checker instead of the internal one.  This option
## does not properly have a default value.
##
# set speller "aspell -x -c"
# set speller "myspell -x -c"
# set speller "hunspell -x -c"
# set speller "ispell -x -c"

There is a commandline option to get to spell checking working:
"nano -s <prog> </path/to/filename> -or-
"nano --speller=prog </path/to/filename>

nano -s aspell ~/test-spelling.txt
- - - doesn't work for me: [ Spell checking failed: Error invoking "aspell": Unknown error 593 ]

iMBeCil wrote in Post #3 of this thread:

nano -s "/usr/bin/aspell check" sometexfile

nano -s myspell ~/test-spelling.txt
- - - doesn't work for me: [ Spell checking failed: Error invoking "myspell": Unknown error 593 ]

nano -s hunspell ~/test-spelling.txt
- - - works as advertised.  <<--- mine by choice now.
- - - I'll reinitialize that in  /etc/nanorc just to be sure it works and I get a Canadian spelling dictionary.

Last edited by Sector11 (2016-04-17 22:23:13)


The sun will never set if you keep walking towards it. - my son
Being positive doesn't understand physics.
_______________________________
Debian 10 Buster = SharpBang ♯!

Offline

#2 2016-04-17 17:21:30

Sector11
Conky 1.9er Mod Squid
From: Upstairs
Registered: 2015-08-20
Posts: 6,591

Re: HowTo: Nano and spellchecking c/w suggestions

Anyone know of a way to have nano check the English spelling in one file and Spanish spelling in another?

Check out iMBeCil's reply in the next post.
Yes it is possible.  smile

Last edited by Sector11 (2016-04-17 22:25:22)


The sun will never set if you keep walking towards it. - my son
Being positive doesn't understand physics.
_______________________________
Debian 10 Buster = SharpBang ♯!

Offline

#3 2016-04-17 19:46:36

iMBeCil
WAAAT?
From: Edrychwch o'ch cwmpas
Registered: 2015-09-29
Posts: 767

Re: HowTo: Nano and spellchecking c/w suggestions

@Sector, to answer your questions:

Sector11 wrote:

nano -s aspell ~/test-spelling.txt
- - - doesn't work for me: [ Spell checking failed: Error invoking "aspell": Unknown error 593 ]

Start it like:

nano -s "/usr/bin/aspell check" sometexfile

(probably it would work without '/usr/bin/' part.)

Sector11 wrote:

Anyone know of a way to have nano check the English spelling in one file and Spanish spelling in another?

nano -s "/usr/bin/aspell -l es check" jaja

It will check against Spanish language. Now, you can make two aliases, one for Engrish, other for Spanich smile


Of course, don't forget

$ sudo apt-get install aspell-es

I presume, other spell checkers behaves similar; just check the command options in manual.

I didn't try other spell checkers because I don't have them installed. But if you really need it, I can install them and find the commands. Just let me know.


Postpone all your duties; if you die, you won't have to do them ..

Offline

#4 2016-04-17 20:33:50

Sector11
Conky 1.9er Mod Squid
From: Upstairs
Registered: 2015-08-20
Posts: 6,591

Re: HowTo: Nano and spellchecking c/w suggestions

OH I have aspell-es installed.  smile

THANK YOU!  You're better than the nano man page

/etc/nanorc reads:

## Use this spelling checker instead of the internal one.  This option
## does not properly have a default value.
##
#set speller "aspell -x -c"
# set speller "myspell -x -c"
set speller "hunspell -x -c"
# set speller "ispell -x -c"

And now these work as well:
nano -s "/usr/bin/aspell check" sometexfile
nano -s "aspell check" sometexfile
nano -s "/usr/bin/aspell check" sometexfile
nano -s "aspell check" sometexfile
nano -s "/usr/bin/aspell -l es check" jaja
nano -s "aspell -l es check" jaja

They also work with a single ' vs the double "  Very nice.

ispell still doesn't work for me - no big loss.

So now I have Spanish via aspell and Canadian English via hunspell
Cool beans

I'll have to edit my OP after dinner.

Thank you iMBeCil - WAAAT a great guy!
I has Engrish anne Spanich spelchekrs now.  lol

PS:  Getting to like nano more each day.


The sun will never set if you keep walking towards it. - my son
Being positive doesn't understand physics.
_______________________________
Debian 10 Buster = SharpBang ♯!

Offline

#5 2016-04-17 21:09:34

iMBeCil
WAAAT?
From: Edrychwch o'ch cwmpas
Registered: 2015-09-29
Posts: 767

Re: HowTo: Nano and spellchecking c/w suggestions

You're welcome Sector.

Sector11 wrote:

You're better than the nano man page

This is the nicest thing anyone ever said to me. Or the weirdest? big_smile big_smile


Postpone all your duties; if you die, you won't have to do them ..

Offline

#6 2016-04-17 22:14:31

Sector11
Conky 1.9er Mod Squid
From: Upstairs
Registered: 2015-08-20
Posts: 6,591

Re: HowTo: Nano and spellchecking c/w suggestions

OK, we'll strike page - from now on you're iMBeCil, NanoMan

I meant it as 'nice' but weird is good too!    devil


The sun will never set if you keep walking towards it. - my son
Being positive doesn't understand physics.
_______________________________
Debian 10 Buster = SharpBang ♯!

Offline

#7 2016-04-17 23:08:12

Sector11
Conky 1.9er Mod Squid
From: Upstairs
Registered: 2015-08-20
Posts: 6,591

Re: HowTo: Nano and spellchecking c/w suggestions

Thunar custom actions and nano:
NngKgQWv.jpg

Basic:
Name:  Nano - English (anything you want)
Description: anything you want
Command: terminator --geometry=900x950+30+20 -b -x nano %f

Basic: (for a second language)
Name:  Nano - Español (anything you want)
Description: anything you want
Command: terminator --geometry=900x950+30+20 -b -x nano -s "aspell -l es check" %f

Appearance Conditions: (for both)
Check "Text file"
Uncheck all others.


The sun will never set if you keep walking towards it. - my son
Being positive doesn't understand physics.
_______________________________
Debian 10 Buster = SharpBang ♯!

Offline

#8 2016-04-18 17:31:36

iMBeCil
WAAAT?
From: Edrychwch o'ch cwmpas
Registered: 2015-09-29
Posts: 767

Re: HowTo: Nano and spellchecking c/w suggestions

Sector11 wrote:

OK, we'll strike page - from now on you're iMBeCil, NanoMan

Sector, Sector ... Are you a wicked man or not?  devil You want me to declare myself the NanoMan, aren't you? And you will claim that you didn't see what connotation this makes? I have two kids, Sector! Two kids! And you call me NanoMan? Really?  big_smile  big_smile  big_smile  big_smile

Moar like HugeHungMan then, right? big_smile big_smile big_smile

Good that I'm careful man, and I dodged your bullet big_smile big_smile

Well, after lots of thinking, I think it would be fair and the most accurate to call me ManMan monkey
I am a man, and I very often read then man pages ... And manuals as well. And I have one woman.


Postpone all your duties; if you die, you won't have to do them ..

Offline

#9 2016-04-18 17:43:04

iMBeCil
WAAAT?
From: Edrychwch o'ch cwmpas
Registered: 2015-09-29
Posts: 767

Re: HowTo: Nano and spellchecking c/w suggestions

Sector11 wrote:

ispell still doesn't work for me - no big loss.

BTW, it does work for me:

$ nano -s ispell somefile

Perhaps, you don't have dictionaries installed? I found available dicts in

$ ll /usr/lib/ispell/
total 4
lrwxrwxrwx 1 root root  30 Mar  4 09:01 american.aff -> ../../share/ispell/english.aff
lrwxrwxrwx 1 root root  29 Jun 22  2015 american.hash -> /var/lib/ispell/american.hash
lrwxrwxrwx 1 root root  30 Mar  4 09:01 british.aff -> ../../share/ispell/english.aff
lrwxrwxrwx 1 root root  28 Jun 22  2015 british.hash -> /var/lib/ispell/british.hash
lrwxrwxrwx 1 root root  36 Feb 26  2014 default.aff -> /etc/dictionaries-common/default.aff
lrwxrwxrwx 1 root root  37 Feb 26  2014 default.hash -> /etc/dictionaries-common/default.hash
-rw-r--r-- 1 root root 197 Aug 31  2015 README.select-ispell

I see that I have (only) two dictionaries, and I can use them with nano as:

$ nano -s "ispell -d british" sometextfile

or

$ nano -s "ispell -d american" sometextfile

HTH


Postpone all your duties; if you die, you won't have to do them ..

Offline

#10 2016-04-18 19:01:14

Sector11
Conky 1.9er Mod Squid
From: Upstairs
Registered: 2015-08-20
Posts: 6,591

Re: HowTo: Nano and spellchecking c/w suggestions

Ahhhhhhhhhhh but ispell has a different way to call it.  I didn't know that, it wasn't explained in the man pages.

And yes, both 'british' and 'british-insane' work - BUT strangely enough they don't 'correct' some misspelled words.  Both color and colour - neighbor and neighbour are recognized.  Weird.

You obviously underestimate the power of NanoMan.  He's a cousin to AntMan, and they have both been known to:

man man

Oh and by the way, I have three kids and they are men  ... ... ...   cool

And besides things are relative.  imagine what a nano is to a yocto.  OH MY GOD HUGE!


The sun will never set if you keep walking towards it. - my son
Being positive doesn't understand physics.
_______________________________
Debian 10 Buster = SharpBang ♯!

Offline

#11 2016-04-18 19:25:46

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,258
Website

Re: HowTo: Nano and spellchecking c/w suggestions

Way better than viman.

Offline

#12 2016-04-18 21:30:22

iMBeCil
WAAAT?
From: Edrychwch o'ch cwmpas
Registered: 2015-09-29
Posts: 767

Re: HowTo: Nano and spellchecking c/w suggestions

Or Heman. I wonder if his wife is Shewoman?


Postpone all your duties; if you die, you won't have to do them ..

Offline

#13 2016-04-18 21:59:46

Sector11
Conky 1.9er Mod Squid
From: Upstairs
Registered: 2015-08-20
Posts: 6,591

Re: HowTo: Nano and spellchecking c/w suggestions

Nope - Sheman.  And that's as far as I'm going with that one.   angel


The sun will never set if you keep walking towards it. - my son
Being positive doesn't understand physics.
_______________________________
Debian 10 Buster = SharpBang ♯!

Offline

Board footer

Powered by FluxBB