From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Hunspell for Japanese
Date: Sun, 18 Feb 2018 17:59:59 +0200 [thread overview]
Message-ID: <83d112b85c.fsf@gnu.org> (raw)
In-Reply-To: <20180218.143156.2077820890057474242.tkk@misasa.okayama-u.ac.jp> (message from Tak Kunihiro on Sun, 18 Feb 2018 14:31:56 +0900 (JST))
> Date: Sun, 18 Feb 2018 14:31:56 +0900 (JST)
> Cc: tkk@misasa.okayama-u.ac.jp
> From: Tak Kunihiro <tkk@misasa.okayama-u.ac.jp>
>
> (defvar ispell-regexp-non-ascii "[^\000-\377]+"
> "Regular expression to match a non-ascii word.")
> (add-to-list 'ispell-skip-region-alist (list ispell-regexp-non-ascii))
>
> Once I accept this solution for M-x spell-buffer, I would accept a
> solution for flyspell-mode as shown below.
>
> (defun flyspell-skip-non-ascii (beg end info)
> "Tell flyspell to skip a non-ascii word.
> Call this on `flyspell-incorrect-hook'."
> (string-match ispell-regexp-non-ascii (buffer-substring beg end)))
> (add-hook 'flyspell-incorrect-hook 'flyspell-skip-non-ascii)
>
> It took me a while to figure this out. I think that what M-x
> ispell-buffer and flyspell-mode provide is fundamental functionalities
> and it is good to be documented in somewhere in Emacs such for (info
> "(emacs) Spelling"). Can you give suggestion?
On the Wiki?
You see, the solution you propose has one significant disadvantage: it
will skip words used in English prose which are written using
non-ASCII characters. It's true that there aren't many of those, but
they do exist.
You could try instead use 2 dictionaries at the same time, one for
English, the other for Japanese. This will only work with Hunspell,
and only in Emacs 26 or later. Caveat: I never tried it with these
two languages, so I don't know whether this combination has some
subtle problems with that feature.
next prev parent reply other threads:[~2018-02-18 15:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-17 13:53 Hunspell for Japanese Tak Kunihiro
2018-02-17 15:18 ` Eli Zaretskii
2018-02-18 5:31 ` Tak Kunihiro
2018-02-18 15:59 ` Eli Zaretskii [this message]
2018-02-24 1:41 ` Tak Kunihiro
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=83d112b85c.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=help-gnu-emacs@gnu.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.
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).