Skip to content

Conversation

@steven10a
Copy link
Collaborator

@steven10a steven10a commented Nov 17, 2025

Updated keyword_filter for better unicode handling

  • Updated tests

Thank you to @yehorkardash for identifying this in our JS version

Copilot AI review requested due to automatic review settings November 17, 2025 20:41
Copilot finished reviewing on behalf of steven10a November 17, 2025 20:42
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the keyword matching functionality to properly handle Unicode characters by replacing ASCII-only word boundaries with Unicode-aware regex patterns.

  • Replaces \b word boundaries with (?<!\w) and (?!\w) lookaround assertions for Unicode-aware matching
  • Adds explicit re.UNICODE flag to the regex compilation
  • Includes comprehensive test coverage for various Unicode scenarios including Chinese characters, numeric tokens, and underscore handling

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/guardrails/checks/text/keywords.py Updated regex pattern to use Unicode-aware word boundaries instead of ASCII \b, added re.UNICODE flag, and improved variable naming
tests/unit/checks/test_keywords.py Added 8 new test cases covering partial word matching, numeric tokens, underscore handling, Chinese characters, and multi-token patterns with Unicode boundaries

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Copilot finished reviewing on behalf of steven10a November 17, 2025 21:06
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gabor-openai
Copy link
Collaborator

@codex pls review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Swish!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@steven10a steven10a requested a review from Copilot November 18, 2025 20:30
Copilot finished reviewing on behalf of steven10a November 18, 2025 20:33
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@steven10a steven10a requested a review from Copilot November 19, 2025 15:04
Copilot finished reviewing on behalf of steven10a November 19, 2025 15:07
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gabor-openai gabor-openai self-requested a review November 19, 2025 18:05
@gabor-openai gabor-openai merged commit 58bfd43 into main Nov 19, 2025
8 of 9 checks passed
@gabor-openai gabor-openai deleted the dev/steven/unicode_keyword branch November 19, 2025 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants