Remove deprecated --handle_kludgy_ordinals flag#61
Merged
vthorsteinsson merged 3 commits intomasterfrom Dec 11, 2025
Merged
Conversation
Remove the outdated handle_kludgy_ordinals option from the CLI and tokenization API. Kludgy ordinals (e.g. '1sti', '3ja') are now always passed through unchanged as word tokens, which was the default behavior. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Install only test dependencies (pytest) on non-3.9 Python versions, since mypy's librt dependency doesn't work on PyPy 3.11. The dev dependencies (including mypy) are only needed for type checking on 3.9. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace the Mapping with a simple tuple, enabling efficient prefix matching with str.startswith(tuple). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request removes the deprecated --handle_kludgy_ordinals CLI flag and associated API functionality. The feature previously allowed three modes for handling kludgy ordinals (e.g., "1sti", "3ja"): pass-through, word modification, and numeric translation. The PR simplifies the codebase by standardizing on the pass-through behavior, where kludgy ordinals are always returned unchanged as word tokens.
Key Changes
- Removed CLI flag
-k/--handle_kludgy_ordinalsand its argument parsing logic - Removed
handle_kludgy_ordinalsparameter from tokenization API functions - Removed constants
KLUDGY_ORDINALS_PASS_THROUGH,KLUDGY_ORDINALS_MODIFY, andKLUDGY_ORDINALS_TRANSLATE - Simplified
NumberParserclass to always pass through kludgy ordinals as word tokens - Added
[test]optional dependency group in pyproject.toml for lightweight test-only installations
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/test_tokenizer.py | Removed test cases for deprecated modify/translate modes; retained tests for pass-through behavior |
| test/test_index_calculation.py | Removed tests for lengthening substitutions that were specific to the modify mode |
| test/test_cli.py | Removed CLI tests for the deprecated --handle_kludgy_ordinals flag |
| src/tokenizer/tokenizer.py | Simplified NumberParser and parse_mixed to remove kludgy ordinals handling options; standardized on pass-through behavior |
| src/tokenizer/main.py | Removed argument parser configuration and option passing for the deprecated flag |
| src/tokenizer/definitions.py | Replaced mapping dictionaries with a simple tuple of kludgy ordinal strings; removed deprecated constants |
| src/tokenizer/init.py | Removed exports of deprecated constants |
| pyproject.toml | Added [test] optional dependency group for lightweight testing |
| README.md | Removed documentation for deprecated CLI flag and API option; updated changelog |
| .github/workflows/python-package.yml | Optimized to install full dev dependencies only for Python 3.9 (where mypy runs); other versions use lightweight test dependencies |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
--handle_kludgy_ordinals/-kCLI flaghandle_kludgy_ordinalsoption from the tokenization APIKLUDGY_ORDINALS_PASS_THROUGH,KLUDGY_ORDINALS_MODIFY, andKLUDGY_ORDINALS_TRANSLATEconstants1sti,3ja) are now always passed through unchanged as word tokens, which was the default behaviorTest plan
🤖 Generated with Claude Code