From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: Hunspell for Japanese Date: Sat, 17 Feb 2018 17:18:23 +0200 Message-ID: <83tvufbq68.fsf@gnu.org> References: <2D3482A4-0F9A-4D09-86C2-958AB03FA388@misasa.okayama-u.ac.jp> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1518880632 18443 195.159.176.226 (17 Feb 2018 15:17:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 17 Feb 2018 15:17:12 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Feb 17 16:17:08 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1en4ER-0003oq-LF for geh-help-gnu-emacs@m.gmane.org; Sat, 17 Feb 2018 16:16:55 +0100 Original-Received: from localhost ([::1]:60064 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1en4GT-0003no-Nl for geh-help-gnu-emacs@m.gmane.org; Sat, 17 Feb 2018 10:19:01 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59740) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1en4Fs-0003mS-IM for help-gnu-emacs@gnu.org; Sat, 17 Feb 2018 10:18:25 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1en4Fp-00040X-CY for help-gnu-emacs@gnu.org; Sat, 17 Feb 2018 10:18:24 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:53518) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1en4Fp-00040K-8W for help-gnu-emacs@gnu.org; Sat, 17 Feb 2018 10:18:21 -0500 Original-Received: from [176.228.60.248] (port=4044 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1en4Fo-0006Uj-Nu for help-gnu-emacs@gnu.org; Sat, 17 Feb 2018 10:18:21 -0500 In-reply-to: <2D3482A4-0F9A-4D09-86C2-958AB03FA388@misasa.okayama-u.ac.jp> (message from Tak Kunihiro on Sat, 17 Feb 2018 22:53:50 +0900) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.help:116032 Archived-At: > From: Tak Kunihiro > Date: Sat, 17 Feb 2018 22:53:50 +0900 > 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. If your dictionary is for English, why do you expect flyspell-mode to work correctly with words in another language? It can't do anything sensible with such foreign words. The underlines flyspell-mode shows in Japanese words when the dictionary is for English could be anything; you should simply disregard any such underlines in non-English words. Can you tell why you pay attention to underlines in non-English words in this situation? > Is is possible to make `hunspell' behave like `aspell'? They are very different programs, so they cannot behave the same. > $ 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 I see the same message. It is caused by Hunspell somehow considering the string "は日本語ではイーマックスと呼ばれる" as more than one word, and it therefore returns 3 misspellings, which then trigger the above cryptic error message. But once again, you've set up flyspell-mode to work in English, so you shouldn't pay attention to what it does with Japanese. For starters, I believe the encoding Emacs uses is incorrect in that case, because the en_US.aff file probably states that it wants a Latin-1 encoding, not UTF-8. But even using UTF-8 will not help here, AFAIU.