unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Hunspell for Japanese
@ 2018-02-17 13:53 Tak Kunihiro
  2018-02-17 15:18 ` Eli Zaretskii
  2018-02-18  5:31 ` Tak Kunihiro
  0 siblings, 2 replies; 5+ messages in thread
From: Tak Kunihiro @ 2018-02-17 13:53 UTC (permalink / raw)
  To: help-gnu-emacs; +Cc: 国広卓也

I want to spellcheck English phrases that are mixed in Japanese
phrases by `hunspell'.  When I call M-x ispell-word, responses from `aspell' and
`hunspell' differ.  The difference results in how underlines are drawn in
flyspell-mode.  The `hunspell' gives many unnecessary underlines on Japanese phrases.
So I add following to my ~/.emacs.d/inits.el for now.

  (defun flyspell-ignore-non-ascii (beg end info)
    "Tell flyspell to ignore non ascii characters.
  Call this on `flyspell-incorrect-hook'."
    (string-match "[^!-~]" (buffer-substring beg end)))
  (add-hook 'flyspell-incorrect-hook 'flyspell-ignore-non-ascii)

Is is possible to make `hunspell' behave like `aspell'?


GNU Emacs 25.3.1 (x86_64-apple-darwin13.4.0, NS appkit-1265.21 Version 10.9.5 (Build 13F1911))
 of 2017-09-19

##
## Aspell
##

$ which aspell
/opt/local/bin/aspell
$ Emacs -Q
M-: (insert "Emacsは日本ではイーマックスと呼ばれる")
C-a
M-: (setq ispell-program-name "aspell")
M-x ispell-word
X-b *Messages*

> Starting new Ispell process /opt/local/bin/aspell with default dictionary...
> Checking spelling of EMACSは日本語ではイーマックスと呼ばれる...
> EMACSは日本語ではイーマックスと呼ばれる is correct
> You can run the command ‘ispell-word’ with M-$

##
## Hunspell
##

$ which hunspell
/opt/local/bin/hunspell
$ hunspell -D
...
/opt/local/share/hunspell/en_US
LOADED DICTIONARY:
/opt/local/share/hunspell/en_US.aff
/opt/local/share/hunspell/en_US.dic
Hunspell 1.6.2
$ Emacs -Q
M-: (insert "Emacsは日本ではイーマックスと呼ばれる")
C-a
M-: (setq ispell-program-name "hunspell")
M-x ispell-word
X-b *Messages*

> Starting new Ispell process hunspell with default dictionary...
> Checking spelling of EMACSは日本語ではイーマックスと呼ばれる...
> ispell-word: Ispell and its process have different character maps




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-02-24  1:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2018-02-24  1:41   ` Tak Kunihiro

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).