osx-dictionary.el
is inspired by dictionary.vim. osx-dictionary.el
provides functions which invoke Dictionary.app from Mac OS X.
Notes: translation between Chinese and English is well supported.
- 结巴中文分词 for Chinese word segmentation (optional)
GNU Emacs doesn't know much about Chinese, for example, it can't not guess most likely meaningful Chinese word under current cursor. 结巴中文分词 is used for this task.
If you don't want to use 结巴中文分词, just customize osx-dictionary-chinese-wordsplit-command
to ""
.
-
Clone this repository
$ git clone https://github.com/xuchunyang/osx-dictionary.el $ cd osx-dictionary.el
-
Compile & install
osx-dictionary
$ clang -O3 -framework CoreServices -framework Foundation osx-dictionary.m -o osx-dictionary $ sudo mv osx-dictionary /usr/local/bin
osx-dictionary
is a simple CommandLine utility to access Dictionary.app -
Put
osx-dictionary.el/
to yourload-path
and add the following to your Emacs initialization file(require osx-'dictionary) ;; Example key binding (global-set-key (kbd "C-c d") 'osx-dictionary-search-pointer) (global-set-key (kbd "C-c c") 'osx-dictionary-search-word)
Below are commands you can use:
osx-dictionary-search-word
Search word from inputosx-dictionary-search-pointer
Search word at point
Here is a screenshot of a sample usage:
- Save search history
- Improve regex for highlight
- Add more keywords, for example, "名" and "代"
- Adopt more precise matching
- Use Chinese text segmentation for better Chinese translation