Skip to content

Remove deprecated --handle_kludgy_ordinals flag#61

Merged
vthorsteinsson merged 3 commits intomasterfrom
remove-kludgy
Dec 11, 2025
Merged

Remove deprecated --handle_kludgy_ordinals flag#61
vthorsteinsson merged 3 commits intomasterfrom
remove-kludgy

Conversation

@vthorsteinsson
Copy link
Member

Summary

  • Remove the outdated --handle_kludgy_ordinals / -k CLI flag
  • Remove the handle_kludgy_ordinals option from the tokenization API
  • Remove KLUDGY_ORDINALS_PASS_THROUGH, KLUDGY_ORDINALS_MODIFY, and KLUDGY_ORDINALS_TRANSLATE constants
  • Kludgy ordinals (e.g. 1sti, 3ja) are now always passed through unchanged as word tokens, which was the default behavior

Test plan

  • All 149 tests pass
  • mypy shows no type errors
  • Ruff linting errors are pre-existing (not introduced by these changes)

🤖 Generated with Claude Code

vthorsteinsson and others added 3 commits December 11, 2025 16:58
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>
Copy link
Contributor

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 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_ordinals and its argument parsing logic
  • Removed handle_kludgy_ordinals parameter from tokenization API functions
  • Removed constants KLUDGY_ORDINALS_PASS_THROUGH, KLUDGY_ORDINALS_MODIFY, and KLUDGY_ORDINALS_TRANSLATE
  • Simplified NumberParser class 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.

@vthorsteinsson vthorsteinsson merged commit 09bf1e5 into master Dec 11, 2025
20 checks passed
@vthorsteinsson vthorsteinsson deleted the remove-kludgy branch December 11, 2025 17:25
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.

1 participant