Repository navigation
fix: recognize equivalent array range adjective definitions #282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1005,6 +1005,7 @@ def _array_range_definition(text: str) -> bool: | |
| """ | ||
| lowered = text.casefold() | ||
| patterns = ( | ||
| r"(?:访问数组时(?:使用)?|访问)?(?:超出|超过)(?:了)?(?:数组(?:的)?|其)?(?:有效|合法)(?:索引|下标)?范围的(?:索引|下标)", | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When Useful? React with 👍 / 👎. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
A response that only asks Useful? React with 👍 / 👎. |
||
| r"(?:索引|下标)(?:落在)?(?:超出|超过|不在)[^。;;!??]{0,16}(?:有效|合法)[^。;;!??]{0,8}范围(?:内)?", | ||
| r"(?:索引|下标)落在(?:有效|合法)范围(?:之外|以外)", | ||
| r"(?:访问)?(?:超出|超过)[^。;;!??]{0,12}数组(?:的)?(?:有效|合法)?(?:索引|下标)?(?:范围|边界|长度)", | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For a response such as
数组越界是指没有使用超过其合法下标范围的索引。, this alternative falls back to matching only超过其合法下标范围的索引. The prefix then ends in使用, so_unnegated_claimcannot see the preceding没有and incorrectly accepts this denied definition; the parent rejected the same input. This can falsely mark the no-tool boundary case as passing, so the grammar needs to retain or otherwise check negation across intervening usage verbs.Useful? React with 👍 / 👎.