From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7306 invoked by alias); 25 Oct 2014 18:06:03 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 19296 Received: (qmail 7218 invoked from network); 25 Oct 2014 18:06:02 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-CMAE-Score: 0 X-CMAE-Analysis: v=2.1 cv=FrayJNvv c=1 sm=1 tr=0 a=FT8er97JFeGWzr5TCOCO5w==:117 a=kj9zAlcOel0A:10 a=q2GGsy2AAAAA:8 a=oR5dmqMzAAAA:8 a=-9mUelKeXuEA:10 a=gxPROXFG7OqhB-ZhAv4A:9 a=CjuIK1q_8ugA:10 From: Bart Schaefer Message-id: <141025110602.ZM23153@torch.brasslantern.com> Date: Sat, 25 Oct 2014 11:06:02 -0700 In-reply-to: Comments: In reply to Eric Smith "Re: spell check on the command line" (Oct 25, 10:17am) References: <141024083614.ZM20933@torch.brasslantern.com> <141025002453.ZM22210@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: spell check on the command line MIME-version: 1.0 Content-type: text/plain; charset=us-ascii 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