Anoncheg1 / pinyin-isearch

Emacs package with minor mode that allow to search with tonelss pinyin in a Chinese text.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

example workflow

Tested with Emacs 29.1

pinyin-isearch

Emacs package for toneless pinyin search in pinyin and Chinese characters.

Allow to search with pinyin without diacritical marks in pinyin text. With few characters you will find all variants.

Emacs Isearch "submode" that replace isearch-regexp-function to generate regex for search.

For example: to find "Shànghǎi" and "上海" in text you just type: C-s shanghai.

Demonstation

Demo

Featurs

  • should not conflict with other isearch modes
  • fix isearch jumping without return.
  • fallback to search for normal latin text if strict mode is not enabled.

Features of Chinese characters search

  • search from the first character entered.
  • punctulation Chinese search with ascii charactes: .,[]<>()$-"` and much more.
  • accurate dissasemble to all possible variants.

Features of pinyin search

  • white spaces are ignored between syllables
  • tone or diacritical mark required only in first syllable in text: Zhēn de ma

Installation

copy file to ~/.emacs.d/contrib/pinyin-isearch.el

add to ~/.emacs

(add-to-list 'load-path "~/.emacs.d/contrib/")
(require 'pinyin-isearch)

Usage

After C-s/r in isearch mode:

  • M-s p to activate pinyin isearch submode.
  • M-s h to activate Chinese characters isearch submode.
  • M-s s to activate strict Chinese characters isearch submode.

or with M-x pinyin-isearch-forward/backward

You can set this mode by default per file with:

;-*- mode: pinyin-isearch; -*-

Configuration

M-x customize-group pinyin-isearch

About

Emacs package with minor mode that allow to search with tonelss pinyin in a Chinese text.

License:GNU General Public License v3.0


Languages

Language:Emacs Lisp 97.0%Language:Shell 2.2%Language:Makefile 0.7%