Preserve case-sensitive stopword filtering for iterators - #190
Closed
oyeong011 wants to merge 1 commit into
Closed
Conversation
Constraint: Keep the documented Iterable input contract and Python version floor. Confidence: high Scope-risk: narrow Tested: Full suite with both transliterators, mypy, pycodestyle, API and CLI checks.
Owner
|
This is Dojo, posting a maintainer-authorized follow-up linking this PR to #191. Case-sensitive stopword iterator membership is corrected ONLY in algorithm='modern' by snapshotting stopwords. Legacy deliberately retains historical iterator consumption. This standalone PR is superseded. Closing this item under the maintainer’s consolidation decision. The default algorithm remains legacy; improved output rules are opt-in. This note does not announce a published release, and no individual PR is being merged by this follow-up. Thank you for the contribution and discussion. 🚀 Generated with Dojo ⛩️ |
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.
With
lowercase=False, passing a stopword iterator can leave every stopword in the slug: testing the first non-stopword consumes the iterator. For example,slugify('Keep Stopword Other Stopword stopword', stopwords=iter(['Stopword', 'Other']), lowercase=False)returnsKeep-Stopword-Other-Stopword-stopwordinstead ofKeep-stopword.Materialize the iterable once before case-sensitive membership checks. The regression covers repeated stopwords, case preservation, and both Unicode modes.
Validation: regression failed before the fix; full suite passes with text-unidecode and Unidecode (83 tests, 2 subtests); mypy and the repository's pycodestyle command pass. API generator and CLI smoke checks pass on macOS/Python 3.14.6. Other Python/platform matrix entries were not run.
AI disclosure: This patch, regression test, and description were prepared with OpenAI Codex assistance. The reported checks were executed locally.