From: Eric Smith <es@fruitcom.com>
To: zsh-users@zsh.org
Subject: Re: spell check on the command line
Date: Mon, 27 Oct 2014 12:18:42 +0100 [thread overview]
Message-ID: <mailbox-26804-1414408655-837462@pepper.0.0.200> (raw)
In-Reply-To: <141025110602.ZM23153@torch.brasslantern.com>
Thanks Bart.
All works first time.
(Perhaps one day I will actually become literate and learn to spell, perhaps not?)
ciao
Eric Smith
Bart Schaefer wrote on Sat-25-Oct 14 8:06PM
> On Oct 25, 10:17am, Eric Smith wrote:
> }
> } I cannot find the application "suggest" anywhere, what do you
> } suggest?
>
> No pun intended?
>
> If you have ispell or aspell you can run them with the -a option and
> parse the output. I'm sure there's a way to do the same with hunspell
> but I'm not familiar with the details.
>
> It'd be something like
>
> suggest() {
> local tag misspelt count offset suggestions
> aspell -a |
> while read tag misspelt count offset suggestions
> do
> [[ $tag = \& ]] && print -R $misspelt ${${(s:, :)suggestions}[1]}
> done
> }
>
> Beware that aspell might suggest that a word be split into two words,
> rather than corrected to a different single word, so you probably want
> to adjust the above to filter ${(s:, :)suggestions} before deciding
> which one to print.
>
> --
> Barton E. Schaefer
--
Eric Smith
prev parent reply other threads:[~2014-10-27 11:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-24 10:54 Eric Smith
2014-10-24 15:36 ` Bart Schaefer
2014-10-24 21:19 ` Eric Smith
2014-10-25 7:24 ` Bart Schaefer
2014-10-25 8:17 ` Eric Smith
2014-10-25 18:06 ` Bart Schaefer
2014-10-27 11:18 ` Eric Smith [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=mailbox-26804-1414408655-837462@pepper.0.0.200 \
--to=es@fruitcom.com \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).