From: Geoff Kuenning <geoff@cs.hmc.edu>
Cc: agustin.martin@hispalinux.es, 130397@bugs.debian.org,
emacs-devel@gnu.org, k.stevens@ieee.org,
Kenichi Handa <handa@m17n.org>
Subject: Re: Bug 130397
Date: 18 Jan 2005 14:57:05 +0100 [thread overview]
Message-ID: <pnihdleyh5a.fsf@bow.cs.hmc.edu> (raw)
In-Reply-To: <878y6rnhd3.fsf@jurta.org>
> I agree that marking would help ispell.el to decide which dictionary
> to use on a word. However, even without marking users might still prefer
> to check words simultaneously with multiple dictionaries
That's a good point. Unfortunately, the current implementation of
ispell makes it impossible to use two dictionaries simultaneously.
I do recall hearing from one user who used a pipe something like this:
ispell -d language-1 -l | ispell -d language-2 -l ... | sort -uf
but of course that only provides a list of misspelled words, and loses
all the correction capabilities.
Just brainstorming, it probably wouldn't be too hard to write a
postprocessing script for -a mode that turned the output of ispell -a
into something suitable for another ispell. The idea would be that
you feed:
I do not want to acept my bda lueck
and turn the output lines:
@(#) International Ispell Version 3.2.06 08/01/01
*
*
*
*
*
& acept 2 17: accept, adept
*
& bda 9 26: Ada, baa, bad, bea, bida, boa, bra, FDA, Ida
& lueck 1 30: luck
into a line of blanks and misspelled words:
acept bda lueck
which can then be fed into another ispell -a instance. The final
output would be returned to emacs. The pipe would look like:
ispell -a -d language-1 | fixispell-a | ispell -a -d language-2
In fact, this script is so easy I think I'll whip it up right now.
It's called fixispell-a, and it will be in the next ispell release.
Here it is:
#!/bin/sh
#
# $Id: fixispell-a,v 1.1 2005/01/18 13:48:52 geoff Exp geoff $
#
# Copyright 2005, Geoff Kuenning, Claremont, CA.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
# 3. All modifications to the source code must be clearly marked as
# such. Binary redistributions based on modified source code
# must be clearly marked as modified versions in the documentation
# and/or other materials provided with the distribution.
# 4. The code that causes the 'ispell -v' command to display a prominent
# link to the official ispell Web site may not be removed.
# 5. The name of Geoff Kuenning may not be used to endorse or promote
# products derived from this software without specific prior
# written permission.
#
# THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
# Take the output of "ispell -a" and turn it into a line that can be
# fed into another "ispell -a" instance.
#
# Usage:
#
USAGE='Usage: ispell -a <ispell-switches> | fixispell-a | ispell -a ...'
#
# BUGS:
#
# This script is probably not portable to older systems.
#
# $Log: fixispell-a,v $
# Revision 1.1 2005/01/18 13:48:52 geoff
# Initial revision
#
case "$#" in
0)
;;
*)
echo "$USAGE" 1>&2
exit 2
;;
esac
awk 'NR == 1 \
{
next
}
NF == 0 \
{
print line
line = ""
next
}
$1 == "*" || $1 == "+" || $1 == "-" \
{
next
}
$1 == "&" || $1 == "?" || $1 == "#" \
{
if ($1 == "#")
offset = $3 + 0
else
offset = substr($4, 1, length($4) - 1) + 0
if (length(line) < offset)
line = sprintf("%s%*s", line, offset - length(line), "")
line = line $2
next
}
{
print "fixispell-a: unrecognized ispell input line" $0 > "/dev/stderr"
exit(2)
}'
--
Geoff Kuenning geoff@cs.hmc.edu http://www.cs.hmc.edu/~geoff/
If a person is obviously mentally disabled, such as having Down's
syndrome or Alzheimer's, decent people exercise sympathy and
understanding in their interactions. So why, if someone merely has a
low IQ, is he treated with ridicule and contempt?
next prev parent reply other threads:[~2005-01-18 13:57 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <Pine.LNX.4.43.0305140821370.30166-100000@wr-linux02.rki.ivbb.bund.de>
[not found] ` <m3addpd2ur.fsf@dionysos.nib>
[not found] ` <E19HNCh-0000tv-00@fencepost.gnu.org>
[not found] ` <20040517120658.GA6919@agmartin.aq.upm.es>
[not found] ` <E1BQ5z5-0000f4-5u@fencepost.gnu.org>
2004-05-19 11:44 ` Bug 130397 (Was: Emacs - Ispell problem with i[no]german dictionary) Agustin Martin
2004-05-21 8:01 ` Agustin Martin
2004-12-17 12:15 ` Agustin Martin
2004-12-22 12:37 ` Kenichi Handa
2004-12-22 17:13 ` Agustin Martin
2005-01-04 12:50 ` Kenichi Handa
2005-01-04 14:55 ` Bug 130397 Stefan
2005-01-05 2:00 ` Kenichi Handa
2005-01-05 4:42 ` Stefan Monnier
2005-01-05 5:50 ` Kenichi Handa
2005-01-05 14:02 ` Stefan Monnier
2005-01-06 0:44 ` Kenichi Handa
2005-01-06 16:30 ` Ken Stevens
2005-01-06 17:33 ` Stefan Monnier
2005-01-07 0:39 ` Kenichi Handa
2005-01-07 15:48 ` Agustin Martin
2005-01-08 12:31 ` Geoff Kuenning
2005-01-08 12:47 ` David Kastrup
2005-01-08 13:29 ` Miles Bader
2005-01-08 17:15 ` Geoff Kuenning
2005-01-10 4:45 ` Eli Zaretskii
2005-01-10 9:09 ` David Kastrup
2005-01-10 20:16 ` Eli Zaretskii
2005-01-13 7:50 ` Kenichi Handa
2005-01-08 22:39 ` Peter Heslin
2005-01-07 15:36 ` Agustin Martin
2005-01-07 20:29 ` Ken Stevens
2005-01-07 21:27 ` Juri Linkov
2005-01-13 5:59 ` Kenichi Handa
2005-01-18 10:44 ` Juri Linkov
2005-01-18 13:57 ` Geoff Kuenning [this message]
2005-01-19 7:34 ` Juri Linkov
2005-01-19 12:22 ` Geoff Kuenning
2005-04-29 0:29 ` Geoff Kuenning
2005-04-29 8:45 ` Thien-Thi Nguyen
2005-01-18 23:24 ` Kenichi Handa
2005-01-19 7:43 ` Juri Linkov
2005-01-19 12:52 ` Kenichi Handa
2005-01-19 13:08 ` David Kastrup
2005-01-07 15:34 ` Bug 130397 (Was: Emacs - Ispell problem with i[no]german dictionary) Agustin Martin
2005-01-10 13:06 ` Lionel Elie Mamane
2005-01-10 17:16 ` Agustin Martin
2005-01-11 5:16 ` Kenichi Handa
2005-01-11 19:56 ` Agustin Martin
2005-01-11 21:39 ` Lionel Elie Mamane
2005-01-12 7:37 ` Kenichi Handa
2005-01-12 19:17 ` Agustin Martin
2005-01-13 5:53 ` Kenichi Handa
2005-01-11 14:29 ` Richard Stallman
2005-01-12 7:45 ` Kenichi Handa
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=pnihdleyh5a.fsf@bow.cs.hmc.edu \
--to=geoff@cs.hmc.edu \
--cc=130397@bugs.debian.org \
--cc=agustin.martin@hispalinux.es \
--cc=emacs-devel@gnu.org \
--cc=handa@m17n.org \
--cc=k.stevens@ieee.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.savannah.gnu.org/cgit/emacs.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).