unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Naohiro Aota <naota@elisp.net>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: Andrew Hyatt <ahyatt@gmail.com>,
	akirashinigami@gmail.com, Alex <agrambot@gmail.com>,
	5990@debbugs.gnu.org
Subject: bug#5990: 23.1; Cannot type the word 買います
Date: Tue, 31 Aug 2021 15:13:09 +0900	[thread overview]
Message-ID: <20210831061309.ppeluqllz4jim5hp@naota-xeon> (raw)
In-Reply-To: <878s0oui53.fsf@gnus.org>

On Thu, Aug 26, 2021 at 09:21:12PM +0200, Lars Ingebrigtsen wrote:
> Alex <agrambot@gmail.com> writes:
> 
> >> If there are significant updates, we can import a new version for the
> >> next release, I think.
> >
> > I can't say anything on that front, but I tried updating the Japanese
> > dictionary to the latest version using skkdic-convert in
> > lisp/international/ja-dic-cnv.el and it still gave the "wrong" results for
> > 買います.

Background: I'm Japanese.

> In Emacs 28, I'm getting:
>

These are still all valid (possible) kanji conversion for "kaimasu".

> 魔居間す

(This looks strange. I guess there are some mistakes for this one.)

> 加居間す
> 過居間す
> 可居間す

All these can be read as "ka" (加, 過, 可) + "ima" (居間) + "su" (す).

> かいます

The implementation of leim's kanji conversion is so simple as
follow. In short, it just find the longest match from the dictionary
even if it is strange (for Japanese) or not.

  (setq kkc-current-key (string-to-vector kkc-original-kana))
  (setq kkc-length-head (length kkc-current-key))
  (unwind-protect
      ...
	(while (not (kkc-lookup-key kkc-length-head nil first))
	  (setq kkc-length-head (1- kkc-length-head)
		first nil))

So, we get the longest conversion of "kaimasu" as "kaima" as above.

To get "買います", we need explicitly set the conversion length to 2
with C-o/C-i. It can be reproduced in a code like this:

(let ((kkc-current-key "かいます"))
  (kkc-lookup-key 2)
  kkc-current-conversions)
(1 "買い" "書い" "描い" "飼い" "画い" "欠い" "掻い" "嗅い" "交い" "畫い" "缺い" ...)
;;  `-- Here, we have the "買います" result
   
(let ((kkc-current-key "かいます"))
  (kkc-lookup-key 3)
  kkc-current-conversions)
(1 "垣間" "加居間" "過居間" "可居間")

> So I'm not getting 買います here, either.
> 
> But I guess we're just using whatever is in:
> 
> http://openlab.ring.gr.jp/skk/skk/dic/SKK-JISYO.L
> 
> (Our version was updated earlier this year.)  So is this something that
> we can fix on our side, or is it just what this dictionary says?  

Well, other IM like mozc is much more intelligent to prefer "買います"
than the above three conversions because "買います" is plausible.

IMHO, implementing such complex algorithm is out of scope for leim. It
still can be a "rescue" tool even with the simple algorithm if you can
set a proper conversion length. And, we anyway use other IM like mozc,
SKK, tc.el.

Thanks,

> -- 
> (domestic pets only, the antidote for overdose, milk.)
>    bloggy blog: http://lars.ingebrigtsen.no
> 
> 
> 





  reply	other threads:[~2021-08-31  6:13 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-20 18:48 bug#5990: 23.1; Cannot type the word 買います Erik Mekhsian
2016-08-07  4:05 ` Andrew Hyatt
2016-08-07 13:59   ` Eli Zaretskii
2016-08-08 17:01     ` Alex
2021-08-26 19:21       ` Lars Ingebrigtsen
2021-08-31  6:13         ` Naohiro Aota [this message]
2021-08-31  8:34           ` Lars Ingebrigtsen
2021-08-31 13:03             ` Naohiro Aota
2021-09-01  8:07               ` Lars Ingebrigtsen

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=20210831061309.ppeluqllz4jim5hp@naota-xeon \
    --to=naota@elisp.net \
    --cc=5990@debbugs.gnu.org \
    --cc=agrambot@gmail.com \
    --cc=ahyatt@gmail.com \
    --cc=akirashinigami@gmail.com \
    --cc=larsi@gnus.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).