Skip to content

kisaragi-hiu/emacs-jieba

Repository files navigation

emacs-jieba

Emacs Lisp bindings for jieba-rs.

Status

It works, and you can load the jieba-rs default dictionary, the original Jieba's big dictionary, or any dictionary (passed in as a string).

I've seen one segfault though.

By default the library will be automatically downloaded from GitHub Releases.

If the Rust toolchain (including Cargo) is available, the library will be built automatically.

The logic to decide whether to download or to build is still flawed.

Thanks

Prior Art

Jieba.el kind of counts, although it's more about integrating with nodejieba in order to get word-wise commands to understand Mandarin words.

Roadmap

  • Support load_dict, with_dict (perhaps by reading a file instead of reading a string passed from Emacs)
  • Support TextRank
  • Support suggest_freq
  • Write docs

Parts of speech

The “parts of speech” (or “tag”) argument is a string specifier. The full list can be seen in Jieba's README.

標籤 含義 標籤 含義 標籤 含義 標籤 含義
n 普通名詞 f 方位名詞 s 處所名詞 t 時間
nr 人名 ns 地名 nt 機構名 nw 作品名
nz 其他專名 v 普通動詞 vd 動副詞 vn 名動詞
a 形容詞 ad 副形詞 an 名形詞 d 副詞
m 數量詞 q 量詞 r 代詞 p 介詞
c 連詞 u 助詞 xc 其他虛詞 w 標點符號
PER 人名 LOC 地名 ORG 機構名 TIME 時間