-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
來源
問題描述
目前 non_word_boundaries 是硬編碼的 ASCII 字符集:
self.non_word_boundaries = set(string.digits + string.ascii_letters + '_')這對非 ASCII 語言不夠友好。
建議方案
使用 Python 的 \W regex class 或 Unicode category 來判斷 word boundary:
import unicodedata
def is_word_char(char):
category = unicodedata.category(char)
return category.startswith(('L', 'N')) # Letter or Number考量
- 效能影響:需要 benchmark 測試
- 向後兼容:可能需要新增參數
unicode_boundaries=True
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request