Skip to content

sawyerzheng/emacs-chinese-word-segmentation

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

emacs-chinese-word-segmentation

Emacs 中的基于 cjieba 的中文分词工具。实现了以中文词语为单位的移动和编辑。

Simple Chinese word segmentation library for Emacs based on cjieba. This library uses cjieba (commit 91c233d) with simple modification.

Compile the C program

To compile the Chinese word segmentation program, do:

cd /path/to/this-library
make

This will generate the chinese-word-segmentation executable.

Usage example

(add-to-list 'load-path "/path/to/this-library")
(setq cns-prog "/path/to/this-library/chinese-word-segmentation")
(setq cns-dict-directory "/path/to/this-library/dict")
(setq cns-recent-segmentation-limit 20) ; default is 10
(setq cns-debug nil) ; disable debug output, default is t
(require 'cns nil t)
(when (featurep 'cns)
  (add-hook 'find-file-hook 'cns-auto-enable))

To turn on this minor mode, type: M-x cns-mode RET. You can also turn on global-cns-mode if you like.

Key bindings

This minor mode changes the following key bindings:

+---------------+----------------------+--------------------------+
| key binding   | default command      | cns-mode command         |
+---------------+----------------------+--------------------------+
| M-b           | (backward-word)      | (cns-backward-word)      |
| M-f           | (forward-word)       | (cns-forward-word)       |
| C-<backspace> | (backward-kill-word) | (cns-backward-kill-word) |
| M-DEL         | (backward-kill-word) | (cns-backward-kill-word) |
| C-<delete>    | (kill-word)          | (cns-kill-word)          |
| M-d           | (kill-word)          | (cns-kill-word)          |
| M-t           | (transpose-words)    | (cns-transpose-words)    |
+---------------+----------------------+--------------------------+

Please see the comments in cns.el for more information.

Platform support

This library is tested to work on Debian Jessie and Cygwin.

About

Simple Chinese word segmentation library for Emacs based on cjieba (https://github.com/yanyiwu/cjieba).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Emacs Lisp 78.3%
  • C 14.4%
  • C++ 6.4%
  • Makefile 0.9%