summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorTaiju HIGASHI <higashi@taiju.info>2022-06-07 21:46:14 +0900
committerEli Zaretskii <eliz@gnu.org>2022-06-10 15:46:32 +0300
commitafbe7585c448c79f0320839d272742968ee88a55 (patch)
treeec03210e56a19d34c0afa3789d1ff32cf1a57296 /lisp
parentdc09759c1d1e7d7c6118fd8e582aaa57454cf001 (diff)
downloademacs-afbe7585c448c79f0320839d272742968ee88a55.tar.gz
emacs-afbe7585c448c79f0320839d272742968ee88a55.tar.bz2
emacs-afbe7585c448c79f0320839d272742968ee88a55.zip
Don't reduce vocabulary in ja-dic.el by default
* configure.ac: Add the "--with-small-ja-dic" configure option. * leim/Makefile.in (${leimdir}/ja-dic/ja-dic.el): Change the build method depending on whether or not the --with-small-ja-dic option is specified. * lisp/international/ja-dic-cnv.el (skkdic-convert-okuri-nasi): Add the "no-reduction" optional argument. When it is specified, then generate a Japanese dictionary without reduced vocabulary. (skkdic-convert): Add the "no-reduction" optional argument. (batch-skkdic-convert): Add the "--no-reduction" command line argument.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/international/ja-dic-cnv.el26
1 files changed, 18 insertions, 8 deletions
diff --git a/lisp/international/ja-dic-cnv.el b/lisp/international/ja-dic-cnv.el
index 1bbc664e756..0bad7dea0a0 100644
--- a/lisp/international/ja-dic-cnv.el
+++ b/lisp/international/ja-dic-cnv.el
@@ -297,7 +297,7 @@
(setq skkdic-okuri-nasi-entries-count (length skkdic-okuri-nasi-entries))
(progress-reporter-done progress))))
-(defun skkdic-convert-okuri-nasi (skkbuf buf)
+(defun skkdic-convert-okuri-nasi (skkbuf buf &optional no-reduction)
(with-current-buffer buf
(insert ";; Setting okuri-nasi entries.\n"
"(skkdic-set-okuri-nasi\n")
@@ -313,7 +313,9 @@
(setq count (1+ count))
(progress-reporter-update progress count)
(if (setq candidates
- (skkdic-reduced-candidates skkbuf kana candidates))
+ (if no-reduction
+ candidates
+ (skkdic-reduced-candidates skkbuf kana candidates)))
(progn
(insert "\"" kana)
(while candidates
@@ -324,10 +326,12 @@
(progress-reporter-done progress))
(insert ")\n\n")))
-(defun skkdic-convert (filename &optional dirname)
+(defun skkdic-convert (filename &optional dirname no-reduction)
"Generate Emacs Lisp file from Japanese dictionary file FILENAME.
The format of the dictionary file should be the same as SKK dictionaries.
-Saves the output as `ja-dic-filename', in directory DIRNAME (if specified)."
+Saves the output as `ja-dic-filename', in directory DIRNAME (if specified).
+When NO-REDUCTION is t, then not reduce dictionary vocabulary.
+"
(interactive "FSKK dictionary file: ")
(let* ((skkbuf (get-buffer-create " *skkdic-unannotated*"))
(buf (get-buffer-create "*skkdic-work*")))
@@ -388,7 +392,7 @@ Saves the output as `ja-dic-filename', in directory DIRNAME (if specified)."
(skkdic-collect-okuri-nasi)
;; Convert okuri-nasi general entries.
- (skkdic-convert-okuri-nasi skkbuf buf)
+ (skkdic-convert-okuri-nasi skkbuf buf no-reduction)
;; Postfix
(with-current-buffer buf
@@ -420,15 +424,21 @@ To get complete usage, invoke:
(message "To convert SKK-JISYO.L into skkdic.el:")
(message " %% emacs -batch -l ja-dic-cnv -f batch-skkdic-convert SKK-JISYO.L")
(message "To convert SKK-JISYO.L into DIR/ja-dic.el:")
- (message " %% emacs -batch -l ja-dic-cnv -f batch-skkdic-convert -dir DIR SKK-JISYO.L"))
- (let (targetdir filename)
+ (message " %% emacs -batch -l ja-dic-cnv -f batch-skkdic-convert -dir DIR SKK-JISYO.L")
+ (message "To convert SKK-JISYO.L into skkdic.el with not reduce dictionary vocabulary:")
+ (message " %% emacs -batch -l ja-dic-cnv -f batch-skkdic-convert --no-reduction SKK-JISYO.L"))
+ (let (targetdir filename no-reduction)
(if (string= (car command-line-args-left) "-dir")
(progn
(setq command-line-args-left (cdr command-line-args-left))
(setq targetdir (expand-file-name (car command-line-args-left)))
(setq command-line-args-left (cdr command-line-args-left))))
+ (if (string= (car command-line-args-left) "--no-reduction")
+ (progn
+ (setq no-reduction t)
+ (setq command-line-args-left (cdr command-line-args-left))))
(setq filename (expand-file-name (car command-line-args-left)))
- (skkdic-convert filename targetdir)))
+ (skkdic-convert filename targetdir no-reduction)))
(kill-emacs 0))