Skip to content

Instantly share code, notes, and snippets.

@lotem
Created July 9, 2012 12:23
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save lotem/3076166 to your computer and use it in GitHub Desktop.
Save lotem/3076166 to your computer and use it in GitHub Desktop.
自動識別西文及數字組成的用戶名
# default.custom.yaml
# 全局範圍識別輸入串爲 rime + 任意數字序列,以及形如 rimeime-1.2.3 的常用西文短語
# 也可將本組 patch 寫入 <輸入方案ID>.custom.yaml 使這組規則僅在一款輸入方案中有效
#
# 第一例,輸入 rime 之後,再輸入任意一個數字,則立即識別爲西文輸入
# 再加上 default.yaml 原有的 email 規則,識別包含 @ 字符的郵箱,於是可以一氣呵成 rime123@company.com
# 第二例,輸入到 rimeime 時,立即識別爲西文輸入,並可跟隨任意位數字及指定的符號
patch:
recognizer/patterns/rime123: "^rime[0-9]+$"
recognizer/patterns/rimeime: "^rimeime[-_.0-9]*$"
@redleafnew
Copy link

2024-03-23_16-28-48

@zwjzxh520
Copy link

作者大大,麻烦整理一下最终版?从最开始的评论依次跟着评论调整下来,效果还是差强人意。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment