Skip to content

"Vibe-Trading: Your Personal Trading Agent"

test(grounding): exercise the adjacent CJK boundary

saju01cd1446a73c8c
diff --git a/agent/src/agent/grounding.py b/agent/src/agent/grounding.py
index 96add7c82..061ea2a0c 100644
--- a/agent/src/agent/grounding.py
+++ b/agent/src/agent/grounding.py
@@ -309,7 +309,7 @@ _PERCENT_RANGE_RE = re.compile(
# The Chinese units take an optional measure word ("3.6 个百分点" is the
# ordinary spelling; bare "3.6 百分点" is the rare one) and are matched
# without a trailing \b: after a CJK character \b requires a non-word
-# character to follow, so "下降 3.6 个百分点,主因…" would not match. The
+# character to follow, so "下降 3.6 个百分点后企稳" would not match. The
# ASCII units keep \b, which is what stops "3.6ppm" being read as pp.
_PERCENTAGE_POINT_RE = re.compile(
r"[-+~≈]?\s*\d[\d,]*(?:\.\d+)?\s*"
diff --git a/agent/tests/test_grounding_percentage_points.py b/agent/tests/test_grounding_percentage_points.py
index b3b0f8af9..f5887f746 100644
--- a/agent/tests/test_grounding_percentage_points.py
+++ b/agent/tests/test_grounding_percentage_points.py
@@ -86,7 +86,7 @@ def test_bare_number_still_extracted():
# A trailing CJK character rather than punctuation: \b after a CJK
# unit needs a non-word char to follow, so this is the case that
# breaks if the boundary is reintroduced there.
- "毛利率下降 3.6 个百分点,主因是原材料",
+ "毛利率下降 3.6 个百分点后企稳",
],
)
def test_chinese_percentage_point_deltas_are_masked(text: str) -> None: