Repository navigation
FEAT: Add FullwidthConverter - #4185
Merged
Roman Lutz (romanlutz) merged 4 commits intoNov 11, 2026
Merged
Roman Lutz (romanlutz) merged 4 commits into
Roman Lutz (romanlutz) merged 4 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The paired notebook is missing the matching import and example cell, leaving the documentation sources out of sync.
1 open issue
What changed in this PR
Adds FullwidthConverter to PyRIT’s text transformation tools for probing filters that do not normalize Unicode input.
Changes:
- Maps printable ASCII characters to fullwidth forms with word-selection support.
- Registers the converter in the public lazy exports and adds a Python documentation example.
- Adds tests for conversion, ASCII NFKC round trips, word selection, input validation, and stable identifiers.
| File | Description |
|---|---|
tests/unit/converter/test_fullwidth_converter.py |
Tests conversion behavior and converter contracts. |
pyrit/converter/fullwidth_converter.py |
Implements the word-level fullwidth transformation. |
pyrit/converter/__init__.py |
Exposes FullwidthConverter through lazy imports. |
doc/code/converters/1_text_to_text_converters.py |
Adds a fullwidth conversion example. |
Review effort: Balanced
The table in 0_converters.ipynb is generated at runtime from the registered converters, so only the stored notebook output was stale. Regenerated the output cell; no source changes needed. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Converting already-fullwidth text is a no-op (code points above U+007E pass through), which matters when converters are stacked, and astral code points such as emoji are preserved intact. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Roman Lutz (romanlutz)
approved these changes
Nov 11, 2026
Roman Lutz (romanlutz)
enabled auto-merge
November 11, 2026 07:50
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Adds
FullwidthConverter, a text-to-text converter that maps printable ASCII to the Unicode fullwidth forms (U+FF01–U+FF5E), e.g.Hello!->Hello!. The output normalizes back to the original under NFKC, so it is a useful probe for filters or classifiers that match exact characters without normalizing input first.WordLevelConvertersubclass inpyrit/converter/fullwidth_converter.py; spaces between words and non-ASCII characters are unchanged, and word selection strategies are supported.pyrit.converterlazy exports.doc/code/converters/1_text_to_text_converters.py. The generated.ipynbfiles were not re-executed because that notebook includes LLM-based sections that need live endpoints.