[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hunspell for Japanese

From: Eli Zaretskii
Subject: Re: Hunspell for Japanese
Date: Sun, 18 Feb 2018 17:59:59 +0200

> Date: Sun, 18 Feb 2018 14:31:56 +0900 (JST)
> Cc: address@hidden
> From: Tak Kunihiro <address@hidden>
>   (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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]