Skip to content

kuanyui/ta.el

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 

Repository files navigation

ta.el - Deal with homophonic characters 搞定同音字

For those who tired of deal with Chinese homophonic characters. (* In Chinese, for some homophone, it’s nearly impossible for input method to select a correct character.)
受夠了「她他它祂牠」這種發音統統都是「tatatatata」的同音字?

demo.gif

你得書在他那裡,不再我這裡啦!  #  =ω="
妳的書在她那裡,不在我這裡啦!  # ˊ・ω・ˋ

Installation 安裝

ta.el is available on MELPA repository, so you can install ta easily via M-x list-packages.
ta.el 可以在 MELPA 取得, 所以你可以直接透過 M-x list-packages 安裝 ta

Add following config into your init.el
在您的 init.el 中加入下列設定:

;; The following two lines ain't needed if installing via MELPA.
;; 如果透過 MELPA 安裝,就不需要加這兩行:
(add-to-list 'load-path "~/PATH/TO/ta.el/")
(require 'ta)

;; If you want to enable `ta-mode' in specific mode automatically, add this
;; 如果想要在特定 mode 中自動啟用`ta-mode',可以加入這樣的設定
(mapc (lambda (mode-hook) (add-hook mode-hook 'ta-mode))
      '(org-mode-hook
        markdown-mode-hook
        rst-mode-hook))

;; Keybindings settings
;; 按鍵設定

;; Modify the character under cursor 
;; 修改游標下的字
(define-key ta-mode-map (kbd "M-p") 'ta-previous-homophony)
(define-key ta-mode-map (kbd "M-n") 'ta-next-homophony)
;; Move cursor left/right to possible character
;; 把目前游標向左/右移動至可能的錯字
(define-key ta-mode-map (kbd "M-i") 'ta-left)
(define-key ta-mode-map (kbd "M-o") 'ta-right)

Usage 使用

  • M-x ta-mode to activate, then:
    • Use M-p & M-n to modify the homophonic characters.
    • Use M-i & M-o to jump between all possible candidate characters.
  • M-x ta-mode, then:
    • 使用 M-pM-n 修改目前被高亮的同音字。
    • 使用 M-iM-o 在所有可能的錯誤同音字中跳來跳去。

Customization 自訂

;; The homophonic characters' list.
;; 所有同音字的清單
(setq ta-homophony-list
      '(("" "" "" "" "")
        ("" "")
        ("" "")
        ("" "")
        ("" "" "")
        ("" "")
        ("" "")
        ))

;; Automatically searching range for possible homophony cadidates.
;; By default, search only 300 characters backward the cursor.
;; 自動搜索候選字的搜索範圍,預設只搜索游標前的 300 個字元。
(setq ta-max-search-range 300
  )

;; The seconds to wait "auto-search-and-highlight". Default is 0.1 second.
;; 等待自動搜索的延遲時間。預設為 0.1 秒。
(setq ta-delay 0.1)

License 授權條款

WTFPL 2.0

Ono Hiroko (kuanyui) (ɔ) Copyleft 2015

This program is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.

About

Deal with homophonic Chinese characters. 受夠了「她他它祂牠」這種發音統統都是「tatatatata」的同音字?

Resources

Stars

Watchers

Forks

Packages

No packages published