Fix grammar bracket detection: split on spaces too, not just slashes
Some checks failed
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-school (push) Successful in 27s
CI / test-go-edu-search (push) Successful in 25s
CI / test-python-klausur (push) Failing after 1m48s
CI / test-python-agent-core (push) Successful in 16s
CI / test-nodejs-website (push) Successful in 15s

_is_grammar_bracket_content now splits "no pl" into ["no", "pl"]
instead of treating it as single token "no pl".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-03-20 11:45:35 +01:00
parent ef5aed6a98
commit 1f7989cfc2

View File

@@ -907,8 +907,9 @@ def _is_grammar_bracket_content(content: str) -> bool:
if not content:
return False
# Split on / for patterns like (about/of), (on/with)
tokens = [t.strip().lower() for t in content.split('/') if t.strip()]
# Split on / and spaces for patterns like (about/of), (no pl)
tokens = re.split(r'[/\s]+', content.strip().lower())
tokens = [t for t in tokens if t]
if not tokens:
return False