You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat: add CJK word segmentation for graph query #1013
graphify query does not segment CJK (Chinese/Japanese/Korean) text. Searching for "页面路由" treats it as one opaque string, so nodes with label "路由" are not found. Only searching for the exact substring "路由" works.
Root Cause
_query_terms() in serve.py splits queries by whitespace only. CJK text has no spaces between words, so "页面路由" becomes a single term. The substring matching (t in norm_label) is one-directional — it checks if the term is inside the label, not the reverse.
Proposed Solution
Add jieba-based CJK word segmentation to _query_terms():
"页面路由" → terms = ["页面", "路由", "页面路由"]
Segmented terms enable substring matching ("路由" matches nodes with "路由" in label)
Original term kept for exact matching ("页面路由" gets EXACT_MATCH_BONUS)
Falls back to character bigrams when jieba is not installed
jieba added as optional dependency: pip install graphifyy[cjk]
Resolved in v0.8.19 via #1026 — Chinese compound tokens are now split using jieba (with bigram fallback when jieba is not installed). Install with pip install "graphifyy[chinese]".
Activity
safishamsi commentedon May 26, 2026
Resolved in v0.8.19 via #1026 — Chinese compound tokens are now split using jieba (with bigram fallback when jieba is not installed). Install with
pip install "graphifyy[chinese]".