Closed chen-chao closed 4 years ago
@chen-chao 今天又想到个更好的思路,先用这个函数跳过标点,然后再正常跳转
(defun jieba--skip-punctuations! (backward?)
(if backward?
(while (re-search-backward (rx punct point) nil t))
(while (re-search-forward (rx point punct) nil t))))
确实比用 forward-word + backward-word 跳过标点要好.
之前还有一个改动是对中英文都返回 beg, end, 我觉得比英文返回 nil 要简单一些.
感谢贡献!