From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Wordingham Newsgroups: gmane.emacs.help Subject: Re: correcting word groups (general spelling question) Date: Wed, 1 Jul 2015 04:46:55 +0100 Message-ID: <20150701044655.63e6e432@JRWUBU2> References: <87zj3gwxhb.fsf@nl106-137-147.student.uu.se> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1435722448 8534 80.91.229.3 (1 Jul 2015 03:47:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 1 Jul 2015 03:47:28 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jul 01 05:47:20 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZA8zX-0002AF-HR for geh-help-gnu-emacs@m.gmane.org; Wed, 01 Jul 2015 05:47:19 +0200 Original-Received: from localhost ([::1]:49514 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZA8zW-0002S3-QR for geh-help-gnu-emacs@m.gmane.org; Tue, 30 Jun 2015 23:47:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55018) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZA8zM-0002Pj-Mk for help-gnu-emacs@gnu.org; Tue, 30 Jun 2015 23:47:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZA8zJ-0005xY-Gt for help-gnu-emacs@gnu.org; Tue, 30 Jun 2015 23:47:08 -0400 Original-Received: from know-smtprelay-omc-2.server.virginmedia.net ([80.0.253.66]:53601) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZA8zJ-0005xK-7y for help-gnu-emacs@gnu.org; Tue, 30 Jun 2015 23:47:05 -0400 Original-Received: from JRWUBU2 ([81.103.224.4]) by know-smtprelay-2-imp with bizsmtp id mrn21q00206JmVd01rn2ko; Wed, 01 Jul 2015 04:47:02 +0100 X-Originating-IP: [81.103.224.4] X-Spam: 0 X-Authority: v=2.1 cv=RLtOZNW+ c=1 sm=1 tr=0 a=pLuj3OkTrmEUIJBpyvkqVg==:117 a=pLuj3OkTrmEUIJBpyvkqVg==:17 a=Fj0c77JwVQQA:10 a=NLZqzBF-AAAA:8 a=kj9zAlcOel0A:10 a=mP9ZyZMHAAAA:8 a=0zYSRFtDnuFUPowzRNgA:9 a=CjuIK1q_8ugA:10 In-Reply-To: <87zj3gwxhb.fsf@nl106-137-147.student.uu.se> X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.10; i686-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.0.253.66 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:105352 Archived-At: On Wed, 01 Jul 2015 02:08:32 +0200 Emanuel Berg wrote: > Yuri D'Elia writes: > > > If I add Kitteh to the dictionary, I will obviously > > allow Kitteh to roam free in my text, which I don't > > want. I really want to lean "Hello Kitteh" instead, > > and also give auto-correct suggestions based on this > > specific meaning, and not on the individual word. > > You can do it like this: > > (setq ispell-skip-region-alist > (append ispell-skip-region-alist '(("Hello" . "Kitteh")) )) No you can't. It would skip all of, "Hello James. We noq go around saying, 'Hello Kitteh'.". "Noq" is a typo for "now". > However, I consider this over-engineering. How many > such combinations to you have? > > Why not just add "Kitteh"? > > Are you really that worried that will appear instead > of the correct spelling? A better example is "fro", which only appears in "to and fro". "Fro" is a common typo for "for" and "from". Hunspell seems to have a method of handling these words. It consists of the qualifier -r on hunspell(1) and WARN in the affix file (see hunspell(4)), along with a qualifier on the word itself in the dictionary file. I haven't tried it, but presumably it relies on the author being careless rather than ignorant of spelling. Another approach is to move these words from the domain of spell-checking to that of grammar-checking. It looks as though the LibreOffice add-on langtool allows one to add grammar rules that would check that Kitteh is preceded by Hello, and that 'fro' occurs in 'to and fro'. Richard.